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 <strings.hrc>
25 #include <sdresid.hxx>
26 #include <svx/ShapeTypeHandler.hxx>
28 #include <com/sun/star/drawing/XShapeDescriptor.hpp>
30 using namespace ::com::sun::star
;
31 using namespace ::com::sun::star::accessibility
;
33 namespace accessibility
{
35 //===== internal ============================================================
37 AccessiblePresentationShape::AccessiblePresentationShape (
38 const AccessibleShapeInfo
& rShapeInfo
,
39 const AccessibleShapeTreeInfo
& rShapeTreeInfo
)
40 : AccessibleShape (rShapeInfo
, rShapeTreeInfo
)
44 AccessiblePresentationShape::~AccessiblePresentationShape()
51 AccessiblePresentationShape::getImplementationName()
53 return "AccessiblePresentationShape";
56 /// Set this object's name if is different to the current name.
57 OUString
AccessiblePresentationShape::CreateAccessibleBaseName()
61 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
64 case PRESENTATION_TITLE
:
65 sName
= SdResId(SID_SD_A11Y_P_TITLE_N
);
67 case PRESENTATION_OUTLINER
:
68 sName
= SdResId(SID_SD_A11Y_P_OUTLINER_N
);
70 case PRESENTATION_SUBTITLE
:
71 sName
= SdResId(SID_SD_A11Y_P_SUBTITLE_N
);
73 case PRESENTATION_PAGE
:
74 sName
= SdResId(SID_SD_A11Y_P_PAGE_N
);
76 case PRESENTATION_NOTES
:
77 sName
= SdResId(SID_SD_A11Y_P_NOTES_N
);
79 case PRESENTATION_HANDOUT
:
80 sName
= SdResId(SID_SD_A11Y_P_HANDOUT_N
);
82 case PRESENTATION_HEADER
:
83 sName
= SdResId(SID_SD_A11Y_P_HEADER_N
);
85 case PRESENTATION_FOOTER
:
86 sName
= SdResId(SID_SD_A11Y_P_FOOTER_N
);
88 case PRESENTATION_DATETIME
:
89 sName
= SdResId(SID_SD_A11Y_P_DATE_N
);
91 case PRESENTATION_PAGENUMBER
:
92 sName
= SdResId(SID_SD_A11Y_P_NUMBER_N
);
95 sName
= SdResId(SID_SD_A11Y_P_UNKNOWN_N
);
96 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
98 sName
+= ": " + xDescriptor
->getShapeType();
104 OUString
AccessiblePresentationShape::GetStyle()
108 ShapeTypeId nShapeType
= ShapeTypeHandler::Instance().GetTypeId (mxShape
);
111 case PRESENTATION_TITLE
:
112 sName
= SdResId(SID_SD_A11Y_P_TITLE_N_STYLE
);
114 case PRESENTATION_OUTLINER
:
115 sName
= SdResId(SID_SD_A11Y_P_OUTLINER_N_STYLE
);
117 case PRESENTATION_SUBTITLE
:
118 sName
= SdResId(SID_SD_A11Y_P_SUBTITLE_N_STYLE
);
120 case PRESENTATION_PAGE
:
121 sName
= SdResId(SID_SD_A11Y_P_PAGE_N_STYLE
);
123 case PRESENTATION_NOTES
:
124 sName
= SdResId(SID_SD_A11Y_P_NOTES_N_STYLE
);
126 case PRESENTATION_HANDOUT
:
127 sName
= SdResId(SID_SD_A11Y_P_HANDOUT_N_STYLE
);
129 case PRESENTATION_FOOTER
:
130 sName
= SdResId(SID_SD_A11Y_P_FOOTER_N_STYLE
);
132 case PRESENTATION_HEADER
:
133 sName
= SdResId(SID_SD_A11Y_P_HEADER_N_STYLE
);
135 case PRESENTATION_DATETIME
:
136 sName
= SdResId(SID_SD_A11Y_P_DATE_N_STYLE
);
138 case PRESENTATION_PAGENUMBER
:
139 sName
= SdResId(SID_SD_A11Y_P_NUMBER_N_STYLE
);
142 sName
= SdResId(SID_SD_A11Y_P_UNKNOWN_N_STYLE
);
143 uno::Reference
<drawing::XShapeDescriptor
> xDescriptor (mxShape
, uno::UNO_QUERY
);
144 if (xDescriptor
.is())
145 sName
+= ": " + xDescriptor
->getShapeType();
151 } // end of namespace accessibility
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */