LibreOffice Module chart2 (master) 1
AccessibleChartShape.cxx
Go to the documentation of this file.
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
21
22#include <com/sun/star/awt/XWindow.hpp>
27
28using namespace ::com::sun::star;
29using namespace ::com::sun::star::accessibility;
30
31using ::com::sun::star::uno::Reference;
32
33namespace chart
34{
35
37 const AccessibleElementInfo& rAccInfo )
38 :impl::AccessibleChartShape_Base( rAccInfo, true/*bMayHaveChildren*/, false/*bAlwaysTransparent*/ )
39{
40 if ( !rAccInfo.m_aOID.isAdditionalShape() )
41 return;
42
45 if ( rAccInfo.m_pParent )
46 {
47 xParent.set( rAccInfo.m_pParent );
48 }
49 ::accessibility::AccessibleShapeInfo aShapeInfo( xShape, xParent );
50
55
57 m_pAccShape = rShapeHandler.CreateAccessibleObject( aShapeInfo, m_aShapeTreeInfo );
58 if ( m_pAccShape.is() )
59 {
60 m_pAccShape->Init();
61 }
62}
63
65{
66 OSL_ASSERT( CheckDisposeState( false /* don't throw exceptions */ ) );
67
68 if ( m_pAccShape.is() )
69 {
70 m_pAccShape->dispose();
71 }
72}
73
74// ________ XServiceInfo ________
76{
77 return "AccessibleChartShape";
78}
79
80// ________ XAccessibleContext ________
82{
83 sal_Int64 nCount(0);
84 if ( m_pAccShape.is() )
85 {
86 nCount = m_pAccShape->getAccessibleChildCount();
87 }
88 return nCount;
89}
90
92{
94 if ( m_pAccShape.is() )
95 {
96 xChild = m_pAccShape->getAccessibleChild( i );
97 }
98 return xChild;
99}
100
102{
103 sal_Int16 nRole(0);
104 if ( m_pAccShape.is() )
105 {
106 nRole = m_pAccShape->getAccessibleRole();
107 }
108 return nRole;
109}
110
112{
113 OUString aDescription;
114 if ( m_pAccShape.is() )
115 {
116 aDescription = m_pAccShape->getAccessibleDescription();
117 }
118 return aDescription;
119}
120
122{
123 OUString aName;
124 if ( m_pAccShape.is() )
125 {
126 aName = m_pAccShape->getAccessibleName();
127 }
128 return aName;
129}
130
131// ________ XAccessibleComponent ________
133{
134 bool bReturn = false;
135 if ( m_pAccShape.is() )
136 {
137 bReturn = m_pAccShape->containsPoint( aPoint );
138 }
139 return bReturn;
140}
141
143{
145 if ( m_pAccShape.is() )
146 {
147 xResult.set( m_pAccShape->getAccessibleAtPoint( aPoint ) );
148 }
149 return xResult;
150}
151
153{
154 awt::Rectangle aBounds;
155 if ( m_pAccShape.is() )
156 {
157 aBounds = m_pAccShape->getBounds();
158 }
159 return aBounds;
160}
161
163{
164 awt::Point aLocation;
165 if ( m_pAccShape.is() )
166 {
167 aLocation = m_pAccShape->getLocation();
168 }
169 return aLocation;
170}
171
173{
174 awt::Point aLocation;
175 if ( m_pAccShape.is() )
176 {
177 aLocation = m_pAccShape->getLocationOnScreen();
178 }
179 return aLocation;
180}
181
183{
184 awt::Size aSize;
185 if ( m_pAccShape.is() )
186 {
187 aSize = m_pAccShape->getSize();
188 }
189 return aSize;
190}
191
193{
195}
196
198{
199 sal_Int32 nColor(0);
200 if ( m_pAccShape.is() )
201 {
202 nColor = m_pAccShape->getForeground();
203 }
204 return nColor;
205}
206
208{
209 sal_Int32 nColor(0);
210 if ( m_pAccShape.is() )
211 {
212 nColor = m_pAccShape->getBackground();
213 }
214 return nColor;
215}
216
217// ________ XAccessibleExtendedComponent ________
219{
221 if ( m_pAccShape.is() )
222 {
223 xFont.set( m_pAccShape->getFont() );
224 }
225 return xFont;
226}
227
229{
230 OUString aText;
231 if ( m_pAccShape.is() )
232 {
233 aText = m_pAccShape->getTitledBorderText();
234 }
235 return aText;
236}
237
239{
240 OUString aText;
241 if ( m_pAccShape.is() )
242 {
243 aText = m_pAccShape->getToolTipText();
244 }
245 return aText;
246}
247
248} // namespace chart
249
250/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
void SetViewForwarder(const IAccessibleViewForwarder *pViewForwarder)
void SetWindow(vcl::Window *pWindow)
void SetController(const css::uno::Reference< css::frame::XController > &rxController)
rtl::Reference< AccessibleShape > CreateAccessibleObject(const AccessibleShapeInfo &rShapeInfo, const AccessibleShapeTreeInfo &rShapeTreeInfo) const
static ShapeTypeHandler & Instance()
virtual void SAL_CALL grabFocus() override
virtual OUString SAL_CALL getTitledBorderText() override
virtual OUString SAL_CALL getImplementationName() override
virtual OUString SAL_CALL getToolTipText() override
virtual OUString SAL_CALL getAccessibleName() override
virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override
AccessibleChartShape(const AccessibleElementInfo &rAccInfo)
rtl::Reference< accessibility::AccessibleShape > m_pAccShape
virtual sal_Int16 SAL_CALL getAccessibleRole() override
::accessibility::AccessibleShapeTreeInfo m_aShapeTreeInfo
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual ~AccessibleChartShape() override
virtual void SAL_CALL grabFocus() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual OUString SAL_CALL getAccessibleDescription() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::awt::Size SAL_CALL getSize() override
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::awt::Point SAL_CALL getLocation() override
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual sal_Int32 SAL_CALL getForeground() override
const css::uno::Reference< css::drawing::XShape > & getAdditionalShape() const
int nCount
OUString aName
::cppu::ImplInheritanceHelper< AccessibleBase, css::accessibility::XAccessibleExtendedComponent > AccessibleChartShape_Base
int i
css::uno::WeakReference< css::awt::XWindow > m_xWindow
::accessibility::IAccessibleViewForwarder * m_pViewForwarder
unsigned char sal_Bool