1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir 29*cdf0e10cSrcweir #ifndef ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLE_HXX 30*cdf0e10cSrcweir #define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLE_HXX 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include "accessibility/extended/AccessibleGridControlTableBase.hxx" 33*cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 34*cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleSelection.hpp> 35*cdf0e10cSrcweir #include <accessibility/extended/AccessibleGridControlTableCell.hxx> 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir // ============================================================================ 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir namespace accessibility { 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir // ============================================================================ 42*cdf0e10cSrcweir typedef ::cppu::ImplHelper1< 43*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessibleSelection > 44*cdf0e10cSrcweir AccessibleGridControlTableImplHelper1; 45*cdf0e10cSrcweir /** This class represents the accessible object of the data table of a 46*cdf0e10cSrcweir Grid control. */ 47*cdf0e10cSrcweir class AccessibleGridControlTable : public AccessibleGridControlTableBase, 48*cdf0e10cSrcweir public AccessibleGridControlTableImplHelper1 49*cdf0e10cSrcweir { 50*cdf0e10cSrcweir public: 51*cdf0e10cSrcweir AccessibleGridControlTable( 52*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 53*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible >& rxParent, 54*cdf0e10cSrcweir ::svt::table::IAccessibleTable& rTable, 55*cdf0e10cSrcweir ::svt::table::AccessibleTableControlObjType _eType); 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir protected: 58*cdf0e10cSrcweir virtual ~AccessibleGridControlTable(); 59*cdf0e10cSrcweir private: 60*cdf0e10cSrcweir std::vector< AccessibleGridControlTableCell* > m_pCellVector; 61*cdf0e10cSrcweir std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible> > m_pAccessCellVector; 62*cdf0e10cSrcweir public: 63*cdf0e10cSrcweir // XAccessibleContext ----------------------------------------------------- 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir /** @return The XAccessible interface of the specified child. */ 66*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 67*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible > SAL_CALL 68*cdf0e10cSrcweir getAccessibleChild( sal_Int32 nChildIndex ) 69*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 70*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir /** @return The index of this object among the parent's children. */ 73*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() 74*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir // XAccessibleComponent --------------------------------------------------- 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir /** @return The accessible child rendered under the given point. */ 79*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 80*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible > SAL_CALL 81*cdf0e10cSrcweir getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) 82*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir /** Grabs the focus to (the current cell of) the data table. */ 85*cdf0e10cSrcweir virtual void SAL_CALL grabFocus() 86*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir /** @return The key bindings associated with this object. */ 89*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding() 90*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir // XAccessibleTable ------------------------------------------------------- 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir /** @return The description text of the specified row. */ 95*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) 96*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 97*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir /** @return The description text of the specified column. */ 100*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) 101*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 102*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir /** @return The XAccessibleTable interface of the row header bar. */ 105*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 106*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL 107*cdf0e10cSrcweir getAccessibleRowHeaders() 108*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir /** @return The XAccessibleTable interface of the column header bar. */ 111*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 112*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL 113*cdf0e10cSrcweir getAccessibleColumnHeaders() 114*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir /** @return An index list of completely selected rows. */ 117*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL 118*cdf0e10cSrcweir getSelectedAccessibleRows() 119*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir /** @return An index list of completely selected columns. */ 122*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL 123*cdf0e10cSrcweir getSelectedAccessibleColumns() 124*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir /** @return <TRUE/>, if the specified row is completely selected. */ 127*cdf0e10cSrcweir virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) 128*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 129*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir /** @return <TRUE/>, if the specified column is completely selected. */ 132*cdf0e10cSrcweir virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) 133*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 134*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir /** @return The XAccessible interface of the cell object at the specified 137*cdf0e10cSrcweir cell position. */ 138*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 139*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible > SAL_CALL 140*cdf0e10cSrcweir getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) 141*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 142*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir /** @return <TRUE/>, if the specified cell is selected. */ 145*cdf0e10cSrcweir virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) 146*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 147*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir // XAccessibleSelection --------------------------------------------------- 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir /** Selects the specified child (row or column of the table). */ 152*cdf0e10cSrcweir virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) 153*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 154*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir /** @return <TRUE/>, if the specified child (row/column) is selected. */ 157*cdf0e10cSrcweir virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) 158*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 159*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir /** Clears the complete selection. */ 162*cdf0e10cSrcweir virtual void SAL_CALL clearAccessibleSelection() 163*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir /** Selects all children or first, if multiselection is not supported. */ 166*cdf0e10cSrcweir virtual void SAL_CALL selectAllAccessibleChildren() 167*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir /** @return The number of selected rows/columns. */ 170*cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() 171*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir /** @return The specified selected row/column. */ 174*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 175*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible > SAL_CALL 176*cdf0e10cSrcweir getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) 177*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 178*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir /** Removes the specified row/column from the selection. */ 181*cdf0e10cSrcweir virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) 182*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 183*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 184*cdf0e10cSrcweir // XInterface ------------------------------------------------------------- 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir /** Queries for a new interface. */ 187*cdf0e10cSrcweir ::com::sun::star::uno::Any SAL_CALL queryInterface( 188*cdf0e10cSrcweir const ::com::sun::star::uno::Type& rType ) 189*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir /** Aquires the object (calls acquire() on base class). */ 192*cdf0e10cSrcweir virtual void SAL_CALL acquire() throw (); 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir /** Releases the object (calls release() on base class). */ 195*cdf0e10cSrcweir virtual void SAL_CALL release() throw (); 196*cdf0e10cSrcweir // XServiceInfo ----------------------------------------------------------- 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir /** @return The name of this class. */ 199*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 200*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir /**@return m_pCellVector*/ 203*cdf0e10cSrcweir std::vector< AccessibleGridControlTableCell* >& getCellVector(); 204*cdf0e10cSrcweir /**@return m_xAccessCellVector*/ 205*cdf0e10cSrcweir std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible > >& getAccessibleCellVector(); 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir protected: 208*cdf0e10cSrcweir // internal virtual methods ----------------------------------------------- 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir /** @attention This method requires locked mutex's and a living object. 211*cdf0e10cSrcweir @return The bounding box (VCL rect.) relative to the parent window. */ 212*cdf0e10cSrcweir virtual Rectangle implGetBoundingBox(); 213*cdf0e10cSrcweir ///** @attention This method requires locked mutex's and a living object. 214*cdf0e10cSrcweir // @return The bounding box (VCL rect.) in screen coordinates. */ 215*cdf0e10cSrcweir virtual Rectangle implGetBoundingBoxOnScreen(); 216*cdf0e10cSrcweir 217*cdf0e10cSrcweir 218*cdf0e10cSrcweir //// internal helper methods ------------------------------------------------ 219*cdf0e10cSrcweir ///** @attention This method requires a locked mutex. 220*cdf0e10cSrcweir // @return The XAccessibleTable interface of the specified header bar. */ 221*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 222*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessibleTable > 223*cdf0e10cSrcweir implGetHeaderBar( sal_Int32 nChildIndex ) 224*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 225*cdf0e10cSrcweir }; 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir // ============================================================================ 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir } // namespace accessibility 230*cdf0e10cSrcweir 231*cdf0e10cSrcweir // ============================================================================ 232*cdf0e10cSrcweir 233*cdf0e10cSrcweir #endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLE_HXX 234*cdf0e10cSrcweir 235