11d2dbeb0SAndrew Rist /************************************************************** 21d2dbeb0SAndrew Rist * 31d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 41d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 51d2dbeb0SAndrew Rist * distributed with this work for additional information 61d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 71d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 81d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 91d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 101d2dbeb0SAndrew Rist * 111d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 121d2dbeb0SAndrew Rist * 131d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 141d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 151d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 161d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 171d2dbeb0SAndrew Rist * specific language governing permissions and limitations 181d2dbeb0SAndrew Rist * under the License. 191d2dbeb0SAndrew Rist * 201d2dbeb0SAndrew Rist *************************************************************/ 211d2dbeb0SAndrew Rist 221d2dbeb0SAndrew Rist 23cdf0e10cSrcweir #ifndef _ACCCELL_HXX 24cdf0e10cSrcweir #define _ACCCELL_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "acccontext.hxx" 27cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleValue.hpp> 28cdf0e10cSrcweir 29ca62e2c2SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_ 30ca62e2c2SSteve Yin #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp> 31ca62e2c2SSteve Yin #endif 32ca62e2c2SSteve Yin 33ca62e2c2SSteve Yin #ifndef _ACCSELECTIONHELPER_HXX_ 34ca62e2c2SSteve Yin #include <accselectionhelper.hxx> 35ca62e2c2SSteve Yin #endif 36ca62e2c2SSteve Yin 37cdf0e10cSrcweir class SwCellFrm; 38ca62e2c2SSteve Yin class SwAccessibleTable; 39cdf0e10cSrcweir class SwFrmFmt; 40cdf0e10cSrcweir 41cdf0e10cSrcweir class SwAccessibleCell : public SwAccessibleContext, 42ca62e2c2SSteve Yin ::com::sun::star::accessibility::XAccessibleValue, 43ca62e2c2SSteve Yin ::com::sun::star::accessibility::XAccessibleSelection, 44ca62e2c2SSteve Yin public ::com::sun::star::accessibility::XAccessibleExtendedAttributes 45cdf0e10cSrcweir { 46ca62e2c2SSteve Yin // Implementation for XAccessibleSelection interface 47ca62e2c2SSteve Yin SwAccessibleSelectionHelper aSelectionHelper; 48cdf0e10cSrcweir sal_Bool bIsSelected; // protected by base class mutex 49cdf0e10cSrcweir 50*46b0c5deSOliver-Rainer Wittmann ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xTableReference; 51*46b0c5deSOliver-Rainer Wittmann SwAccessibleTable *m_pAccTable; 52*46b0c5deSOliver-Rainer Wittmann 53*46b0c5deSOliver-Rainer Wittmann sal_Bool IsSelected(); 54cdf0e10cSrcweir 55cdf0e10cSrcweir sal_Bool _InvalidateMyCursorPos(); 56cdf0e10cSrcweir sal_Bool _InvalidateChildrenCursorPos( const SwFrm *pFrm ); 57cdf0e10cSrcweir 58cdf0e10cSrcweir protected: 59cdf0e10cSrcweir 60cdf0e10cSrcweir // Set states for getAccessibleStateSet. 61cdf0e10cSrcweir // This drived class additionaly sets SELECTABLE(1) and SELECTED(+) 62cdf0e10cSrcweir virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet ); 63cdf0e10cSrcweir 64cdf0e10cSrcweir virtual void _InvalidateCursorPos(); 65cdf0e10cSrcweir 66cdf0e10cSrcweir virtual ~SwAccessibleCell(); 67cdf0e10cSrcweir 68cdf0e10cSrcweir public: 69cdf0e10cSrcweir 70cdf0e10cSrcweir SwAccessibleCell( SwAccessibleMap* pInitMap, const SwCellFrm *pCellFrm ); 71cdf0e10cSrcweir 72cdf0e10cSrcweir virtual sal_Bool HasCursor(); // required by map to remember that object 73cdf0e10cSrcweir 74cdf0e10cSrcweir //===== XAccessibleContext ============================================== 75cdf0e10cSrcweir 76cdf0e10cSrcweir /// Return this object's description. 77cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 78cdf0e10cSrcweir getAccessibleDescription (void) 79cdf0e10cSrcweir throw (com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir 81cdf0e10cSrcweir //===== XServiceInfo ==================================================== 82cdf0e10cSrcweir 83cdf0e10cSrcweir /** Returns an identifier for the implementation of this object. 84cdf0e10cSrcweir */ 85cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 86cdf0e10cSrcweir getImplementationName (void) 87cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 88cdf0e10cSrcweir 89cdf0e10cSrcweir /** Return whether the specified service is supported by this class. 90cdf0e10cSrcweir */ 91cdf0e10cSrcweir virtual sal_Bool SAL_CALL 92cdf0e10cSrcweir supportsService (const ::rtl::OUString& sServiceName) 93cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir 95cdf0e10cSrcweir /** Returns a list of all supported services. In this case that is just 96cdf0e10cSrcweir the AccessibleContext service. 97cdf0e10cSrcweir */ 98cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL 99cdf0e10cSrcweir getSupportedServiceNames (void) 100cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir 102cdf0e10cSrcweir virtual void Dispose( sal_Bool bRecursive = sal_False ); 103cdf0e10cSrcweir 104cdf0e10cSrcweir virtual void InvalidatePosOrSize( const SwRect& rFrm ); 105cdf0e10cSrcweir 106cdf0e10cSrcweir //===== XInterface ====================================================== 107cdf0e10cSrcweir 108cdf0e10cSrcweir // (XInterface methods need to be implemented to disambiguate 109cdf0e10cSrcweir // between those inherited through SwAcessibleContext and 110cdf0e10cSrcweir // XAccessibleValue). 111cdf0e10cSrcweir 112cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 113cdf0e10cSrcweir const ::com::sun::star::uno::Type& aType ) 114cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 115cdf0e10cSrcweir acquire()116cdf0e10cSrcweir virtual void SAL_CALL acquire( ) throw () 117cdf0e10cSrcweir { SwAccessibleContext::acquire(); }; 118cdf0e10cSrcweir release()119cdf0e10cSrcweir virtual void SAL_CALL release( ) throw () 120cdf0e10cSrcweir { SwAccessibleContext::release(); }; 121cdf0e10cSrcweir 122cdf0e10cSrcweir //====== XTypeProvider ==================================================== 123cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 124cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 125cdf0e10cSrcweir 126cdf0e10cSrcweir //===== XAccessibleValue ================================================ 127cdf0e10cSrcweir 128ca62e2c2SSteve Yin //===== XAccessibleExtendedAttributes ================================================ 129ca62e2c2SSteve Yin ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() 130ca62e2c2SSteve Yin throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ; 131cdf0e10cSrcweir private: 132cdf0e10cSrcweir SwFrmFmt* GetTblBoxFormat() const; 133cdf0e10cSrcweir 134cdf0e10cSrcweir public: 135cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) 136cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 137cdf0e10cSrcweir 138cdf0e10cSrcweir virtual sal_Bool SAL_CALL setCurrentValue( 139cdf0e10cSrcweir const ::com::sun::star::uno::Any& aNumber ) 140cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 141cdf0e10cSrcweir 142cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) 143cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 144cdf0e10cSrcweir 145cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) 146cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 147ca62e2c2SSteve Yin //===== XAccessibleComponent ============================================ 148ca62e2c2SSteve Yin sal_Int32 SAL_CALL getBackground() 149ca62e2c2SSteve Yin throw (::com::sun::star::uno::RuntimeException); 150ca62e2c2SSteve Yin 151ca62e2c2SSteve Yin //===== XAccessibleSelection ============================================ 152ca62e2c2SSteve Yin virtual void SAL_CALL selectAccessibleChild( 153ca62e2c2SSteve Yin sal_Int32 nChildIndex ) 154ca62e2c2SSteve Yin throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 155ca62e2c2SSteve Yin ::com::sun::star::uno::RuntimeException ); 156ca62e2c2SSteve Yin 157ca62e2c2SSteve Yin virtual sal_Bool SAL_CALL isAccessibleChildSelected( 158ca62e2c2SSteve Yin sal_Int32 nChildIndex ) 159ca62e2c2SSteve Yin throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 160ca62e2c2SSteve Yin ::com::sun::star::uno::RuntimeException ); 161ca62e2c2SSteve Yin virtual void SAL_CALL clearAccessibleSelection( ) 162ca62e2c2SSteve Yin throw ( ::com::sun::star::uno::RuntimeException ); 163ca62e2c2SSteve Yin virtual void SAL_CALL selectAllAccessibleChildren( ) 164ca62e2c2SSteve Yin throw ( ::com::sun::star::uno::RuntimeException ); 165ca62e2c2SSteve Yin virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) 166ca62e2c2SSteve Yin throw ( ::com::sun::star::uno::RuntimeException ); 167ca62e2c2SSteve Yin virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( 168ca62e2c2SSteve Yin sal_Int32 nSelectedChildIndex ) 169ca62e2c2SSteve Yin throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 170ca62e2c2SSteve Yin ::com::sun::star::uno::RuntimeException); 171ca62e2c2SSteve Yin 172ca62e2c2SSteve Yin virtual void SAL_CALL deselectAccessibleChild( 173ca62e2c2SSteve Yin sal_Int32 nSelectedChildIndex ) 174ca62e2c2SSteve Yin throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 175ca62e2c2SSteve Yin ::com::sun::star::uno::RuntimeException ); 176ca62e2c2SSteve Yin 177cdf0e10cSrcweir }; 178cdf0e10cSrcweir 179cdf0e10cSrcweir 180cdf0e10cSrcweir #endif 181cdf0e10cSrcweir 182