Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "AccessiblePresentationOLEShape.hxx"
30 : :
31 : : #include "SdShapeTypes.hxx"
32 : :
33 : : #include <svx/DescriptionGenerator.hxx>
34 : : #include <rtl/ustring.h>
35 : :
36 : : using namespace ::rtl;
37 : : using namespace ::com::sun::star;
38 : : using namespace ::com::sun::star::accessibility;
39 : :
40 : : namespace accessibility {
41 : :
42 : : //===== internal ============================================================
43 : :
44 : 0 : AccessiblePresentationOLEShape::AccessiblePresentationOLEShape (
45 : : const AccessibleShapeInfo& rShapeInfo,
46 : : const AccessibleShapeTreeInfo& rShapeTreeInfo)
47 : 0 : : AccessibleOLEShape (rShapeInfo, rShapeTreeInfo)
48 : : {
49 : 0 : }
50 : :
51 : 0 : AccessiblePresentationOLEShape::~AccessiblePresentationOLEShape (void)
52 : : {
53 [ # # ]: 0 : }
54 : :
55 : : //===== XServiceInfo ========================================================
56 : :
57 : : ::rtl::OUString SAL_CALL
58 : 0 : AccessiblePresentationOLEShape::getImplementationName (void)
59 : : throw (::com::sun::star::uno::RuntimeException)
60 : : {
61 : 0 : return ::rtl::OUString("AccessiblePresentationOLEShape");
62 : : }
63 : :
64 : : /// Set this object's name if it is different to the current name.
65 : : ::rtl::OUString
66 : 0 : AccessiblePresentationOLEShape::CreateAccessibleBaseName (void)
67 : : throw (::com::sun::star::uno::RuntimeException)
68 : : {
69 : 0 : ::rtl::OUString sName;
70 : :
71 [ # # ][ # # ]: 0 : ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
72 [ # # # # ]: 0 : switch (nShapeType)
73 : : {
74 : : case PRESENTATION_OLE:
75 : 0 : sName = "ImpressOLE";
76 : : break;
77 : : case PRESENTATION_CHART:
78 : 0 : sName = "ImpressChart";
79 : : break;
80 : : case PRESENTATION_TABLE:
81 : 0 : sName = "ImpressTable";
82 : : break;
83 : : default:
84 : 0 : sName = "UnknownAccessibleImpressOLEShape";
85 [ # # ]: 0 : uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
86 [ # # ]: 0 : if (xDescriptor.is())
87 [ # # ][ # # ]: 0 : sName += ": " + xDescriptor->getShapeType();
88 : : }
89 : :
90 : 0 : return sName;
91 : : }
92 : :
93 : : ::rtl::OUString
94 : 0 : AccessiblePresentationOLEShape::CreateAccessibleDescription (void)
95 : : throw (::com::sun::star::uno::RuntimeException)
96 : : {
97 : : // return createAccessibleName();
98 [ # # ]: 0 : DescriptionGenerator aDG (mxShape);
99 [ # # ][ # # ]: 0 : ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
100 [ # # # # ]: 0 : switch (nShapeType)
101 : : {
102 : : case PRESENTATION_OLE:
103 [ # # ]: 0 : aDG.Initialize ("PresentationOLEShape");
104 : : //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
105 [ # # ]: 0 : aDG.AddProperty ("CLSID" ,DescriptionGenerator::STRING);
106 : : break;
107 : : case PRESENTATION_CHART:
108 [ # # ]: 0 : aDG.Initialize ("PresentationChartShape");
109 : : //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
110 [ # # ]: 0 : aDG.AddProperty ( "CLSID" , DescriptionGenerator::STRING);
111 : : break;
112 : : case PRESENTATION_TABLE:
113 [ # # ]: 0 : aDG.Initialize ("PresentationTableShape");
114 : : //SVX_RESSTR(RID_SVXSTR_A11Y_ST_RECTANGLE));
115 [ # # ]: 0 : aDG.AddProperty ("CLSID" , DescriptionGenerator::STRING);
116 : : break;
117 : : default:
118 [ # # ]: 0 : aDG.Initialize ("Unknown accessible presentation OLE shape");
119 [ # # ]: 0 : uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
120 [ # # ]: 0 : if (xDescriptor.is())
121 : : {
122 [ # # ]: 0 : aDG.AppendString ("service name=");
123 [ # # ][ # # ]: 0 : aDG.AppendString (xDescriptor->getShapeType());
[ # # ]
124 : 0 : }
125 : : }
126 : :
127 [ # # ][ # # ]: 0 : return aDG();
128 : : }
129 : :
130 : : } // end of namespace accessibility
131 : :
132 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|