1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #ifndef _SC_ACCESSIBLETABLEBASE_HXX
22 #define _SC_ACCESSIBLETABLEBASE_HXX
24 #include "AccessibleContextBase.hxx"
26 #include "address.hxx"
27 #include <com/sun/star/accessibility/XAccessibleTable.hpp>
28 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
29 #include <cppuhelper/implbase2.hxx>
32 This base class provides an implementation of the
33 <code>AccessibleTable</code> service.
36 typedef cppu::ImplHelper2
< ::com::sun::star::accessibility::XAccessibleTable
,
37 ::com::sun::star::accessibility::XAccessibleSelection
>
38 ScAccessibleTableBaseImpl
;
40 class ScAccessibleTableBase
:
41 public ScAccessibleContextBase
,
42 public ScAccessibleTableBaseImpl
45 //===== internal ========================================================
46 ScAccessibleTableBase(
47 const ::com::sun::star::uno::Reference
<
48 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
50 const ScRange
& rRange
);
52 virtual ~ScAccessibleTableBase();
55 using ScAccessibleContextBase::disposing
;
56 virtual void SAL_CALL
disposing();
58 ///===== XInterface =====================================================
60 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
61 ::com::sun::star::uno::Type
const & rType
)
62 throw (::com::sun::star::uno::RuntimeException
);
64 virtual void SAL_CALL
acquire() throw ();
66 virtual void SAL_CALL
release() throw ();
68 ///===== XAccessibleTable ================================================
70 /// Returns the number of rows in the table.
71 virtual sal_Int32 SAL_CALL
72 getAccessibleRowCount( )
73 throw (::com::sun::star::uno::RuntimeException
);
75 /// Returns the number of columns in the table.
76 virtual sal_Int32 SAL_CALL
77 getAccessibleColumnCount( )
78 throw (::com::sun::star::uno::RuntimeException
);
80 /// Returns the description of the specified row in the table.
81 virtual OUString SAL_CALL
82 getAccessibleRowDescription( sal_Int32 nRow
)
83 throw (::com::sun::star::uno::RuntimeException
,
84 ::com::sun::star::lang::IndexOutOfBoundsException
);
86 /// Returns the description text of the specified column in the table.
87 virtual OUString SAL_CALL
88 getAccessibleColumnDescription( sal_Int32 nColumn
)
89 throw (::com::sun::star::uno::RuntimeException
,
90 ::com::sun::star::lang::IndexOutOfBoundsException
);
92 /** Returns the number of rows occupied by the Accessible at a specified row and column in the table.
93 Returns 1 if it is only a cell and the number of rows the cell is merged if the cell is a merged cell.
95 virtual sal_Int32 SAL_CALL
96 getAccessibleRowExtentAt( sal_Int32 nRow
, sal_Int32 nColumn
)
97 throw (::com::sun::star::uno::RuntimeException
,
98 ::com::sun::star::lang::IndexOutOfBoundsException
);
100 /** Returns the number of columns occupied by the Accessible at a specified row and column in the table.
101 Returns 1 if it is only a cell and the number of columns the cell is merged if the cell is a merged cell.
103 virtual sal_Int32 SAL_CALL
104 getAccessibleColumnExtentAt( sal_Int32 nRow
, sal_Int32 nColumn
)
105 throw (::com::sun::star::uno::RuntimeException
,
106 ::com::sun::star::lang::IndexOutOfBoundsException
);
108 /// Returns the row headers as an AccessibleTable.
109 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleTable
> SAL_CALL
110 getAccessibleRowHeaders( )
111 throw (::com::sun::star::uno::RuntimeException
);
113 /// Returns the column headers as an AccessibleTable.
114 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleTable
> SAL_CALL
115 getAccessibleColumnHeaders( )
116 throw (::com::sun::star::uno::RuntimeException
);
118 /// Returns the selected rows in a table.
119 virtual ::com::sun::star::uno::Sequence
< sal_Int32
> SAL_CALL
120 getSelectedAccessibleRows( )
121 throw (::com::sun::star::uno::RuntimeException
);
123 /// Returns the selected columns in a table.
124 virtual ::com::sun::star::uno::Sequence
< sal_Int32
> SAL_CALL
125 getSelectedAccessibleColumns( )
126 throw (::com::sun::star::uno::RuntimeException
);
128 /// Returns a boolean value indicating whether the specified row is selected.
129 virtual sal_Bool SAL_CALL
130 isAccessibleRowSelected( sal_Int32 nRow
)
131 throw (::com::sun::star::uno::RuntimeException
,
132 ::com::sun::star::lang::IndexOutOfBoundsException
);
134 /// Returns a boolean value indicating whether the specified column is selected.
135 virtual sal_Bool SAL_CALL
136 isAccessibleColumnSelected( sal_Int32 nColumn
)
137 throw (::com::sun::star::uno::RuntimeException
,
138 ::com::sun::star::lang::IndexOutOfBoundsException
);
140 /// Returns the Accessible at a specified row and column in the table.
141 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
142 getAccessibleCellAt( sal_Int32 nRow
, sal_Int32 nColumn
)
143 throw (::com::sun::star::uno::RuntimeException
,
144 ::com::sun::star::lang::IndexOutOfBoundsException
);
146 /// Returns the caption for the table.
147 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
148 getAccessibleCaption( )
149 throw (::com::sun::star::uno::RuntimeException
);
151 /// Returns the summary description of the table.
152 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
153 getAccessibleSummary( )
154 throw (::com::sun::star::uno::RuntimeException
);
156 /// Returns a boolean value indicating whether the accessible at a specified row and column is selected.
157 virtual sal_Bool SAL_CALL
158 isAccessibleSelected( sal_Int32 nRow
, sal_Int32 nColumn
)
159 throw (::com::sun::star::uno::RuntimeException
,
160 ::com::sun::star::lang::IndexOutOfBoundsException
);
162 ///===== XAccessibleExtendedTable ========================================
164 /// Returns the index of the cell on the given position.
165 virtual sal_Int32 SAL_CALL
166 getAccessibleIndex( sal_Int32 nRow
, sal_Int32 nColumn
)
167 throw (::com::sun::star::uno::RuntimeException
,
168 ::com::sun::star::lang::IndexOutOfBoundsException
);
170 /// Returns the row number of an index in the table.
171 virtual sal_Int32 SAL_CALL
172 getAccessibleRow( sal_Int32 nChildIndex
)
173 throw (::com::sun::star::uno::RuntimeException
,
174 ::com::sun::star::lang::IndexOutOfBoundsException
);
176 /// Returns the column number of an index in the table.
177 virtual sal_Int32 SAL_CALL
178 getAccessibleColumn( sal_Int32 nChildIndex
)
179 throw (::com::sun::star::uno::RuntimeException
,
180 ::com::sun::star::lang::IndexOutOfBoundsException
);
182 //===== XAccessibleContext ==============================================
184 /// Return the number of currently visible children.
185 // is overloaded to calculate this on demand
186 virtual sal_Int32 SAL_CALL
187 getAccessibleChildCount(void)
188 throw (::com::sun::star::uno::RuntimeException
);
190 /// Return the specified child or NULL if index is invalid.
191 // is overloaded to calculate this on demand
192 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
193 getAccessibleChild(sal_Int32 nIndex
)
194 throw (::com::sun::star::uno::RuntimeException
,
195 ::com::sun::star::lang::IndexOutOfBoundsException
);
198 /// Return this object's description.
199 virtual OUString SAL_CALL
200 createAccessibleDescription(void)
201 throw (::com::sun::star::uno::RuntimeException
);
203 /// Return the object's current name.
204 virtual OUString SAL_CALL
205 createAccessibleName(void)
206 throw (::com::sun::star::uno::RuntimeException
);
209 /// Return NULL to indicate that an empty relation set.
210 virtual ::com::sun::star::uno::Reference
<
211 ::com::sun::star::accessibility::XAccessibleRelationSet
> SAL_CALL
212 getAccessibleRelationSet(void)
213 throw (::com::sun::star::uno::RuntimeException
);
215 /// Return the set of current states.
216 // perhaps sometimes to be implemented
217 virtual ::com::sun::star::uno::Reference
<
218 ::com::sun::star::accessibility::XAccessibleStateSet
> SAL_CALL
219 getAccessibleStateSet(void)
220 throw (::com::sun::star::uno::RuntimeException
);
222 ///===== XAccessibleSelection ===========================================
224 virtual void SAL_CALL
225 selectAccessibleChild( sal_Int32 nChildIndex
)
226 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
227 ::com::sun::star::uno::RuntimeException
);
229 virtual sal_Bool SAL_CALL
230 isAccessibleChildSelected( sal_Int32 nChildIndex
)
231 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
232 ::com::sun::star::uno::RuntimeException
);
234 virtual void SAL_CALL
235 clearAccessibleSelection( )
236 throw (::com::sun::star::uno::RuntimeException
);
238 virtual void SAL_CALL
239 selectAllAccessibleChildren( )
240 throw (::com::sun::star::uno::RuntimeException
);
242 virtual sal_Int32 SAL_CALL
243 getSelectedAccessibleChildCount( )
244 throw (::com::sun::star::uno::RuntimeException
);
246 virtual ::com::sun::star::uno::Reference
<
247 ::com::sun::star::accessibility::XAccessible
> SAL_CALL
248 getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex
)
249 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
250 ::com::sun::star::uno::RuntimeException
);
252 virtual void SAL_CALL
253 deselectAccessibleChild( sal_Int32 nSelectedChildIndex
)
254 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
255 ::com::sun::star::uno::RuntimeException
);
257 ///===== XServiceInfo ===================================================
259 /** Returns an identifier for the implementation of this object.
261 virtual OUString SAL_CALL
262 getImplementationName(void)
263 throw (::com::sun::star::uno::RuntimeException
);
265 ///===== XTypeProvider ===================================================
267 /// returns the possible types
268 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
270 throw (::com::sun::star::uno::RuntimeException
);
272 /** Returns a implementation id.
274 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
275 getImplementationId(void)
276 throw (::com::sun::star::uno::RuntimeException
);
279 /// contains the range of the table, because it could be a subrange of the complete table
284 void CommitTableModelChange(sal_Int32 nStartRow
, sal_Int32 nStartCol
, sal_Int32 nEndRow
, sal_Int32 nEndCol
, sal_uInt16 nId
);
290 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */