1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtDBus module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
46 // This file is not part of the public API. This header file may
47 // change from version to version without notice, or even be
54 #ifndef QDBUS_SYMBOLS_P_H
55 #define QDBUS_SYMBOLS_P_H
57 #include <QtCore/qglobal.h>
58 #include <dbus/dbus.h>
64 #if !defined QT_LINKED_LIBDBUS
66 void (*qdbus_resolve_conditionally(const char *name))(); // doesn't print a warning
67 void (*qdbus_resolve_me(const char *name))(); // prints a warning
68 bool qdbus_loadLibDBus();
70 # define DEFINEFUNC(ret, func, args, argcall, funcret) \
71 typedef ret (* _q_PTR_##func) args; \
72 static inline ret q_##func args \
74 static _q_PTR_##func ptr; \
76 ptr = (_q_PTR_##func) qdbus_resolve_me(#func); \
77 funcret ptr argcall; \
80 #else // defined QT_LINKED_LIBDBUS
82 inline bool qdbus_loadLibDBus() { return true; }
84 # define DEFINEFUNC(ret, func, args, argcall, funcret) \
85 static inline ret q_##func args { funcret func argcall; }
87 #endif // defined QT_LINKED_LIBDBUS
90 DEFINEFUNC(void, dbus_bus_add_match, (DBusConnection *connection,
93 (connection, rule, error), )
94 DEFINEFUNC(void, dbus_bus_remove_match, (DBusConnection *connection,
97 (connection, rule, error), )
98 DEFINEFUNC(dbus_bool_t, dbus_bus_register,(DBusConnection *connection,
100 (connection, error), return)
101 DEFINEFUNC(DBusConnection *, dbus_bus_get_private, (DBusBusType type,
103 (type, error), return)
104 DEFINEFUNC(const char*, dbus_bus_get_unique_name, (DBusConnection *connection),
105 (connection), return)
107 /* dbus-connection.h */
108 DEFINEFUNC(dbus_bool_t , dbus_connection_add_filter, (DBusConnection *connection,
109 DBusHandleMessageFunction function,
111 DBusFreeFunction free_data_function),
112 (connection, function, user_data, free_data_function), return)
113 DEFINEFUNC(void , dbus_connection_close, (DBusConnection *connection),
114 (connection), return)
115 DEFINEFUNC(DBusDispatchStatus , dbus_connection_dispatch, (DBusConnection *connection),
116 (connection), return)
117 DEFINEFUNC(DBusDispatchStatus , dbus_connection_get_dispatch_status, (DBusConnection *connection),
118 (connection), return)
119 DEFINEFUNC(dbus_bool_t , dbus_connection_get_is_connected, (DBusConnection *connection),
120 (connection), return)
121 DEFINEFUNC(DBusConnection* , dbus_connection_open_private, (const char *address,
123 (address, error), return)
124 DEFINEFUNC(DBusConnection* , dbus_connection_ref, (DBusConnection *connection),
125 (connection), return)
126 DEFINEFUNC(dbus_bool_t , dbus_connection_send, (DBusConnection *connection,
127 DBusMessage *message,
128 dbus_uint32_t *client_serial),
129 (connection, message, client_serial), return)
130 DEFINEFUNC(dbus_bool_t , dbus_connection_send_with_reply, (DBusConnection *connection,
131 DBusMessage *message,
132 DBusPendingCall **pending_return,
133 int timeout_milliseconds),
134 (connection, message, pending_return, timeout_milliseconds), return)
135 DEFINEFUNC(DBusMessage * , dbus_connection_send_with_reply_and_block, (DBusConnection *connection,
136 DBusMessage *message,
137 int timeout_milliseconds,
139 (connection, message, timeout_milliseconds, error), return)
140 DEFINEFUNC(void , dbus_connection_set_exit_on_disconnect, (DBusConnection *connection,
141 dbus_bool_t exit_on_disconnect),
142 (connection, exit_on_disconnect), )
143 DEFINEFUNC(dbus_bool_t , dbus_connection_set_timeout_functions, (DBusConnection *connection,
144 DBusAddTimeoutFunction add_function,
145 DBusRemoveTimeoutFunction remove_function,
146 DBusTimeoutToggledFunction toggled_function,
148 DBusFreeFunction free_data_function),
149 (connection, add_function, remove_function, toggled_function, data, free_data_function), return)
150 DEFINEFUNC(dbus_bool_t , dbus_connection_set_watch_functions, (DBusConnection *connection,
151 DBusAddWatchFunction add_function,
152 DBusRemoveWatchFunction remove_function,
153 DBusWatchToggledFunction toggled_function,
155 DBusFreeFunction free_data_function),
156 (connection, add_function, remove_function, toggled_function, data, free_data_function), return)
157 DEFINEFUNC(void , dbus_connection_set_wakeup_main_function, (DBusConnection *connection,
158 DBusWakeupMainFunction wakeup_main_function,
160 DBusFreeFunction free_data_function),
161 (connection, wakeup_main_function, data, free_data_function), )
162 DEFINEFUNC(void , dbus_connection_set_dispatch_status_function, (DBusConnection *connection,
163 DBusDispatchStatusFunction function,
165 DBusFreeFunction free_data_function),
166 (connection, function, data, free_data_function), )
168 DEFINEFUNC(void , dbus_connection_unref, (DBusConnection *connection),
170 DEFINEFUNC(dbus_bool_t , dbus_timeout_get_enabled, (DBusTimeout *timeout),
172 DEFINEFUNC(int , dbus_timeout_get_interval, (DBusTimeout *timeout),
174 DEFINEFUNC(dbus_bool_t , dbus_timeout_handle, (DBusTimeout *timeout),
177 DEFINEFUNC(dbus_bool_t , dbus_watch_get_enabled, (DBusWatch *watch),
179 DEFINEFUNC(int , dbus_watch_get_fd, (DBusWatch *watch),
181 DEFINEFUNC(unsigned int , dbus_watch_get_flags, (DBusWatch *watch),
183 DEFINEFUNC(dbus_bool_t , dbus_watch_handle, (DBusWatch *watch,
185 (watch, flags), return)
188 DEFINEFUNC(void , dbus_error_free, (DBusError *error),
190 DEFINEFUNC(void , dbus_error_init, (DBusError *error),
192 DEFINEFUNC(dbus_bool_t , dbus_error_is_set, (const DBusError *error),
196 DEFINEFUNC(void , dbus_free, (void *memory), (memory), )
199 DEFINEFUNC(DBusMessage* , dbus_message_copy, (const DBusMessage *message),
201 DEFINEFUNC(dbus_bool_t , dbus_message_get_auto_start, (DBusMessage *message),
203 DEFINEFUNC(const char* , dbus_message_get_error_name, (DBusMessage *message),
205 DEFINEFUNC(const char* , dbus_message_get_interface, (DBusMessage *message),
207 DEFINEFUNC(const char* , dbus_message_get_member, (DBusMessage *message),
209 DEFINEFUNC(dbus_bool_t , dbus_message_get_no_reply, (DBusMessage *message),
211 DEFINEFUNC(const char* , dbus_message_get_path, (DBusMessage *message),
213 DEFINEFUNC(const char* , dbus_message_get_sender, (DBusMessage *message),
215 DEFINEFUNC(dbus_uint32_t , dbus_message_get_serial, (DBusMessage *message),
217 DEFINEFUNC(const char* , dbus_message_get_signature, (DBusMessage *message),
219 DEFINEFUNC(int , dbus_message_get_type, (DBusMessage *message),
221 DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_basic, (DBusMessageIter *iter,
224 (iter, type, value), return)
225 DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_fixed_array, (DBusMessageIter *iter,
229 (iter, element_type, value, n_elements), return)
230 DEFINEFUNC(dbus_bool_t , dbus_message_iter_close_container, (DBusMessageIter *iter,
231 DBusMessageIter *sub),
233 DEFINEFUNC(int , dbus_message_iter_get_arg_type, (DBusMessageIter *iter),
235 DEFINEFUNC(void , dbus_message_iter_get_basic, (DBusMessageIter *iter,
238 DEFINEFUNC(int , dbus_message_iter_get_element_type, (DBusMessageIter *iter),
240 DEFINEFUNC(void , dbus_message_iter_get_fixed_array, (DBusMessageIter *iter,
243 (iter, value, n_elements), return)
244 DEFINEFUNC(char* , dbus_message_iter_get_signature, (DBusMessageIter *iter),
246 DEFINEFUNC(dbus_bool_t , dbus_message_iter_init, (DBusMessage *message,
247 DBusMessageIter *iter),
248 (message, iter), return)
249 DEFINEFUNC(void , dbus_message_iter_init_append, (DBusMessage *message,
250 DBusMessageIter *iter),
251 (message, iter), return)
252 DEFINEFUNC(dbus_bool_t , dbus_message_iter_next, (DBusMessageIter *iter),
254 DEFINEFUNC(dbus_bool_t , dbus_message_iter_open_container, (DBusMessageIter *iter,
256 const char *contained_signature,
257 DBusMessageIter *sub),
258 (iter, type, contained_signature, sub), return)
259 DEFINEFUNC(void , dbus_message_iter_recurse, (DBusMessageIter *iter,
260 DBusMessageIter *sub),
262 DEFINEFUNC(DBusMessage* , dbus_message_new, (int message_type),
263 (message_type), return)
264 DEFINEFUNC(DBusMessage* , dbus_message_new_method_call, (const char *bus_name,
266 const char *interface,
268 (bus_name, path, interface, method), return)
269 DEFINEFUNC(DBusMessage* , dbus_message_new_signal, (const char *path,
270 const char *interface,
272 (path, interface, name), return)
273 DEFINEFUNC(DBusMessage* , dbus_message_ref, (DBusMessage *message),
275 DEFINEFUNC(void , dbus_message_set_auto_start, (DBusMessage *message,
276 dbus_bool_t auto_start),
277 (message, auto_start), return)
278 DEFINEFUNC(dbus_bool_t , dbus_message_set_destination, (DBusMessage *message,
279 const char *destination),
280 (message, destination), return)
281 DEFINEFUNC(dbus_bool_t , dbus_message_set_error_name, (DBusMessage *message,
283 (message, name), return)
284 DEFINEFUNC(void , dbus_message_set_no_reply, (DBusMessage *message,
285 dbus_bool_t no_reply),
286 (message, no_reply), return)
287 DEFINEFUNC(dbus_bool_t , dbus_message_set_path, (DBusMessage *message,
288 const char *object_path),
289 (message, object_path), return)
290 DEFINEFUNC(dbus_bool_t , dbus_message_set_reply_serial, (DBusMessage *message,
291 dbus_uint32_t reply_serial),
292 (message, reply_serial), return)
293 DEFINEFUNC(dbus_bool_t , dbus_message_set_sender, (DBusMessage *message,
295 (message, sender), return)
296 DEFINEFUNC(void , dbus_message_unref, (DBusMessage *message),
300 DEFINEFUNC(void , dbus_get_version , (int *major_version_p,
301 int *minor_version_p,
302 int *micro_version_p),
303 (major_version_p, minor_version_p, micro_version_p), )
304 DEFINEFUNC(char* , dbus_get_local_machine_id , (void), (), return)
307 /* dbus-pending-call.h */
308 DEFINEFUNC(dbus_bool_t , dbus_pending_call_set_notify, (DBusPendingCall *pending,
309 DBusPendingCallNotifyFunction function,
311 DBusFreeFunction free_user_data),
312 (pending, function, user_data, free_user_data), return)
313 DEFINEFUNC(void , dbus_pending_call_block, (DBusPendingCall *pending),
315 DEFINEFUNC(void , dbus_pending_call_cancel, (DBusPendingCall *pending),
317 DEFINEFUNC(dbus_bool_t , dbus_pending_call_get_completed, (DBusPendingCall *pending),
319 DEFINEFUNC(DBusMessage* , dbus_pending_call_steal_reply, (DBusPendingCall *pending),
321 DEFINEFUNC(void , dbus_pending_call_unref, (DBusPendingCall *pending),
325 DEFINEFUNC(dbus_bool_t , dbus_server_allocate_data_slot, (dbus_int32_t *slot_p),
327 DEFINEFUNC(void , dbus_server_disconnect, (DBusServer *server),
329 DEFINEFUNC(char* , dbus_server_get_address, (DBusServer *server),
331 DEFINEFUNC(dbus_bool_t , dbus_server_get_is_connected, (DBusServer *server),
333 DEFINEFUNC(DBusServer* , dbus_server_listen, (const char *address,
335 (address, error), return)
336 DEFINEFUNC(dbus_bool_t , dbus_server_set_data, (DBusServer *server,
339 DBusFreeFunction free_data_func),
340 (server, slot, data, free_data_func), return)
341 DEFINEFUNC(void , dbus_server_set_new_connection_function, (DBusServer *server,
342 DBusNewConnectionFunction function,
344 DBusFreeFunction free_data_function),
345 (server, function, data, free_data_function), )
346 DEFINEFUNC(dbus_bool_t , dbus_server_set_timeout_functions, (DBusServer *server,
347 DBusAddTimeoutFunction add_function,
348 DBusRemoveTimeoutFunction remove_function,
349 DBusTimeoutToggledFunction toggled_function,
351 DBusFreeFunction free_data_function),
352 (server, add_function, remove_function, toggled_function, data, free_data_function), return)
353 DEFINEFUNC(dbus_bool_t , dbus_server_set_watch_functions, (DBusServer *server,
354 DBusAddWatchFunction add_function,
355 DBusRemoveWatchFunction remove_function,
356 DBusWatchToggledFunction toggled_function,
358 DBusFreeFunction free_data_function),
359 (server, add_function, remove_function, toggled_function, data, free_data_function), return)
360 DEFINEFUNC(void , dbus_server_unref, (DBusServer *server),
364 DEFINEFUNC(dbus_bool_t , dbus_threads_init_default, (), (), return)
367 /* D-Bus 1.4 symbols */
368 #if !defined(QT_LINKED_LIBDBUS) || (DBUS_VERSION >= 0x010400)
369 DEFINEFUNC(dbus_bool_t , dbus_connection_can_send_type , (DBusConnection *connection,
371 (connection, type), return)
377 #endif // QDBUS_SYMBOLS_P_H