Update ooo320-m1
[ooovba.git] / sd / source / ui / accessibility / AccessiblePresentationGraphicShape.cxx
blob10cc5aa0246c0ab3033d2f56cbce6c324a7f2ff6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessiblePresentationGraphicShape.cxx,v $
10 * $Revision: 1.14 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
33 #include "AccessiblePresentationGraphicShape.hxx"
35 #include "SdShapeTypes.hxx"
37 #include <svx/DescriptionGenerator.hxx>
38 #include <rtl/ustring.h>
40 using namespace ::rtl;
41 using namespace ::com::sun::star;
42 using namespace ::com::sun::star::accessibility;
44 namespace accessibility {
46 //===== internal ============================================================
48 AccessiblePresentationGraphicShape::AccessiblePresentationGraphicShape (
49 const AccessibleShapeInfo& rShapeInfo,
50 const AccessibleShapeTreeInfo& rShapeTreeInfo)
51 : AccessibleGraphicShape (rShapeInfo, rShapeTreeInfo)
58 AccessiblePresentationGraphicShape::~AccessiblePresentationGraphicShape (void)
65 //===== XServiceInfo ========================================================
67 ::rtl::OUString SAL_CALL
68 AccessiblePresentationGraphicShape::getImplementationName (void)
69 throw (::com::sun::star::uno::RuntimeException)
71 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessiblePresentationGraphicShape"));
77 /// Set this object's name if is different to the current name.
78 ::rtl::OUString
79 AccessiblePresentationGraphicShape::CreateAccessibleBaseName (void)
80 throw (::com::sun::star::uno::RuntimeException)
82 ::rtl::OUString sName;
84 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
85 switch (nShapeType)
87 case PRESENTATION_GRAPHIC_OBJECT:
88 sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressGraphicObject"));
89 break;
90 default:
91 sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleImpressShape"));
92 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
93 if (xDescriptor.is())
94 sName += ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": "))
95 + xDescriptor->getShapeType();
98 return sName;
104 ::rtl::OUString
105 AccessiblePresentationGraphicShape::CreateAccessibleDescription (void)
106 throw (::com::sun::star::uno::RuntimeException)
108 // return createAccessibleName ();
109 DescriptionGenerator aDG (mxShape);
110 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
111 switch (nShapeType)
113 case PRESENTATION_GRAPHIC_OBJECT:
114 aDG.Initialize (::rtl::OUString::createFromAscii ("PresentationGraphicShape"));
115 break;
116 default:
117 aDG.Initialize (
118 ::rtl::OUString::createFromAscii ("Unknown accessible presentation graphic shape"));
119 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
120 if (xDescriptor.is())
122 aDG.AppendString (::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("service name=")));
123 aDG.AppendString (xDescriptor->getShapeType());
127 return aDG();
130 } // end of namespace accessibility