1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessiblePresentationOLEShape.cxx,v $
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 "AccessiblePresentationOLEShape.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 AccessiblePresentationOLEShape::AccessiblePresentationOLEShape (
49 const AccessibleShapeInfo
& rShapeInfo
,
50 const AccessibleShapeTreeInfo
& rShapeTreeInfo
)
51 : AccessibleOLEShape (rShapeInfo
, rShapeTreeInfo
)
58 AccessiblePresentationOLEShape::~AccessiblePresentationOLEShape (void)
65 //===== XServiceInfo ========================================================
67 ::rtl::OUString SAL_CALL
68 AccessiblePresentationOLEShape::getImplementationName (void)
69 throw (::com::sun::star::uno::RuntimeException
)
71 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessiblePresentationOLEShape"));
77 /// Set this object's name if it is different to the current name.
79 AccessiblePresentationOLEShape::CreateAccessibleBaseName (void)
80 throw (::com::sun::star::uno::RuntimeException
)
82 ::rtl::OUString sName
;
84 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
87 case PRESENTATION_OLE
:
88 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressOLE"));
90 case PRESENTATION_CHART
:
91 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressChart"));
93 case PRESENTATION_TABLE
:
94 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressTable"));
97 sName
= ::rtl::OUString (
98 RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleImpressOLEShape"));
99 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
100 if (xDescriptor
.is())
101 sName
+= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": "))
102 + xDescriptor
->getShapeType();
112 AccessiblePresentationOLEShape::CreateAccessibleDescription (void)
113 throw (::com::sun::star::uno::RuntimeException
)
115 // return createAccessibleName();
116 DescriptionGenerator
aDG (mxShape
);
117 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
120 case PRESENTATION_OLE
:
121 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationOLEShape"));
122 //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
123 aDG
.AddProperty (OUString::createFromAscii ("CLSID"),
124 DescriptionGenerator::STRING
);
126 case PRESENTATION_CHART
:
127 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationChartShape"));
128 //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
129 aDG
.AddProperty (OUString::createFromAscii ("CLSID"),
130 DescriptionGenerator::STRING
);
132 case PRESENTATION_TABLE
:
133 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationTableShape"));
134 //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
135 aDG
.AddProperty (OUString::createFromAscii ("CLSID"),
136 DescriptionGenerator::STRING
);
139 aDG
.Initialize (::rtl::OUString::createFromAscii ("Unknown accessible presentation OLE shape"));
140 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
141 if (xDescriptor
.is())
143 aDG
.AppendString (::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("service name=")));
144 aDG
.AppendString (xDescriptor
->getShapeType());
151 } // end of namespace accessibility