Merge remote-tracking branch 'origin/api_changes'
[profile/ivi/qtbase.git] / src / dbus / qdbus_symbols_p.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtDBus module of the Qt Toolkit.
7 **
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.
16 **
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.
20 **
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.
28 **
29 ** Other Usage
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.
32 **
33 **
34 **
35 **
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
62 QT_BEGIN_NAMESPACE
63
64 #if !defined QT_LINKED_LIBDBUS
65
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();
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
82 inline 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 */
90 DEFINEFUNC(void, dbus_bus_add_match, (DBusConnection *connection,
91                                       const char     *rule,
92                                       DBusError      *error),
93            (connection, rule, error), )
94 DEFINEFUNC(void, dbus_bus_remove_match, (DBusConnection *connection,
95                                          const char     *rule,
96                                          DBusError      *error),
97            (connection, rule, error), )
98 DEFINEFUNC(dbus_bool_t, dbus_bus_register,(DBusConnection *connection,
99                                            DBusError      *error),
100            (connection, error), return)
101 DEFINEFUNC(DBusConnection *, dbus_bus_get_private, (DBusBusType     type,
102                                                     DBusError      *error),
103            (type, error), return)
104 DEFINEFUNC(const char*, dbus_bus_get_unique_name, (DBusConnection *connection),
105            (connection), return)
106
107 /* dbus-connection.h */
108 DEFINEFUNC(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)
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,
122                                                                DBusError                  *error),
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,
138                                                                             DBusError                  *error),
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,
147                                                                         void                       *data,
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,
154                                                                       void                       *data,
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,
159                                                                           void                       *data,
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,
164                                                                               void                       *data,
165                                                                               DBusFreeFunction            free_data_function),
166            (connection, function, data, free_data_function), )
167
168 DEFINEFUNC(void               , dbus_connection_unref, (DBusConnection             *connection),
169            (connection), )
170 DEFINEFUNC(dbus_bool_t , dbus_timeout_get_enabled, (DBusTimeout      *timeout),
171            (timeout), return)
172 DEFINEFUNC(int         , dbus_timeout_get_interval, (DBusTimeout      *timeout),
173            (timeout), return)
174 DEFINEFUNC(dbus_bool_t , dbus_timeout_handle, (DBusTimeout      *timeout),
175            (timeout), return)
176
177 DEFINEFUNC(dbus_bool_t  , dbus_watch_get_enabled, (DBusWatch        *watch),
178            (watch), return)
179 DEFINEFUNC(int , dbus_watch_get_fd, (DBusWatch        *watch),
180            (watch), return)
181 DEFINEFUNC(unsigned int , dbus_watch_get_flags, (DBusWatch        *watch),
182            (watch), return)
183 DEFINEFUNC(dbus_bool_t  , dbus_watch_handle, (DBusWatch        *watch,
184                                               unsigned int      flags),
185            (watch, flags), return)
186
187 /* dbus-errors.h */
188 DEFINEFUNC(void        , dbus_error_free, (DBusError       *error),
189            (error), )
190 DEFINEFUNC(void        , dbus_error_init, (DBusError       *error),
191            (error), )
192 DEFINEFUNC(dbus_bool_t , dbus_error_is_set, (const DBusError *error),
193            (error), return)
194
195 /* dbus-memory.h */
196 DEFINEFUNC(void  , dbus_free, (void  *memory), (memory), )
197
198 /* dbus-message.h */
199 DEFINEFUNC(DBusMessage* , dbus_message_copy, (const DBusMessage *message),
200            (message), return)
201 DEFINEFUNC(dbus_bool_t   , dbus_message_get_auto_start, (DBusMessage   *message),
202            (message), return)
203 DEFINEFUNC(const char*   , dbus_message_get_error_name, (DBusMessage   *message),
204            (message), return)
205 DEFINEFUNC(const char*   , dbus_message_get_interface, (DBusMessage   *message),
206            (message), return)
207 DEFINEFUNC(const char*   , dbus_message_get_member, (DBusMessage   *message),
208            (message), return)
209 DEFINEFUNC(dbus_bool_t   , dbus_message_get_no_reply, (DBusMessage   *message),
210            (message), return)
211 DEFINEFUNC(const char*   , dbus_message_get_path, (DBusMessage   *message),
212            (message), return)
213 DEFINEFUNC(const char*   , dbus_message_get_sender, (DBusMessage   *message),
214            (message), return)
215 DEFINEFUNC(dbus_uint32_t , dbus_message_get_serial, (DBusMessage   *message),
216            (message), return)
217 DEFINEFUNC(const char*   , dbus_message_get_signature, (DBusMessage   *message),
218            (message), return)
219 DEFINEFUNC(int           , dbus_message_get_type, (DBusMessage   *message),
220            (message), return)
221 DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_basic, (DBusMessageIter *iter,
222                                                           int              type,
223                                                           const void      *value),
224            (iter, type, value), return)
225 DEFINEFUNC(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)
230 DEFINEFUNC(dbus_bool_t , dbus_message_iter_close_container, (DBusMessageIter *iter,
231                                                              DBusMessageIter *sub),
232            (iter, sub), return)
233 DEFINEFUNC(int         , dbus_message_iter_get_arg_type, (DBusMessageIter *iter),
234            (iter), return)
235 DEFINEFUNC(void        , dbus_message_iter_get_basic, (DBusMessageIter *iter,
236                                                        void            *value),
237            (iter, value), )
238 DEFINEFUNC(int         , dbus_message_iter_get_element_type, (DBusMessageIter *iter),
239            (iter), return)
240 DEFINEFUNC(void        , dbus_message_iter_get_fixed_array, (DBusMessageIter *iter,
241                                                              void            *value,
242                                                              int             *n_elements),
243            (iter, value, n_elements), return)
244 DEFINEFUNC(char*       , dbus_message_iter_get_signature, (DBusMessageIter *iter),
245            (iter), return)
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),
253            (iter), return)
254 DEFINEFUNC(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)
259 DEFINEFUNC(void        , dbus_message_iter_recurse, (DBusMessageIter *iter,
260                                                      DBusMessageIter *sub),
261            (iter, 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,
265                                                          const char  *path,
266                                                          const char  *interface,
267                                                          const char  *method),
268            (bus_name, path, interface, method), return)
269 DEFINEFUNC(DBusMessage* , dbus_message_new_signal, (const char  *path,
270                                                     const char  *interface,
271                                                     const char  *name),
272            (path, interface, name), return)
273 DEFINEFUNC(DBusMessage*  , dbus_message_ref, (DBusMessage   *message),
274            (message), return)
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,
282                                                          const char    *name),
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,
294                                                      const char    *sender),
295            (message, sender), return)
296 DEFINEFUNC(void          , dbus_message_unref, (DBusMessage   *message),
297            (message), )
298
299 /* dbus-misc.h */
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)
305
306
307 /* dbus-pending-call.h */
308 DEFINEFUNC(dbus_bool_t  , dbus_pending_call_set_notify, (DBusPendingCall               *pending,
309                                                          DBusPendingCallNotifyFunction  function,
310                                                          void                          *user_data,
311                                                          DBusFreeFunction               free_user_data),
312            (pending, function, user_data, free_user_data), return)
313 DEFINEFUNC(void         , dbus_pending_call_block, (DBusPendingCall               *pending),
314            (pending), )
315 DEFINEFUNC(void         , dbus_pending_call_cancel, (DBusPendingCall               *pending),
316            (pending), )
317 DEFINEFUNC(dbus_bool_t  , dbus_pending_call_get_completed, (DBusPendingCall               *pending),
318            (pending), return)
319 DEFINEFUNC(DBusMessage* , dbus_pending_call_steal_reply, (DBusPendingCall               *pending),
320            (pending), return)
321 DEFINEFUNC(void         , dbus_pending_call_unref, (DBusPendingCall               *pending),
322            (pending), return)
323
324 /* dbus-server.h */
325 DEFINEFUNC(dbus_bool_t , dbus_server_allocate_data_slot, (dbus_int32_t     *slot_p),
326            (slot_p), return)
327 DEFINEFUNC(void        , dbus_server_disconnect, (DBusServer     *server),
328            (server), )
329 DEFINEFUNC(char*       , dbus_server_get_address, (DBusServer     *server),
330            (server), return)
331 DEFINEFUNC(dbus_bool_t , dbus_server_get_is_connected, (DBusServer     *server),
332            (server), return)
333 DEFINEFUNC(DBusServer* , dbus_server_listen, (const char     *address,
334                                               DBusError      *error),
335            (address, error), return)
336 DEFINEFUNC(dbus_bool_t , dbus_server_set_data, (DBusServer       *server,
337                                                 int               slot,
338                                                 void             *data,
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,
343                                                                    void                      *data,
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,
350                                                              void                      *data,
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,
357                                                            void                      *data,
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),
361            (server), )
362
363 /* dbus-thread.h */
364 DEFINEFUNC(dbus_bool_t     , dbus_threads_init_default, (), (), return)
365
366
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,
370                                                                             int                         type),
371            (connection, type), return)
372 #endif
373
374 QT_END_NAMESPACE
375
376 #endif // QT_NO_DBUS
377 #endif // QDBUS_SYMBOLS_P_H