1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24
25 #ifndef _SVXRECTACCESSIBLECONTEXT_HXX
26 #define _SVXRECTACCESSIBLECONTEXT_HXX
27
28 #include <com/sun/star/accessibility/XAccessible.hpp>
29 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
30 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
31 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
32 #include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
33 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
34 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
35 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
36 #include <com/sun/star/uno/Reference.hxx>
37 #include <cppuhelper/weak.hxx>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/lang/XTypeProvider.hpp>
40 #include <com/sun/star/lang/XServiceName.hpp>
41 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
42 #include <com/sun/star/lang/DisposedException.hpp>
43 #include <vos/mutex.hxx>
44 #include <cppuhelper/interfacecontainer.h>
45 #include <cppuhelper/compbase6.hxx>
46 #ifndef _CPPUHELPER_COMPBASE7_HXX_
47 #include <cppuhelper/compbase7.hxx>
48 #endif
49 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_ACTION_HPP_
50 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
51 #endif
52 #include <comphelper/broadcasthelper.hxx>
53 #include <cppuhelper/implbase6.hxx>
54 #include <comphelper/servicehelper.hxx>
55 #include <svx/rectenum.hxx>
56
57 namespace com { namespace sun { namespace star { namespace awt {
58 struct Point;
59 struct Rectangle;
60 struct Size;
61 class XFocusListener;
62 } } } }
63
64 class Rectangle;
65 class SvxRectCtl;
66 class SvxRectCtlChildAccessibleContext;
67 class Window;
68
69
70 typedef ::cppu::WeakAggComponentImplHelper6<
71 ::com::sun::star::accessibility::XAccessible,
72 ::com::sun::star::accessibility::XAccessibleComponent,
73 ::com::sun::star::accessibility::XAccessibleContext,
74 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
75 ::com::sun::star::accessibility::XAccessibleSelection,
76 ::com::sun::star::lang::XServiceInfo >
77 SvxRectCtlAccessibleContext_Base;
78
79 class SvxRectCtlAccessibleContext : public ::comphelper::OBaseMutex, public SvxRectCtlAccessibleContext_Base
80 {
81 public:
82 //===== internal ========================================================
83 SvxRectCtlAccessibleContext(
84 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent,
85 SvxRectCtl& rRepresentation,
86 const ::rtl::OUString* pName = NULL,
87 const ::rtl::OUString* pDescription = NULL );
88 protected:
89 virtual ~SvxRectCtlAccessibleContext();
90 public:
91 //===== XAccessible =====================================================
92
93 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
94 getAccessibleContext( void ) throw( ::com::sun::star::uno::RuntimeException );
95
96 //===== XAccessibleComponent ============================================
97
98 virtual sal_Bool SAL_CALL
99 containsPoint( const ::com::sun::star::awt::Point& rPoint ) throw( ::com::sun::star::uno::RuntimeException );
100
101 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
102 getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) throw( ::com::sun::star::uno::RuntimeException );
103
104 virtual ::com::sun::star::awt::Rectangle SAL_CALL
105 getBounds() throw( ::com::sun::star::uno::RuntimeException );
106
107 virtual ::com::sun::star::awt::Point SAL_CALL
108 getLocation() throw( ::com::sun::star::uno::RuntimeException );
109
110 virtual ::com::sun::star::awt::Point SAL_CALL
111 getLocationOnScreen() throw( ::com::sun::star::uno::RuntimeException );
112
113 virtual ::com::sun::star::awt::Size SAL_CALL
114 getSize() throw( ::com::sun::star::uno::RuntimeException );
115
116 virtual sal_Bool SAL_CALL
117 isShowing() throw( ::com::sun::star::uno::RuntimeException );
118
119 virtual sal_Bool SAL_CALL
120 isVisible() throw( ::com::sun::star::uno::RuntimeException );
121
122 virtual sal_Bool SAL_CALL
123 isFocusTraversable() throw( ::com::sun::star::uno::RuntimeException );
124
125 virtual void SAL_CALL
126 addFocusListener(
127 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener )
128 throw( ::com::sun::star::uno::RuntimeException );
129
130 virtual void SAL_CALL
131 removeFocusListener(
132 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener )
133 throw( ::com::sun::star::uno::RuntimeException );
134
135 virtual void SAL_CALL
136 grabFocus() throw( ::com::sun::star::uno::RuntimeException );
137
138 virtual ::com::sun::star::uno::Any SAL_CALL
139 getAccessibleKeyBinding() throw( ::com::sun::star::uno::RuntimeException );
140 virtual sal_Int32 SAL_CALL
141 getForeground( ) throw (::com::sun::star::uno::RuntimeException);
142 virtual sal_Int32 SAL_CALL
143 getBackground( ) throw (::com::sun::star::uno::RuntimeException);
144
145 //===== XAccessibleContext ==============================================
146
147 virtual sal_Int32 SAL_CALL
148 getAccessibleChildCount( void ) throw( ::com::sun::star::uno::RuntimeException );
149
150 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
151 getAccessibleChild( sal_Int32 nIndex )
152 throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException );
153
154 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
155 getAccessibleParent( void ) throw( ::com::sun::star::uno::RuntimeException );
156
157 virtual sal_Int32 SAL_CALL
158 getAccessibleIndexInParent( void ) throw( ::com::sun::star::uno::RuntimeException );
159
160 virtual sal_Int16 SAL_CALL
161 getAccessibleRole( void ) throw( ::com::sun::star::uno::RuntimeException );
162
163 virtual ::rtl::OUString SAL_CALL
164 getAccessibleDescription( void ) throw (::com::sun::star::uno::RuntimeException);
165
166 virtual ::rtl::OUString SAL_CALL
167 getAccessibleName( void ) throw (::com::sun::star::uno::RuntimeException);
168
169 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL
170 getAccessibleRelationSet( void ) throw( ::com::sun::star::uno::RuntimeException );
171
172 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL
173 getAccessibleStateSet( void ) throw( ::com::sun::star::uno::RuntimeException );
174
175 virtual ::com::sun::star::lang::Locale SAL_CALL
176 getLocale( void )
177 throw( ::com::sun::star::uno::RuntimeException,
178 ::com::sun::star::accessibility::IllegalAccessibleComponentStateException );
179
180 //===== XComponent =====================================================
181
182 using ::cppu::WeakAggComponentImplHelperBase::addEventListener;
183 using ::cppu::WeakAggComponentImplHelperBase::removeEventListener;
184
185 //===== XAccessibleEventBroadcaster =====================================
186
187 virtual void SAL_CALL
188 addEventListener(
189 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
190 throw( com::sun::star::uno::RuntimeException );
191
192 virtual void SAL_CALL
193 removeEventListener(
194 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
195 throw( com::sun::star::uno::RuntimeException );
196
197 //===== XServiceInfo ====================================================
198
199 virtual ::rtl::OUString SAL_CALL
200 getImplementationName( void ) throw( ::com::sun::star::uno::RuntimeException );
201
202 virtual sal_Bool SAL_CALL
203 supportsService( const ::rtl::OUString& sServiceName ) throw( ::com::sun::star::uno::RuntimeException );
204
205 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
206 getSupportedServiceNames( void ) throw( ::com::sun::star::uno::RuntimeException );
207
208 //===== XTypeProvider ===================================================
209
210 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
211 getImplementationId( void ) throw( ::com::sun::star::uno::RuntimeException );
212
213 //===== XAccessibleSelection =============================================
214
215 virtual void SAL_CALL
216 selectAccessibleChild( sal_Int32 nChildIndex )
217 throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
218
219 virtual sal_Bool SAL_CALL
220 isAccessibleChildSelected( sal_Int32 nChildIndex )
221 throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
222
223 virtual void SAL_CALL
224 clearAccessibleSelection() throw( ::com::sun::star::uno::RuntimeException );
225
226 virtual void SAL_CALL
227 selectAllAccessibleChildren() throw( ::com::sun::star::uno::RuntimeException );
228
229 virtual sal_Int32 SAL_CALL
230 getSelectedAccessibleChildCount() throw( ::com::sun::star::uno::RuntimeException );
231
232 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
233 getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
234 throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
235
236 virtual void SAL_CALL
237 deselectAccessibleChild( sal_Int32 nSelectedChildIndex )
238 throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );
239
240
241 protected:
242 //===== internals ========================================================
243
244 void checkChildIndex( long nIndexOfChild ) throw( ::com::sun::star::lang::IndexOutOfBoundsException );
245
246 void checkChildIndexOnSelection( long nIndexOfChild ) throw( ::com::sun::star::lang::IndexOutOfBoundsException );
247
248 /** Selects a new child by index.
249
250 <p>If the child was not selected before, the state of the child will
251 be updated. If the index is invalid, the index will internally set to NOCHILDSELECTED</p>
252
253 @param nIndexOfChild
254 Index of the new child which should be selected.
255 */
256 //void selectChild( long nIndexOfChild );
257 void selectChild( long nIndexOfChild, sal_Bool bFireFocus = sal_True);
258
259 public:
260 /** Selects a new child by point.
261
262 <p>If the child was not selected before, the state of the child will
263 be updated. If the point is not invalid, the index will internally set to NOCHILDSELECTED</p>
264
265 @param eButton
266 Button which belongs to the child which should be selected.
267 */
268 //void selectChild( RECT_POINT ePoint );
269 void selectChild( RECT_POINT ePoint, sal_Bool bFireFocus = sal_True );
270 void FireChildFocus( RECT_POINT eButton );
271 //Solution: Add the event handling method
272 void FireAccessibleEvent (short nEventId, const ::com::sun::star::uno::Any& rOld, const ::com::sun::star::uno::Any& rNew);
273 /// Sets the name
274 void setName( const ::rtl::OUString& rName );
275
276 /// Sets the description
277 void setDescription( const ::rtl::OUString& rDescr );
278 private:
279 static ::com::sun::star::uno::Sequence< sal_Int8 > getUniqueId( void );
280 protected:
281
282 /// @Return the object's current bounding box relative to the desktop.
283 virtual Rectangle GetBoundingBoxOnScreen( void ) throw( ::com::sun::star::uno::RuntimeException );
284
285 /// @Return the object's current bounding box relative to the parent object.
286 virtual Rectangle GetBoundingBox( void ) throw( ::com::sun::star::uno::RuntimeException );
287
288 /// Calls all Listener to tell they the change.
289 void CommitChange( const com::sun::star::accessibility::AccessibleEventObject& rEvent );
290
291 virtual void SAL_CALL disposing();
292
293 /// @returns true if it's disposed or in disposing
294 inline sal_Bool IsAlive( void ) const;
295
296 /// @returns true if it's not disposed and no in disposing
297 inline sal_Bool IsNotAlive( void ) const;
298
299 /// throws the exception DisposedException if it's not alive
300 void ThrowExceptionIfNotAlive( void ) throw( ::com::sun::star::lang::DisposedException );
301
302 private:
303 /** Description of this object. This is not a constant because it can
304 be set from the outside.
305 */
306 ::rtl::OUString msDescription;
307
308 /** Name of this object.
309 */
310 ::rtl::OUString msName;
311
312 /// Reference to the parent object.
313 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
314 mxParent;
315
316 /// pointer to internal representation
317 SvxRectCtl* mpRepr;
318
319 /// array for all possible childs
320 SvxRectCtlChildAccessibleContext** mpChilds;
321
322 /// client id in the AccessibleEventNotifier queue
323 sal_uInt32 mnClientId;
324
325 /// actual selected child
326 long mnSelectedChild;
327
328 /// mode of control (true -> 8 points, false -> 9 points)
329 sal_Bool mbAngleMode;
330 };
331
IsAlive(void) const332 inline sal_Bool SvxRectCtlAccessibleContext::IsAlive( void ) const
333 {
334 return !rBHelper.bDisposed && !rBHelper.bInDispose;
335 }
336
IsNotAlive(void) const337 inline sal_Bool SvxRectCtlAccessibleContext::IsNotAlive( void ) const
338 {
339 return rBHelper.bDisposed || rBHelper.bInDispose;
340 }
341
342 typedef ::cppu::WeakAggComponentImplHelper7<
343 ::com::sun::star::accessibility::XAccessible,
344 ::com::sun::star::accessibility::XAccessibleComponent,
345 ::com::sun::star::accessibility::XAccessibleContext,
346 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
347 ::com::sun::star::accessibility::XAccessibleValue,
348 ::com::sun::star::accessibility::XAccessibleAction,
349 ::com::sun::star::lang::XServiceInfo >
350 SvxRectCtlChildAccessibleContext_Base;
351
352
353 class SvxRectCtlChildAccessibleContext : public SvxRectCtlChildAccessibleContext_Base
354 {
355 public:
356 SvxRectCtlChildAccessibleContext(
357 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent,
358 const Window& rParentWindow,
359 const ::rtl::OUString& rName, const ::rtl::OUString& rDescription,
360 const Rectangle& rBoundingBox,
361 long nIndexInParent );
362 protected:
363 virtual ~SvxRectCtlChildAccessibleContext();
364 public:
365 //===== XAccessible =====================================================
366
367 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
368 getAccessibleContext( void ) throw( ::com::sun::star::uno::RuntimeException );
369
370 //===== XAccessibleComponent ============================================
371
372 virtual sal_Bool SAL_CALL
373 containsPoint( const ::com::sun::star::awt::Point& rPoint ) throw( ::com::sun::star::uno::RuntimeException );
374
375 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
376 getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) throw( ::com::sun::star::uno::RuntimeException );
377
378 virtual ::com::sun::star::awt::Rectangle SAL_CALL
379 getBounds() throw( ::com::sun::star::uno::RuntimeException );
380
381 virtual ::com::sun::star::awt::Point SAL_CALL
382 getLocation() throw( ::com::sun::star::uno::RuntimeException );
383
384 virtual ::com::sun::star::awt::Point SAL_CALL
385 getLocationOnScreen() throw( ::com::sun::star::uno::RuntimeException );
386
387 virtual ::com::sun::star::awt::Size SAL_CALL
388 getSize() throw( ::com::sun::star::uno::RuntimeException );
389
390 virtual sal_Bool SAL_CALL
391 isShowing() throw( ::com::sun::star::uno::RuntimeException );
392
393 virtual sal_Bool SAL_CALL
394 isVisible() throw( ::com::sun::star::uno::RuntimeException );
395
396 virtual sal_Bool SAL_CALL
397 isFocusTraversable() throw( ::com::sun::star::uno::RuntimeException );
398
399 virtual void SAL_CALL
400 addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener )
401 throw( ::com::sun::star::uno::RuntimeException );
402
403 virtual void SAL_CALL
404 removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener )
405 throw (::com::sun::star::uno::RuntimeException);
406
407 virtual void SAL_CALL
408 grabFocus() throw( ::com::sun::star::uno::RuntimeException );
409
410 virtual ::com::sun::star::uno::Any SAL_CALL
411 getAccessibleKeyBinding() throw( ::com::sun::star::uno::RuntimeException );
412 virtual sal_Int32 SAL_CALL
413 getForeground( ) throw (::com::sun::star::uno::RuntimeException);
414 virtual sal_Int32 SAL_CALL
415 getBackground( ) throw (::com::sun::star::uno::RuntimeException);
416
417 //===== XAccessibleContext ==============================================
418
419 virtual sal_Int32 SAL_CALL
420 getAccessibleChildCount( void ) throw( ::com::sun::star::uno::RuntimeException );
421
422 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
423 getAccessibleChild( sal_Int32 nIndex )
424 throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException );
425
426 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
427 getAccessibleParent( void ) throw( ::com::sun::star::uno::RuntimeException );
428
429 virtual sal_Int32 SAL_CALL
430 getAccessibleIndexInParent( void ) throw( ::com::sun::star::uno::RuntimeException );
431
432 virtual sal_Int16 SAL_CALL
433 getAccessibleRole( void ) throw( ::com::sun::star::uno::RuntimeException );
434
435 virtual ::rtl::OUString SAL_CALL
436 getAccessibleDescription( void ) throw( ::com::sun::star::uno::RuntimeException );
437
438 virtual ::rtl::OUString SAL_CALL
439 getAccessibleName( void ) throw( ::com::sun::star::uno::RuntimeException );
440
441 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL
442 getAccessibleRelationSet( void ) throw( ::com::sun::star::uno::RuntimeException );
443
444 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL
445 getAccessibleStateSet( void ) throw( ::com::sun::star::uno::RuntimeException );
446
447 virtual ::com::sun::star::lang::Locale SAL_CALL
448 getLocale( void )
449 throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::accessibility::IllegalAccessibleComponentStateException );
450
451 //===== XComponent =====================================================
452
453 using ::cppu::WeakAggComponentImplHelperBase::addEventListener;
454 using ::cppu::WeakAggComponentImplHelperBase::removeEventListener;
455
456 //===== XAccessibleEventBroadcaster =====================================
457
458 virtual void SAL_CALL
459 addEventListener(
460 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
461 throw( ::com::sun::star::uno::RuntimeException );
462
463 virtual void SAL_CALL
464 removeEventListener(
465 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
466 throw( com::sun::star::uno::RuntimeException );
467
468 //===== XAccessibleValue ================================================
469
470 virtual ::com::sun::star::uno::Any SAL_CALL
471 getCurrentValue() throw( ::com::sun::star::uno::RuntimeException );
472
473 virtual sal_Bool SAL_CALL
474 setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw( ::com::sun::star::uno::RuntimeException );
475
476 virtual ::com::sun::star::uno::Any SAL_CALL
477 getMaximumValue() throw( ::com::sun::star::uno::RuntimeException );
478
479 virtual ::com::sun::star::uno::Any SAL_CALL
480 getMinimumValue() throw( ::com::sun::star::uno::RuntimeException );
481
482 // XAccessibleAction
483 virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException);
484 virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
485 virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
486 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);
487 //===== XServiceInfo ====================================================
488
489 virtual ::rtl::OUString SAL_CALL
490 getImplementationName( void ) throw( ::com::sun::star::uno::RuntimeException );
491
492 virtual sal_Bool SAL_CALL
493 supportsService( const ::rtl::OUString& sServiceName ) throw( ::com::sun::star::uno::RuntimeException );
494
495 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
496 getSupportedServiceNames( void ) throw( ::com::sun::star::uno::RuntimeException );
497
498
499 //===== XTypeProvider ===================================================
500
501 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
502 getImplementationId( void ) throw( ::com::sun::star::uno::RuntimeException );
503
504 //===== internal ==========================================================
505
506 /// Sets the checked status
507 //void setStateChecked( sal_Bool bChecked );
508 void setStateChecked( sal_Bool bChecked, sal_Bool bFireFocus = sal_True);
509 void FireFocusEvent();
510 protected:
511 virtual Rectangle GetBoundingBoxOnScreen( void ) throw( ::com::sun::star::uno::RuntimeException );
512
513 virtual Rectangle GetBoundingBox( void ) throw( ::com::sun::star::uno::RuntimeException );
514
515 void CommitChange( const com::sun::star::accessibility::AccessibleEventObject& rEvent );
516
517 virtual void SAL_CALL disposing();
518
519 /// @returns true if it's disposed or in disposing
520 inline sal_Bool IsAlive( void ) const;
521
522 /// @returns true if it's not disposed and no in disposing
523 inline sal_Bool IsNotAlive( void ) const;
524
525 /// throws the exception DisposedException if it's not alive
526 void ThrowExceptionIfNotAlive( void ) throw( ::com::sun::star::lang::DisposedException );
527
528 /// Mutex guarding this object.
529 ::osl::Mutex maMutex;
530
531 private:
532
533 /** Description of this object. This is not a constant because it can
534 be set from the outside. Furthermore, it changes according the the
535 draw page's display mode.
536 */
537 ::rtl::OUString msDescription;
538
539 /** Name of this object. It changes according the draw page's
540 display mode.
541 */
542 ::rtl::OUString msName;
543
544 /// Reference to the parent object.
545 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
546 mxParent;
547
548 /// Bounding box
549 Rectangle* mpBoundingBox;
550
551 /// window of parent
552 const Window& mrParentWindow;
553
554 /// client id in the AccessibleEventNotifier queue
555 sal_uInt32 mnClientId;
556
557 /// index of child in parent
558 long mnIndexInParent;
559
560 /// Indicates, if object is checked
561 sal_Bool mbIsChecked;
562 };
563
IsAlive(void) const564 inline sal_Bool SvxRectCtlChildAccessibleContext::IsAlive( void ) const
565 {
566 return !rBHelper.bDisposed && !rBHelper.bInDispose;
567 }
568
IsNotAlive(void) const569 inline sal_Bool SvxRectCtlChildAccessibleContext::IsNotAlive( void ) const
570 {
571 return rBHelper.bDisposed || rBHelper.bInDispose;
572 }
573
574
575 #endif
576