1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _ACCCELL_HXX 24 #define _ACCCELL_HXX 25 26 #include "acccontext.hxx" 27 #include <com/sun/star/accessibility/XAccessibleValue.hpp> 28 29 class SwCellFrm; 30 class SwFrmFmt; 31 32 class SwAccessibleCell : public SwAccessibleContext, 33 ::com::sun::star::accessibility::XAccessibleValue 34 35 { 36 sal_Bool bIsSelected; // protected by base class mutex 37 38 sal_Bool IsSelected(); 39 40 sal_Bool _InvalidateMyCursorPos(); 41 sal_Bool _InvalidateChildrenCursorPos( const SwFrm *pFrm ); 42 43 protected: 44 45 // Set states for getAccessibleStateSet. 46 // This drived class additionaly sets SELECTABLE(1) and SELECTED(+) 47 virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet ); 48 49 virtual void _InvalidateCursorPos(); 50 51 virtual ~SwAccessibleCell(); 52 53 public: 54 55 SwAccessibleCell( SwAccessibleMap* pInitMap, const SwCellFrm *pCellFrm ); 56 57 virtual sal_Bool HasCursor(); // required by map to remember that object 58 59 //===== XAccessibleContext ============================================== 60 61 /// Return this object's description. 62 virtual ::rtl::OUString SAL_CALL 63 getAccessibleDescription (void) 64 throw (com::sun::star::uno::RuntimeException); 65 66 //===== XServiceInfo ==================================================== 67 68 /** Returns an identifier for the implementation of this object. 69 */ 70 virtual ::rtl::OUString SAL_CALL 71 getImplementationName (void) 72 throw (::com::sun::star::uno::RuntimeException); 73 74 /** Return whether the specified service is supported by this class. 75 */ 76 virtual sal_Bool SAL_CALL 77 supportsService (const ::rtl::OUString& sServiceName) 78 throw (::com::sun::star::uno::RuntimeException); 79 80 /** Returns a list of all supported services. In this case that is just 81 the AccessibleContext service. 82 */ 83 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL 84 getSupportedServiceNames (void) 85 throw (::com::sun::star::uno::RuntimeException); 86 87 virtual void Dispose( sal_Bool bRecursive = sal_False ); 88 89 virtual void InvalidatePosOrSize( const SwRect& rFrm ); 90 91 //===== XInterface ====================================================== 92 93 // (XInterface methods need to be implemented to disambiguate 94 // between those inherited through SwAcessibleContext and 95 // XAccessibleValue). 96 97 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 98 const ::com::sun::star::uno::Type& aType ) 99 throw (::com::sun::star::uno::RuntimeException); 100 101 virtual void SAL_CALL acquire( ) throw () 102 { SwAccessibleContext::acquire(); }; 103 104 virtual void SAL_CALL release( ) throw () 105 { SwAccessibleContext::release(); }; 106 107 //====== XTypeProvider ==================================================== 108 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 109 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 110 111 //===== XAccessibleValue ================================================ 112 113 private: 114 SwFrmFmt* GetTblBoxFormat() const; 115 116 public: 117 virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) 118 throw (::com::sun::star::uno::RuntimeException); 119 120 virtual sal_Bool SAL_CALL setCurrentValue( 121 const ::com::sun::star::uno::Any& aNumber ) 122 throw (::com::sun::star::uno::RuntimeException); 123 124 virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) 125 throw (::com::sun::star::uno::RuntimeException); 126 127 virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) 128 throw (::com::sun::star::uno::RuntimeException); 129 }; 130 131 132 #endif 133 134