xref: /AOO41X/main/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx (revision a462bbb78c0111848099221503583b85b642c10e)
1*a462bbb7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*a462bbb7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*a462bbb7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*a462bbb7SAndrew Rist  * distributed with this work for additional information
6*a462bbb7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*a462bbb7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*a462bbb7SAndrew Rist  * "License"); you may not use this file except in compliance
9*a462bbb7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*a462bbb7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*a462bbb7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*a462bbb7SAndrew Rist  * software distributed under the License is distributed on an
15*a462bbb7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*a462bbb7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*a462bbb7SAndrew Rist  * specific language governing permissions and limitations
18*a462bbb7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*a462bbb7SAndrew Rist  *************************************************************/
21*a462bbb7SAndrew Rist 
22*a462bbb7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #ifndef ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLE_HXX
26cdf0e10cSrcweir #define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLE_HXX
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "accessibility/extended/AccessibleGridControlTableBase.hxx"
29cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
30cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
31cdf0e10cSrcweir #include <accessibility/extended/AccessibleGridControlTableCell.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir // ============================================================================
34cdf0e10cSrcweir 
35cdf0e10cSrcweir namespace accessibility {
36cdf0e10cSrcweir 
37cdf0e10cSrcweir // ============================================================================
38cdf0e10cSrcweir typedef ::cppu::ImplHelper1<
39cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessibleSelection >
40cdf0e10cSrcweir         AccessibleGridControlTableImplHelper1;
41cdf0e10cSrcweir /** This class represents the accessible object of the data table of a
42cdf0e10cSrcweir     Grid control. */
43cdf0e10cSrcweir class AccessibleGridControlTable : public AccessibleGridControlTableBase,
44cdf0e10cSrcweir 								public AccessibleGridControlTableImplHelper1
45cdf0e10cSrcweir {
46cdf0e10cSrcweir public:
47cdf0e10cSrcweir     AccessibleGridControlTable(
48cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
49cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessible >& rxParent,
50cdf0e10cSrcweir 			::svt::table::IAccessibleTable& rTable,
51cdf0e10cSrcweir 			::svt::table::AccessibleTableControlObjType _eType);
52cdf0e10cSrcweir 
53cdf0e10cSrcweir protected:
54cdf0e10cSrcweir     virtual ~AccessibleGridControlTable();
55cdf0e10cSrcweir private:
56cdf0e10cSrcweir 	std::vector< AccessibleGridControlTableCell* > m_pCellVector;
57cdf0e10cSrcweir 	std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible> > m_pAccessCellVector;
58cdf0e10cSrcweir public:
59cdf0e10cSrcweir     // XAccessibleContext -----------------------------------------------------
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     /** @return  The XAccessible interface of the specified child. */
62cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
63cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible > SAL_CALL
64cdf0e10cSrcweir     getAccessibleChild( sal_Int32 nChildIndex )
65cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
66cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     /** @return  The index of this object among the parent's children. */
69cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleIndexInParent()
70cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     // XAccessibleComponent ---------------------------------------------------
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     /** @return  The accessible child rendered under the given point. */
75cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
76cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible > SAL_CALL
77cdf0e10cSrcweir     getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint )
78cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     /** Grabs the focus to (the current cell of) the data table. */
81cdf0e10cSrcweir     virtual void SAL_CALL grabFocus()
82cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     /** @return  The key bindings associated with this object. */
85cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding()
86cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     // XAccessibleTable -------------------------------------------------------
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     /** @return  The description text of the specified row. */
91cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow )
92cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
93cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     /** @return  The description text of the specified column. */
96cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn )
97cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
98cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     /** @return  The XAccessibleTable interface of the row header bar. */
101cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
102cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL
103cdf0e10cSrcweir     getAccessibleRowHeaders()
104cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     /** @return  The XAccessibleTable interface of the column header bar. */
107cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
108cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL
109cdf0e10cSrcweir     getAccessibleColumnHeaders()
110cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     /** @return  An index list of completely selected rows. */
113cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
114cdf0e10cSrcweir     getSelectedAccessibleRows()
115cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     /** @return  An index list of completely selected columns. */
118cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
119cdf0e10cSrcweir     getSelectedAccessibleColumns()
120cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     /** @return  <TRUE/>, if the specified row is completely selected. */
123cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow )
124cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
125cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     /** @return  <TRUE/>, if the specified column is completely selected. */
128cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn )
129cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
130cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
131cdf0e10cSrcweir 
132cdf0e10cSrcweir     /** @return The XAccessible interface of the cell object at the specified
133cdf0e10cSrcweir                 cell position. */
134cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
135cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible > SAL_CALL
136cdf0e10cSrcweir     getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
137cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
138cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     /** @return  <TRUE/>, if the specified cell is selected. */
141cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
142cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
143cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     // XAccessibleSelection ---------------------------------------------------
146cdf0e10cSrcweir 
147cdf0e10cSrcweir     /** Selects the specified child (row or column of the table). */
148cdf0e10cSrcweir     virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex )
149cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
150cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     /** @return  <TRUE/>, if the specified child (row/column) is selected. */
153cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex )
154cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
155cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
156cdf0e10cSrcweir 
157cdf0e10cSrcweir     /** Clears the complete selection. */
158cdf0e10cSrcweir     virtual void SAL_CALL clearAccessibleSelection()
159cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
160cdf0e10cSrcweir 
161cdf0e10cSrcweir     /** Selects all children or first, if multiselection is not supported. */
162cdf0e10cSrcweir     virtual void SAL_CALL selectAllAccessibleChildren()
163cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
164cdf0e10cSrcweir 
165cdf0e10cSrcweir     /** @return  The number of selected rows/columns. */
166cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount()
167cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
168cdf0e10cSrcweir 
169cdf0e10cSrcweir     /** @return  The specified selected row/column. */
170cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
171cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible > SAL_CALL
172cdf0e10cSrcweir     getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
173cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
174cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
175cdf0e10cSrcweir 
176cdf0e10cSrcweir     /** Removes the specified row/column from the selection. */
177cdf0e10cSrcweir     virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex )
178cdf0e10cSrcweir         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
179cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
180cdf0e10cSrcweir 	 // XInterface -------------------------------------------------------------
181cdf0e10cSrcweir 
182cdf0e10cSrcweir     /** Queries for a new interface. */
183cdf0e10cSrcweir     ::com::sun::star::uno::Any SAL_CALL queryInterface(
184cdf0e10cSrcweir             const ::com::sun::star::uno::Type& rType )
185cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
186cdf0e10cSrcweir 
187cdf0e10cSrcweir     /** Aquires the object (calls acquire() on base class). */
188cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw ();
189cdf0e10cSrcweir 
190cdf0e10cSrcweir     /** Releases the object (calls release() on base class). */
191cdf0e10cSrcweir     virtual void SAL_CALL release() throw ();
192cdf0e10cSrcweir     // XServiceInfo -----------------------------------------------------------
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     /** @return  The name of this class. */
195cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName()
196cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
197cdf0e10cSrcweir 
198cdf0e10cSrcweir     /**@return m_pCellVector*/
199cdf0e10cSrcweir     std::vector< AccessibleGridControlTableCell* >& getCellVector();
200cdf0e10cSrcweir     /**@return m_xAccessCellVector*/
201cdf0e10cSrcweir     std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible > >& getAccessibleCellVector();
202cdf0e10cSrcweir 
203cdf0e10cSrcweir protected:
204cdf0e10cSrcweir     // internal virtual methods -----------------------------------------------
205cdf0e10cSrcweir 
206cdf0e10cSrcweir     /** @attention  This method requires locked mutex's and a living object.
207cdf0e10cSrcweir         @return  The bounding box (VCL rect.) relative to the parent window. */
208cdf0e10cSrcweir     virtual Rectangle implGetBoundingBox();
209cdf0e10cSrcweir     ///** @attention  This method requires locked mutex's and a living object.
210cdf0e10cSrcweir     //    @return  The bounding box (VCL rect.) in screen coordinates. */
211cdf0e10cSrcweir     virtual Rectangle implGetBoundingBoxOnScreen();
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 
214cdf0e10cSrcweir     //// internal helper methods ------------------------------------------------
215cdf0e10cSrcweir     ///** @attention  This method requires a locked mutex.
216cdf0e10cSrcweir     //    @return  The XAccessibleTable interface of the specified header bar. */
217cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
218cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessibleTable >
219cdf0e10cSrcweir     implGetHeaderBar( sal_Int32 nChildIndex )
220cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
221cdf0e10cSrcweir };
222cdf0e10cSrcweir 
223cdf0e10cSrcweir // ============================================================================
224cdf0e10cSrcweir 
225cdf0e10cSrcweir } // namespace accessibility
226cdf0e10cSrcweir 
227cdf0e10cSrcweir // ============================================================================
228cdf0e10cSrcweir 
229cdf0e10cSrcweir #endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLE_HXX
230cdf0e10cSrcweir 
231