2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef _ATSPI_WRAPPER_H_
19 #define _ATSPI_WRAPPER_H_
21 #include <atspi/atspi.h>
24 namespace AurumInternal {
33 * @brief Class that matches atspi Window Node.
37 /** Wrapper methods for Atspi APIs **/
38 static GArray *Atspi_state_set_get_states(AtspiStateSet *set);
39 static GArray *Atspi_accessible_get_interfaces(AtspiAccessible *node);
40 static gchar *Atspi_accessible_get_name(AtspiAccessible *node, GError **error);
41 static AtspiAccessible *Atspi_get_desktop(int n);
42 static int Atspi_accessible_get_child_count(AtspiAccessible *node, GError **error);
43 static GArray *Atspi_accessible_get_children(AtspiAccessible *node, GError **error);
44 static AtspiAccessible *Atspi_accessible_get_child_at_index(AtspiAccessible *node, int index, GError **error);
45 static AtspiAccessible *Atspi_accessible_get_parent(AtspiAccessible *node, GError **error);
46 static AtspiStateSet *Atspi_accessible_get_state_set(AtspiAccessible *node);
47 static gboolean Atspi_state_set_contains(AtspiStateSet *set , AtspiStateType state);
48 static gchar *Atspi_accessible_get_role_name(AtspiAccessible *node, GError **error);
49 static gchar *Atspi_accessible_get_unique_id(AtspiAccessible *node, GError **error);
50 static GHashTable *Atspi_accessible_get_attributes(AtspiAccessible *node, GError **error);
51 static AtspiComponent *Atspi_accessible_get_component_iface(AtspiAccessible *node);
52 static AtspiRect *Atspi_component_get_extents(AtspiComponent *obj, AtspiCoordType ctype, GError **error);
53 static AtspiAction *Atspi_accessible_get_action_iface(AtspiAccessible *node);
54 static int Atspi_action_get_n_actions(AtspiAction *action, GError **error);
55 static gchar *Atspi_action_get_action_name(AtspiAction *action, int index, GError **error);
56 static gboolean Atspi_action_do_action(AtspiAction *action, int index, GError **error);
57 static AtspiEditableText *Atspi_accessible_get_editable_text(AtspiAccessible *node);
58 static gboolean Atspi_editable_text_delete_text(AtspiEditableText *, int start, int end, GError **error);
59 static gboolean Atspi_editable_text_insert_text(AtspiEditableText *, int pos, const gchar *text, int len, GError **error);
60 static AtspiAccessible *Atspi_accessible_get_application (AtspiAccessible *node, GError **error);
61 static void Atspi_accessible_clear_cache (AtspiAccessible *node);
62 static gboolean Atspi_component_grab_focus(AtspiComponent *obj, GError **error);
63 static void Atspi_accessible_set_cache_mask(AtspiAccessible *node, AtspiCache mask);
64 static AtspiValue *Atspi_accessible_get_value(AtspiAccessible *node);
65 static gdouble Atspi_value_get_minimum_value(AtspiValue *iface, GError **error);
66 static gdouble Atspi_value_get_current_value(AtspiValue *iface, GError **error);
67 static gdouble Atspi_value_get_maximum_value(AtspiValue *iface, GError **error);
68 static gboolean Atspi_value_set_current_value(AtspiValue *iface, gdouble value, GError **error);
69 static gdouble Atspi_value_get_minimum_increment(AtspiValue *iface, GError **error);
70 static guint Atspi_accessible_get_process_id(AtspiAccessible *node, GError **error);
71 static gchar *Atspi_accessible_get_toolkit_name(AtspiAccessible *node, GError **error);
72 static AtspiRect *Atspi_text_get_minimum_bounding_rectangles(AtspiText* obj, gint start_offset, gint end_offset, AtspiCoordType type, GError** error);
73 static void Atspi_accessible_set_listen_post_render(AtspiAccessible *obj, gboolean enabled, GError **error);
74 static AtspiCollection *Atspi_accessible_get_collection_iface(AtspiAccessible *node);
75 static GArray *Atspi_collection_get_matches(AtspiCollection *obj, AtspiMatchRule *rule, AtspiCollectionSortOrder sortby, gint count, gboolean traverse, GError **error);
76 static AtspiAccessibleNodeInfo *Atspi_accessible_get_node_info(AtspiAccessible *obj, GError **error);
77 static void Atspi_accessible_free_node_info(AtspiAccessibleNodeInfo *node_info);
80 static std::recursive_mutex mMutex;