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