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