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