libaurum: apply smart pointer wider and extract impl out
[platform/core/uifw/aurum.git] / libaurum / inc / PartialMatch.h
1 #ifndef PARTIAL_MATCH_H
2 #define PARTIAL_MATCH_H
3
4 #include <list>
5 #include <memory>
6 #include <vector>
7
8 #include "AccessibleNode.h"
9 #include "UiSelector.h"
10 /**
11  * @brief PartialMatch class
12  * @since_tizen 5.5
13  */
14 class PartialMatch {
15 private:
16     /**
17      * @brief TBD
18      * @since_tizen 5.5
19      */
20     PartialMatch();
21
22 public:
23     /**
24      * @brief TBD
25      * @since_tizen 5.5
26      */
27     PartialMatch(const std::shared_ptr<UiSelector> selector, const int absDepth);
28
29 public:
30     /**
31      * @brief TBD
32      * @since_tizen 5.5
33      */
34     void update(const std::shared_ptr<AccessibleNode> node, int index, int depth,
35                 std::list<std::shared_ptr<PartialMatch>> &partialMatches);
36
37     /**
38      * @brief TBD
39      * @since_tizen 5.5
40      */
41     bool finalizeMatch();
42
43     /**
44      * @brief TBD
45      * @since_tizen 5.5
46      */
47     void debugPrint();
48
49 public:
50     static std::shared_ptr<PartialMatch> accept(const std::shared_ptr<AccessibleNode> node,
51                                                 const std::shared_ptr<UiSelector> selector,
52                                                 int index, int depth);
53
54     /**
55      * @brief TBD
56      * @since_tizen 5.5
57      */
58     static std::shared_ptr<PartialMatch> accept(const std::shared_ptr<AccessibleNode> node,
59                                                 const std::shared_ptr<UiSelector> selector,
60                                                 int index, int absoluteDepth,
61                                                 int relativeDepth);
62
63     /**
64      * @brief TBD
65      * @since_tizen 5.5
66      */
67 private:
68     static bool checkCriteria(const std::shared_ptr<UiSelector> selector,
69                               const std::shared_ptr<AccessibleNode> node);
70
71     /**
72      * @brief TBD
73      * @since_tizen 5.5
74      */
75
76     static bool checkCriteria(const std::string *textA, const std::string textB);
77
78     /**
79      * @brief TBD
80      * @since_tizen 5.5
81      */
82     static bool checkCriteria(const bool *boolA, const bool boolB);
83
84 private:
85     /**
86      * @brief TBD
87      */
88     const std::shared_ptr<UiSelector>        mSelector;
89
90     /**
91      * @brief TBD
92      */
93     const int                                mDepth;
94
95     /**
96      * @brief TBD
97      */
98     std::list<std::shared_ptr<PartialMatch>> mPartialMatches;
99 };
100
101 #endif