xref: /AOO41X/main/svx/source/inc/svxpixelctlaccessiblecontext.hxx (revision a7f6452ca3a8538d027043cd710649e772bbe7e7)
1*a7f6452cSSteve Yin /*************************************************************************
2*a7f6452cSSteve Yin  *
3*a7f6452cSSteve Yin  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*a7f6452cSSteve Yin  *
5*a7f6452cSSteve Yin  * Copyright IBM Corporation 2010.
6*a7f6452cSSteve Yin  * Copyright 2000, 2010 Oracle and/or its affiliates.
7*a7f6452cSSteve Yin  *
8*a7f6452cSSteve Yin  * OpenOffice.org - a multi-platform office productivity suite
9*a7f6452cSSteve Yin  *
10*a7f6452cSSteve Yin  * This file is part of OpenOffice.org.
11*a7f6452cSSteve Yin  *
12*a7f6452cSSteve Yin  * OpenOffice.org is free software: you can redistribute it and/or modify
13*a7f6452cSSteve Yin  * it under the terms of the GNU Lesser General Public License version 3
14*a7f6452cSSteve Yin  * only, as published by the Free Software Foundation.
15*a7f6452cSSteve Yin  *
16*a7f6452cSSteve Yin  * OpenOffice.org is distributed in the hope that it will be useful,
17*a7f6452cSSteve Yin  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18*a7f6452cSSteve Yin  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19*a7f6452cSSteve Yin  * GNU Lesser General Public License version 3 for more details
20*a7f6452cSSteve Yin  * (a copy is included in the LICENSE file that accompanied this code).
21*a7f6452cSSteve Yin  *
22*a7f6452cSSteve Yin  * You should have received a copy of the GNU Lesser General Public License
23*a7f6452cSSteve Yin  * version 3 along with OpenOffice.org.  If not, see
24*a7f6452cSSteve Yin  * <http://www.openoffice.org/license.html>
25*a7f6452cSSteve Yin  * for a copy of the LGPLv3 License.
26*a7f6452cSSteve Yin  *
27*a7f6452cSSteve Yin  ************************************************************************/
28*a7f6452cSSteve Yin 
29*a7f6452cSSteve Yin #ifndef _SVXPIXELACCESSIBLECONTEXT_HXX
30*a7f6452cSSteve Yin #define _SVXPIXELACCESSIBLECONTEXT_HXX
31*a7f6452cSSteve Yin 
32*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
33*a7f6452cSSteve Yin #include <com/sun/star/accessibility/XAccessible.hpp>
34*a7f6452cSSteve Yin #endif
35*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECOMPONENT_HPP_
36*a7f6452cSSteve Yin #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
37*a7f6452cSSteve Yin #endif
38*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECONTEXT_HPP_
39*a7f6452cSSteve Yin #include <com/sun/star/accessibility/XAccessibleContext.hpp>
40*a7f6452cSSteve Yin #endif
41*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEEVENTBROADCASTER_HPP_
42*a7f6452cSSteve Yin #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
43*a7f6452cSSteve Yin #endif
44*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_ILLEGALACCESSIBLECOMPONENTSTATEEXCEPTION_HPP_
45*a7f6452cSSteve Yin #include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
46*a7f6452cSSteve Yin #endif
47*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESELECTION_HPP_
48*a7f6452cSSteve Yin #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
49*a7f6452cSSteve Yin #endif
50*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEVALUE_HPP_
51*a7f6452cSSteve Yin #include <com/sun/star/accessibility/XAccessibleValue.hpp>
52*a7f6452cSSteve Yin #endif
53*a7f6452cSSteve Yin 
54*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
55*a7f6452cSSteve Yin #include <com/sun/star/beans/XPropertyChangeListener.hpp>
56*a7f6452cSSteve Yin #endif
57*a7f6452cSSteve Yin #ifndef	_COM_SUN_STAR_UNO_REFERENCE_HXX_
58*a7f6452cSSteve Yin #include <com/sun/star/uno/Reference.hxx>
59*a7f6452cSSteve Yin #endif
60*a7f6452cSSteve Yin #ifndef	_CPPUHELPER_WEAK_HXX_
61*a7f6452cSSteve Yin #include <cppuhelper/weak.hxx>
62*a7f6452cSSteve Yin #endif
63*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
64*a7f6452cSSteve Yin #include <com/sun/star/lang/XServiceInfo.hpp>
65*a7f6452cSSteve Yin #endif
66*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
67*a7f6452cSSteve Yin #include <com/sun/star/lang/XTypeProvider.hpp>
68*a7f6452cSSteve Yin #endif
69*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_LANG_XSERVICENAME_HPP_
70*a7f6452cSSteve Yin #include <com/sun/star/lang/XServiceName.hpp>
71*a7f6452cSSteve Yin #endif
72*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_LANG_INDEXOUTOFBOUNDSEXCEPTION_HPP_
73*a7f6452cSSteve Yin #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
74*a7f6452cSSteve Yin #endif
75*a7f6452cSSteve Yin #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
76*a7f6452cSSteve Yin #include <com/sun/star/lang/DisposedException.hpp>
77*a7f6452cSSteve Yin #endif
78*a7f6452cSSteve Yin #ifndef _VOS_MUTEX_HXX_
79*a7f6452cSSteve Yin #include <vos/mutex.hxx>
80*a7f6452cSSteve Yin #endif
81*a7f6452cSSteve Yin #ifndef _CPPUHELPER_INTERFACECONTAINER_H_
82*a7f6452cSSteve Yin #include <cppuhelper/interfacecontainer.h>
83*a7f6452cSSteve Yin #endif
84*a7f6452cSSteve Yin #ifndef _CPPUHELPER_COMPBASE6_HXX_
85*a7f6452cSSteve Yin #include <cppuhelper/compbase6.hxx>
86*a7f6452cSSteve Yin #endif
87*a7f6452cSSteve Yin #ifndef _CPPUHELPER_COMPBASE7_HXX_
88*a7f6452cSSteve Yin #include <cppuhelper/compbase7.hxx>
89*a7f6452cSSteve Yin #endif
90*a7f6452cSSteve Yin #ifndef _CPPUHELPER_COMPBASE5_HXX_
91*a7f6452cSSteve Yin #include <cppuhelper/compbase5.hxx>
92*a7f6452cSSteve Yin #endif
93*a7f6452cSSteve Yin #ifndef _COMPHELPER_BROADCASTHELPER_HXX_
94*a7f6452cSSteve Yin #include <comphelper/broadcasthelper.hxx>
95*a7f6452cSSteve Yin #endif
96*a7f6452cSSteve Yin #ifndef _CPPUHELPER_IMPLBASE6_HXX_
97*a7f6452cSSteve Yin #include <cppuhelper/implbase6.hxx>
98*a7f6452cSSteve Yin #endif
99*a7f6452cSSteve Yin #include <comphelper/servicehelper.hxx>
100*a7f6452cSSteve Yin 
101*a7f6452cSSteve Yin //#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLETABLE_HPP_
102*a7f6452cSSteve Yin //#include <com/sun/star/accessibility/XAccessibleTable.hpp>
103*a7f6452cSSteve Yin //#endif
104*a7f6452cSSteve Yin 
105*a7f6452cSSteve Yin #ifndef _SVX_RECTENUM_HXX //autogen
106*a7f6452cSSteve Yin #include <rectenum.hxx>
107*a7f6452cSSteve Yin #endif
108*a7f6452cSSteve Yin 
109*a7f6452cSSteve Yin 
110*a7f6452cSSteve Yin #include <tools/gen.hxx>
111*a7f6452cSSteve Yin 
112*a7f6452cSSteve Yin 
113*a7f6452cSSteve Yin namespace com { namespace sun { namespace star { namespace awt {
114*a7f6452cSSteve Yin 	struct Point;
115*a7f6452cSSteve Yin 	struct Rectangle;
116*a7f6452cSSteve Yin 	struct Size;
117*a7f6452cSSteve Yin 	class XFocusListener;
118*a7f6452cSSteve Yin } } } };
119*a7f6452cSSteve Yin class SvxPixelCtl;
120*a7f6452cSSteve Yin 
121*a7f6452cSSteve Yin 
122*a7f6452cSSteve Yin typedef ::cppu::WeakAggComponentImplHelper5<
123*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessible,
124*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessibleComponent,
125*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessibleContext,
126*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessibleEventBroadcaster,
127*a7f6452cSSteve Yin 			::com::sun::star::lang::XServiceInfo >
128*a7f6452cSSteve Yin 			SvxPixelCtlAccessibleChild_BASE;
129*a7f6452cSSteve Yin 
130*a7f6452cSSteve Yin class SvxPixelCtlAccessibleChild :
131*a7f6452cSSteve Yin 	public ::comphelper::OBaseMutex,
132*a7f6452cSSteve Yin 	public SvxPixelCtlAccessibleChild_BASE
133*a7f6452cSSteve Yin {
134*a7f6452cSSteve Yin 	SvxPixelCtl* mrParentWindow;
135*a7f6452cSSteve Yin 	::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxParent;
136*a7f6452cSSteve Yin        void IsValid() throw (::com::sun::star::uno::RuntimeException);
137*a7f6452cSSteve Yin 	sal_Bool m_bPixelColorOrBG;//Pixel Color Or BackGround Color
138*a7f6452cSSteve Yin 	Point maPoint;
139*a7f6452cSSteve Yin 	Rectangle*	mpBoundingBox;
140*a7f6452cSSteve Yin 	/// index of child in parent
141*a7f6452cSSteve Yin 	long								mnIndexInParent;
142*a7f6452cSSteve Yin 	///	Mutex guarding this object.
143*a7f6452cSSteve Yin     ::osl::Mutex						m_aMutex;
144*a7f6452cSSteve Yin public:
145*a7f6452cSSteve Yin     SvxPixelCtlAccessibleChild(
146*a7f6452cSSteve Yin 				SvxPixelCtl* rWindow,
147*a7f6452cSSteve Yin 				sal_Bool bPixelColorOrBG,
148*a7f6452cSSteve Yin 				const Point& aPoint,
149*a7f6452cSSteve Yin 				const Rectangle& rBounds,
150*a7f6452cSSteve Yin 				const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& xParent,
151*a7f6452cSSteve Yin 				long nIndexInParent );
152*a7f6452cSSteve Yin     ~SvxPixelCtlAccessibleChild();
153*a7f6452cSSteve Yin 
154*a7f6452cSSteve Yin     //XAccessible
155*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
156*a7f6452cSSteve Yin 
157*a7f6452cSSteve Yin     //XAccessibleContext
158*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
159*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::uno::RuntimeException);
160*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
161*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
162*a7f6452cSSteve Yin     virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
163*a7f6452cSSteve Yin     virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
164*a7f6452cSSteve Yin     virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
165*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet(  ) throw (::com::sun::star::uno::RuntimeException);
166*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
167*a7f6452cSSteve Yin     virtual ::com::sun::star::lang::Locale SAL_CALL getLocale(  ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
168*a7f6452cSSteve Yin 
169*a7f6452cSSteve Yin 
170*a7f6452cSSteve Yin     //XAccessibleComponent
171*a7f6452cSSteve Yin     virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
172*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
173*a7f6452cSSteve Yin     virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds(  ) throw (::com::sun::star::uno::RuntimeException);
174*a7f6452cSSteve Yin     virtual ::com::sun::star::awt::Point SAL_CALL getLocation(  ) throw (::com::sun::star::uno::RuntimeException);
175*a7f6452cSSteve Yin     virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen(  ) throw (::com::sun::star::uno::RuntimeException);
176*a7f6452cSSteve Yin     virtual ::com::sun::star::awt::Size SAL_CALL getSize(  ) throw (::com::sun::star::uno::RuntimeException);
177*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getForeground(  ) throw (::com::sun::star::uno::RuntimeException);
178*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getBackground(  ) throw (::com::sun::star::uno::RuntimeException);
179*a7f6452cSSteve Yin     virtual void SAL_CALL grabFocus(  ) throw (::com::sun::star::uno::RuntimeException);
180*a7f6452cSSteve Yin 
181*a7f6452cSSteve Yin     //XServiceInfo
182*a7f6452cSSteve Yin     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
183*a7f6452cSSteve Yin     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
184*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
185*a7f6452cSSteve Yin 
186*a7f6452cSSteve Yin     //Methods for XAccessibleEventBroadcaster
187*a7f6452cSSteve Yin 	sal_uInt32 mnClientId;
188*a7f6452cSSteve Yin 
189*a7f6452cSSteve Yin 	virtual void SAL_CALL
190*a7f6452cSSteve Yin 		addEventListener(
191*a7f6452cSSteve Yin 			const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
192*a7f6452cSSteve Yin 			throw( com::sun::star::uno::RuntimeException );
193*a7f6452cSSteve Yin 
194*a7f6452cSSteve Yin 	virtual void SAL_CALL
195*a7f6452cSSteve Yin 		removeEventListener(
196*a7f6452cSSteve Yin 			const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
197*a7f6452cSSteve Yin 			throw( com::sun::star::uno::RuntimeException );
198*a7f6452cSSteve Yin 	void CommitChange( const com::sun::star::accessibility::AccessibleEventObject& rEvent );
199*a7f6452cSSteve Yin 
200*a7f6452cSSteve Yin 	//Solution: Add the event handling method
201*a7f6452cSSteve Yin 	void FireAccessibleEvent (short nEventId, const ::com::sun::star::uno::Any& rOld, const ::com::sun::star::uno::Any& rNew);
202*a7f6452cSSteve Yin 	virtual void SAL_CALL disposing();
203*a7f6452cSSteve Yin 
204*a7f6452cSSteve Yin 	virtual Rectangle GetBoundingBoxOnScreen( void ) throw( ::com::sun::star::uno::RuntimeException );
205*a7f6452cSSteve Yin 
206*a7f6452cSSteve Yin 	virtual Rectangle GetBoundingBox( void ) throw( ::com::sun::star::uno::RuntimeException );
207*a7f6452cSSteve Yin 
208*a7f6452cSSteve Yin 	/// @returns true if it's disposed or in disposing
209*a7f6452cSSteve Yin 	inline sal_Bool IsAlive( void ) const;
210*a7f6452cSSteve Yin 	/// @returns true if it's not disposed and no in disposing
211*a7f6452cSSteve Yin 	inline sal_Bool IsNotAlive( void ) const;
212*a7f6452cSSteve Yin 	/// throws the exception DisposedException if it's not alive
213*a7f6452cSSteve Yin 	void ThrowExceptionIfNotAlive( void ) throw( ::com::sun::star::lang::DisposedException );
214*a7f6452cSSteve Yin 
215*a7f6452cSSteve Yin 
216*a7f6452cSSteve Yin 	void CheckChild();
217*a7f6452cSSteve Yin 	void SelectChild( sal_Bool bSelect);
218*a7f6452cSSteve Yin 	void ChangePixelColorOrBG(sal_Bool bPixelColorOrBG){ m_bPixelColorOrBG = bPixelColorOrBG ;}
219*a7f6452cSSteve Yin 	::rtl::OUString GetName();
220*a7f6452cSSteve Yin };
221*a7f6452cSSteve Yin 
222*a7f6452cSSteve Yin 
223*a7f6452cSSteve Yin typedef ::cppu::WeakAggComponentImplHelper6<
224*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessible,
225*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessibleComponent,
226*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessibleContext,
227*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessibleEventBroadcaster,
228*a7f6452cSSteve Yin 			::com::sun::star::accessibility::XAccessibleSelection,
229*a7f6452cSSteve Yin //			::com::sun::star::accessibility::XAccessibleTable,
230*a7f6452cSSteve Yin 			::com::sun::star::lang::XServiceInfo >
231*a7f6452cSSteve Yin 			SvxPixelCtlAccessible_BASE;
232*a7f6452cSSteve Yin 
233*a7f6452cSSteve Yin class SvxPixelCtlAccessible :
234*a7f6452cSSteve Yin 	public ::comphelper::OBaseMutex,
235*a7f6452cSSteve Yin 	public SvxPixelCtlAccessible_BASE
236*a7f6452cSSteve Yin {
237*a7f6452cSSteve Yin 	SvxPixelCtl* pPixelCtl;
238*a7f6452cSSteve Yin     void IsValid() throw (::com::sun::star::uno::RuntimeException);
239*a7f6452cSSteve Yin 
240*a7f6452cSSteve Yin public:
241*a7f6452cSSteve Yin     SvxPixelCtlAccessible(SvxPixelCtl& rWindow);
242*a7f6452cSSteve Yin     ~SvxPixelCtlAccessible();
243*a7f6452cSSteve Yin 
244*a7f6452cSSteve Yin 	void ensureIsAlive() const throw ( ::com::sun::star::lang::DisposedException );
245*a7f6452cSSteve Yin 
246*a7f6452cSSteve Yin     //XAccessible
247*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
248*a7f6452cSSteve Yin 
249*a7f6452cSSteve Yin     //XAccessibleContext
250*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
251*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::uno::RuntimeException);
252*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
253*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
254*a7f6452cSSteve Yin     virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
255*a7f6452cSSteve Yin     virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
256*a7f6452cSSteve Yin     virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
257*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet(  ) throw (::com::sun::star::uno::RuntimeException);
258*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
259*a7f6452cSSteve Yin     virtual ::com::sun::star::lang::Locale SAL_CALL getLocale(  ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
260*a7f6452cSSteve Yin 
261*a7f6452cSSteve Yin 
262*a7f6452cSSteve Yin     //XAccessibleComponent
263*a7f6452cSSteve Yin     virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
264*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
265*a7f6452cSSteve Yin     virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds(  ) throw (::com::sun::star::uno::RuntimeException);
266*a7f6452cSSteve Yin     virtual ::com::sun::star::awt::Point SAL_CALL getLocation(  ) throw (::com::sun::star::uno::RuntimeException);
267*a7f6452cSSteve Yin     virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen(  ) throw (::com::sun::star::uno::RuntimeException);
268*a7f6452cSSteve Yin     virtual ::com::sun::star::awt::Size SAL_CALL getSize(  ) throw (::com::sun::star::uno::RuntimeException);
269*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getForeground(  ) throw (::com::sun::star::uno::RuntimeException);
270*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getBackground(  ) throw (::com::sun::star::uno::RuntimeException);
271*a7f6452cSSteve Yin     virtual void SAL_CALL grabFocus(  ) throw (::com::sun::star::uno::RuntimeException);
272*a7f6452cSSteve Yin     //XServiceInfo
273*a7f6452cSSteve Yin     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
274*a7f6452cSSteve Yin     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
275*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
276*a7f6452cSSteve Yin 	// XAccessibleSelection
277*a7f6452cSSteve Yin 	void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
278*a7f6452cSSteve Yin 	sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
279*a7f6452cSSteve Yin 	void SAL_CALL clearAccessibleSelection(  ) throw (::com::sun::star::uno::RuntimeException);
280*a7f6452cSSteve Yin 	void SAL_CALL selectAllAccessibleChildren(  ) throw (::com::sun::star::uno::RuntimeException);
281*a7f6452cSSteve Yin 	sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
282*a7f6452cSSteve Yin 	::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
283*a7f6452cSSteve Yin 	void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
284*a7f6452cSSteve Yin 
285*a7f6452cSSteve Yin /*
286*a7f6452cSSteve Yin 	// XAccessibleTable -------------------------------------------------------
287*a7f6452cSSteve Yin     /-** @return  The number of used rows in the table (0 = empty table). *-/
288*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleRowCount() throw ( ::com::sun::star::uno::RuntimeException );
289*a7f6452cSSteve Yin     /-** @return  The number of used columns in the table (0 = empty table). *-/
290*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleColumnCount() throw ( ::com::sun::star::uno::RuntimeException );
291*a7f6452cSSteve Yin     /-** @return  The row extent of the specified cell (always 1). *-/
292*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
293*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
294*a7f6452cSSteve Yin                 ::com::sun::star::uno::RuntimeException );
295*a7f6452cSSteve Yin     /-** @return  The column extent of the specified cell (always 1). *-/
296*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
297*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
298*a7f6452cSSteve Yin                 ::com::sun::star::uno::RuntimeException );
299*a7f6452cSSteve Yin     /-** @return  The caption cell of the table (not supported). *-/
300*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
301*a7f6452cSSteve Yin     	getAccessibleCaption() throw ( ::com::sun::star::uno::RuntimeException );
302*a7f6452cSSteve Yin     /-** @return  The summary object of the table (not supported). *-/
303*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
304*a7f6452cSSteve Yin     	getAccessibleSummary() throw ( ::com::sun::star::uno::RuntimeException );
305*a7f6452cSSteve Yin     /-** @return  The child index of the specified cell. *-/
306*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
307*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
308*a7f6452cSSteve Yin     /-** @return  The row index of the specified child cell. *-/
309*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex )
310*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
311*a7f6452cSSteve Yin     /-** @return  The column index of the specified child cell. *-/
312*a7f6452cSSteve Yin     virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex )
313*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
314*a7f6452cSSteve Yin     /-** @return  The description text of the specified row. *-/
315*a7f6452cSSteve Yin     virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow )
316*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
317*a7f6452cSSteve Yin     /-** @return  The description text of the specified column. *-/
318*a7f6452cSSteve Yin     virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn )
319*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
320*a7f6452cSSteve Yin     /-** @return  The XAccessibleTable interface of the row header bar. *-/
321*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL
322*a7f6452cSSteve Yin     	getAccessibleRowHeaders() throw ( ::com::sun::star::uno::RuntimeException );
323*a7f6452cSSteve Yin     /-** @return  The XAccessibleTable interface of the column header bar. *-/
324*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL
325*a7f6452cSSteve Yin     	getAccessibleColumnHeaders() throw ( ::com::sun::star::uno::RuntimeException );
326*a7f6452cSSteve Yin     /-** @return  An index list of completely selected rows. *-/
327*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
328*a7f6452cSSteve Yin     	getSelectedAccessibleRows() throw ( ::com::sun::star::uno::RuntimeException );
329*a7f6452cSSteve Yin     /-** @return  An index list of completely selected columns. *-/
330*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
331*a7f6452cSSteve Yin     	getSelectedAccessibleColumns() throw ( ::com::sun::star::uno::RuntimeException );
332*a7f6452cSSteve Yin     /-** @return  <TRUE/>, if the specified row is completely selected. *-/
333*a7f6452cSSteve Yin     virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow )
334*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
335*a7f6452cSSteve Yin     /-** @return  <TRUE/>, if the specified column is completely selected. *-/
336*a7f6452cSSteve Yin     virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn )
337*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
338*a7f6452cSSteve Yin     /-** @return The XAccessible interface of the cell object at the specified cell position. *-/
339*a7f6452cSSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
340*a7f6452cSSteve Yin     	getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
341*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
342*a7f6452cSSteve Yin                 ::com::sun::star::uno::RuntimeException );
343*a7f6452cSSteve Yin     /-** @return  <TRUE/>, if the specified cell is selected. *-/
344*a7f6452cSSteve Yin     virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
345*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
346*a7f6452cSSteve Yin 
347*a7f6452cSSteve Yin */
348*a7f6452cSSteve Yin     //Methods for XAccessibleEventBroadcaster
349*a7f6452cSSteve Yin 	sal_uInt32 mnClientId;
350*a7f6452cSSteve Yin 
351*a7f6452cSSteve Yin 	virtual void SAL_CALL
352*a7f6452cSSteve Yin 		addEventListener(
353*a7f6452cSSteve Yin 			const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
354*a7f6452cSSteve Yin 			throw( com::sun::star::uno::RuntimeException );
355*a7f6452cSSteve Yin 
356*a7f6452cSSteve Yin 	virtual void SAL_CALL
357*a7f6452cSSteve Yin 		removeEventListener(
358*a7f6452cSSteve Yin 			const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
359*a7f6452cSSteve Yin 			throw( com::sun::star::uno::RuntimeException );
360*a7f6452cSSteve Yin 	void CommitChange( const com::sun::star::accessibility::AccessibleEventObject& rEvent );
361*a7f6452cSSteve Yin 	//Solution: Add the event handling method
362*a7f6452cSSteve Yin 	void FireAccessibleEvent (short nEventId, const ::com::sun::star::uno::Any& rOld, const ::com::sun::star::uno::Any& rNew);
363*a7f6452cSSteve Yin 	virtual void SAL_CALL disposing();
364*a7f6452cSSteve Yin 
365*a7f6452cSSteve Yin 	/// select child
366*a7f6452cSSteve Yin 	void SelectChild( Point pos );
367*a7f6452cSSteve Yin 	void SelectChild( long nIndex);
368*a7f6452cSSteve Yin 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
369*a7f6452cSSteve Yin 		 CreateChild (long nIndex, Point mPoint);
370*a7f6452cSSteve Yin 
371*a7f6452cSSteve Yin 
372*a7f6452cSSteve Yin 	void LoseFocus();
373*a7f6452cSSteve Yin 
374*a7f6452cSSteve Yin     void Invalidate();
375*a7f6452cSSteve Yin 	/// @returns true if it's disposed or in disposing
376*a7f6452cSSteve Yin 	inline sal_Bool IsAlive( void ) const;
377*a7f6452cSSteve Yin 	/// @returns true if it's not disposed and no in disposing
378*a7f6452cSSteve Yin 	inline sal_Bool IsNotAlive( void ) const;
379*a7f6452cSSteve Yin 	/// throws the exception DisposedException if it's not alive
380*a7f6452cSSteve Yin 	void ThrowExceptionIfNotAlive( void ) throw( ::com::sun::star::lang::DisposedException );
381*a7f6452cSSteve Yin 
382*a7f6452cSSteve Yin protected:
383*a7f6452cSSteve Yin 	/** @attention  This method requires locked mutex's and a living object.
384*a7f6452cSSteve Yin         @throws <type>IndexOutOfBoundsException</type>
385*a7f6452cSSteve Yin         If the specified row index is invalid. */
386*a7f6452cSSteve Yin     void ensureIsValidRow( sal_Int32 nRow )
387*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException );
388*a7f6452cSSteve Yin     /** @attention  This method requires locked mutex's and a living object.
389*a7f6452cSSteve Yin         @throws <type>IndexOutOfBoundsException</type>
390*a7f6452cSSteve Yin         If the specified column index is invalid. */
391*a7f6452cSSteve Yin     void ensureIsValidColumn( sal_Int32 nColumn )
392*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException );
393*a7f6452cSSteve Yin     /** @attention  This method requires locked mutex's and a living object.
394*a7f6452cSSteve Yin         @throws <type>IndexOutOfBoundsException</type>
395*a7f6452cSSteve Yin         If the specified cell address is invalid. */
396*a7f6452cSSteve Yin     void ensureIsValidAddress( sal_Int32 nRow, sal_Int32 nColumn )
397*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException );
398*a7f6452cSSteve Yin     /** @attention  This method requires locked mutex's and a living object.
399*a7f6452cSSteve Yin         @throws <type>IndexOutOfBoundsException</type>
400*a7f6452cSSteve Yin         If the specified child index is invalid. */
401*a7f6452cSSteve Yin     void ensureIsValidIndex( sal_Int32 nChildIndex )
402*a7f6452cSSteve Yin         throw ( ::com::sun::star::lang::IndexOutOfBoundsException );
403*a7f6452cSSteve Yin 
404*a7f6452cSSteve Yin 
405*a7f6452cSSteve Yin 	::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> m_xCurChild;
406*a7f6452cSSteve Yin public:
407*a7f6452cSSteve Yin 	void NotifyChild(long nIndex,sal_Bool bSelect ,sal_Bool bCheck);
408*a7f6452cSSteve Yin };
409*a7f6452cSSteve Yin 
410*a7f6452cSSteve Yin inline sal_Bool SvxPixelCtlAccessible::IsAlive( void ) const
411*a7f6452cSSteve Yin {
412*a7f6452cSSteve Yin 	return !rBHelper.bDisposed && !rBHelper.bInDispose;
413*a7f6452cSSteve Yin }
414*a7f6452cSSteve Yin 
415*a7f6452cSSteve Yin inline sal_Bool SvxPixelCtlAccessible::IsNotAlive( void ) const
416*a7f6452cSSteve Yin {
417*a7f6452cSSteve Yin 	return rBHelper.bDisposed || rBHelper.bInDispose;
418*a7f6452cSSteve Yin }
419*a7f6452cSSteve Yin 
420*a7f6452cSSteve Yin inline sal_Bool SvxPixelCtlAccessibleChild::IsAlive( void ) const
421*a7f6452cSSteve Yin {
422*a7f6452cSSteve Yin 	return !rBHelper.bDisposed && !rBHelper.bInDispose;
423*a7f6452cSSteve Yin }
424*a7f6452cSSteve Yin 
425*a7f6452cSSteve Yin inline sal_Bool SvxPixelCtlAccessibleChild::IsNotAlive( void ) const
426*a7f6452cSSteve Yin {
427*a7f6452cSSteve Yin 	return rBHelper.bDisposed || rBHelper.bInDispose;
428*a7f6452cSSteve Yin }
429*a7f6452cSSteve Yin 
430*a7f6452cSSteve Yin 
431*a7f6452cSSteve Yin #endif
432