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