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 //IAccessibility2 Implementation 2009----- 30 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_ 31 #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp> 32 #endif 33 34 #ifndef _ACCSELECTIONHELPER_HXX_ 35 #include <accselectionhelper.hxx> 36 #endif 37 //-----IAccessibility2 Implementation 2009 38 39 class SwCellFrm; 40 class SwAccessibleTable; 41 class SwFrmFmt; 42 43 class SwAccessibleCell : public SwAccessibleContext, 44 ::com::sun::star::accessibility::XAccessibleValue, 45 ::com::sun::star::accessibility::XAccessibleSelection, 46 public ::com::sun::star::accessibility::XAccessibleExtendedAttributes 47 { 48 // Implementation for XAccessibleSelection interface 49 SwAccessibleSelectionHelper aSelectionHelper; 50 sal_Bool bIsSelected; // protected by base class mutex 51 52 sal_Bool IsSelected(); 53 54 sal_Bool _InvalidateMyCursorPos(); 55 sal_Bool _InvalidateChildrenCursorPos( const SwFrm *pFrm ); 56 57 protected: 58 59 // Set states for getAccessibleStateSet. 60 // This drived class additionaly sets SELECTABLE(1) and SELECTED(+) 61 virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet ); 62 63 virtual void _InvalidateCursorPos(); 64 65 virtual ~SwAccessibleCell(); 66 67 public: 68 69 SwAccessibleCell( SwAccessibleMap* pInitMap, const SwCellFrm *pCellFrm ); 70 71 virtual sal_Bool HasCursor(); // required by map to remember that object 72 73 //===== XAccessibleContext ============================================== 74 75 /// Return this object's description. 76 virtual ::rtl::OUString SAL_CALL 77 getAccessibleDescription (void) 78 throw (com::sun::star::uno::RuntimeException); 79 80 //===== XServiceInfo ==================================================== 81 82 /** Returns an identifier for the implementation of this object. 83 */ 84 virtual ::rtl::OUString SAL_CALL 85 getImplementationName (void) 86 throw (::com::sun::star::uno::RuntimeException); 87 88 /** Return whether the specified service is supported by this class. 89 */ 90 virtual sal_Bool SAL_CALL 91 supportsService (const ::rtl::OUString& sServiceName) 92 throw (::com::sun::star::uno::RuntimeException); 93 94 /** Returns a list of all supported services. In this case that is just 95 the AccessibleContext service. 96 */ 97 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL 98 getSupportedServiceNames (void) 99 throw (::com::sun::star::uno::RuntimeException); 100 101 virtual void Dispose( sal_Bool bRecursive = sal_False ); 102 103 virtual void InvalidatePosOrSize( const SwRect& rFrm ); 104 105 //===== XInterface ====================================================== 106 107 // (XInterface methods need to be implemented to disambiguate 108 // between those inherited through SwAcessibleContext and 109 // XAccessibleValue). 110 111 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 112 const ::com::sun::star::uno::Type& aType ) 113 throw (::com::sun::star::uno::RuntimeException); 114 115 virtual void SAL_CALL acquire( ) throw () 116 { SwAccessibleContext::acquire(); }; 117 118 virtual void SAL_CALL release( ) throw () 119 { SwAccessibleContext::release(); }; 120 121 //====== XTypeProvider ==================================================== 122 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 123 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 124 125 //===== XAccessibleValue ================================================ 126 127 //===== XAccessibleExtendedAttributes ================================================ 128 //IAccessibility2 Implementation 2009----- 129 ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() 130 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ; 131 //-----IAccessibility2 Implementation 2009 132 private: 133 SwFrmFmt* GetTblBoxFormat() const; 134 135 public: 136 virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) 137 throw (::com::sun::star::uno::RuntimeException); 138 139 virtual sal_Bool SAL_CALL setCurrentValue( 140 const ::com::sun::star::uno::Any& aNumber ) 141 throw (::com::sun::star::uno::RuntimeException); 142 143 virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) 144 throw (::com::sun::star::uno::RuntimeException); 145 146 virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) 147 throw (::com::sun::star::uno::RuntimeException); 148 //IAccessibility2 Implementation 2009----- 149 //===== XAccessibleComponent ============================================ 150 sal_Int32 SAL_CALL getBackground() 151 throw (::com::sun::star::uno::RuntimeException); 152 153 //===== XAccessibleSelection ============================================ 154 virtual void SAL_CALL selectAccessibleChild( 155 sal_Int32 nChildIndex ) 156 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 157 ::com::sun::star::uno::RuntimeException ); 158 159 virtual sal_Bool SAL_CALL isAccessibleChildSelected( 160 sal_Int32 nChildIndex ) 161 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 162 ::com::sun::star::uno::RuntimeException ); 163 virtual void SAL_CALL clearAccessibleSelection( ) 164 throw ( ::com::sun::star::uno::RuntimeException ); 165 virtual void SAL_CALL selectAllAccessibleChildren( ) 166 throw ( ::com::sun::star::uno::RuntimeException ); 167 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) 168 throw ( ::com::sun::star::uno::RuntimeException ); 169 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( 170 sal_Int32 nSelectedChildIndex ) 171 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 172 ::com::sun::star::uno::RuntimeException); 173 174 virtual void SAL_CALL deselectAccessibleChild( 175 sal_Int32 nSelectedChildIndex ) 176 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 177 ::com::sun::star::uno::RuntimeException ); 178 179 SwAccessibleTable *GetTable(); 180 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTableReference; 181 SwAccessibleTable *m_pAccTable; 182 //-----IAccessibility2 Implementation 2009 183 }; 184 185 186 #endif 187 188