fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sd / source / ui / accessibility / AccessiblePresentationShape.cxx
blob2b48c2b436cff3116f9c3f5962e70cce04a1f939
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 <svx/DescriptionGenerator.hxx>
25 #include <rtl/ustring.h>
27 using namespace ::rtl;
28 using namespace ::com::sun::star;
29 using namespace ::com::sun::star::accessibility;
31 namespace accessibility {
33 //===== internal ============================================================
35 AccessiblePresentationShape::AccessiblePresentationShape (
36 const AccessibleShapeInfo& rShapeInfo,
37 const AccessibleShapeTreeInfo& rShapeTreeInfo)
38 : AccessibleShape (rShapeInfo, rShapeTreeInfo)
45 AccessiblePresentationShape::~AccessiblePresentationShape (void)
52 //===== XServiceInfo ========================================================
54 OUString SAL_CALL
55 AccessiblePresentationShape::getImplementationName (void)
56 throw (::com::sun::star::uno::RuntimeException)
58 return OUString("AccessiblePresentationShape");
64 /// Set this object's name if is different to the current name.
65 OUString
66 AccessiblePresentationShape::CreateAccessibleBaseName (void)
67 throw (::com::sun::star::uno::RuntimeException)
69 OUString sName;
71 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
72 switch (nShapeType)
74 case PRESENTATION_TITLE:
75 sName = "ImpressTitle";
76 break;
77 case PRESENTATION_OUTLINER:
78 sName = "ImpressOutliner";
79 break;
80 case PRESENTATION_SUBTITLE:
81 sName = "ImpressSubtitle";
82 break;
83 case PRESENTATION_PAGE:
84 sName = "ImpressPage";
85 break;
86 case PRESENTATION_NOTES:
87 sName = "ImpressNotes";
88 break;
89 case PRESENTATION_HANDOUT:
90 sName = "ImpressHandout";
91 break;
92 case PRESENTATION_HEADER:
93 sName = "ImpressHeader";
94 break;
95 case PRESENTATION_FOOTER:
96 sName = "ImpressFooter";
97 break;
98 case PRESENTATION_DATETIME:
99 sName = "ImpressDateAndTime";
100 break;
101 case PRESENTATION_PAGENUMBER:
102 sName = "ImpressPageNumber";
103 break;
104 default:
105 sName = "UnknownAccessibleImpressShape";
106 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
107 if (xDescriptor.is())
108 sName += ": " + xDescriptor->getShapeType();
111 return sName;
117 OUString
118 AccessiblePresentationShape::CreateAccessibleDescription (void)
119 throw (::com::sun::star::uno::RuntimeException)
121 // return createAccessibleName ();
122 DescriptionGenerator aDG (mxShape);
123 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
124 switch (nShapeType)
126 case PRESENTATION_TITLE:
127 aDG.Initialize ("PresentationTitleShape");
128 break;
129 case PRESENTATION_OUTLINER:
130 aDG.Initialize ("PresentationOutlinerShape");
131 break;
132 case PRESENTATION_SUBTITLE:
133 aDG.Initialize ("PresentationSubtitleShape");
134 break;
135 case PRESENTATION_PAGE:
136 aDG.Initialize ("PresentationPageShape");
137 break;
138 case PRESENTATION_NOTES:
139 aDG.Initialize ("PresentationNotesShape");
140 break;
141 case PRESENTATION_HANDOUT:
142 aDG.Initialize ("PresentationHandoutShape");
143 break;
144 case PRESENTATION_HEADER:
145 aDG.Initialize ("PresentationHeaderShape");
146 break;
147 case PRESENTATION_FOOTER:
148 aDG.Initialize ("PresentationFooterShape");
149 break;
150 case PRESENTATION_DATETIME:
151 aDG.Initialize ("PresentationDateAndTimeShape");
152 break;
153 case PRESENTATION_PAGENUMBER:
154 aDG.Initialize ("PresentationPageNumberShape");
155 break;
156 default:
157 aDG.Initialize ("Unknown accessible presentation shape");
158 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
159 if (xDescriptor.is())
161 aDG.AppendString ("service name=");
162 aDG.AppendString (xDescriptor->getShapeType());
166 return aDG();
169 } // end of namespace accessibility
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */