1 #ifndef DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_H
2 #define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_H
5 * Copyright (c) 2019 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();
38 enum class GetNeighborSearchMode
42 continueAfterFailedRecursion = 2,
46 DBus::ValueOrError< Dali::Accessibility::Accessible* > GetChildAtIndex( int index );
47 Dali::Accessibility::Accessible* GetParent();
48 DBus::ValueOrError< std::vector< Dali::Accessibility::Accessible* > > GetChildren();
49 std::string GetName();
50 std::string GetDescription();
51 DBus::ValueOrError< uint32_t > GetRole();
52 DBus::ValueOrError< std::string > GetRoleName();
53 DBus::ValueOrError< std::string > GetLocalizedRoleName();
54 DBus::ValueOrError< int32_t > GetIndexInParent();
55 DBus::ValueOrError< std::array< uint32_t, 2 > > GetStates();
56 DBus::ValueOrError< std::unordered_map< std::string, std::string > > GetAttributes();
57 DBus::ValueOrError< std::vector< std::string > > GetInterfaces();
58 DBus::ValueOrError< Dali::Accessibility::Accessible*, uint8_t, Dali::Accessibility::Accessible* > GetNavigableAtPoint( int32_t x, int32_t y, uint32_t coordType );
59 DBus::ValueOrError< Dali::Accessibility::Accessible*, uint8_t > GetNeighbor( std::string root_path, int32_t direction, int32_t search_mode );
60 DBus::ValueOrError< Dali::Accessibility::Accessible*, uint32_t , std::unordered_map< std::string, std::string > > GetDefaultLabelInfo();
61 using ReadingMaterialType = DBus::ValueOrError<
62 std::unordered_map< std::string, std::string >, // attributes
64 std::string, // labeledByName
65 std::string, // textIfceName
67 Dali::Accessibility::States,
68 std::string, // localized name
69 int32_t, // child count
70 double, // current value
71 double, // minimum increment
72 double, // maximum value
73 double, // minimum value
74 std::string, // description
75 int32_t, // index in parent
76 bool, // isSelectedInParent
77 bool, // hasCheckBoxChild
78 int32_t, // listChildrenCount
79 int32_t, // firstSelectedChildIndex
80 Dali::Accessibility::Accessible*, // parent
81 Dali::Accessibility::States, // parentStateSet
82 int32_t, // parentChildCount
83 uint32_t, // parentRole
84 int32_t, // selectedChildCount,
85 Dali::Accessibility::Accessible* // describedByObject
88 ReadingMaterialType GetReadingMaterial();
90 DBus::ValueOrError< bool > DoGesture( Dali::Accessibility::Gesture type, int32_t xBeg, int32_t xEnd, int32_t yBeg, int32_t yEnd, Dali::Accessibility::GestureState state, uint32_t eventTime );
92 using Relation = std::tuple< uint32_t, std::vector< Dali::Accessibility::Address > >;
93 DBus::ValueOrError<std::vector< Relation >> GetRelationSet();
96 Dali::Accessibility::Accessible* CalculateNeighbor( Dali::Accessibility::Accessible* root, Dali::Accessibility::Accessible* start, unsigned char forward, GetNeighborSearchMode search_mode );
97 std::vector< Dali::Accessibility::Accessible* > ValidChildrenGet( const std::vector< Dali::Accessibility::Accessible* >& children, Dali::Accessibility::Accessible* start, Dali::Accessibility::Accessible* root );
98 Dali::Accessibility::Accessible* GetCurrentlyHighlighted();
99 Dali::Accessibility::Accessible* DirectionalDepthFirstSearchTryNonDefunctSibling( bool& all_children_visited, Dali::Accessibility::Accessible* node, Dali::Accessibility::Accessible* start, Dali::Accessibility::Accessible* root, unsigned char forward );
100 Dali::Accessibility::Accessible* GetNextNonDefunctSibling( Dali::Accessibility::Accessible* obj, Dali::Accessibility::Accessible* start, Dali::Accessibility::Accessible* root, unsigned char forward );
101 Dali::Accessibility::Component* CalculateNavigableAccessibleAtPoint( Dali::Accessibility::Accessible* root, Dali::Accessibility::Point p, Dali::Accessibility::CoordType cType, unsigned int maxRecursionDepth );
102 Dali::Accessibility::Component * GetObjectInRelation(Dali::Accessibility::Accessible * obj, Dali::Accessibility::RelationType ralationType);
105 #endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_H