bump product version to 6.4.0.3
[LibreOffice.git] / sd / source / ui / accessibility / AccessiblePresentationShape.cxx
blob5fef2489825aae376197393f1ed73bedeb418517
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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()
48 // XServiceInfo
50 OUString SAL_CALL
51 AccessiblePresentationShape::getImplementationName()
53 return "AccessiblePresentationShape";
56 /// Set this object's name if is different to the current name.
57 OUString AccessiblePresentationShape::CreateAccessibleBaseName()
59 OUString sName;
61 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
62 switch (nShapeType)
64 case PRESENTATION_TITLE:
65 sName = SdResId(SID_SD_A11Y_P_TITLE_N);
66 break;
67 case PRESENTATION_OUTLINER:
68 sName = SdResId(SID_SD_A11Y_P_OUTLINER_N);
69 break;
70 case PRESENTATION_SUBTITLE:
71 sName = SdResId(SID_SD_A11Y_P_SUBTITLE_N);
72 break;
73 case PRESENTATION_PAGE:
74 sName = SdResId(SID_SD_A11Y_P_PAGE_N);
75 break;
76 case PRESENTATION_NOTES:
77 sName = SdResId(SID_SD_A11Y_P_NOTES_N);
78 break;
79 case PRESENTATION_HANDOUT:
80 sName = SdResId(SID_SD_A11Y_P_HANDOUT_N);
81 break;
82 case PRESENTATION_HEADER:
83 sName = SdResId(SID_SD_A11Y_P_HEADER_N);
84 break;
85 case PRESENTATION_FOOTER:
86 sName = SdResId(SID_SD_A11Y_P_FOOTER_N);
87 break;
88 case PRESENTATION_DATETIME:
89 sName = SdResId(SID_SD_A11Y_P_DATE_N);
90 break;
91 case PRESENTATION_PAGENUMBER:
92 sName = SdResId(SID_SD_A11Y_P_NUMBER_N);
93 break;
94 default:
95 sName = SdResId(SID_SD_A11Y_P_UNKNOWN_N);
96 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
97 if (xDescriptor.is())
98 sName += ": " + xDescriptor->getShapeType();
101 return sName;
104 OUString AccessiblePresentationShape::GetStyle()
106 OUString sName;
108 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
109 switch (nShapeType)
111 case PRESENTATION_TITLE:
112 sName = SdResId(SID_SD_A11Y_P_TITLE_N_STYLE);
113 break;
114 case PRESENTATION_OUTLINER:
115 sName = SdResId(SID_SD_A11Y_P_OUTLINER_N_STYLE);
116 break;
117 case PRESENTATION_SUBTITLE:
118 sName = SdResId(SID_SD_A11Y_P_SUBTITLE_N_STYLE);
119 break;
120 case PRESENTATION_PAGE:
121 sName = SdResId(SID_SD_A11Y_P_PAGE_N_STYLE);
122 break;
123 case PRESENTATION_NOTES:
124 sName = SdResId(SID_SD_A11Y_P_NOTES_N_STYLE);
125 break;
126 case PRESENTATION_HANDOUT:
127 sName = SdResId(SID_SD_A11Y_P_HANDOUT_N_STYLE);
128 break;
129 case PRESENTATION_FOOTER:
130 sName = SdResId(SID_SD_A11Y_P_FOOTER_N_STYLE);
131 break;
132 case PRESENTATION_HEADER:
133 sName = SdResId(SID_SD_A11Y_P_HEADER_N_STYLE);
134 break;
135 case PRESENTATION_DATETIME:
136 sName = SdResId(SID_SD_A11Y_P_DATE_N_STYLE);
137 break;
138 case PRESENTATION_PAGENUMBER:
139 sName = SdResId(SID_SD_A11Y_P_NUMBER_N_STYLE);
140 break;
141 default:
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();
148 return sName;
151 } // end of namespace accessibility
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */