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 "AccessiblePresentationGraphicShape.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 : AccessiblePresentationGraphicShape::AccessiblePresentationGraphicShape (
45 : : const AccessibleShapeInfo& rShapeInfo,
46 : : const AccessibleShapeTreeInfo& rShapeTreeInfo)
47 : 0 : : AccessibleGraphicShape (rShapeInfo, rShapeTreeInfo)
48 : : {
49 : 0 : }
50 : :
51 : :
52 : :
53 : :
54 : 0 : AccessiblePresentationGraphicShape::~AccessiblePresentationGraphicShape (void)
55 : : {
56 [ # # ]: 0 : }
57 : :
58 : :
59 : :
60 : :
61 : : //===== XServiceInfo ========================================================
62 : :
63 : : ::rtl::OUString SAL_CALL
64 : 0 : AccessiblePresentationGraphicShape::getImplementationName (void)
65 : : throw (::com::sun::star::uno::RuntimeException)
66 : : {
67 : 0 : return ::rtl::OUString("AccessiblePresentationGraphicShape");
68 : : }
69 : :
70 : :
71 : :
72 : :
73 : : /// Set this object's name if is different to the current name.
74 : : ::rtl::OUString
75 : 0 : AccessiblePresentationGraphicShape::CreateAccessibleBaseName (void)
76 : : throw (::com::sun::star::uno::RuntimeException)
77 : : {
78 : 0 : ::rtl::OUString sName;
79 : :
80 [ # # ][ # # ]: 0 : ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
81 [ # # ]: 0 : switch (nShapeType)
82 : : {
83 : : case PRESENTATION_GRAPHIC_OBJECT:
84 : 0 : sName = "ImpressGraphicObject";
85 : : break;
86 : : default:
87 : 0 : sName = "UnknownAccessibleImpressShape";
88 [ # # ]: 0 : uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
89 [ # # ]: 0 : if (xDescriptor.is())
90 [ # # ][ # # ]: 0 : sName += ": " + xDescriptor->getShapeType();
91 : : }
92 : :
93 : 0 : return sName;
94 : : }
95 : :
96 : :
97 : :
98 : :
99 : : ::rtl::OUString
100 : 0 : AccessiblePresentationGraphicShape::CreateAccessibleDescription (void)
101 : : throw (::com::sun::star::uno::RuntimeException)
102 : : {
103 : : // return createAccessibleName ();
104 [ # # ]: 0 : DescriptionGenerator aDG (mxShape);
105 [ # # ][ # # ]: 0 : ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
106 [ # # ]: 0 : switch (nShapeType)
107 : : {
108 : : case PRESENTATION_GRAPHIC_OBJECT:
109 [ # # ]: 0 : aDG.Initialize ("PresentationGraphicShape");
110 : : break;
111 : : default:
112 [ # # ]: 0 : aDG.Initialize ("Unknown accessible presentation graphic shape");
113 [ # # ]: 0 : uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape, uno::UNO_QUERY);
114 [ # # ]: 0 : if (xDescriptor.is())
115 : : {
116 [ # # ]: 0 : aDG.AppendString ("service name=");
117 [ # # ][ # # ]: 0 : aDG.AppendString (xDescriptor->getShapeType());
[ # # ]
118 : 0 : }
119 : : }
120 : :
121 [ # # ][ # # ]: 0 : return aDG();
122 : : }
123 : :
124 : : } // end of namespace accessibility
125 : :
126 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|