office-gobmx/sd/source/ui/accessibility/AccessiblePresentationGraphicShape.cxx

128 lines
4.1 KiB
C++
Raw Normal View History

2002-03-06 10:34:56 -06:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2002-03-06 10:34:56 -06:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2002-03-06 10:34:56 -06:00
*
* OpenOffice.org - a multi-platform office productivity suite
2002-03-06 10:34:56 -06:00
*
* This file is part of OpenOffice.org.
2002-03-06 10:34:56 -06: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
*
* 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
*
* 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
*
************************************************************************/
// 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>
#include <rtl/ustring.h>
2002-03-06 10:34:56 -06:00
using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
2002-03-06 10:34:56 -06:00
namespace accessibility {
//===== internal ============================================================
AccessiblePresentationGraphicShape::AccessiblePresentationGraphicShape (
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)
{
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.
::rtl::OUString
AccessiblePresentationGraphicShape::CreateAccessibleBaseName (void)
2002-03-06 10:34:56 -06:00
throw (::com::sun::star::uno::RuntimeException)
{
::rtl::OUString sName;
ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
2002-03-06 10:34:56 -06:00
switch (nShapeType)
{
case PRESENTATION_GRAPHIC_OBJECT:
sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressGraphicObject"));
2002-03-06 10:34:56 -06:00
break;
default:
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())
sName += ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": "))
2002-03-06 10:34:56 -06:00
+ xDescriptor->getShapeType();
}
return sName;
}
::rtl::OUString
AccessiblePresentationGraphicShape::CreateAccessibleDescription (void)
2002-03-06 10:34:56 -06:00
throw (::com::sun::star::uno::RuntimeException)
{
// return createAccessibleName ();
DescriptionGenerator aDG (mxShape);
ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
2002-03-06 10:34:56 -06:00
switch (nShapeType)
{
case PRESENTATION_GRAPHIC_OBJECT:
aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationGraphicShape"));
2002-03-06 10:34:56 -06:00
break;
default:
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())
{
aDG.AppendString (::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("service name=")));
aDG.AppendString (xDescriptor->getShapeType());
2002-03-06 10:34:56 -06:00
}
}
return aDG();
}
} // end of namespace accessibility