Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / accessibility / inc / extended / AccessibleGridControlTable.hxx
blob18627c22e021cc3a4a3fafb7f619140abe677a5c
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 .
21 #ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLE_HXX
22 #define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLE_HXX
24 #include <extended/AccessibleGridControlTableBase.hxx>
25 #include <cppuhelper/implbase1.hxx>
26 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
27 #include <extended/AccessibleGridControlTableCell.hxx>
30 namespace accessibility {
33 typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleSelection >
34 AccessibleGridControlTableSelectionImplHelper;
35 /** This class represents the accessible object of the data table of a
36 Grid control. */
37 class AccessibleGridControlTable final : public AccessibleGridControlTableBase,
38 public AccessibleGridControlTableSelectionImplHelper
40 public:
41 AccessibleGridControlTable(
42 const css::uno::Reference< css::accessibility::XAccessible >& rxParent,
43 ::svt::table::IAccessibleTable& rTable);
45 private:
46 virtual ~AccessibleGridControlTable() override = default;
47 std::vector< AccessibleGridControlTableCell* > m_pCellVector;
48 std::vector< css::uno::Reference< css::accessibility::XAccessible> > m_pAccessCellVector;
49 public:
50 // XAccessibleContext
52 /** @return The XAccessible interface of the specified child. */
53 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
54 getAccessibleChild( sal_Int32 nChildIndex ) override;
56 /** @return The index of this object among the parent's children. */
57 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override;
59 // XAccessibleComponent
61 /** @return The accessible child rendered under the given point. */
62 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
63 getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
65 /** Grabs the focus to (the current cell of) the data table. */
66 virtual void SAL_CALL grabFocus() override;
68 // XAccessibleTable
70 /** @return The description text of the specified row. */
71 virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) override;
73 /** @return The description text of the specified column. */
74 virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) override;
76 /** @return The XAccessibleTable interface of the row header bar. */
77 virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
78 getAccessibleRowHeaders() override;
80 /** @return The XAccessibleTable interface of the column header bar. */
81 virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
82 getAccessibleColumnHeaders() override;
84 /** @return An index list of completely selected rows. */
85 virtual css::uno::Sequence< sal_Int32 > SAL_CALL
86 getSelectedAccessibleRows() override;
88 /** @return An index list of completely selected columns. */
89 virtual css::uno::Sequence< sal_Int32 > SAL_CALL
90 getSelectedAccessibleColumns() override;
92 /** @return TRUE, if the specified row is completely selected. */
93 virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) override;
95 /** @return TRUE, if the specified column is completely selected. */
96 virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) override;
98 /** @return The XAccessible interface of the cell object at the specified
99 cell position. */
100 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
101 getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
103 /** @return TRUE, if the specified cell is selected. */
104 virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override;
106 // XAccessibleSelection
108 /** Selects the specified child (row or column of the table). */
109 virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) override;
111 /** @return TRUE, if the specified child (row/column) is selected. */
112 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) override;
114 /** Clears the complete selection. */
115 virtual void SAL_CALL clearAccessibleSelection() override;
117 /** Selects all children or first, if multiselection is not supported. */
118 virtual void SAL_CALL selectAllAccessibleChildren() override;
120 /** @return The number of selected rows/columns. */
121 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override;
123 /** @return The specified selected row/column. */
124 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
125 getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override;
127 /** Removes the specified row/column from the selection. */
128 virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) override;
129 // XInterface
131 /** Queries for a new interface. */
132 css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override;
134 /** Acquires the object (calls acquire() on base class). */
135 virtual void SAL_CALL acquire() throw () override;
137 /** Releases the object (calls release() on base class). */
138 virtual void SAL_CALL release() throw () override;
139 // XServiceInfo
141 /** @return The name of this class. */
142 virtual OUString SAL_CALL getImplementationName() override;
144 /**@return m_pCellVector*/
145 std::vector< AccessibleGridControlTableCell* >& getCellVector() { return m_pCellVector;}
146 /**@return m_xAccessCellVector*/
147 std::vector< css::uno::Reference< css::accessibility::XAccessible > >& getAccessibleCellVector() { return m_pAccessCellVector;}
149 private:
150 // internal virtual methods
152 /** @attention This method requires locked mutex's and a living object.
153 @return The bounding box (VCL rect.) relative to the parent window. */
154 virtual tools::Rectangle implGetBoundingBox() override;
155 ///** @attention This method requires locked mutex's and a living object.
156 // @return The bounding box (VCL rect.) in screen coordinates. */
157 virtual tools::Rectangle implGetBoundingBoxOnScreen() override;
160 //// internal helper methods
161 ///** @attention This method requires a locked mutex.
162 // @return The XAccessibleTable interface of the specified header bar. */
163 /// @throws css::uno::RuntimeException
164 css::uno::Reference< css::accessibility::XAccessibleTable >
165 implGetHeaderBar( sal_Int32 nChildIndex );
169 } // namespace accessibility
172 #endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLE_HXX
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */