Aurum  0.1.1
 All Classes Functions Variables Pages
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"
14 class PartialMatch {
15 private:
20  PartialMatch();
21 
22 public:
27  PartialMatch(const std::shared_ptr<UiSelector> selector, const int absDepth);
28 
29 public:
34  void update(const AccessibleNode *node, int index, int depth,
35  std::list<std::shared_ptr<PartialMatch>> &partialMatches);
36 
41  bool finalizeMatch();
42 
47  void debugPrint();
48 
49 public:
50  static std::shared_ptr<PartialMatch> accept(const AccessibleNode *node,
51  const std::shared_ptr<UiSelector> selector,
52  int index, int depth);
53 
58  static std::shared_ptr<PartialMatch> accept(const AccessibleNode *node,
59  const std::shared_ptr<UiSelector> selector,
60  int index, int absoluteDepth,
61  int relativeDepth);
62 
67 private:
68  static bool checkCriteria(const std::shared_ptr<UiSelector> selector,
69  const AccessibleNode *node);
70 
76  static bool checkCriteria(const std::string *textA, const std::string textB);
77 
82  static bool checkCriteria(const bool *boolA, const bool boolB);
83 
84 private:
88  const std::shared_ptr<UiSelector> mSelector;
89 
93  const int mDepth;
94 
98  std::list<std::shared_ptr<PartialMatch>> mPartialMatches;
99 };
100 
101 #endif