1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "AccessiblePresentationShape.hxx"
22 #include "SdShapeTypes.hxx"
24 #include <svx/DescriptionGenerator.hxx>
25 #include <rtl/ustring.h>
27 using namespace ::rtl
;
28 using namespace ::com::sun::star
;
29 using namespace ::com::sun::star::accessibility
;
31 namespace accessibility
{
33 //===== internal ============================================================
35 AccessiblePresentationShape::AccessiblePresentationShape (
36 const AccessibleShapeInfo
& rShapeInfo
,
37 const AccessibleShapeTreeInfo
& rShapeTreeInfo
)
38 : AccessibleShape (rShapeInfo
, rShapeTreeInfo
)
45 AccessiblePresentationShape::~AccessiblePresentationShape (void)
52 //===== XServiceInfo ========================================================
55 AccessiblePresentationShape::getImplementationName (void)
56 throw (::com::sun::star::uno::RuntimeException
)
58 return OUString("AccessiblePresentationShape");
64 /// Set this object's name if is different to the current name.
66 AccessiblePresentationShape::CreateAccessibleBaseName (void)
67 throw (::com::sun::star::uno::RuntimeException
)
71 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
74 case PRESENTATION_TITLE
:
75 sName
= "ImpressTitle";
77 case PRESENTATION_OUTLINER
:
78 sName
= "ImpressOutliner";
80 case PRESENTATION_SUBTITLE
:
81 sName
= "ImpressSubtitle";
83 case PRESENTATION_PAGE
:
84 sName
= "ImpressPage";
86 case PRESENTATION_NOTES
:
87 sName
= "ImpressNotes";
89 case PRESENTATION_HANDOUT
:
90 sName
= "ImpressHandout";
92 case PRESENTATION_HEADER
:
93 sName
= "ImpressHeader";
95 case PRESENTATION_FOOTER
:
96 sName
= "ImpressFooter";
98 case PRESENTATION_DATETIME
:
99 sName
= "ImpressDateAndTime";
101 case PRESENTATION_PAGENUMBER
:
102 sName
= "ImpressPageNumber";
105 sName
= "UnknownAccessibleImpressShape";
106 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
107 if (xDescriptor
.is())
108 sName
+= ": " + xDescriptor
->getShapeType();
118 AccessiblePresentationShape::CreateAccessibleDescription (void)
119 throw (::com::sun::star::uno::RuntimeException
)
121 // return createAccessibleName ();
122 DescriptionGenerator
aDG (mxShape
);
123 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
126 case PRESENTATION_TITLE
:
127 aDG
.Initialize ("PresentationTitleShape");
129 case PRESENTATION_OUTLINER
:
130 aDG
.Initialize ("PresentationOutlinerShape");
132 case PRESENTATION_SUBTITLE
:
133 aDG
.Initialize ("PresentationSubtitleShape");
135 case PRESENTATION_PAGE
:
136 aDG
.Initialize ("PresentationPageShape");
138 case PRESENTATION_NOTES
:
139 aDG
.Initialize ("PresentationNotesShape");
141 case PRESENTATION_HANDOUT
:
142 aDG
.Initialize ("PresentationHandoutShape");
144 case PRESENTATION_HEADER
:
145 aDG
.Initialize ("PresentationHeaderShape");
147 case PRESENTATION_FOOTER
:
148 aDG
.Initialize ("PresentationFooterShape");
150 case PRESENTATION_DATETIME
:
151 aDG
.Initialize ("PresentationDateAndTimeShape");
153 case PRESENTATION_PAGENUMBER
:
154 aDG
.Initialize ("PresentationPageNumberShape");
157 aDG
.Initialize ("Unknown accessible presentation shape");
158 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
159 if (xDescriptor
.is())
161 aDG
.AppendString ("service name=");
162 aDG
.AppendString (xDescriptor
->getShapeType());
169 } // end of namespace accessibility
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */