Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / vcl / accessibletableprovider.hxx
blob94e5d85832d109ce06e1b6b56227f8428c21bbc1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_VCL_ACCESSIBLETABLEPROVIDER_HXX
21 #define INCLUDED_VCL_ACCESSIBLETABLEPROVIDER_HXX
23 #include <vcl/AccessibleBrowseBoxObjType.hxx>
24 #include <vcl/window.hxx>
26 namespace com::sun::star::accessibility { class XAccessible; }
28 namespace vcl
31 #define OFFSET_DEFAULT (sal_Int32(-1))
32 #define OFFSET_NONE (sal_Int32(0))
34 enum AccessibleTableChildIndex
36 /** Child index of the column header bar (first row). Exists always. */
37 BBINDEX_COLUMNHEADERBAR = 0,
38 /** Child index of the row header bar ("handle column"). Exists always. */
39 BBINDEX_ROWHEADERBAR = 1,
40 /** Child index of the data table. */
41 BBINDEX_TABLE = 2,
42 /** Child index of the first additional control. */
43 BBINDEX_FIRSTCONTROL = 3
47 /** This abstract class provides methods to implement an accessible table object.
49 class IAccessibleTableProvider
51 public:
52 /** @return The count of the rows. */
53 virtual sal_Int32 GetRowCount() const = 0;
54 /** @return The count of the columns. */
55 virtual sal_uInt16 GetColumnCount() const = 0;
57 /** @return The position of the current row. */
58 virtual sal_Int32 GetCurrRow() const = 0;
59 /** @return The position of the current column. */
60 virtual sal_uInt16 GetCurrColumn() const = 0;
62 /** @return The description of a row.
63 @param _nRow The row which description is in demand. */
64 virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
65 /** @return The description of a column.
66 @param _nColumn The column which description is in demand. */
67 virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
69 /** @return <TRUE/>, if the object has a row header. */
70 virtual bool HasRowHeader() const = 0; //GetColumnId
71 virtual bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
73 virtual void SetNoSelection() = 0;
74 virtual void SelectAll() = 0;
75 virtual void SelectRow( sal_Int32 _nRow, bool _bSelect = true, bool bExpand = true ) = 0;
76 virtual void SelectColumn( sal_uInt16 _nColumnPos, bool _bSelect = true ) = 0;
77 virtual sal_Int32 GetSelectedRowCount() const = 0;
78 virtual sal_Int32 GetSelectedColumnCount() const = 0;
79 /** @return <TRUE/>, if the row is selected. */
80 virtual bool IsRowSelected( sal_Int32 _nRow ) const = 0;
81 virtual bool IsColumnSelected( sal_Int32 _nColumnPos ) const = 0;
82 virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const = 0;
83 virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const = 0;
85 /** @return <TRUE/>, if the cell is visible. */
86 virtual bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
87 virtual OUString GetAccessibleCellText( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
89 virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar, bool _bOnScreen = true ) = 0;
90 virtual tools::Rectangle calcTableRect( bool _bOnScreen = true ) = 0;
91 virtual tools::Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumnPos, bool _bIsHeader, bool _bOnScreen = true ) = 0;
93 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
94 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow ) = 0;
95 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) = 0;
97 virtual sal_Int32 GetAccessibleControlCount() const = 0;
98 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex ) = 0;
99 virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) = 0;
101 virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
102 virtual bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint ) = 0;
103 virtual bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
105 virtual OUString GetAccessibleObjectName( AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
106 virtual OUString GetAccessibleObjectDescription( AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
108 virtual void FillAccessibleStateSet( sal_Int64& _rStateSet, AccessibleBrowseBoxObjType _eType ) const = 0;
109 virtual void FillAccessibleStateSetForCell( sal_Int64& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
110 virtual void GrabTableFocus() = 0;
112 // OutputDevice
113 virtual bool GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, std::vector< tools::Rectangle >& rVector ) = 0;
115 // Window
116 virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const = 0;
117 virtual void GrabFocus() = 0;
118 virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() = 0;
119 virtual vcl::Window* GetAccessibleParentWindow() const = 0;
120 virtual vcl::Window* GetWindowInstance() = 0;
122 virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) = 0;
123 virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) = 0;
125 protected:
126 ~IAccessibleTableProvider() {}
130 /** interface for an implementation of a table control's Accessible component
132 class IAccessibleTabListBox
134 public:
135 /** returns the XAccessible object itself
137 The reference returned here can be used to control the life time of the
138 IAccessibleTableImplementation object.
140 The returned reference is guaranteed to not be <NULL/>.
142 virtual css::uno::Reference< css::accessibility::XAccessible >
143 getMyself() = 0;
145 /** returns the accessible object for the column header bar
147 virtual css::uno::Reference< css::accessibility::XAccessible >
148 getHeaderBar() = 0;
150 protected:
151 ~IAccessibleTabListBox() {}
154 /** interface for an implementation of a browse box's Accessible component
156 class IAccessibleBrowseBox
158 public:
159 /** returns the XAccessible object itself
161 The reference returned here can be used to control the life time of the
162 IAccessibleTableImplementation object.
164 The returned reference is guaranteed to not be <NULL/>.
166 virtual css::uno::Reference< css::accessibility::XAccessible >
167 getMyself() = 0;
169 /** disposes the accessible implementation, so that it becomes defunc
171 virtual void dispose() = 0;
173 /** checks whether the accessible implementation, and its context, are still alive
174 @return <TRUE/>, if the object is not disposed or disposing.
176 virtual bool isAlive() const = 0;
178 /** returns the accessible object for the row or the column header bar
180 virtual css::uno::Reference< css::accessibility::XAccessible >
181 getHeaderBar( AccessibleBrowseBoxObjType _eObjType ) = 0;
183 /** returns the accessible object for the table representation
185 virtual css::uno::Reference< css::accessibility::XAccessible >
186 getTable() = 0;
188 /** commits the event at all listeners of the column/row header bar
189 @param nEventId
190 the event id
191 @param rNewValue
192 the new value
193 @param rOldValue
194 the old value
196 virtual void commitHeaderBarEvent(
197 sal_Int16 nEventId,
198 const css::uno::Any& rNewValue,
199 const css::uno::Any& rOldValue,
200 bool _bColumnHeaderBar
201 ) = 0;
203 /** commits the event at all listeners of the table
204 @param nEventId
205 the event id
206 @param rNewValue
207 the new value
208 @param rOldValue
209 the old value
211 virtual void commitTableEvent(
212 sal_Int16 nEventId,
213 const css::uno::Any& rNewValue,
214 const css::uno::Any& rOldValue
215 ) = 0;
217 /** Commits an event to all listeners. */
218 virtual void commitEvent(
219 sal_Int16 nEventId,
220 const css::uno::Any& rNewValue,
221 const css::uno::Any& rOldValue
222 ) = 0;
224 protected:
225 ~IAccessibleBrowseBox() {}
228 } // namespace vcl
230 #endif // INCLUDED_VCL_ACCESSIBLETABLEPROVIDER_HXX
232 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */