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