2 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/accessibility/bridge/bridge-table-cell.h>
22 #include <dali/devel-api/atspi-interfaces/table.h>
24 using namespace Dali::Accessibility;
26 void BridgeTableCell::RegisterInterfaces()
28 DBus::DBusInterfaceDescription desc{Accessible::GetInterfaceName(AtspiInterface::TABLE_CELL)};
30 AddGetPropertyToInterface(desc, "Table", &BridgeTableCell::GetTable);
31 AddGetPropertyToInterface(desc, "Position", &BridgeTableCell::GetCellPosition);
32 AddGetPropertyToInterface(desc, "RowSpan", &BridgeTableCell::GetCellRowSpan);
33 AddGetPropertyToInterface(desc, "ColumnSpan", &BridgeTableCell::GetCellColumnSpan);
34 AddFunctionToInterface(desc, "GetRowColumnSpan", &BridgeTableCell::GetCellRowColumnSpan);
36 mDbusServer.addInterface("/", desc, true);
39 TableCell* BridgeTableCell::FindSelf() const
41 return FindCurrentObjectWithInterface<AtspiInterface::TABLE_CELL>();
44 DBus::ValueOrError<Accessible*> BridgeTableCell::GetTable()
46 return FindSelf()->GetTable();
49 DBus::ValueOrError<std::int32_t, std::int32_t> BridgeTableCell::GetCellPosition()
51 std::pair<int, int> position = FindSelf()->GetCellPosition();
53 return {position.first, position.second};
56 DBus::ValueOrError<std::int32_t> BridgeTableCell::GetCellRowSpan()
58 return FindSelf()->GetCellRowSpan();
61 DBus::ValueOrError<std::int32_t> BridgeTableCell::GetCellColumnSpan()
63 return FindSelf()->GetCellColumnSpan();
66 DBus::ValueOrError<std::int32_t, std::int32_t, std::int32_t, std::int32_t> BridgeTableCell::GetCellRowColumnSpan()
68 TableCell::RowColumnSpanType span = FindSelf()->GetCellRowColumnSpan();
70 return {span.row, span.column, span.rowSpan, span.columnSpan};