tdf#119209: Windows share has inappropriate server suggestion
[LibreOffice.git] / include / svtools / accessibletableprovider.hxx
blob094c4a16fb2798ea2b846e2771707b704339e425
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_SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
21 #define INCLUDED_SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
23 #include <vcl/window.hxx>
24 #include <unotools/accessiblestatesethelper.hxx>
25 #include <svtools/AccessibleBrowseBoxObjType.hxx>
26 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
29 namespace svt
32 #define OFFSET_DEFAULT (sal_Int32(-1))
33 #define OFFSET_NONE (sal_Int32(0))
35 enum AccessibleTableChildIndex
37 /** Child index of the column header bar (first row). Exists always. */
38 BBINDEX_COLUMNHEADERBAR = 0,
39 /** Child index of the row header bar ("handle column"). Exists always. */
40 BBINDEX_ROWHEADERBAR = 1,
41 /** Child index of the data table. */
42 BBINDEX_TABLE = 2,
43 /** Child index of the first additional control. */
44 BBINDEX_FIRSTCONTROL = 3
48 /** This abstract class provides methods to implement an accessible table object.
50 class IAccessibleTableProvider
52 public:
53 /** @return The count of the rows. */
54 virtual long GetRowCount() const = 0;
55 /** @return The count of the columns. */
56 virtual sal_uInt16 GetColumnCount() const = 0;
58 /** @return The position of the current row. */
59 virtual sal_Int32 GetCurrRow() const = 0;
60 /** @return The position of the current column. */
61 virtual sal_uInt16 GetCurrColumn() const = 0;
63 /** @return The description of a row.
64 @param _nRow The row which description is in demand. */
65 virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
66 /** @return The description of a column.
67 @param _nColumn The column which description is in demand. */
68 virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
70 /** @return <TRUE/>, if the object has a row header. */
71 virtual bool HasRowHeader() const = 0; //GetColumnId
72 virtual bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
74 virtual void SetNoSelection() = 0;
75 virtual void SelectAll() = 0;
76 virtual void SelectRow( long _nRow, bool _bSelect = true, bool bExpand = true ) = 0;
77 virtual void SelectColumn( sal_uInt16 _nColumnPos, bool _bSelect = true ) = 0;
78 virtual sal_Int32 GetSelectedRowCount() const = 0;
79 virtual sal_Int32 GetSelectedColumnCount() const = 0;
80 /** @return <TRUE/>, if the row is selected. */
81 virtual bool IsRowSelected( long _nRow ) const = 0;
82 virtual bool IsColumnSelected( long _nColumnPos ) const = 0;
83 virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const = 0;
84 virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const = 0;
86 /** @return <TRUE/>, if the cell is visible. */
87 virtual bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
88 virtual OUString GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const = 0;
90 virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar, bool _bOnScreen = true ) = 0;
91 virtual tools::Rectangle calcTableRect( bool _bOnScreen = true ) = 0;
92 virtual tools::Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumnPos, bool _bIsHeader, bool _bOnScreen = true ) = 0;
94 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
95 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow ) = 0;
96 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) = 0;
98 virtual sal_Int32 GetAccessibleControlCount() const = 0;
99 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex ) = 0;
100 virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) = 0;
102 virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
103 virtual bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint ) = 0;
104 virtual bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
106 virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
107 virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
109 virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const = 0;
110 virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
111 virtual void GrabTableFocus() = 0;
113 // OutputDevice
114 virtual bool GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, MetricVector& rVector ) = 0;
116 // Window
117 virtual tools::Rectangle GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const = 0;
118 virtual void GrabFocus() = 0;
119 virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() = 0;
120 virtual vcl::Window* GetAccessibleParentWindow() const = 0;
121 virtual vcl::Window* GetWindowInstance() = 0;
123 virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) = 0;
124 virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) = 0;
126 protected:
127 ~IAccessibleTableProvider() {}
131 /** interface for an implementation of a table control's Accessible component
133 class IAccessibleTabListBox
135 public:
136 /** returns the XAccessible object itself
138 The reference returned here can be used to control the life time of the
139 IAccessibleTableImplementation object.
141 The returned reference is guaranteed to not be <NULL/>.
143 virtual css::uno::Reference< css::accessibility::XAccessible >
144 getMyself() = 0;
146 /** returns the accessible object for the column header bar
148 virtual css::uno::Reference< css::accessibility::XAccessible >
149 getHeaderBar() = 0;
151 protected:
152 ~IAccessibleTabListBox() {}
155 /** interface for an implementation of a browse box's Accessible component
157 class IAccessibleBrowseBox
159 public:
160 /** returns the XAccessible object itself
162 The reference returned here can be used to control the life time of the
163 IAccessibleTableImplementation object.
165 The returned reference is guaranteed to not be <NULL/>.
167 virtual css::uno::Reference< css::accessibility::XAccessible >
168 getMyself() = 0;
170 /** disposes the accessible implementation, so that it becomes defunc
172 virtual void dispose() = 0;
174 /** checks whether the accessible implementation, and its context, are still alive
175 @return <TRUE/>, if the object is not disposed or disposing.
177 virtual bool isAlive() const = 0;
179 /** returns the accessible object for the row or the column header bar
181 virtual css::uno::Reference< css::accessibility::XAccessible >
182 getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) = 0;
184 /** returns the accessible object for the table representation
186 virtual css::uno::Reference< css::accessibility::XAccessible >
187 getTable() = 0;
189 /** commits the event at all listeners of the column/row header bar
190 @param nEventId
191 the event id
192 @param rNewValue
193 the new value
194 @param rOldValue
195 the old value
197 virtual void commitHeaderBarEvent(
198 sal_Int16 nEventId,
199 const css::uno::Any& rNewValue,
200 const css::uno::Any& rOldValue,
201 bool _bColumnHeaderBar
202 ) = 0;
204 /** commits the event at all listeners of the table
205 @param nEventId
206 the event id
207 @param rNewValue
208 the new value
209 @param rOldValue
210 the old value
212 virtual void commitTableEvent(
213 sal_Int16 nEventId,
214 const css::uno::Any& rNewValue,
215 const css::uno::Any& rOldValue
216 ) = 0;
218 /** Commits an event to all listeners. */
219 virtual void commitEvent(
220 sal_Int16 nEventId,
221 const css::uno::Any& rNewValue,
222 const css::uno::Any& rOldValue
223 ) = 0;
225 protected:
226 ~IAccessibleBrowseBox() {}
230 } // namespace svt
233 #endif // INCLUDED_SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
235 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */