1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _ACCCELL_HXX 28 #define _ACCCELL_HXX 29 30 #include "acccontext.hxx" 31 #include <com/sun/star/accessibility/XAccessibleValue.hpp> 32 33 class SwCellFrm; 34 class SwFrmFmt; 35 36 class SwAccessibleCell : public SwAccessibleContext, 37 ::com::sun::star::accessibility::XAccessibleValue 38 39 { 40 sal_Bool bIsSelected; // protected by base class mutex 41 42 sal_Bool IsSelected(); 43 44 sal_Bool _InvalidateMyCursorPos(); 45 sal_Bool _InvalidateChildrenCursorPos( const SwFrm *pFrm ); 46 47 protected: 48 49 // Set states for getAccessibleStateSet. 50 // This drived class additionaly sets SELECTABLE(1) and SELECTED(+) 51 virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet ); 52 53 virtual void _InvalidateCursorPos(); 54 55 virtual ~SwAccessibleCell(); 56 57 public: 58 59 SwAccessibleCell( SwAccessibleMap* pInitMap, const SwCellFrm *pCellFrm ); 60 61 virtual sal_Bool HasCursor(); // required by map to remember that object 62 63 //===== XAccessibleContext ============================================== 64 65 /// Return this object's description. 66 virtual ::rtl::OUString SAL_CALL 67 getAccessibleDescription (void) 68 throw (com::sun::star::uno::RuntimeException); 69 70 //===== XServiceInfo ==================================================== 71 72 /** Returns an identifier for the implementation of this object. 73 */ 74 virtual ::rtl::OUString SAL_CALL 75 getImplementationName (void) 76 throw (::com::sun::star::uno::RuntimeException); 77 78 /** Return whether the specified service is supported by this class. 79 */ 80 virtual sal_Bool SAL_CALL 81 supportsService (const ::rtl::OUString& sServiceName) 82 throw (::com::sun::star::uno::RuntimeException); 83 84 /** Returns a list of all supported services. In this case that is just 85 the AccessibleContext service. 86 */ 87 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL 88 getSupportedServiceNames (void) 89 throw (::com::sun::star::uno::RuntimeException); 90 91 virtual void Dispose( sal_Bool bRecursive = sal_False ); 92 93 virtual void InvalidatePosOrSize( const SwRect& rFrm ); 94 95 //===== XInterface ====================================================== 96 97 // (XInterface methods need to be implemented to disambiguate 98 // between those inherited through SwAcessibleContext and 99 // XAccessibleValue). 100 101 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 102 const ::com::sun::star::uno::Type& aType ) 103 throw (::com::sun::star::uno::RuntimeException); 104 105 virtual void SAL_CALL acquire( ) throw () 106 { SwAccessibleContext::acquire(); }; 107 108 virtual void SAL_CALL release( ) throw () 109 { SwAccessibleContext::release(); }; 110 111 //====== XTypeProvider ==================================================== 112 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 113 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 114 115 //===== XAccessibleValue ================================================ 116 117 private: 118 SwFrmFmt* GetTblBoxFormat() const; 119 120 public: 121 virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) 122 throw (::com::sun::star::uno::RuntimeException); 123 124 virtual sal_Bool SAL_CALL setCurrentValue( 125 const ::com::sun::star::uno::Any& aNumber ) 126 throw (::com::sun::star::uno::RuntimeException); 127 128 virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) 129 throw (::com::sun::star::uno::RuntimeException); 130 131 virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) 132 throw (::com::sun::star::uno::RuntimeException); 133 }; 134 135 136 #endif 137 138