tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sd / source / ui / accessibility / AccessiblePresentationShape.cxx
blob784cb2eda1d5f7e9d50bc607ec431cd256c41209
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/XShape.hpp>
30 using namespace ::com::sun::star;
32 namespace accessibility
34 //===== internal ============================================================
36 AccessiblePresentationShape::AccessiblePresentationShape(
37 const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo)
38 : AccessibleShape(rShapeInfo, rShapeTreeInfo)
42 AccessiblePresentationShape::~AccessiblePresentationShape() {}
44 // XServiceInfo
46 OUString SAL_CALL AccessiblePresentationShape::getImplementationName()
48 return u"AccessiblePresentationShape"_ustr;
51 /// Set this object's name if is different to the current name.
52 OUString AccessiblePresentationShape::CreateAccessibleBaseName()
54 OUString sName;
56 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId(mxShape);
57 switch (nShapeType)
59 case PRESENTATION_TITLE:
60 sName = SdResId(SID_SD_A11Y_P_TITLE_N);
61 break;
62 case PRESENTATION_OUTLINER:
63 sName = SdResId(SID_SD_A11Y_P_OUTLINER_N);
64 break;
65 case PRESENTATION_SUBTITLE:
66 sName = SdResId(SID_SD_A11Y_P_SUBTITLE_N);
67 break;
68 case PRESENTATION_PAGE:
69 sName = SdResId(SID_SD_A11Y_P_PAGE_N);
70 break;
71 case PRESENTATION_NOTES:
72 sName = SdResId(SID_SD_A11Y_P_NOTES_N);
73 break;
74 case PRESENTATION_HANDOUT:
75 sName = SdResId(SID_SD_A11Y_P_HANDOUT_N);
76 break;
77 case PRESENTATION_HEADER:
78 sName = SdResId(SID_SD_A11Y_P_HEADER_N);
79 break;
80 case PRESENTATION_FOOTER:
81 sName = SdResId(SID_SD_A11Y_P_FOOTER_N);
82 break;
83 case PRESENTATION_DATETIME:
84 sName = SdResId(SID_SD_A11Y_P_DATE_N);
85 break;
86 case PRESENTATION_PAGENUMBER:
87 sName = SdResId(SID_SD_A11Y_P_NUMBER_N);
88 break;
89 default:
90 sName = SdResId(SID_SD_A11Y_P_UNKNOWN_N);
91 if (mxShape.is())
92 sName += ": " + mxShape->getShapeType();
95 return sName;
98 OUString AccessiblePresentationShape::GetStyle() const
100 OUString sName;
102 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId(mxShape);
103 switch (nShapeType)
105 case PRESENTATION_TITLE:
106 sName = SdResId(SID_SD_A11Y_P_TITLE_N_STYLE);
107 break;
108 case PRESENTATION_OUTLINER:
109 sName = SdResId(SID_SD_A11Y_P_OUTLINER_N_STYLE);
110 break;
111 case PRESENTATION_SUBTITLE:
112 sName = SdResId(SID_SD_A11Y_P_SUBTITLE_N_STYLE);
113 break;
114 case PRESENTATION_PAGE:
115 sName = SdResId(SID_SD_A11Y_P_PAGE_N_STYLE);
116 break;
117 case PRESENTATION_NOTES:
118 sName = SdResId(SID_SD_A11Y_P_NOTES_N_STYLE);
119 break;
120 case PRESENTATION_HANDOUT:
121 sName = SdResId(SID_SD_A11Y_P_HANDOUT_N_STYLE);
122 break;
123 case PRESENTATION_FOOTER:
124 sName = SdResId(SID_SD_A11Y_P_FOOTER_N_STYLE);
125 break;
126 case PRESENTATION_HEADER:
127 sName = SdResId(SID_SD_A11Y_P_HEADER_N_STYLE);
128 break;
129 case PRESENTATION_DATETIME:
130 sName = SdResId(SID_SD_A11Y_P_DATE_N_STYLE);
131 break;
132 case PRESENTATION_PAGENUMBER:
133 sName = SdResId(SID_SD_A11Y_P_NUMBER_N_STYLE);
134 break;
135 default:
136 sName = SdResId(SID_SD_A11Y_P_UNKNOWN_N_STYLE);
137 if (mxShape.is())
138 sName += ": " + mxShape->getShapeType();
141 return sName;
143 } // end of namespace accessibility
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */