Acacia
atspi_node.h
1 #ifndef INCLUDE_ACACIA_ATSPI_ATSPI_NODE_H_
2 #define INCLUDE_ACACIA_ATSPI_ATSPI_NODE_H_
3 
4 #include <memory>
5 #include <string>
6 #include <vector>
7 
8 #include <atspi/atspi.h>
9 #include <glib.h>
10 
11 #include "acacia/atspi/atspi_action_interface.h"
12 #include "acacia/atspi/atspi_component_interface.h"
13 #include "acacia/atspi/atspi_document_interface.h"
14 #include "acacia/atspi/atspi_hyperlink_interface.h"
15 #include "acacia/atspi/atspi_table_cell_interface.h"
16 #include "acacia/atspi/atspi_table_interface.h"
17 #include "acacia/atspi/atspi_text_interface.h"
18 #include "acacia/atspi/atspi_value_interface.h"
19 
20 namespace acacia {
21 
27 class AtspiNode {
28  public:
29  AtspiNode(AtspiAccessible* accessible) : accessible_(accessible, Deleter()) {}
30  AtspiNode() = default;
31  ~AtspiNode() = default;
32 
39  bool isNull() const;
40 
46  std::string getRoleName() const;
47 
53  std::string getName() const;
54 
60  std::string getDescription() const;
61 
71  std::vector<std::string> getAttributes() const;
72 
80  std::vector<std::string> getInterfaces() const;
81 
89  std::vector<std::string> getRelations() const;
90 
102  int target_index = 0) const;
103 
114  std::vector<std::string> getStates() const;
115 
121  int getChildCount() const;
122 
132  AtspiNode getChildAtIndex(int index) const;
133 
140  std::vector<AtspiNode> getChildren() const;
141 
150 
159 
168 
177 
186 
195 
204 
213 
214  private:
215  class Deleter {
216  public:
217  void operator()(AtspiAccessible* ptr) {
218  if (ptr == nullptr)
219  return;
220  g_object_unref(ptr);
221  }
222  };
223 
224  std::shared_ptr<AtspiAccessible> accessible_;
225 };
226 
227 } // namespace acacia
228 
229 #endif // INCLUDE_ACACIA_ATSPI_ATSPI_NODE_H_
Definition: atspi_action_interface.h:19
Definition: atspi_component_interface.h:19
Definition: atspi_document_interface.h:20
Definition: atspi_hyperlink_interface.h:18
Definition: atspi_node.h:27
Definition: atspi_table_cell_interface.h:19
Definition: atspi_table_interface.h:19
Definition: atspi_text_interface.h:19
Definition: atspi_value_interface.h:19
std::vector< AtspiNode > getChildren() const
std::vector< std::string > getInterfaces() const
AtspiTableInterface queryTable() const
std::vector< std::string > getAttributes() const
AtspiTableCellInterface queryTableCell() const
std::string getRoleName() const
AtspiTextInterface queryText() const
std::vector< std::string > getRelations() const
std::string getName() const
AtspiHyperlinkInterface queryHyperlink() const
bool isNull() const
AtspiNode getTargetForRelationAtIndex(int relation_index, int target_index=0) const
int getChildCount() const
AtspiActionInterface queryAction() const
AtspiDocumentInterface queryDocument() const
AtspiNode getChildAtIndex(int index) const
AtspiValueInterface queryValue() const
AtspiComponentInterface queryComponent() const
std::string getDescription() const
std::vector< std::string > getStates() const