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: AccessiblePresentationShape.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 "AccessiblePresentationShape.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 AccessiblePresentationShape::AccessiblePresentationShape (
49 const AccessibleShapeInfo
& rShapeInfo
,
50 const AccessibleShapeTreeInfo
& rShapeTreeInfo
)
51 : AccessibleShape (rShapeInfo
, rShapeTreeInfo
)
58 AccessiblePresentationShape::~AccessiblePresentationShape (void)
65 //===== XServiceInfo ========================================================
67 ::rtl::OUString SAL_CALL
68 AccessiblePresentationShape::getImplementationName (void)
69 throw (::com::sun::star::uno::RuntimeException
)
71 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessiblePresentationShape"));
77 /// Set this object's name if is different to the current name.
79 AccessiblePresentationShape::CreateAccessibleBaseName (void)
80 throw (::com::sun::star::uno::RuntimeException
)
82 ::rtl::OUString sName
;
84 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
87 case PRESENTATION_TITLE
:
88 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressTitle"));
90 case PRESENTATION_OUTLINER
:
91 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressOutliner"));
93 case PRESENTATION_SUBTITLE
:
94 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressSubtitle"));
96 case PRESENTATION_PAGE
:
97 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPage"));
99 case PRESENTATION_NOTES
:
100 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressNotes"));
102 case PRESENTATION_HANDOUT
:
103 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHandout"));
105 case PRESENTATION_HEADER
:
106 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressHeader"));
108 case PRESENTATION_FOOTER
:
109 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressFooter"));
111 case PRESENTATION_DATETIME
:
112 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressDateAndTime"));
114 case PRESENTATION_PAGENUMBER
:
115 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("ImpressPageNumber"));
118 sName
= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("UnknownAccessibleImpressShape"));
119 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
120 if (xDescriptor
.is())
121 sName
+= ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM(": "))
122 + xDescriptor
->getShapeType();
132 AccessiblePresentationShape::CreateAccessibleDescription (void)
133 throw (::com::sun::star::uno::RuntimeException
)
135 // return createAccessibleName ();
136 DescriptionGenerator
aDG (mxShape
);
137 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
140 case PRESENTATION_TITLE
:
141 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationTitleShape"));
143 case PRESENTATION_OUTLINER
:
144 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationOutlinerShape"));
146 case PRESENTATION_SUBTITLE
:
147 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationSubtitleShape"));
149 case PRESENTATION_PAGE
:
150 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationPageShape"));
152 case PRESENTATION_NOTES
:
153 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationNotesShape"));
155 case PRESENTATION_HANDOUT
:
156 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationHandoutShape"));
158 case PRESENTATION_HEADER
:
159 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationHeaderShape"));
161 case PRESENTATION_FOOTER
:
162 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationFooterShape"));
164 case PRESENTATION_DATETIME
:
165 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationDateAndTimeShape"));
167 case PRESENTATION_PAGENUMBER
:
168 aDG
.Initialize (::rtl::OUString::createFromAscii ("PresentationPageNumberShape"));
171 aDG
.Initialize (::rtl::OUString::createFromAscii ("Unknown accessible presentation shape"));
172 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
173 if (xDescriptor
.is())
175 aDG
.AppendString (::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("service name=")));
176 aDG
.AppendString (xDescriptor
->getShapeType());
183 } // end of namespace accessibility