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