/src/libreoffice/sd/source/ui/accessibility/AccessiblePresentationShape.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #include <AccessiblePresentationShape.hxx> |
21 | | |
22 | | #include <SdShapeTypes.hxx> |
23 | | |
24 | | #include <strings.hrc> |
25 | | #include <sdresid.hxx> |
26 | | #include <svx/ShapeTypeHandler.hxx> |
27 | | |
28 | | #include <com/sun/star/drawing/XShape.hpp> |
29 | | |
30 | | using namespace ::com::sun::star; |
31 | | |
32 | | namespace accessibility |
33 | | { |
34 | | AccessiblePresentationShape::AccessiblePresentationShape( |
35 | | const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo) |
36 | 0 | : AccessibleShape(rShapeInfo, rShapeTreeInfo) |
37 | 0 | { |
38 | 0 | } |
39 | | |
40 | 0 | AccessiblePresentationShape::~AccessiblePresentationShape() {} |
41 | | |
42 | | // XServiceInfo |
43 | | |
44 | | OUString SAL_CALL AccessiblePresentationShape::getImplementationName() |
45 | 0 | { |
46 | 0 | return u"AccessiblePresentationShape"_ustr; |
47 | 0 | } |
48 | | |
49 | | /// Set this object's name if is different to the current name. |
50 | | OUString AccessiblePresentationShape::CreateAccessibleBaseName() |
51 | 0 | { |
52 | 0 | OUString sName; |
53 | |
|
54 | 0 | ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId(mxShape); |
55 | 0 | switch (nShapeType) |
56 | 0 | { |
57 | 0 | case PRESENTATION_TITLE: |
58 | 0 | sName = SdResId(SID_SD_A11Y_P_TITLE_N); |
59 | 0 | break; |
60 | 0 | case PRESENTATION_OUTLINER: |
61 | 0 | sName = SdResId(SID_SD_A11Y_P_OUTLINER_N); |
62 | 0 | break; |
63 | 0 | case PRESENTATION_SUBTITLE: |
64 | 0 | sName = SdResId(SID_SD_A11Y_P_SUBTITLE_N); |
65 | 0 | break; |
66 | 0 | case PRESENTATION_PAGE: |
67 | 0 | sName = SdResId(SID_SD_A11Y_P_PAGE_N); |
68 | 0 | break; |
69 | 0 | case PRESENTATION_NOTES: |
70 | 0 | sName = SdResId(SID_SD_A11Y_P_NOTES_N); |
71 | 0 | break; |
72 | 0 | case PRESENTATION_HANDOUT: |
73 | 0 | sName = SdResId(SID_SD_A11Y_P_HANDOUT_N); |
74 | 0 | break; |
75 | 0 | case PRESENTATION_HEADER: |
76 | 0 | sName = SdResId(SID_SD_A11Y_P_HEADER_N); |
77 | 0 | break; |
78 | 0 | case PRESENTATION_FOOTER: |
79 | 0 | sName = SdResId(SID_SD_A11Y_P_FOOTER_N); |
80 | 0 | break; |
81 | 0 | case PRESENTATION_DATETIME: |
82 | 0 | sName = SdResId(SID_SD_A11Y_P_DATE_N); |
83 | 0 | break; |
84 | 0 | case PRESENTATION_PAGENUMBER: |
85 | 0 | sName = SdResId(SID_SD_A11Y_P_NUMBER_N); |
86 | 0 | break; |
87 | 0 | default: |
88 | 0 | sName = SdResId(SID_SD_A11Y_P_UNKNOWN_N); |
89 | 0 | if (mxShape.is()) |
90 | 0 | sName += ": " + mxShape->getShapeType(); |
91 | 0 | } |
92 | | |
93 | 0 | return sName; |
94 | 0 | } |
95 | | |
96 | | OUString AccessiblePresentationShape::GetStyle() const |
97 | 0 | { |
98 | 0 | OUString sName; |
99 | |
|
100 | 0 | ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId(mxShape); |
101 | 0 | switch (nShapeType) |
102 | 0 | { |
103 | 0 | case PRESENTATION_TITLE: |
104 | 0 | sName = SdResId(SID_SD_A11Y_P_TITLE_N_STYLE); |
105 | 0 | break; |
106 | 0 | case PRESENTATION_OUTLINER: |
107 | 0 | sName = SdResId(SID_SD_A11Y_P_OUTLINER_N_STYLE); |
108 | 0 | break; |
109 | 0 | case PRESENTATION_SUBTITLE: |
110 | 0 | sName = SdResId(SID_SD_A11Y_P_SUBTITLE_N_STYLE); |
111 | 0 | break; |
112 | 0 | case PRESENTATION_PAGE: |
113 | 0 | sName = SdResId(SID_SD_A11Y_P_PAGE_N_STYLE); |
114 | 0 | break; |
115 | 0 | case PRESENTATION_NOTES: |
116 | 0 | sName = SdResId(SID_SD_A11Y_P_NOTES_N_STYLE); |
117 | 0 | break; |
118 | 0 | case PRESENTATION_HANDOUT: |
119 | 0 | sName = SdResId(SID_SD_A11Y_P_HANDOUT_N_STYLE); |
120 | 0 | break; |
121 | 0 | case PRESENTATION_FOOTER: |
122 | 0 | sName = SdResId(SID_SD_A11Y_P_FOOTER_N_STYLE); |
123 | 0 | break; |
124 | 0 | case PRESENTATION_HEADER: |
125 | 0 | sName = SdResId(SID_SD_A11Y_P_HEADER_N_STYLE); |
126 | 0 | break; |
127 | 0 | case PRESENTATION_DATETIME: |
128 | 0 | sName = SdResId(SID_SD_A11Y_P_DATE_N_STYLE); |
129 | 0 | break; |
130 | 0 | case PRESENTATION_PAGENUMBER: |
131 | 0 | sName = SdResId(SID_SD_A11Y_P_NUMBER_N_STYLE); |
132 | 0 | break; |
133 | 0 | default: |
134 | 0 | sName = SdResId(SID_SD_A11Y_P_UNKNOWN_N_STYLE); |
135 | 0 | if (mxShape.is()) |
136 | 0 | sName += ": " + mxShape->getShapeType(); |
137 | 0 | } |
138 | | |
139 | 0 | return sName; |
140 | 0 | } |
141 | | } // end of namespace accessibility |
142 | | |
143 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |