2010-10-12 08:53:47 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2002-02-05 03:35:08 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 15:40:02 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2002-02-05 03:35:08 -06:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2002-02-05 03:35:08 -06:00
|
|
|
*
|
2008-04-10 15:40:02 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2002-02-05 03:35:08 -06:00
|
|
|
*
|
2008-04-10 15:40:02 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2002-02-05 03:35:08 -06:00
|
|
|
*
|
2008-04-10 15:40:02 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2002-02-05 03:35:08 -06:00
|
|
|
*
|
2008-04-10 15:40:02 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2002-02-05 03:35:08 -06:00
|
|
|
*
|
2008-04-10 15:40:02 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2002-02-05 03:35:08 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 22:00:49 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_svx.hxx"
|
|
|
|
|
2002-02-05 03:35:08 -06:00
|
|
|
|
2007-06-27 10:37:37 -05:00
|
|
|
#include <svx/AccessibleGraphicShape.hxx>
|
2002-02-05 03:35:08 -06:00
|
|
|
|
2007-06-27 10:37:37 -05:00
|
|
|
#include <svx/ShapeTypeHandler.hxx>
|
|
|
|
#include <svx/SvxShapeTypes.hxx>
|
2002-02-05 03:35:08 -06:00
|
|
|
|
|
|
|
using namespace ::accessibility;
|
|
|
|
using namespace ::rtl;
|
|
|
|
using namespace ::com::sun::star;
|
2003-04-24 10:53:35 -05:00
|
|
|
using namespace ::com::sun::star::accessibility;
|
2002-02-05 03:35:08 -06:00
|
|
|
|
|
|
|
//===== internal ============================================================
|
|
|
|
|
2002-05-03 10:49:07 -05:00
|
|
|
AccessibleGraphicShape::AccessibleGraphicShape (
|
|
|
|
const AccessibleShapeInfo& rShapeInfo,
|
|
|
|
const AccessibleShapeTreeInfo& rShapeTreeInfo)
|
|
|
|
: AccessibleShape (rShapeInfo, rShapeTreeInfo)
|
2002-02-05 03:35:08 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AccessibleGraphicShape::~AccessibleGraphicShape (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===== XAccessibleImage ====================================================
|
|
|
|
|
|
|
|
::rtl::OUString SAL_CALL AccessibleGraphicShape::getAccessibleImageDescription (void)
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2002-05-03 10:49:07 -05:00
|
|
|
return AccessibleShape::getAccessibleDescription ();
|
2002-02-05 03:35:08 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL AccessibleGraphicShape::getAccessibleImageHeight (void)
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2002-05-03 10:49:07 -05:00
|
|
|
return AccessibleShape::getSize().Height;
|
2002-02-05 03:35:08 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL AccessibleGraphicShape::getAccessibleImageWidth (void)
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2002-05-03 10:49:07 -05:00
|
|
|
return AccessibleShape::getSize().Width;
|
2002-02-05 03:35:08 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===== XInterface ==========================================================
|
|
|
|
|
|
|
|
com::sun::star::uno::Any SAL_CALL
|
|
|
|
AccessibleGraphicShape::queryInterface (const com::sun::star::uno::Type & rType)
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::com::sun::star::uno::Any aReturn = AccessibleShape::queryInterface (rType);
|
|
|
|
if ( ! aReturn.hasValue())
|
|
|
|
aReturn = ::cppu::queryInterface (rType,
|
|
|
|
static_cast<XAccessibleImage*>(this));
|
|
|
|
return aReturn;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SAL_CALL
|
|
|
|
AccessibleGraphicShape::acquire (void)
|
|
|
|
throw ()
|
|
|
|
{
|
|
|
|
AccessibleShape::acquire ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SAL_CALL
|
|
|
|
AccessibleGraphicShape::release (void)
|
|
|
|
throw ()
|
|
|
|
{
|
|
|
|
AccessibleShape::release ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===== XServiceInfo ========================================================
|
|
|
|
|
|
|
|
::rtl::OUString SAL_CALL
|
|
|
|
AccessibleGraphicShape::getImplementationName (void)
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2002-06-28 08:51:57 -05:00
|
|
|
return ::rtl::OUString(
|
|
|
|
RTL_CONSTASCII_USTRINGPARAM("AccessibleGraphicShape"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
|
|
|
|
AccessibleGraphicShape::getSupportedServiceNames (void)
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2002-11-29 10:56:48 -06:00
|
|
|
ThrowIfDisposed ();
|
2002-06-28 08:51:57 -05:00
|
|
|
// Get list of supported service names from base class...
|
|
|
|
uno::Sequence<OUString> aServiceNames =
|
|
|
|
AccessibleShape::getSupportedServiceNames();
|
|
|
|
sal_Int32 nCount (aServiceNames.getLength());
|
|
|
|
|
|
|
|
// ...and add additional names.
|
|
|
|
aServiceNames.realloc (nCount + 1);
|
|
|
|
static const OUString sAdditionalServiceName (RTL_CONSTASCII_USTRINGPARAM(
|
2003-04-24 10:53:35 -05:00
|
|
|
"com.sun.star.drawing.AccessibleGraphicShape"));
|
2002-06-28 08:51:57 -05:00
|
|
|
aServiceNames[nCount] = sAdditionalServiceName;
|
|
|
|
|
|
|
|
return aServiceNames;
|
2002-02-05 03:35:08 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===== XTypeProvider ===================================================
|
|
|
|
|
|
|
|
uno::Sequence<uno::Type> SAL_CALL
|
|
|
|
AccessibleGraphicShape::getTypes (void)
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
// Get list of types from the context base implementation...
|
|
|
|
uno::Sequence<uno::Type> aTypeList (AccessibleShape::getTypes());
|
|
|
|
// ...and add the additional type for the component.
|
|
|
|
long nTypeCount = aTypeList.getLength();
|
|
|
|
aTypeList.realloc (nTypeCount + 1);
|
|
|
|
const uno::Type aImageType =
|
|
|
|
::getCppuType((const uno::Reference<XAccessibleImage>*)0);
|
|
|
|
aTypeList[nTypeCount] = aImageType;
|
|
|
|
|
|
|
|
return aTypeList;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-05-03 10:49:07 -05:00
|
|
|
/// Create the base name of this object, i.e. the name without appended number.
|
2002-02-08 10:01:33 -06:00
|
|
|
::rtl::OUString
|
2002-03-18 03:15:41 -06:00
|
|
|
AccessibleGraphicShape::CreateAccessibleBaseName (void)
|
2002-02-05 03:35:08 -06:00
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::rtl::OUString sName;
|
|
|
|
|
2002-03-18 03:15:41 -06:00
|
|
|
ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
|
2002-02-05 03:35:08 -06:00
|
|
|
switch (nShapeType)
|
|
|
|
{
|
|
|
|
case DRAWING_GRAPHIC_OBJECT:
|
2002-04-11 06:52:05 -05:00
|
|
|
sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("GraphicObjectShape"));
|
2002-02-05 03:35:08 -06:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2002-04-11 06:52:05 -05:00
|
|
|
sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleGraphicShape"));
|
2002-02-05 03:35:08 -06:00
|
|
|
uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
|
|
|
|
if (xDescriptor.is())
|
2002-04-11 06:52:05 -05:00
|
|
|
sName += ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": "))
|
2002-02-05 03:35:08 -06:00
|
|
|
+ xDescriptor->getShapeType();
|
|
|
|
}
|
|
|
|
|
|
|
|
return sName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-02-08 10:01:33 -06:00
|
|
|
::rtl::OUString
|
2002-03-18 03:15:41 -06:00
|
|
|
AccessibleGraphicShape::CreateAccessibleDescription (void)
|
2002-02-05 03:35:08 -06:00
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2002-03-18 03:15:41 -06:00
|
|
|
return CreateAccessibleName ();
|
2002-02-05 03:35:08 -06:00
|
|
|
}
|
2010-10-12 08:53:47 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|