1 #ifndef DALI_ADAPTOR_ATSPI_TABLE_CELL_H
2 #define DALI_ADAPTOR_ATSPI_TABLE_CELL_H
5 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
24 #include <dali/devel-api/atspi-interfaces/accessible.h>
26 namespace Dali::Accessibility
31 * @brief Interface representing a table cell.
33 * @see Dali::Accessibility::Table
35 class DALI_ADAPTOR_API TableCell : public virtual Accessible
39 * @brief Cell information type.
41 * @see TableCell:GetCellRowColumnSpan()
43 struct RowColumnSpanType
45 int row; ///< Row index
46 int column; ///< Column index
47 int rowSpan; ///< Row span
48 int columnSpan; ///< Column span
52 * @brief Returns the table this cell belongs to.
56 virtual Table* GetTable() const = 0;
59 * @brief Returns the position of this cell in the table.
61 * @return A pair of integers (row index, column index)
63 virtual std::pair<int, int> GetCellPosition() const = 0;
66 * @brief Returns the number of rows occupied by this cell.
68 * @return Number of rows
70 virtual int GetCellRowSpan() const = 0;
73 * @brief Returns the number of columns occupied by this cell.
75 * @return Number of columns
77 virtual int GetCellColumnSpan() const = 0;
80 * @brief Returns the position, row span, and column span of this cell.
82 * @return Cell information
84 * @see TableCell::RowColumnSpanType
85 * @see TableCell::GetCellPosition()
86 * @see TableCell::GetCellRowSpan()
87 * @see TableCell::GetCellColumnSpan()
89 virtual RowColumnSpanType GetCellRowColumnSpan() const = 0;
92 * @brief Downcasts an Accessible to a TableCell.
94 * @param obj The Accessible
95 * @return A Table or null
97 * @see Dali::Accessibility::Accessible::DownCast()
99 static inline TableCell* DownCast(Accessible* obj);
105 struct AtspiInterfaceTypeHelper<AtspiInterface::TABLE_CELL>
107 using Type = TableCell;
109 } // namespace Internal
111 inline TableCell* TableCell::DownCast(Accessible* obj)
113 return Accessible::DownCast<AtspiInterface::TABLE_CELL>(obj);
116 } // namespace Dali::Accessibility
118 #endif // DALI_ADAPTOR_ATSPI_TABLE_CELL_H