ba92f30f62de1de647c1995c6b2f2e55808a5c79
[platform/core/uifw/dali-adaptor.git] / dali / dali-bridge / src / BridgeCollection.hpp
1 #ifndef BRIDGE_COLLECTION_HPP
2 #define BRIDGE_COLLECTION_HPP
3
4 #include "BridgeBase.hpp"
5
6 #include <array>
7 #include <tuple>
8 #include <unordered_map>
9 #include <vector>
10
11 class BridgeCollection : public virtual BridgeBase
12 {
13 private:
14   struct Comparer;
15   static void VisitNodes( Dali::Accessibility::Accessible* obj, std::vector< Dali::Accessibility::Accessible* >& result, Comparer& cmp, size_t maxCount );
16
17 protected:
18   BridgeCollection() = default;
19
20   void RegisterInterfaces();
21
22   Dali::Accessibility::Collection* FindSelf() const;
23
24 public:
25   using MatchRule = std::tuple<
26       std::array< int32_t, 2 >, int32_t,
27       std::unordered_map< std::string, std::string >, int32_t,
28       std::array< int32_t, 4 >, int32_t,
29       std::vector< std::string >, int32_t,
30       bool >;
31   struct Index
32   {
33     enum
34     {
35       States,
36       StatesMatchType,
37       Attributes,
38       AttributesMatchType,
39       Roles,
40       RolesMatchType,
41       Interfaces,
42       InterfacesMatchType,
43     };
44   };
45
46   DBus::ValueOrError< std::vector< Dali::Accessibility::Accessible* > > GetMatches( MatchRule rule, uint32_t sortBy, int32_t count, bool traverse );
47 };
48
49 #endif