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