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