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