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 "accessibility.hrc"
25 #include "sdresid.hxx"
26 #include <svx/DescriptionGenerator.hxx>
27 #include <rtl/ustring.h>
29 using namespace ::com::sun::star
;
30 using namespace ::com::sun::star::accessibility
;
32 namespace accessibility
{
34 //===== internal ============================================================
36 AccessiblePresentationShape::AccessiblePresentationShape (
37 const AccessibleShapeInfo
& rShapeInfo
,
38 const AccessibleShapeTreeInfo
& rShapeTreeInfo
)
39 : AccessibleShape (rShapeInfo
, rShapeTreeInfo
)
43 AccessiblePresentationShape::~AccessiblePresentationShape()
50 AccessiblePresentationShape::getImplementationName()
51 throw (::com::sun::star::uno::RuntimeException
, std::exception
)
53 return OUString("AccessiblePresentationShape");
56 /// Set this object's name if is different to the current name.
57 OUString
AccessiblePresentationShape::CreateAccessibleBaseName()
58 throw (::com::sun::star::uno::RuntimeException
)
62 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
65 case PRESENTATION_TITLE
:
66 sName
= SdResId(SID_SD_A11Y_P_TITLE_N
);
68 case PRESENTATION_OUTLINER
:
69 sName
= SdResId(SID_SD_A11Y_P_OUTLINER_N
);
71 case PRESENTATION_SUBTITLE
:
72 sName
= SdResId(SID_SD_A11Y_P_SUBTITLE_N
);
74 case PRESENTATION_PAGE
:
75 sName
= SdResId(SID_SD_A11Y_P_PAGE_N
);
77 case PRESENTATION_NOTES
:
78 sName
= SdResId(SID_SD_A11Y_P_NOTES_N
);
80 case PRESENTATION_HANDOUT
:
81 sName
= SdResId(SID_SD_A11Y_P_HANDOUT_N
);
83 case PRESENTATION_HEADER
:
84 sName
= SdResId(SID_SD_A11Y_P_HEADER_N
);
86 case PRESENTATION_FOOTER
:
87 sName
= SdResId(SID_SD_A11Y_P_FOOTER_N
);
89 case PRESENTATION_DATETIME
:
90 sName
= SdResId(SID_SD_A11Y_P_DATE_N
);
92 case PRESENTATION_PAGENUMBER
:
93 sName
= SdResId(SID_SD_A11Y_P_NUMBER_N
);
96 sName
= SdResId(SID_SD_A11Y_P_UNKNOWN_N
);
97 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
99 sName
+= ": " + xDescriptor
->getShapeType();
106 AccessiblePresentationShape::CreateAccessibleDescription()
107 throw (::com::sun::star::uno::RuntimeException
)
109 // return createAccessibleName ();
110 DescriptionGenerator
aDG (mxShape
);
111 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
114 case PRESENTATION_TITLE
:
115 aDG
.Initialize (SdResId(SID_SD_A11Y_P_TITLE_D
));
117 case PRESENTATION_OUTLINER
:
118 aDG
.Initialize (SdResId(SID_SD_A11Y_P_OUTLINER_D
));
120 case PRESENTATION_SUBTITLE
:
121 aDG
.Initialize (SdResId(SID_SD_A11Y_P_SUBTITLE_D
));
123 case PRESENTATION_PAGE
:
124 aDG
.Initialize (SdResId(SID_SD_A11Y_P_PAGE_D
));
126 case PRESENTATION_NOTES
:
127 aDG
.Initialize (SdResId(SID_SD_A11Y_P_NOTES_D
));
129 case PRESENTATION_HANDOUT
:
130 aDG
.Initialize (SdResId(SID_SD_A11Y_P_HANDOUT_D
));
132 case PRESENTATION_HEADER
:
133 aDG
.Initialize (SdResId(SID_SD_A11Y_P_HEADER_D
));
135 case PRESENTATION_FOOTER
:
136 aDG
.Initialize (SdResId(SID_SD_A11Y_P_FOOTER_D
));
138 case PRESENTATION_DATETIME
:
139 aDG
.Initialize (SdResId(SID_SD_A11Y_P_DATE_D
));
141 case PRESENTATION_PAGENUMBER
:
142 aDG
.Initialize (SdResId(SID_SD_A11Y_P_NUMBER_D
));
145 aDG
.Initialize (SdResId(SID_SD_A11Y_P_UNKNOWN_D
));
146 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
147 if (xDescriptor
.is())
149 aDG
.AppendString ("service name=");
150 aDG
.AppendString (xDescriptor
->getShapeType());
157 OUString
AccessiblePresentationShape::GetStyle()
161 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
164 case PRESENTATION_TITLE
:
165 sName
= SdResId(SID_SD_A11Y_P_TITLE_N_STYLE
);
167 case PRESENTATION_OUTLINER
:
168 sName
= SdResId(SID_SD_A11Y_P_OUTLINER_N_STYLE
);
170 case PRESENTATION_SUBTITLE
:
171 sName
= SdResId(SID_SD_A11Y_P_SUBTITLE_N_STYLE
);
173 case PRESENTATION_PAGE
:
174 sName
= SdResId(SID_SD_A11Y_P_PAGE_N_STYLE
);
176 case PRESENTATION_NOTES
:
177 sName
= SdResId(SID_SD_A11Y_P_NOTES_N_STYLE
);
179 case PRESENTATION_HANDOUT
:
180 sName
= SdResId(SID_SD_A11Y_P_HANDOUT_N_STYLE
);
182 case PRESENTATION_FOOTER
:
183 sName
= SdResId(SID_SD_A11Y_P_FOOTER_N_STYLE
);
185 case PRESENTATION_HEADER
:
186 sName
= SdResId(SID_SD_A11Y_P_HEADER_N_STYLE
);
188 case PRESENTATION_DATETIME
:
189 sName
= SdResId(SID_SD_A11Y_P_DATE_N_STYLE
);
191 case PRESENTATION_PAGENUMBER
:
192 sName
= SdResId(SID_SD_A11Y_P_NUMBER_N_STYLE
);
195 sName
= SdResId(SID_SD_A11Y_P_UNKNOWN_N_STYLE
);
196 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
197 if (xDescriptor
.is())
198 sName
+= ": " + xDescriptor
->getShapeType();
204 } // end of namespace accessibility
206 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */