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 28 29 #ifndef ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLE_HXX 30 #define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLE_HXX 31 32 #include "accessibility/extended/AccessibleGridControlTableBase.hxx" 33 #include <cppuhelper/implbase1.hxx> 34 #include <com/sun/star/accessibility/XAccessibleSelection.hpp> 35 #include <accessibility/extended/AccessibleGridControlTableCell.hxx> 36 37 // ============================================================================ 38 39 namespace accessibility { 40 41 // ============================================================================ 42 typedef ::cppu::ImplHelper1< 43 ::com::sun::star::accessibility::XAccessibleSelection > 44 AccessibleGridControlTableImplHelper1; 45 /** This class represents the accessible object of the data table of a 46 Grid control. */ 47 class AccessibleGridControlTable : public AccessibleGridControlTableBase, 48 public AccessibleGridControlTableImplHelper1 49 { 50 public: 51 AccessibleGridControlTable( 52 const ::com::sun::star::uno::Reference< 53 ::com::sun::star::accessibility::XAccessible >& rxParent, 54 ::svt::table::IAccessibleTable& rTable, 55 ::svt::table::AccessibleTableControlObjType _eType); 56 57 protected: 58 virtual ~AccessibleGridControlTable(); 59 private: 60 std::vector< AccessibleGridControlTableCell* > m_pCellVector; 61 std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible> > m_pAccessCellVector; 62 public: 63 // XAccessibleContext ----------------------------------------------------- 64 65 /** @return The XAccessible interface of the specified child. */ 66 virtual ::com::sun::star::uno::Reference< 67 ::com::sun::star::accessibility::XAccessible > SAL_CALL 68 getAccessibleChild( sal_Int32 nChildIndex ) 69 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 70 ::com::sun::star::uno::RuntimeException ); 71 72 /** @return The index of this object among the parent's children. */ 73 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() 74 throw ( ::com::sun::star::uno::RuntimeException ); 75 76 // XAccessibleComponent --------------------------------------------------- 77 78 /** @return The accessible child rendered under the given point. */ 79 virtual ::com::sun::star::uno::Reference< 80 ::com::sun::star::accessibility::XAccessible > SAL_CALL 81 getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) 82 throw ( ::com::sun::star::uno::RuntimeException ); 83 84 /** Grabs the focus to (the current cell of) the data table. */ 85 virtual void SAL_CALL grabFocus() 86 throw ( ::com::sun::star::uno::RuntimeException ); 87 88 /** @return The key bindings associated with this object. */ 89 virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding() 90 throw ( ::com::sun::star::uno::RuntimeException ); 91 92 // XAccessibleTable ------------------------------------------------------- 93 94 /** @return The description text of the specified row. */ 95 virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) 96 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 97 ::com::sun::star::uno::RuntimeException ); 98 99 /** @return The description text of the specified column. */ 100 virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) 101 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 102 ::com::sun::star::uno::RuntimeException ); 103 104 /** @return The XAccessibleTable interface of the row header bar. */ 105 virtual ::com::sun::star::uno::Reference< 106 ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL 107 getAccessibleRowHeaders() 108 throw ( ::com::sun::star::uno::RuntimeException ); 109 110 /** @return The XAccessibleTable interface of the column header bar. */ 111 virtual ::com::sun::star::uno::Reference< 112 ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL 113 getAccessibleColumnHeaders() 114 throw ( ::com::sun::star::uno::RuntimeException ); 115 116 /** @return An index list of completely selected rows. */ 117 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL 118 getSelectedAccessibleRows() 119 throw ( ::com::sun::star::uno::RuntimeException ); 120 121 /** @return An index list of completely selected columns. */ 122 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL 123 getSelectedAccessibleColumns() 124 throw ( ::com::sun::star::uno::RuntimeException ); 125 126 /** @return <TRUE/>, if the specified row is completely selected. */ 127 virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) 128 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 129 ::com::sun::star::uno::RuntimeException ); 130 131 /** @return <TRUE/>, if the specified column is completely selected. */ 132 virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) 133 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 134 ::com::sun::star::uno::RuntimeException ); 135 136 /** @return The XAccessible interface of the cell object at the specified 137 cell position. */ 138 virtual ::com::sun::star::uno::Reference< 139 ::com::sun::star::accessibility::XAccessible > SAL_CALL 140 getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) 141 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 142 ::com::sun::star::uno::RuntimeException ); 143 144 /** @return <TRUE/>, if the specified cell is selected. */ 145 virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) 146 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 147 ::com::sun::star::uno::RuntimeException ); 148 149 // XAccessibleSelection --------------------------------------------------- 150 151 /** Selects the specified child (row or column of the table). */ 152 virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) 153 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 154 ::com::sun::star::uno::RuntimeException ); 155 156 /** @return <TRUE/>, if the specified child (row/column) is selected. */ 157 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) 158 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 159 ::com::sun::star::uno::RuntimeException ); 160 161 /** Clears the complete selection. */ 162 virtual void SAL_CALL clearAccessibleSelection() 163 throw ( ::com::sun::star::uno::RuntimeException ); 164 165 /** Selects all children or first, if multiselection is not supported. */ 166 virtual void SAL_CALL selectAllAccessibleChildren() 167 throw ( ::com::sun::star::uno::RuntimeException ); 168 169 /** @return The number of selected rows/columns. */ 170 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() 171 throw ( ::com::sun::star::uno::RuntimeException ); 172 173 /** @return The specified selected row/column. */ 174 virtual ::com::sun::star::uno::Reference< 175 ::com::sun::star::accessibility::XAccessible > SAL_CALL 176 getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) 177 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 178 ::com::sun::star::uno::RuntimeException ); 179 180 /** Removes the specified row/column from the selection. */ 181 virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) 182 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 183 ::com::sun::star::uno::RuntimeException ); 184 // XInterface ------------------------------------------------------------- 185 186 /** Queries for a new interface. */ 187 ::com::sun::star::uno::Any SAL_CALL queryInterface( 188 const ::com::sun::star::uno::Type& rType ) 189 throw ( ::com::sun::star::uno::RuntimeException ); 190 191 /** Aquires the object (calls acquire() on base class). */ 192 virtual void SAL_CALL acquire() throw (); 193 194 /** Releases the object (calls release() on base class). */ 195 virtual void SAL_CALL release() throw (); 196 // XServiceInfo ----------------------------------------------------------- 197 198 /** @return The name of this class. */ 199 virtual ::rtl::OUString SAL_CALL getImplementationName() 200 throw ( ::com::sun::star::uno::RuntimeException ); 201 202 /**@return m_pCellVector*/ 203 std::vector< AccessibleGridControlTableCell* >& getCellVector(); 204 /**@return m_xAccessCellVector*/ 205 std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible > >& getAccessibleCellVector(); 206 207 protected: 208 // internal virtual methods ----------------------------------------------- 209 210 /** @attention This method requires locked mutex's and a living object. 211 @return The bounding box (VCL rect.) relative to the parent window. */ 212 virtual Rectangle implGetBoundingBox(); 213 ///** @attention This method requires locked mutex's and a living object. 214 // @return The bounding box (VCL rect.) in screen coordinates. */ 215 virtual Rectangle implGetBoundingBoxOnScreen(); 216 217 218 //// internal helper methods ------------------------------------------------ 219 ///** @attention This method requires a locked mutex. 220 // @return The XAccessibleTable interface of the specified header bar. */ 221 ::com::sun::star::uno::Reference< 222 ::com::sun::star::accessibility::XAccessibleTable > 223 implGetHeaderBar( sal_Int32 nChildIndex ) 224 throw ( ::com::sun::star::uno::RuntimeException ); 225 }; 226 227 // ============================================================================ 228 229 } // namespace accessibility 230 231 // ============================================================================ 232 233 #endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLE_HXX 234 235