tdf#119209: Windows share has inappropriate server suggestion
[LibreOffice.git] / include / svtools / accessibletable.hxx
blobf24e2963270a697ac1716ebdddaec040194b86f8
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_ACCESSIBLETABLE_HXX
21 #define INCLUDED_SVTOOLS_ACCESSIBLETABLE_HXX
23 #include <vcl/window.hxx>
24 #include <unotools/accessiblestatesethelper.hxx>
25 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
28 namespace svt{ namespace table
31 typedef sal_Int32 RowPos;
33 enum AccessibleTableControlObjType
35 TCTYPE_GRIDCONTROL, /// The GridControl itself.
36 TCTYPE_TABLE, /// The data table.
37 TCTYPE_ROWHEADERBAR, /// The row header bar.
38 TCTYPE_COLUMNHEADERBAR, /// The horizontal column header bar.
39 TCTYPE_TABLECELL, /// A cell of the data table.
40 TCTYPE_ROWHEADERCELL, /// A cell of the row header bar.
41 TCTYPE_COLUMNHEADERCELL, /// A cell of the column header bar.
45 /** This abstract class provides methods to implement an accessible table object.
47 class IAccessibleTable
49 public:
50 /** @return The position of the current row. */
51 virtual sal_Int32 GetCurrentRow() const = 0;
52 /** @return The position of the current column. */
53 virtual sal_Int32 GetCurrentColumn() const = 0;
54 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex )= 0;
55 virtual OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const= 0;
56 virtual void GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow )= 0;
57 virtual bool HasColHeader() = 0;
58 virtual bool HasRowHeader() = 0;
60 /** return the description of the specified object.
61 @param eObjType
62 The type to ask for
63 @return
64 The description of the specified object.
66 virtual OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType) const= 0;
68 /** Fills the StateSet with all states (except DEFUNC and SHOWING, done by
69 the accessible object), depending on the specified object type. */
70 virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet,
71 AccessibleTableControlObjType eObjType ) const= 0;
73 // Window
74 virtual tools::Rectangle GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const = 0;
75 virtual void GrabFocus()= 0;
76 virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible()= 0;
77 virtual vcl::Window* GetAccessibleParentWindow() const= 0;
78 virtual vcl::Window* GetWindowInstance()= 0;
79 virtual sal_Int32 GetAccessibleControlCount() const = 0;
80 virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )= 0;
81 virtual long GetRowCount() const= 0;
82 virtual long GetColumnCount() const= 0;
83 virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0;
84 virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar ) = 0;
85 virtual tools::Rectangle calcHeaderCellRect( bool _bColHeader, sal_Int32 _nPos ) = 0;
86 virtual tools::Rectangle calcTableRect() = 0;
87 virtual tools::Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) = 0;
88 virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)= 0;
89 virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0;
90 virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0;
91 virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
92 virtual OUString GetRowName(sal_Int32 _nIndex) const = 0;
93 virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
94 virtual OUString GetColumnName( sal_Int32 _nIndex ) const = 0;
95 virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
97 virtual sal_Int32 GetSelectedRowCount() const = 0;
98 virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const = 0;
99 virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const = 0;
100 virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) = 0;
101 virtual void SelectAllRows( bool const i_select ) = 0;
103 protected:
104 ~IAccessibleTable() {}
108 /** interface for an implementation of a table control's Accessible component
110 class IAccessibleTableControl
112 public:
113 /** returns the XAccessible object itself
115 The reference returned here can be used to control the life time of the
116 IAccessibleTableImplementation object.
118 The returned reference is guaranteed to not be <NULL/>.
120 virtual css::uno::Reference< css::accessibility::XAccessible >
121 getMyself() = 0;
123 /** disposes the accessible implementation, so that it becomes defunc
125 virtual void DisposeAccessImpl() = 0;
127 /** checks whether the accessible implementation, and its context, are still alive
128 @return <TRUE/>, if the object is not disposed or disposing.
130 virtual bool isAlive() const = 0;
132 /** commits the event at all listeners of the cell
133 @param nEventId
134 the event id
135 @param rNewValue
136 the new value
137 @param rOldValue
138 the old value
140 virtual void commitCellEvent(
141 sal_Int16 nEventId,
142 const css::uno::Any& rNewValue,
143 const css::uno::Any& rOldValue
144 ) = 0;
145 /** commits the event at all listeners of the table
146 @param nEventId
147 the event id
148 @param rNewValue
149 the new value
150 @param rOldValue
151 the old value
153 virtual void commitTableEvent(
154 sal_Int16 nEventId,
155 const css::uno::Any& rNewValue,
156 const css::uno::Any& rOldValue
157 ) = 0;
159 ///** Commits an event to all listeners. */
160 virtual void commitEvent(
161 sal_Int16 nEventId,
162 const css::uno::Any& rNewValue
163 ) = 0;
165 protected:
166 ~IAccessibleTableControl() {}
170 } // namespace table
171 } // namespace svt
173 #endif // INCLUDED_SVTOOLS_ACCESSIBLETABLE_HXX
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */