bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / accessibility / AccessiblePresentationOLEShape.cxx
blobf6307e68c28a61b961fb2dbbf1f1ce186c000aa5
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 "AccessiblePresentationOLEShape.hxx"
22 #include "SdShapeTypes.hxx"
24 #include <svx/DescriptionGenerator.hxx>
25 #include <rtl/ustring.h>
27 using namespace ::com::sun::star;
28 using namespace ::com::sun::star::accessibility;
30 namespace accessibility {
32 //===== internal ============================================================
34 AccessiblePresentationOLEShape::AccessiblePresentationOLEShape (
35 const AccessibleShapeInfo& rShapeInfo,
36 const AccessibleShapeTreeInfo& rShapeTreeInfo)
37 : AccessibleOLEShape (rShapeInfo, rShapeTreeInfo)
41 AccessiblePresentationOLEShape::~AccessiblePresentationOLEShape()
45 // XServiceInfo
47 OUString SAL_CALL
48 AccessiblePresentationOLEShape::getImplementationName()
49 throw (::com::sun::star::uno::RuntimeException, std::exception)
51 return OUString("AccessiblePresentationOLEShape");
54 /// Set this object's name if it is different to the current name.
55 OUString
56 AccessiblePresentationOLEShape::CreateAccessibleBaseName()
57 throw (::com::sun::star::uno::RuntimeException)
59 OUString sName;
61 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
62 switch (nShapeType)
64 case PRESENTATION_OLE:
65 sName = "ImpressOLE";
66 break;
67 case PRESENTATION_CHART:
68 sName = "ImpressChart";
69 break;
70 case PRESENTATION_TABLE:
71 sName = "ImpressTable";
72 break;
73 default:
74 sName = "UnknownAccessibleImpressOLEShape";
75 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
76 if (xDescriptor.is())
77 sName += ": " + xDescriptor->getShapeType();
80 return sName;
83 OUString
84 AccessiblePresentationOLEShape::CreateAccessibleDescription()
85 throw (::com::sun::star::uno::RuntimeException)
87 // return createAccessibleName();
88 DescriptionGenerator aDG (mxShape);
89 ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
90 switch (nShapeType)
92 case PRESENTATION_OLE:
93 aDG.Initialize ("PresentationOLEShape");
94 //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
95 aDG.AddProperty ("CLSID" ,DescriptionGenerator::STRING);
96 break;
97 case PRESENTATION_CHART:
98 aDG.Initialize ("PresentationChartShape");
99 //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
100 aDG.AddProperty ( "CLSID" , DescriptionGenerator::STRING);
101 break;
102 case PRESENTATION_TABLE:
103 aDG.Initialize ("PresentationTableShape");
104 //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
105 aDG.AddProperty ("CLSID" , DescriptionGenerator::STRING);
106 break;
107 default:
108 aDG.Initialize ("Unknown accessible presentation OLE shape");
109 uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
110 if (xDescriptor.is())
112 aDG.AppendString ("service name=");
113 aDG.AppendString (xDescriptor->getShapeType());
117 return aDG();
120 // Return this object's role.
121 sal_Int16 SAL_CALL AccessiblePresentationOLEShape::getAccessibleRole ()
122 throw (::com::sun::star::uno::RuntimeException, std::exception)
124 return AccessibleRole::EMBEDDED_OBJECT ;
127 } // end of namespace accessibility
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */