[Tizen][AT-SPI] Add Table and TableCell interfaces
[platform/core/uifw/dali-adaptor.git] / dali / internal / accessibility / bridge / bridge-table.h
1 #ifndef DALI_INTERNAL_ACCESSIBILITY_BRIDGE_TABLE_H
2 #define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_TABLE_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/devel-api/atspi-interfaces/table.h>
23 #include <dali/internal/accessibility/bridge/bridge-base.h>
24
25 /**
26  * @brief The BridgeTable class contains glue code for Accessibility::Table.
27  */
28 class BridgeTable : public virtual BridgeBase
29 {
30 protected:
31   BridgeTable() = default;
32
33   /**
34    * @brief Registers Table methods as a DBus interface.
35    */
36   void RegisterInterfaces();
37
38   /**
39    * @brief Returns the Table object of the currently executed DBus method call.
40    *
41    * @return The Table object
42    */
43   Dali::Accessibility::Table* FindSelf() const;
44
45 public:
46   using RowColumnSpanType = DBus::ValueOrError<
47     bool,         // success
48     std::int32_t, // row
49     std::int32_t, // column
50     std::int32_t, // rowSpan
51     std::int32_t, // columnSpan
52     bool          // isSelected
53     >;
54
55   /**
56    * @copydoc Dali::Accessibility::Table::GetRowCount()
57    */
58   DBus::ValueOrError<std::int32_t> GetRowCount();
59
60   /**
61    * @copydoc Dali::Accessibility::Table::GetColumnCount()
62    */
63   DBus::ValueOrError<std::int32_t> GetColumnCount();
64
65   /**
66    * @copydoc Dali::Accessibility::Table::GetSelectedRowCount()
67    */
68   DBus::ValueOrError<std::int32_t> GetSelectedRowCount();
69
70   /**
71    * @copydoc Dali::Accessibility::Table::GetSelectedColumnCount()
72    */
73   DBus::ValueOrError<std::int32_t> GetSelectedColumnCount();
74
75   /**
76    * @copydoc Dali::Accessibility::Table::GetCaption()
77    */
78   DBus::ValueOrError<Dali::Accessibility::Accessible*> GetCaption();
79
80   /**
81    * @copydoc Dali::Accessibility::Table::GetSummary()
82    */
83   DBus::ValueOrError<Dali::Accessibility::Accessible*> GetSummary();
84
85   /**
86    * @copydoc Dali::Accessibility::Table::GetCell()
87    */
88   DBus::ValueOrError<Dali::Accessibility::Accessible*> GetCell(std::int32_t row, std::int32_t column);
89
90   /**
91    * @copydoc Dali::Accessibility::Table::GetChildIndex()
92    */
93   DBus::ValueOrError<std::int32_t> GetChildIndex(std::int32_t row, std::int32_t column);
94
95   /**
96    * @copydoc Dali::Accessibility::Table::GetRowByChildIndex()
97    */
98   DBus::ValueOrError<std::int32_t> GetRowByChildIndex(std::int32_t childIndex);
99
100   /**
101    * @copydoc Dali::Accessibility::Table::GetColumnByChildIndex()
102    */
103   DBus::ValueOrError<std::int32_t> GetColumnByChildIndex(std::int32_t childIndex);
104
105   /**
106    * @copydoc Dali::Accessibility::Table::GetRowDescription()
107    */
108   DBus::ValueOrError<std::string> GetRowDescription(std::int32_t row);
109
110   /**
111    * @copydoc Dali::Accessibility::Table::GetColumnDescription()
112    */
113   DBus::ValueOrError<std::string> GetColumnDescription(std::int32_t column);
114
115   /**
116    * @copydoc Dali::Accessibility::Table::GetRowSpan()
117    */
118   DBus::ValueOrError<std::int32_t> GetRowSpan(std::int32_t row, std::int32_t column);
119
120   /**
121    * @copydoc Dali::Accessibility::Table::GetColumnSpan()
122    */
123   DBus::ValueOrError<std::int32_t> GetColumnSpan(std::int32_t row, std::int32_t column);
124
125   /**
126    * @copydoc Dali::Accessibility::Table::GetRowHeader()
127    */
128   DBus::ValueOrError<Dali::Accessibility::Accessible*> GetRowHeader(std::int32_t row);
129
130   /**
131    * @copydoc Dali::Accessibility::Table::GetColumnHeader()
132    */
133   DBus::ValueOrError<Dali::Accessibility::Accessible*> GetColumnHeader(std::int32_t column);
134
135   /**
136    * @copydoc Dali::Accessibility::Table::GetSelectedRows()
137    */
138   DBus::ValueOrError<std::vector<std::int32_t>> GetSelectedRows();
139
140   /**
141    * @copydoc Dali::Accessibility::Table::GetSelectedColumns()
142    */
143   DBus::ValueOrError<std::vector<std::int32_t>> GetSelectedColumns();
144
145   /**
146    * @copydoc Dali::Accessibility::Table::IsRowSelected()
147    */
148   DBus::ValueOrError<bool> IsRowSelected(std::int32_t row);
149
150   /**
151    * @copydoc Dali::Accessibility::Table::IsColumnSelected()
152    */
153   DBus::ValueOrError<bool> IsColumnSelected(std::int32_t column);
154
155   /**
156    * @copydoc Dali::Accessibility::Table::IsCellSelected()
157    */
158   DBus::ValueOrError<bool> IsCellSelected(std::int32_t row, std::int32_t column);
159
160   /**
161    * @copydoc Dali::Accessibility::Table::AddRowSelection()
162    */
163   DBus::ValueOrError<bool> AddRowSelection(std::int32_t row);
164
165   /**
166    * @copydoc Dali::Accessibility::Table::AddColumnSelection()
167    */
168   DBus::ValueOrError<bool> AddColumnSelection(std::int32_t column);
169
170   /**
171    * @copydoc Dali::Accessibility::Table::RemoveRowSelection()
172    */
173   DBus::ValueOrError<bool> RemoveRowSelection(std::int32_t row);
174
175   /**
176    * @copydoc Dali::Accessibility::Table::RemoveColumnSelection()
177    */
178   DBus::ValueOrError<bool> RemoveColumnSelection(std::int32_t column);
179
180   /**
181    * @copydoc Dali::Accessibility::Table::GetRowColumnSpan()
182    */
183   RowColumnSpanType GetRowColumnSpan(std::int32_t childIndex);
184 };
185
186 #endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_TABLE_H