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 :
21 : #ifndef INCLUDED_SVX_SOURCE_INC_SVXRECTCTACCESSIBLECONTEXT_HXX
22 : #define INCLUDED_SVX_SOURCE_INC_SVXRECTCTACCESSIBLECONTEXT_HXX
23 :
24 : #include <com/sun/star/accessibility/XAccessible.hpp>
25 : #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
26 : #include <com/sun/star/accessibility/XAccessibleContext.hpp>
27 : #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
28 : #include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
29 : #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
30 : #include <com/sun/star/accessibility/XAccessibleAction.hpp>
31 : #include <com/sun/star/accessibility/XAccessibleValue.hpp>
32 : #include <com/sun/star/beans/XPropertyChangeListener.hpp>
33 : #include <com/sun/star/uno/Reference.hxx>
34 : #include <cppuhelper/weak.hxx>
35 : #include <com/sun/star/lang/XServiceInfo.hpp>
36 : #include <com/sun/star/lang/XTypeProvider.hpp>
37 : #include <com/sun/star/lang/XServiceName.hpp>
38 : #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
39 : #include <com/sun/star/lang/DisposedException.hpp>
40 : #include <osl/mutex.hxx>
41 : #include <cppuhelper/interfacecontainer.h>
42 : #include <cppuhelper/compbase6.hxx>
43 : #include <cppuhelper/compbase7.hxx>
44 : #include <comphelper/broadcasthelper.hxx>
45 : #include <cppuhelper/implbase6.hxx>
46 : #include <cppuhelper/implbase7.hxx>
47 : #include <comphelper/servicehelper.hxx>
48 : #include <svx/rectenum.hxx>
49 : #include <vcl/vclptr.hxx>
50 :
51 : namespace com { namespace sun { namespace star { namespace awt {
52 : struct Point;
53 : struct Rectangle;
54 : struct Size;
55 : class XFocusListener;
56 : } } } }
57 :
58 : class Rectangle;
59 : class SvxRectCtl;
60 : class SvxRectCtlChildAccessibleContext;
61 : namespace vcl { class Window; }
62 :
63 :
64 : typedef ::cppu::WeakAggComponentImplHelper6<
65 : ::com::sun::star::accessibility::XAccessible,
66 : ::com::sun::star::accessibility::XAccessibleComponent,
67 : ::com::sun::star::accessibility::XAccessibleContext,
68 : ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
69 : ::com::sun::star::accessibility::XAccessibleSelection,
70 : ::com::sun::star::lang::XServiceInfo >
71 : SvxRectCtlAccessibleContext_Base;
72 :
73 : class SvxRectCtlAccessibleContext : public ::comphelper::OBaseMutex, public SvxRectCtlAccessibleContext_Base
74 : {
75 : public:
76 : // internal
77 : SvxRectCtlAccessibleContext(
78 : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent,
79 : SvxRectCtl& rRepresentation,
80 : const OUString* pName = NULL,
81 : const OUString* pDescription = NULL );
82 : protected:
83 : virtual ~SvxRectCtlAccessibleContext();
84 : public:
85 : // XAccessible
86 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
87 : getAccessibleContext() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
88 :
89 : // XAccessibleComponent
90 : virtual sal_Bool SAL_CALL
91 : containsPoint( const ::com::sun::star::awt::Point& rPoint ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
92 :
93 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
94 : getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
95 :
96 : virtual ::com::sun::star::awt::Rectangle SAL_CALL
97 : getBounds() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
98 :
99 : virtual ::com::sun::star::awt::Point SAL_CALL
100 : getLocation() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
101 :
102 : virtual ::com::sun::star::awt::Point SAL_CALL
103 : getLocationOnScreen() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
104 :
105 : virtual ::com::sun::star::awt::Size SAL_CALL
106 : getSize() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
107 :
108 : bool SAL_CALL
109 : isVisible() throw( ::com::sun::star::uno::RuntimeException );
110 :
111 : virtual void SAL_CALL
112 : grabFocus() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
113 :
114 : virtual sal_Int32 SAL_CALL
115 : getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 : virtual sal_Int32 SAL_CALL
117 : getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 :
119 : // XAccessibleContext
120 : virtual sal_Int32 SAL_CALL
121 : getAccessibleChildCount() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
122 :
123 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
124 : getAccessibleChild( sal_Int32 nIndex )
125 : throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException, std::exception ) SAL_OVERRIDE;
126 :
127 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
128 : getAccessibleParent() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
129 :
130 : virtual sal_Int32 SAL_CALL
131 : getAccessibleIndexInParent() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
132 :
133 : virtual sal_Int16 SAL_CALL
134 : getAccessibleRole() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
135 :
136 : virtual OUString SAL_CALL
137 : getAccessibleDescription() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
138 :
139 : virtual OUString SAL_CALL
140 : getAccessibleName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
141 :
142 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL
143 : getAccessibleRelationSet() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
144 :
145 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL
146 : getAccessibleStateSet() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
147 :
148 : virtual ::com::sun::star::lang::Locale SAL_CALL
149 : getLocale()
150 : throw( ::com::sun::star::uno::RuntimeException,
151 : ::com::sun::star::accessibility::IllegalAccessibleComponentStateException, std::exception ) SAL_OVERRIDE;
152 :
153 : // XAccessibleEventBroadcaster
154 : virtual void SAL_CALL
155 : addAccessibleEventListener(
156 : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
157 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
158 :
159 : virtual void SAL_CALL
160 : removeAccessibleEventListener(
161 : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
162 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
163 :
164 : // XServiceInfo
165 : virtual OUString SAL_CALL
166 : getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
167 :
168 : virtual sal_Bool SAL_CALL
169 : supportsService( const OUString& sServiceName ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
170 :
171 : virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
172 : getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
173 :
174 : // XTypeProvider
175 : virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
176 : getImplementationId() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
177 :
178 : // XAccessibleSelection
179 : virtual void SAL_CALL
180 : selectAccessibleChild( sal_Int32 nChildIndex )
181 : throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
182 :
183 : virtual sal_Bool SAL_CALL
184 : isAccessibleChildSelected( sal_Int32 nChildIndex )
185 : throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
186 :
187 : virtual void SAL_CALL
188 : clearAccessibleSelection() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
189 :
190 : virtual void SAL_CALL
191 : selectAllAccessibleChildren() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
192 :
193 : virtual sal_Int32 SAL_CALL
194 : getSelectedAccessibleChildCount() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
195 :
196 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
197 : getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
198 : throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
199 :
200 : virtual void SAL_CALL
201 : deselectAccessibleChild( sal_Int32 nSelectedChildIndex )
202 : throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
203 :
204 :
205 : protected:
206 : // internals
207 : void checkChildIndex( long nIndexOfChild ) throw( ::com::sun::star::lang::IndexOutOfBoundsException );
208 :
209 : void checkChildIndexOnSelection( long nIndexOfChild ) throw( ::com::sun::star::lang::IndexOutOfBoundsException );
210 :
211 : /** Selects a new child by index.
212 :
213 : <p>If the child was not selected before, the state of the child will
214 : be updated. If the index is invalid, the index will internally set to NOCHILDSELECTED</p>
215 :
216 : @param nIndexOfChild
217 : Index of the new child which should be selected.
218 : */
219 : void selectChild( long nIndexOfChild, bool bFireFocus = true);
220 :
221 : public:
222 : /** Selects a new child by point.
223 :
224 : <p>If the child was not selected before, the state of the child will
225 : be updated. If the point is not invalid, the index will internally set to NOCHILDSELECTED</p>
226 :
227 : @param eButton
228 : Button which belongs to the child which should be selected.
229 : */
230 : void selectChild( RECT_POINT ePoint, bool bFireFocus = true );
231 : void FireChildFocus( RECT_POINT eButton );
232 :
233 : protected:
234 :
235 : /// @Return the object's current bounding box relative to the desktop.
236 : Rectangle GetBoundingBoxOnScreen() throw( ::com::sun::star::uno::RuntimeException );
237 :
238 : /// @Return the object's current bounding box relative to the parent object.
239 : Rectangle GetBoundingBox() throw( ::com::sun::star::uno::RuntimeException );
240 :
241 : /// Calls all Listener to tell they the change.
242 : void CommitChange( const com::sun::star::accessibility::AccessibleEventObject& rEvent );
243 :
244 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
245 :
246 : /// @returns true if it's disposed or in disposing
247 : inline bool IsAlive() const;
248 :
249 : /// @returns true if it's not disposed and no in disposing
250 : inline bool IsNotAlive() const;
251 :
252 : /// throws the exception DisposedException if it's not alive
253 : void ThrowExceptionIfNotAlive() throw( ::com::sun::star::lang::DisposedException );
254 :
255 : private:
256 : /** Description of this object. This is not a constant because it can
257 : be set from the outside.
258 : */
259 : OUString msDescription;
260 :
261 : /** Name of this object.
262 : */
263 : OUString msName;
264 :
265 : /// Reference to the parent object.
266 : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
267 : mxParent;
268 :
269 : /// pointer to internal representation
270 : VclPtr<SvxRectCtl> mpRepr;
271 :
272 : /// array for all possible children
273 : SvxRectCtlChildAccessibleContext** mpChildren;
274 :
275 : /// client id in the AccessibleEventNotifier queue
276 : sal_uInt32 mnClientId;
277 :
278 : /// actual selected child
279 : long mnSelectedChild;
280 :
281 : /// mode of control (true -> 8 points, false -> 9 points)
282 : bool mbAngleMode;
283 : };
284 :
285 0 : inline bool SvxRectCtlAccessibleContext::IsAlive() const
286 : {
287 0 : return !rBHelper.bDisposed && !rBHelper.bInDispose;
288 : }
289 :
290 0 : inline bool SvxRectCtlAccessibleContext::IsNotAlive() const
291 : {
292 0 : return rBHelper.bDisposed || rBHelper.bInDispose;
293 : }
294 :
295 : typedef ::cppu::WeakAggComponentImplHelper7<
296 : ::com::sun::star::accessibility::XAccessible,
297 : ::com::sun::star::accessibility::XAccessibleComponent,
298 : ::com::sun::star::accessibility::XAccessibleContext,
299 : ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
300 : ::com::sun::star::accessibility::XAccessibleValue,
301 : ::com::sun::star::accessibility::XAccessibleAction,
302 : ::com::sun::star::lang::XServiceInfo >
303 : SvxRectCtlChildAccessibleContext_Base;
304 :
305 : class SvxRectCtlChildAccessibleContext : public SvxRectCtlChildAccessibleContext_Base
306 : {
307 : public:
308 : SvxRectCtlChildAccessibleContext(
309 : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent,
310 : const vcl::Window& rParentWindow,
311 : const OUString& rName, const OUString& rDescription,
312 : const Rectangle& rBoundingBox,
313 : long nIndexInParent );
314 : protected:
315 : virtual ~SvxRectCtlChildAccessibleContext();
316 : public:
317 : // XAccessible
318 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
319 : getAccessibleContext() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
320 :
321 : // XAccessibleComponent
322 : virtual sal_Bool SAL_CALL
323 : containsPoint( const ::com::sun::star::awt::Point& rPoint ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
324 :
325 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
326 : getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
327 :
328 : virtual ::com::sun::star::awt::Rectangle SAL_CALL
329 : getBounds() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
330 :
331 : virtual ::com::sun::star::awt::Point SAL_CALL
332 : getLocation() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
333 :
334 : virtual ::com::sun::star::awt::Point SAL_CALL
335 : getLocationOnScreen() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
336 :
337 : virtual ::com::sun::star::awt::Size SAL_CALL
338 : getSize() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
339 :
340 : virtual void SAL_CALL
341 : grabFocus() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
342 :
343 : virtual sal_Int32 SAL_CALL
344 : getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
345 : virtual sal_Int32 SAL_CALL
346 : getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
347 :
348 : // XAccessibleContext
349 : virtual sal_Int32 SAL_CALL
350 : getAccessibleChildCount() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
351 :
352 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
353 : getAccessibleChild( sal_Int32 nIndex )
354 : throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException, std::exception ) SAL_OVERRIDE;
355 :
356 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
357 : getAccessibleParent() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
358 :
359 : virtual sal_Int32 SAL_CALL
360 : getAccessibleIndexInParent() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
361 :
362 : virtual sal_Int16 SAL_CALL
363 : getAccessibleRole() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
364 :
365 : virtual OUString SAL_CALL
366 : getAccessibleDescription() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
367 :
368 : virtual OUString SAL_CALL
369 : getAccessibleName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
370 :
371 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL
372 : getAccessibleRelationSet() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
373 :
374 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL
375 : getAccessibleStateSet() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
376 :
377 : virtual ::com::sun::star::lang::Locale SAL_CALL
378 : getLocale()
379 : throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::accessibility::IllegalAccessibleComponentStateException, std::exception ) SAL_OVERRIDE;
380 :
381 : // XAccessibleEventBroadcaster
382 : virtual void SAL_CALL
383 : addAccessibleEventListener(
384 : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
385 : throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
386 :
387 : virtual void SAL_CALL
388 : removeAccessibleEventListener(
389 : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
390 : throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
391 :
392 : // XAccessibleValue
393 : virtual ::com::sun::star::uno::Any SAL_CALL
394 : getCurrentValue() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
395 :
396 : virtual sal_Bool SAL_CALL
397 : setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
398 :
399 : virtual ::com::sun::star::uno::Any SAL_CALL
400 : getMaximumValue() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
401 :
402 : virtual ::com::sun::star::uno::Any SAL_CALL
403 : getMinimumValue() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
404 :
405 : // XAccessibleAction
406 : virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
407 : virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
408 : virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
409 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
410 : // XServiceInfo
411 : virtual OUString SAL_CALL
412 : getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
413 :
414 : virtual sal_Bool SAL_CALL
415 : supportsService( const OUString& sServiceName ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
416 :
417 : virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
418 : getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
419 :
420 : // XTypeProvider
421 : virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
422 : getImplementationId() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
423 :
424 : // internal
425 : /// Sets the checked status
426 : void setStateChecked(bool bChecked, bool bFireFocus = true);
427 : void FireFocusEvent();
428 :
429 : protected:
430 : Rectangle GetBoundingBoxOnScreen() throw( ::com::sun::star::uno::RuntimeException );
431 :
432 : Rectangle GetBoundingBox() throw( ::com::sun::star::uno::RuntimeException );
433 :
434 : void CommitChange( const com::sun::star::accessibility::AccessibleEventObject& rEvent );
435 :
436 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
437 :
438 : /// @returns true if it's disposed or in disposing
439 : inline bool IsAlive() const;
440 :
441 : /// @returns true if it's not disposed and no in disposing
442 : inline bool IsNotAlive() const;
443 :
444 : /// throws the exception DisposedException if it's not alive
445 : void ThrowExceptionIfNotAlive() throw( ::com::sun::star::lang::DisposedException );
446 :
447 : /// Mutex guarding this object.
448 : ::osl::Mutex maMutex;
449 :
450 : private:
451 :
452 : /** Description of this object. This is not a constant because it can
453 : be set from the outside. Furthermore, it changes according to the
454 : draw page's display mode.
455 : */
456 : OUString msDescription;
457 :
458 : /** Name of this object. It changes according the draw page's
459 : display mode.
460 : */
461 : OUString msName;
462 :
463 : /// Reference to the parent object.
464 : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
465 : mxParent;
466 :
467 : /// Bounding box
468 : Rectangle* mpBoundingBox;
469 :
470 : /// window of parent
471 : const vcl::Window& mrParentWindow;
472 :
473 : /// client id in the AccessibleEventNotifier queue
474 : sal_uInt32 mnClientId;
475 :
476 : /// index of child in parent
477 : long mnIndexInParent;
478 :
479 : /// Indicates, if object is checked
480 : bool mbIsChecked;
481 : };
482 :
483 0 : inline bool SvxRectCtlChildAccessibleContext::IsAlive() const
484 : {
485 0 : return !rBHelper.bDisposed && !rBHelper.bInDispose;
486 : }
487 :
488 0 : inline bool SvxRectCtlChildAccessibleContext::IsNotAlive() const
489 : {
490 0 : return rBHelper.bDisposed || rBHelper.bInDispose;
491 : }
492 :
493 :
494 : #endif
495 :
496 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|