2002-03-06 10:34:56 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:02:31 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2002-03-06 10:34:56 -06:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2002-03-06 10:34:56 -06:00
|
|
|
*
|
2008-04-10 13:02:31 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2002-03-06 10:34:56 -06:00
|
|
|
*
|
2008-04-10 13:02:31 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2002-03-06 10:34:56 -06:00
|
|
|
*
|
2008-04-10 13:02:31 -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-03-06 10:34:56 -06:00
|
|
|
*
|
2008-04-10 13:02:31 -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-03-06 10:34:56 -06:00
|
|
|
*
|
2008-04-10 13:02:31 -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-03-06 10:34:56 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 12:25:35 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
2002-03-06 10:34:56 -06:00
|
|
|
#include "AccessiblePresentationGraphicShape.hxx"
|
|
|
|
|
|
|
|
#include "SdShapeTypes.hxx"
|
|
|
|
|
|
|
|
#include <svx/DescriptionGenerator.hxx>
|
2002-03-19 10:21:36 -06:00
|
|
|
#include <rtl/ustring.h>
|
2002-03-06 10:34:56 -06:00
|
|
|
|
|
|
|
using namespace ::rtl;
|
|
|
|
using namespace ::com::sun::star;
|
2003-04-24 11:03:54 -05:00
|
|
|
using namespace ::com::sun::star::accessibility;
|
2002-03-06 10:34:56 -06:00
|
|
|
|
|
|
|
namespace accessibility {
|
|
|
|
|
|
|
|
//===== internal ============================================================
|
|
|
|
|
|
|
|
AccessiblePresentationGraphicShape::AccessiblePresentationGraphicShape (
|
2002-05-06 03:46:54 -05:00
|
|
|
const AccessibleShapeInfo& rShapeInfo,
|
|
|
|
const AccessibleShapeTreeInfo& rShapeTreeInfo)
|
|
|
|
: AccessibleGraphicShape (rShapeInfo, rShapeTreeInfo)
|
2002-03-06 10:34:56 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AccessiblePresentationGraphicShape::~AccessiblePresentationGraphicShape (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===== XServiceInfo ========================================================
|
|
|
|
|
|
|
|
::rtl::OUString SAL_CALL
|
|
|
|
AccessiblePresentationGraphicShape::getImplementationName (void)
|
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2002-04-10 06:19:16 -05:00
|
|
|
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessiblePresentationGraphicShape"));
|
2002-03-06 10:34:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Set this object's name if is different to the current name.
|
2002-03-07 02:41:23 -06:00
|
|
|
::rtl::OUString
|
2002-03-18 03:30:29 -06:00
|
|
|
AccessiblePresentationGraphicShape::CreateAccessibleBaseName (void)
|
2002-03-06 10:34:56 -06:00
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::rtl::OUString sName;
|
|
|
|
|
2002-03-18 03:30:29 -06:00
|
|
|
ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
|
2002-03-06 10:34:56 -06:00
|
|
|
switch (nShapeType)
|
|
|
|
{
|
|
|
|
case PRESENTATION_GRAPHIC_OBJECT:
|
2002-04-10 06:19:16 -05:00
|
|
|
sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressGraphicObject"));
|
2002-03-06 10:34:56 -06:00
|
|
|
break;
|
|
|
|
default:
|
2002-04-10 06:19:16 -05:00
|
|
|
sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleImpressShape"));
|
2002-03-06 10:34:56 -06:00
|
|
|
uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
|
|
|
|
if (xDescriptor.is())
|
2002-04-10 06:19:16 -05:00
|
|
|
sName += ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": "))
|
2002-03-06 10:34:56 -06:00
|
|
|
+ xDescriptor->getShapeType();
|
|
|
|
}
|
|
|
|
|
|
|
|
return sName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-03-07 02:41:23 -06:00
|
|
|
::rtl::OUString
|
2002-03-18 03:30:29 -06:00
|
|
|
AccessiblePresentationGraphicShape::CreateAccessibleDescription (void)
|
2002-03-06 10:34:56 -06:00
|
|
|
throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
// return createAccessibleName ();
|
|
|
|
DescriptionGenerator aDG (mxShape);
|
2002-03-18 03:30:29 -06:00
|
|
|
ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
|
2002-03-06 10:34:56 -06:00
|
|
|
switch (nShapeType)
|
|
|
|
{
|
|
|
|
case PRESENTATION_GRAPHIC_OBJECT:
|
2002-03-18 03:30:29 -06:00
|
|
|
aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationGraphicShape"));
|
2002-03-06 10:34:56 -06:00
|
|
|
break;
|
|
|
|
default:
|
2002-04-11 07:29:00 -05:00
|
|
|
aDG.Initialize (
|
|
|
|
::rtl::OUString::createFromAscii ("Unknown accessible presentation graphic shape"));
|
2002-03-06 10:34:56 -06:00
|
|
|
uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
|
|
|
|
if (xDescriptor.is())
|
|
|
|
{
|
2002-04-10 06:19:16 -05:00
|
|
|
aDG.AppendString (::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("service name=")));
|
2002-03-18 03:30:29 -06:00
|
|
|
aDG.AppendString (xDescriptor->getShapeType());
|
2002-03-06 10:34:56 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return aDG();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end of namespace accessibility
|