1/****************************************************************************
2**
3** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtDBus module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42//
43// W A R N I N G
44// -------------
45//
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
48// removed.
49//
50// We mean it.
51//
52//
53
54#ifndef QDBUS_SYMBOLS_P_H
55#define QDBUS_SYMBOLS_P_H
56
57#include <QtCore/qglobal.h>
58#include <dbus/dbus.h>
59
60#ifndef QT_NO_DBUS
61
62QT_BEGIN_NAMESPACE
63
64#if !defined QT_LINKED_LIBDBUS
65
66void *qdbus_resolve_conditionally(const char *name); // doesn't print a warning
67void *qdbus_resolve_me(const char *name); // prints a warning
68bool qdbus_loadLibDBus();
69
70# define DEFINEFUNC(ret, func, args, argcall, funcret) \
71 typedef ret (* _q_PTR_##func) args; \
72 static inline ret q_##func args \
73 { \
74 static _q_PTR_##func ptr; \
75 if (!ptr) \
76 ptr = (_q_PTR_##func) qdbus_resolve_me(#func); \
77 funcret ptr argcall; \
78 }
79
80#else // defined QT_LINKED_LIBDBUS
81
82inline bool qdbus_loadLibDBus() { return true; }
83
84# define DEFINEFUNC(ret, func, args, argcall, funcret) \
85 static inline ret q_##func args { funcret func argcall; }
86
87#endif // defined QT_LINKED_LIBDBUS
88
89/* dbus-bus.h */
90DEFINEFUNC(void, dbus_bus_add_match, (DBusConnection *connection,
91 const char *rule,
92 DBusError *error),
93 (connection, rule, error), )
94DEFINEFUNC(void, dbus_bus_remove_match, (DBusConnection *connection,
95 const char *rule,
96 DBusError *error),
97 (connection, rule, error), )
98DEFINEFUNC(dbus_bool_t, dbus_bus_register,(DBusConnection *connection,
99 DBusError *error),
100 (connection, error), return)
101DEFINEFUNC(DBusConnection *, dbus_bus_get_private, (DBusBusType type,
102 DBusError *error),
103 (type, error), return)
104DEFINEFUNC(const char*, dbus_bus_get_unique_name, (DBusConnection *connection),
105 (connection), return)
106
107/* dbus-connection.h */
108DEFINEFUNC(dbus_bool_t , dbus_connection_add_filter, (DBusConnection *connection,
109 DBusHandleMessageFunction function,
110 void *user_data,
111 DBusFreeFunction free_data_function),
112 (connection, function, user_data, free_data_function), return)
113DEFINEFUNC(void , dbus_connection_close, (DBusConnection *connection),
114 (connection), return)
115DEFINEFUNC(DBusDispatchStatus , dbus_connection_dispatch, (DBusConnection *connection),
116 (connection), return)
117DEFINEFUNC(DBusDispatchStatus , dbus_connection_get_dispatch_status, (DBusConnection *connection),
118 (connection), return)
119DEFINEFUNC(dbus_bool_t , dbus_connection_get_is_connected, (DBusConnection *connection),
120 (connection), return)
121DEFINEFUNC(DBusConnection* , dbus_connection_open_private, (const char *address,
122 DBusError *error),
123 (address, error), return)
124DEFINEFUNC(DBusConnection* , dbus_connection_ref, (DBusConnection *connection),
125 (connection), return)
126DEFINEFUNC(dbus_bool_t , dbus_connection_send, (DBusConnection *connection,
127 DBusMessage *message,
128 dbus_uint32_t *client_serial),
129 (connection, message, client_serial), return)
130DEFINEFUNC(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)
135DEFINEFUNC(DBusMessage * , dbus_connection_send_with_reply_and_block, (DBusConnection *connection,
136 DBusMessage *message,
137 int timeout_milliseconds,
138 DBusError *error),
139 (connection, message, timeout_milliseconds, error), return)
140DEFINEFUNC(void , dbus_connection_set_exit_on_disconnect, (DBusConnection *connection,
141 dbus_bool_t exit_on_disconnect),
142 (connection, exit_on_disconnect), )
143DEFINEFUNC(dbus_bool_t , dbus_connection_set_timeout_functions, (DBusConnection *connection,
144 DBusAddTimeoutFunction add_function,
145 DBusRemoveTimeoutFunction remove_function,
146 DBusTimeoutToggledFunction toggled_function,
147 void *data,
148 DBusFreeFunction free_data_function),
149 (connection, add_function, remove_function, toggled_function, data, free_data_function), return)
150DEFINEFUNC(dbus_bool_t , dbus_connection_set_watch_functions, (DBusConnection *connection,
151 DBusAddWatchFunction add_function,
152 DBusRemoveWatchFunction remove_function,
153 DBusWatchToggledFunction toggled_function,
154 void *data,
155 DBusFreeFunction free_data_function),
156 (connection, add_function, remove_function, toggled_function, data, free_data_function), return)
157DEFINEFUNC(void , dbus_connection_set_wakeup_main_function, (DBusConnection *connection,
158 DBusWakeupMainFunction wakeup_main_function,
159 void *data,
160 DBusFreeFunction free_data_function),
161 (connection, wakeup_main_function, data, free_data_function), )
162DEFINEFUNC(void , dbus_connection_set_dispatch_status_function, (DBusConnection *connection,
163 DBusDispatchStatusFunction function,
164 void *data,
165 DBusFreeFunction free_data_function),
166 (connection, function, data, free_data_function), )
167
168DEFINEFUNC(void , dbus_connection_unref, (DBusConnection *connection),
169 (connection), )
170DEFINEFUNC(dbus_bool_t , dbus_timeout_get_enabled, (DBusTimeout *timeout),
171 (timeout), return)
172DEFINEFUNC(int , dbus_timeout_get_interval, (DBusTimeout *timeout),
173 (timeout), return)
174DEFINEFUNC(dbus_bool_t , dbus_timeout_handle, (DBusTimeout *timeout),
175 (timeout), return)
176
177DEFINEFUNC(dbus_bool_t , dbus_watch_get_enabled, (DBusWatch *watch),
178 (watch), return)
179DEFINEFUNC(int , dbus_watch_get_fd, (DBusWatch *watch),
180 (watch), return)
181DEFINEFUNC(unsigned int , dbus_watch_get_flags, (DBusWatch *watch),
182 (watch), return)
183DEFINEFUNC(dbus_bool_t , dbus_watch_handle, (DBusWatch *watch,
184 unsigned int flags),
185 (watch, flags), return)
186
187/* dbus-errors.h */
188DEFINEFUNC(void , dbus_error_free, (DBusError *error),
189 (error), )
190DEFINEFUNC(void , dbus_error_init, (DBusError *error),
191 (error), )
192DEFINEFUNC(dbus_bool_t , dbus_error_is_set, (const DBusError *error),
193 (error), return)
194
195/* dbus-memory.h */
196DEFINEFUNC(void , dbus_free, (void *memory), (memory), )
197
198/* dbus-message.h */
199DEFINEFUNC(DBusMessage* , dbus_message_copy, (const DBusMessage *message),
200 (message), return)
201DEFINEFUNC(dbus_bool_t , dbus_message_get_auto_start, (DBusMessage *message),
202 (message), return)
203DEFINEFUNC(const char* , dbus_message_get_error_name, (DBusMessage *message),
204 (message), return)
205DEFINEFUNC(const char* , dbus_message_get_interface, (DBusMessage *message),
206 (message), return)
207DEFINEFUNC(const char* , dbus_message_get_member, (DBusMessage *message),
208 (message), return)
209DEFINEFUNC(dbus_bool_t , dbus_message_get_no_reply, (DBusMessage *message),
210 (message), return)
211DEFINEFUNC(const char* , dbus_message_get_path, (DBusMessage *message),
212 (message), return)
213DEFINEFUNC(const char* , dbus_message_get_sender, (DBusMessage *message),
214 (message), return)
215DEFINEFUNC(dbus_uint32_t , dbus_message_get_serial, (DBusMessage *message),
216 (message), return)
217DEFINEFUNC(const char* , dbus_message_get_signature, (DBusMessage *message),
218 (message), return)
219DEFINEFUNC(int , dbus_message_get_type, (DBusMessage *message),
220 (message), return)
221DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_basic, (DBusMessageIter *iter,
222 int type,
223 const void *value),
224 (iter, type, value), return)
225DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_fixed_array, (DBusMessageIter *iter,
226 int element_type,
227 const void *value,
228 int n_elements),
229 (iter, element_type, value, n_elements), return)
230DEFINEFUNC(dbus_bool_t , dbus_message_iter_close_container, (DBusMessageIter *iter,
231 DBusMessageIter *sub),
232 (iter, sub), return)
233DEFINEFUNC(int , dbus_message_iter_get_arg_type, (DBusMessageIter *iter),
234 (iter), return)
235DEFINEFUNC(void , dbus_message_iter_get_basic, (DBusMessageIter *iter,
236 void *value),
237 (iter, value), )
238DEFINEFUNC(int , dbus_message_iter_get_element_type, (DBusMessageIter *iter),
239 (iter), return)
240DEFINEFUNC(void , dbus_message_iter_get_fixed_array, (DBusMessageIter *iter,
241 void *value,
242 int *n_elements),
243 (iter, value, n_elements), return)
244DEFINEFUNC(char* , dbus_message_iter_get_signature, (DBusMessageIter *iter),
245 (iter), return)
246DEFINEFUNC(dbus_bool_t , dbus_message_iter_init, (DBusMessage *message,
247 DBusMessageIter *iter),
248 (message, iter), return)
249DEFINEFUNC(void , dbus_message_iter_init_append, (DBusMessage *message,
250 DBusMessageIter *iter),
251 (message, iter), return)
252DEFINEFUNC(dbus_bool_t , dbus_message_iter_next, (DBusMessageIter *iter),
253 (iter), return)
254DEFINEFUNC(dbus_bool_t , dbus_message_iter_open_container, (DBusMessageIter *iter,
255 int type,
256 const char *contained_signature,
257 DBusMessageIter *sub),
258 (iter, type, contained_signature, sub), return)
259DEFINEFUNC(void , dbus_message_iter_recurse, (DBusMessageIter *iter,
260 DBusMessageIter *sub),
261 (iter, sub), )
262DEFINEFUNC(DBusMessage* , dbus_message_new, (int message_type),
263 (message_type), return)
264DEFINEFUNC(DBusMessage* , dbus_message_new_method_call, (const char *bus_name,
265 const char *path,
266 const char *interface,
267 const char *method),
268 (bus_name, path, interface, method), return)
269DEFINEFUNC(DBusMessage* , dbus_message_new_signal, (const char *path,
270 const char *interface,
271 const char *name),
272 (path, interface, name), return)
273DEFINEFUNC(DBusMessage* , dbus_message_ref, (DBusMessage *message),
274 (message), return)
275DEFINEFUNC(void , dbus_message_set_auto_start, (DBusMessage *message,
276 dbus_bool_t auto_start),
277 (message, auto_start), return)
278DEFINEFUNC(dbus_bool_t , dbus_message_set_destination, (DBusMessage *message,
279 const char *destination),
280 (message, destination), return)
281DEFINEFUNC(dbus_bool_t , dbus_message_set_error_name, (DBusMessage *message,
282 const char *name),
283 (message, name), return)
284DEFINEFUNC(void , dbus_message_set_no_reply, (DBusMessage *message,
285 dbus_bool_t no_reply),
286 (message, no_reply), return)
287DEFINEFUNC(dbus_bool_t , dbus_message_set_path, (DBusMessage *message,
288 const char *object_path),
289 (message, object_path), return)
290DEFINEFUNC(dbus_bool_t , dbus_message_set_reply_serial, (DBusMessage *message,
291 dbus_uint32_t reply_serial),
292 (message, reply_serial), return)
293DEFINEFUNC(dbus_bool_t , dbus_message_set_sender, (DBusMessage *message,
294 const char *sender),
295 (message, sender), return)
296DEFINEFUNC(void , dbus_message_unref, (DBusMessage *message),
297 (message), )
298
299/* dbus-misc.h */
300DEFINEFUNC(char* , dbus_get_local_machine_id , (void), (), return)
301
302
303/* dbus-pending-call.h */
304DEFINEFUNC(dbus_bool_t , dbus_pending_call_set_notify, (DBusPendingCall *pending,
305 DBusPendingCallNotifyFunction function,
306 void *user_data,
307 DBusFreeFunction free_user_data),
308 (pending, function, user_data, free_user_data), return)
309DEFINEFUNC(void , dbus_pending_call_block, (DBusPendingCall *pending),
310 (pending), )
311DEFINEFUNC(void , dbus_pending_call_cancel, (DBusPendingCall *pending),
312 (pending), )
313DEFINEFUNC(dbus_bool_t , dbus_pending_call_get_completed, (DBusPendingCall *pending),
314 (pending), return)
315DEFINEFUNC(DBusMessage* , dbus_pending_call_steal_reply, (DBusPendingCall *pending),
316 (pending), return)
317DEFINEFUNC(void , dbus_pending_call_unref, (DBusPendingCall *pending),
318 (pending), return)
319
320/* dbus-server.h */
321DEFINEFUNC(dbus_bool_t , dbus_server_allocate_data_slot, (dbus_int32_t *slot_p),
322 (slot_p), return)
323DEFINEFUNC(void , dbus_server_disconnect, (DBusServer *server),
324 (server), )
325DEFINEFUNC(char* , dbus_server_get_address, (DBusServer *server),
326 (server), return)
327DEFINEFUNC(dbus_bool_t , dbus_server_get_is_connected, (DBusServer *server),
328 (server), return)
329DEFINEFUNC(DBusServer* , dbus_server_listen, (const char *address,
330 DBusError *error),
331 (address, error), return)
332DEFINEFUNC(dbus_bool_t , dbus_server_set_data, (DBusServer *server,
333 int slot,
334 void *data,
335 DBusFreeFunction free_data_func),
336 (server, slot, data, free_data_func), return)
337DEFINEFUNC(void , dbus_server_set_new_connection_function, (DBusServer *server,
338 DBusNewConnectionFunction function,
339 void *data,
340 DBusFreeFunction free_data_function),
341 (server, function, data, free_data_function), )
342DEFINEFUNC(dbus_bool_t , dbus_server_set_timeout_functions, (DBusServer *server,
343 DBusAddTimeoutFunction add_function,
344 DBusRemoveTimeoutFunction remove_function,
345 DBusTimeoutToggledFunction toggled_function,
346 void *data,
347 DBusFreeFunction free_data_function),
348 (server, add_function, remove_function, toggled_function, data, free_data_function), return)
349DEFINEFUNC(dbus_bool_t , dbus_server_set_watch_functions, (DBusServer *server,
350 DBusAddWatchFunction add_function,
351 DBusRemoveWatchFunction remove_function,
352 DBusWatchToggledFunction toggled_function,
353 void *data,
354 DBusFreeFunction free_data_function),
355 (server, add_function, remove_function, toggled_function, data, free_data_function), return)
356DEFINEFUNC(void , dbus_server_unref, (DBusServer *server),
357 (server), )
358
359/* dbus-thread.h */
360DEFINEFUNC(dbus_bool_t , dbus_threads_init_default, (), (), return)
361
362QT_END_NAMESPACE
363
364#endif // QT_NO_DBUS
365#endif // QDBUS_SYMBOLS_P_H
366