Add atspi_accessible_set_cache_mask
[platform/upstream/at-spi2-core.git] / atspi / atspi-misc-private.h
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2002 Ximian, Inc.
6  *           2002 Sun Microsystems Inc.
7  *           
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #ifndef _ATSPI_MISC_PRIVATE_H_
26 #define _ATSPI_MISC_PRIVATE_H_
27
28 /* Private internal implementation details of at-spi. */
29
30 #include "atspi.h"
31
32 #include "dbus/dbus.h"
33
34 #include "dbind/dbind.h"
35
36 typedef struct _AtspiReference AtspiReference;
37 struct _AtspiReference
38 {
39   char *name;
40   char *path;
41 };
42
43 /* constants */
44 #define ATSPI_DBUS_NAME_REGISTRY "org.a11y.atspi.Registry"
45 #define ATSPI_DBUS_PATH_REGISTRY "/org/a11y/atspi/registry"
46 #define ATSPI_DBUS_INTERFACE_REGISTRY "org.a11y.atspi.Registry"
47
48 #define ATSPI_DBUS_PATH_NULL "/org/a11y/atspi/null"
49 #define ATSPI_DBUS_PATH_ROOT "/org/a11y/atspi/accessible/root"
50
51 #define ATSPI_DBUS_PATH_DEC "/org/a11y/atspi/registry/deviceeventcontroller"
52 #define ATSPI_DBUS_INTERFACE_DEC "org.a11y.atspi.DeviceEventController"
53 #define ATSPI_DBUS_INTERFACE_DEVICE_EVENT_LISTENER "org.a11y.atspi.DeviceEventListener"
54
55 #define ATSPI_DBUS_INTERFACE_CACHE "org.a11y.atspi.Cache"
56 #define ATSPI_DBUS_INTERFACE_ACCESSIBLE "org.a11y.atspi.Accessible"
57 #define ATSPI_DBUS_INTERFACE_ACTION "org.a11y.atspi.Action"
58 #define ATSPI_DBUS_INTERFACE_APPLICATION "org.a11y.atspi.Application"
59 #define ATSPI_DBUS_INTERFACE_COLLECTION "org.a11y.atspi.Collection"
60 #define ATSPI_DBUS_INTERFACE_COMPONENT "org.a11y.atspi.Component"
61 #define ATSPI_DBUS_INTERFACE_DOCUMENT "org.a11y.atspi.Document"
62 #define ATSPI_DBUS_INTERFACE_EDITABLE_TEXT "org.a11y.atspi.EditableText"
63 #define ATSPI_DBUS_INTERFACE_EVENT_KEYBOARD "org.a11y.atspi.Event.Keyboard"
64 #define ATSPI_DBUS_INTERFACE_EVENT_MOUSE "org.a11y.atspi.Event.Mouse"
65 #define ATSPI_DBUS_INTERFACE_EVENT_OBJECT "org.a11y.atspi.Event.Object"
66 #define ATSPI_DBUS_INTERFACE_HYPERLINK "org.a11y.atspi.Hyperlink"
67 #define ATSPI_DBUS_INTERFACE_HYPERTEXT "org.a11y.atspi.Hypertext"
68 #define ATSPI_DBUS_INTERFACE_IMAGE "org.a11y.atspi.Image"
69 #define ATSPI_DBUS_INTERFACE_SELECTION "org.a11y.atspi.Selection"
70 #define ATSPI_DBUS_INTERFACE_TABLE "org.a11y.atspi.Table"
71 #define ATSPI_DBUS_INTERFACE_TEXT "org.a11y.atspi.Text"
72 #define ATSPI_DBUS_INTERFACE_VALUE "org.a11y.atspi.Value"
73 #define ATSPI_DBUS_INTERFACE_SOCKET "org.a11y.atspi.Socket"
74
75 /* externs */
76 extern const char *atspi_path_dec;
77 extern const char *atspi_path_registry;
78 extern const char *atspi_path_root;
79 extern const char *atspi_bus_registry;
80 extern const char *atspi_interface_accessible;
81 extern const char *atspi_interface_action;
82 extern const char *atspi_interface_application;
83 extern const char *atspi_interface_collection;
84 extern const char *atspi_interface_component;
85 extern const char *atspi_interface_dec;
86 extern const char *atspi_interface_device_event_listener;
87 extern const char *atspi_interface_document;
88 extern const char *atspi_interface_editable_text;
89 extern const char *atspi_interface_hyperlink;
90 extern const char *atspi_interface_hypertext;
91 extern const char *atspi_interface_image;
92 extern const char *atspi_interface_registry;
93 extern const char *atspi_interface_selection;
94 extern const char *atspi_interface_table;
95 extern const char *atspi_interface_text;
96 extern const char *atspi_interface_cache;
97 extern const char *atspi_interface_value;
98
99 /* function prototypes */
100 gint _atspi_get_iface_num (const char *iface);
101
102 DBusConnection * _atspi_bus ();
103
104 AtspiAccessible * _atspi_ref_accessible (const char *app, const char *path);
105
106 AtspiAccessible *
107 _atspi_dbus_return_accessible_from_message (DBusMessage *message);
108
109 AtspiAccessible *
110 _atspi_dbus_return_accessible_from_iter (DBusMessageIter *iter);
111
112 AtspiHyperlink *
113 _atspi_dbus_return_hyperlink_from_message (DBusMessage *message);
114
115 AtspiHyperlink *
116 _atspi_dbus_return_hyperlink_from_iter (DBusMessageIter *iter);
117
118 dbus_bool_t _atspi_dbus_call (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
119
120 DBusMessage *_atspi_dbus_call_partial (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
121
122 DBusMessage *_atspi_dbus_call_partial_va (gpointer obj, const char *interface, const char *method, GError **error, const char *type, va_list args);
123
124 dbus_bool_t _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name, GError **error, const char *type, void *data);
125
126 DBusMessage * _atspi_dbus_send_with_reply_and_block (DBusMessage *message, GError **error);
127
128 GHashTable *_atspi_dbus_return_hash_from_message (DBusMessage *message);
129
130 GHashTable *_atspi_dbus_hash_from_iter (DBusMessageIter *iter);
131
132 GArray *_atspi_dbus_return_attribute_array_from_message (DBusMessage *message);
133
134 GArray *_atspi_dbus_attribute_array_from_iter (DBusMessageIter *iter);
135
136 gboolean _atspi_process_deferred_messages (gpointer data);
137
138 void _atspi_dbus_set_interfaces (AtspiAccessible *accessible, DBusMessageIter *iter);
139
140 void _atspi_dbus_set_state (AtspiAccessible *accessible, DBusMessageIter *iter);
141
142 #define _ATSPI_DBUS_CHECK_SIG(message, type, error, ret) \
143   if (!message) { \
144     g_warning ("at-spi: Got no message at %s line %d\n", __FILE__, __LINE__); \
145     return (ret); \
146   } \
147   if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) \
148   { \
149     const char *err; \
150     dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID); \
151     if (err) \
152       g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_IPC, err); \
153     dbus_message_unref (message); \
154     return ret; \
155   } \
156   if (strcmp (dbus_message_get_signature (message), type) != 0) \
157   { \
158     g_warning ("at-spi: Expected message signature %s but got %s at %s line %d", type, dbus_message_get_signature (message), __FILE__, __LINE__); \
159     dbus_message_unref (message); \
160     return (ret); \
161   }
162
163
164 /**
165  * ATSPI_ERROR:
166  *
167  * Error domain for AT-SPI IPC failures. Errors in this domain will
168  * be from the #ATSPIAtspiError enumeration. See #GError for information on
169  * error domains.
170  */
171 #define ATSPI_ERROR atspi_error_quark()
172 GQuark atspi_error_quark (void);
173
174 /**
175  * AtspiError:
176  * @ATSPI_APPLICATION_NO_LONGER_EXISTS: The application has quit.
177  */
178 typedef enum
179 {
180   ATSPI_ERROR_APPLICATION_GONE,
181   ATSPI_ERROR_IPC
182 } AtspiError;
183 #endif  /* _ATSPI_MISC_PRIVATE_H_ */