1 #ifndef DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_H
2 #define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_H
5 * Copyright (c) 2021 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 <unordered_map>
28 #include "bridge-base.h"
30 class BridgeAccessible : public virtual BridgeBase
35 void RegisterInterfaces();
36 bool suppressScreenReader = false;
39 enum class GetNeighborSearchMode
43 continueAfterFailedRecursion = 2,
47 DBus::ValueOrError<Dali::Accessibility::Accessible*> GetChildAtIndex(int index);
48 Dali::Accessibility::Accessible* GetParent();
49 DBus::ValueOrError<std::vector<Dali::Accessibility::Accessible*>> GetChildren();
50 std::string GetName();
51 std::string GetDescription();
52 DBus::ValueOrError<uint32_t> GetRole();
53 DBus::ValueOrError<std::string> GetRoleName();
54 DBus::ValueOrError<std::string> GetLocalizedRoleName();
55 DBus::ValueOrError<int32_t> GetIndexInParent();
56 DBus::ValueOrError<std::array<uint32_t, 2>> GetStates();
57 DBus::ValueOrError<std::unordered_map<std::string, std::string>> GetAttributes();
58 DBus::ValueOrError<std::vector<std::string>> GetInterfaces();
59 DBus::ValueOrError<Dali::Accessibility::Accessible*, uint8_t, Dali::Accessibility::Accessible*> GetNavigableAtPoint(int32_t x, int32_t y, uint32_t coordinateType);
60 DBus::ValueOrError<Dali::Accessibility::Accessible*, uint8_t> GetNeighbor(std::string root_path, int32_t direction, int32_t search_mode);
61 DBus::ValueOrError<Dali::Accessibility::Accessible*, uint32_t, std::unordered_map<std::string, std::string>> GetDefaultLabelInfo();
62 using ReadingMaterialType = DBus::ValueOrError<
63 std::unordered_map<std::string, std::string>, // attributes
65 std::string, // labeledByName
66 std::string, // textIfceName
68 Dali::Accessibility::States,
69 std::string, // localized name
70 int32_t, // child count
71 double, // current value
72 double, // minimum increment
73 double, // maximum value
74 double, // minimum value
75 std::string, // description
76 int32_t, // index in parent
77 bool, // isSelectedInParent
78 bool, // hasCheckBoxChild
79 int32_t, // listChildrenCount
80 int32_t, // firstSelectedChildIndex
81 Dali::Accessibility::Accessible*, // parent
82 Dali::Accessibility::States, // parentStateSet
83 int32_t, // parentChildCount
84 uint32_t, // parentRole
85 int32_t, // selectedChildCount,
86 Dali::Accessibility::Accessible* // describedByObject
89 ReadingMaterialType GetReadingMaterial();
90 void SuppressScreenReader(bool) override;
92 DBus::ValueOrError<bool> DoGesture(Dali::Accessibility::Gesture type, int32_t xBeg, int32_t yBeg, int32_t xEnd, int32_t yEnd, Dali::Accessibility::GestureState state, uint32_t eventTime);
94 using Relation = std::tuple<uint32_t, std::vector<Dali::Accessibility::Address>>;
95 DBus::ValueOrError<std::vector<Relation>> GetRelationSet();
98 Dali::Accessibility::Accessible* CalculateNeighbor(Dali::Accessibility::Accessible* root, Dali::Accessibility::Accessible* start, unsigned char forward, GetNeighborSearchMode search_mode);
99 std::vector<Dali::Accessibility::Accessible*> ValidChildrenGet(const std::vector<Dali::Accessibility::Accessible*>& children, Dali::Accessibility::Accessible* start, Dali::Accessibility::Accessible* root);
100 Dali::Accessibility::Accessible* GetCurrentlyHighlighted();
101 Dali::Accessibility::Accessible* DirectionalDepthFirstSearchTryNonDefunctSibling(bool& all_children_visited, Dali::Accessibility::Accessible* node, Dali::Accessibility::Accessible* start, Dali::Accessibility::Accessible* root, unsigned char forward);
102 Dali::Accessibility::Accessible* GetNextNonDefunctSibling(Dali::Accessibility::Accessible* obj, Dali::Accessibility::Accessible* start, Dali::Accessibility::Accessible* root, unsigned char forward);
103 Dali::Accessibility::Component* CalculateNavigableAccessibleAtPoint(Dali::Accessibility::Accessible* root, Dali::Accessibility::Point p, Dali::Accessibility::CoordinateType type, unsigned int maxRecursionDepth);
104 Dali::Accessibility::Component* GetObjectInRelation(Dali::Accessibility::Accessible* obj, Dali::Accessibility::RelationType ralationType);
107 #endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_H