Line data Source code
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 "AccessiblePresentationOLEShape.hxx"
21 :
22 : #include "SdShapeTypes.hxx"
23 :
24 : #include <svx/DescriptionGenerator.hxx>
25 : #include <rtl/ustring.h>
26 :
27 : using namespace ::com::sun::star;
28 : using namespace ::com::sun::star::accessibility;
29 :
30 : namespace accessibility {
31 :
32 : //===== internal ============================================================
33 :
34 0 : AccessiblePresentationOLEShape::AccessiblePresentationOLEShape (
35 : const AccessibleShapeInfo& rShapeInfo,
36 : const AccessibleShapeTreeInfo& rShapeTreeInfo)
37 0 : : AccessibleOLEShape (rShapeInfo, rShapeTreeInfo)
38 : {
39 0 : }
40 :
41 0 : AccessiblePresentationOLEShape::~AccessiblePresentationOLEShape (void)
42 : {
43 0 : }
44 :
45 : //===== XServiceInfo ========================================================
46 :
47 : OUString SAL_CALL
48 0 : AccessiblePresentationOLEShape::getImplementationName (void)
49 : throw (::com::sun::star::uno::RuntimeException, std::exception)
50 : {
51 0 : return OUString("AccessiblePresentationOLEShape");
52 : }
53 :
54 : /// Set this object's name if it is different to the current name.
55 : OUString
56 0 : AccessiblePresentationOLEShape::CreateAccessibleBaseName (void)
57 : throw (::com::sun::star::uno::RuntimeException)
58 : {
59 0 : OUString sName;
60 :
61 0 : ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
62 0 : switch (nShapeType)
63 : {
64 : case PRESENTATION_OLE:
65 0 : sName = "ImpressOLE";
66 0 : break;
67 : case PRESENTATION_CHART:
68 0 : sName = "ImpressChart";
69 0 : break;
70 : case PRESENTATION_TABLE:
71 0 : sName = "ImpressTable";
72 0 : break;
73 : default:
74 0 : sName = "UnknownAccessibleImpressOLEShape";
75 0 : uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
76 0 : if (xDescriptor.is())
77 0 : sName += ": " + xDescriptor->getShapeType();
78 : }
79 :
80 0 : return sName;
81 : }
82 :
83 : OUString
84 0 : AccessiblePresentationOLEShape::CreateAccessibleDescription (void)
85 : throw (::com::sun::star::uno::RuntimeException)
86 : {
87 : // return createAccessibleName();
88 0 : DescriptionGenerator aDG (mxShape);
89 0 : ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
90 0 : switch (nShapeType)
91 : {
92 : case PRESENTATION_OLE:
93 0 : aDG.Initialize ("PresentationOLEShape");
94 : //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
95 0 : aDG.AddProperty ("CLSID" ,DescriptionGenerator::STRING);
96 0 : break;
97 : case PRESENTATION_CHART:
98 0 : aDG.Initialize ("PresentationChartShape");
99 : //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
100 0 : aDG.AddProperty ( "CLSID" , DescriptionGenerator::STRING);
101 0 : break;
102 : case PRESENTATION_TABLE:
103 0 : aDG.Initialize ("PresentationTableShape");
104 : //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
105 0 : aDG.AddProperty ("CLSID" , DescriptionGenerator::STRING);
106 0 : break;
107 : default:
108 0 : aDG.Initialize ("Unknown accessible presentation OLE shape");
109 0 : uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
110 0 : if (xDescriptor.is())
111 : {
112 0 : aDG.AppendString ("service name=");
113 0 : aDG.AppendString (xDescriptor->getShapeType());
114 0 : }
115 : }
116 :
117 0 : return aDG();
118 : }
119 :
120 : // Return this object's role.
121 0 : sal_Int16 SAL_CALL AccessiblePresentationOLEShape::getAccessibleRole ()
122 : throw (::com::sun::star::uno::RuntimeException, std::exception)
123 : {
124 0 : return AccessibleRole::EMBEDDED_OBJECT ;
125 : }
126 :
127 : } // end of namespace accessibility
128 :
129 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|