1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/dbus-1.0/dbus/dbus-glib.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,409 @@
1.4 +/* -*- mode: C; c-file-style: "gnu" -*- */
1.5 +/* dbus-glib.h GLib integration
1.6 + *
1.7 + * Copyright (C) 2002, 2003 CodeFactory AB
1.8 + * Copyright (C) 2003, 2004 Red Hat, Inc.
1.9 + * Portion Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.10 + * Licensed under the Academic Free License version 2.1
1.11 + *
1.12 + * This program is free software; you can redistribute it and/or modify
1.13 + * it under the terms of the GNU General Public License as published by
1.14 + * the Free Software Foundation; either version 2 of the License, or
1.15 + * (at your option) any later version.
1.16 + *
1.17 + * This program is distributed in the hope that it will be useful,
1.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.20 + * GNU General Public License for more details.
1.21 + *
1.22 + * You should have received a copy of the GNU General Public License
1.23 + * along with this program; if not, write to the Free Software
1.24 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.25 + *
1.26 + */
1.27 +#ifndef DBUS_GLIB_H
1.28 +#define DBUS_GLIB_H
1.29 +
1.30 +#include <glib-object.h>
1.31 +#include <dbus/dbus-shared.h>
1.32 +
1.33 +G_BEGIN_DECLS
1.34 +
1.35 +#define DBUS_INSIDE_DBUS_GLIB_H 1
1.36 +
1.37 +
1.38 +/**
1.39 + * Convert to DBusConnection with dbus_g_connection_get_connection() in dbus-glib-lowlevel.h
1.40 + */
1.41 +typedef struct _DBusGConnection DBusGConnection;
1.42 +/**
1.43 + * Convert to DBusMessage with dbus_g_message_get_message() in dbus-glib-lowlevel.h
1.44 + */
1.45 +typedef struct _DBusGMessage DBusGMessage;
1.46 +
1.47 +
1.48 +#define DBUS_TYPE_G_CONNECTION (dbus_g_connection_get_g_type ())
1.49 +#define DBUS_TYPE_G_MESSAGE (dbus_g_message_get_g_type ())
1.50 +#ifdef __SYMBIAN32__
1.51 +IMPORT_C
1.52 +#endif
1.53 +GType dbus_g_connection_get_g_type (void) G_GNUC_CONST;
1.54 +#ifdef __SYMBIAN32__
1.55 +IMPORT_C
1.56 +#endif
1.57 +GType dbus_g_message_get_g_type (void) G_GNUC_CONST;
1.58 +
1.59 +
1.60 +#ifdef __SYMBIAN32__
1.61 +IMPORT_C
1.62 +#endif
1.63 +DBusGConnection* dbus_g_connection_ref (DBusGConnection *connection);
1.64 +#ifdef __SYMBIAN32__
1.65 +IMPORT_C
1.66 +#endif
1.67 +void dbus_g_connection_unref (DBusGConnection *connection);
1.68 +#ifdef __SYMBIAN32__
1.69 +IMPORT_C
1.70 +#endif
1.71 +DBusGMessage* dbus_g_message_ref (DBusGMessage *message);
1.72 +#ifdef __SYMBIAN32__
1.73 +IMPORT_C
1.74 +#endif
1.75 +void dbus_g_message_unref (DBusGMessage *message);
1.76 +
1.77 +#ifdef __SYMBIAN32__
1.78 +IMPORT_C
1.79 +#endif
1.80 +void dbus_g_connection_flush (DBusGConnection *connection);
1.81 +
1.82 +#ifdef __SYMBIAN32__
1.83 +IMPORT_C
1.84 +#endif
1.85 +GQuark dbus_g_error_quark (void);
1.86 +#define DBUS_GERROR dbus_g_error_quark ()
1.87 +
1.88 +typedef enum
1.89 +{
1.90 +#ifndef __SYMBIAN32__
1.91 +#include "dbus-glib-error-enum.h"
1.92 +#else
1.93 +#include <dbus/dbus-glib-error-enum.h>
1.94 +#endif //__SYMBIAN32__
1.95 +} DBusGError;
1.96 +
1.97 +#ifdef __SYMBIAN32__
1.98 +IMPORT_C
1.99 +#endif
1.100 +gboolean dbus_g_error_has_name (GError *error,
1.101 + const char *name);
1.102 +#ifdef __SYMBIAN32__
1.103 +IMPORT_C
1.104 +#endif
1.105 +const char * dbus_g_error_get_name (GError *error);
1.106 +
1.107 +#ifdef __SYMBIAN32__
1.108 +IMPORT_C
1.109 +#endif
1.110 +void dbus_g_thread_init (void);
1.111 +
1.112 +#ifdef __SYMBIAN32__
1.113 +IMPORT_C
1.114 +#endif
1.115 +DBusGConnection* dbus_g_connection_open (const gchar *address,
1.116 + GError **error);
1.117 +#ifdef __SYMBIAN32__
1.118 +IMPORT_C
1.119 +#endif
1.120 +DBusGConnection* dbus_g_bus_get (DBusBusType type,
1.121 + GError **error);
1.122 +
1.123 +typedef struct _DBusGObjectInfo DBusGObjectInfo;
1.124 +typedef struct _DBusGMethodInfo DBusGMethodInfo;
1.125 +
1.126 +/**
1.127 + * DBusGMethodInfo:
1.128 + * @function: C method to invoke
1.129 + * @marshaller: Marshaller to invoke method
1.130 + * @data_offset: Offset into the introspection data
1.131 + *
1.132 + * Object typically generated by #dbus-binding-tool that
1.133 + * stores a mapping from introspection data to a
1.134 + * function pointer for a C method to be invoked.
1.135 + */
1.136 +struct _DBusGMethodInfo
1.137 +{
1.138 + GCallback function;
1.139 + GClosureMarshal marshaller;
1.140 + int data_offset;
1.141 +};
1.142 +
1.143 +/**
1.144 + * DBusGObjectInfo:
1.145 + * @format_version: Allows us to change the rest of this struct
1.146 + * by adding DBusGObjectInfo2, DBusGObjectInfo3, etc.
1.147 + * @method_infos: Array of method pointers
1.148 + * @n_method_infos: Length of the infos array
1.149 + * @data: Introspection data
1.150 + * @exported_signals: Exported signals
1.151 + * @exported_properties: Exported properties
1.152 + *
1.153 + * Introspection data for a #GObject, normally autogenerated by
1.154 + * a tool such as #dbus-binding-tool.
1.155 + */
1.156 +struct _DBusGObjectInfo
1.157 +{
1.158 + int format_version;
1.159 +
1.160 + const DBusGMethodInfo *method_infos;
1.161 + int n_method_infos;
1.162 + const char *data;
1.163 + const char *exported_signals;
1.164 + const char *exported_properties;
1.165 +};
1.166 +
1.167 +#ifdef __SYMBIAN32__
1.168 +IMPORT_C
1.169 +#endif
1.170 +void dbus_g_object_type_install_info (GType object_type,
1.171 + const DBusGObjectInfo *info);
1.172 +
1.173 +#ifdef __SYMBIAN32__
1.174 +IMPORT_C
1.175 +#endif
1.176 +void dbus_g_error_domain_register (GQuark domain,
1.177 + const char * default_iface,
1.178 + GType code_enum);
1.179 +
1.180 +#ifdef __SYMBIAN32__
1.181 +IMPORT_C
1.182 +#endif
1.183 +void dbus_g_connection_register_g_object (DBusGConnection *connection,
1.184 + const char *at_path,
1.185 + GObject *object);
1.186 +#ifdef __SYMBIAN32__
1.187 +IMPORT_C
1.188 +#endif
1.189 +GObject * dbus_g_connection_lookup_g_object (DBusGConnection *connection,
1.190 + const char *at_path);
1.191 +
1.192 +#ifdef DBUS_COMPILATION
1.193 +#include "dbus/dbus-gtype-specialized.h"
1.194 +#else
1.195 +#include <dbus/dbus-gtype-specialized.h>
1.196 +#endif
1.197 +
1.198 +/* definitions for some basic array types */
1.199 +#define DBUS_TYPE_G_BOOLEAN_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_BOOLEAN))
1.200 +#define DBUS_TYPE_G_UCHAR_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR))
1.201 +#define DBUS_TYPE_G_UINT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT))
1.202 +#define DBUS_TYPE_G_INT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT))
1.203 +#define DBUS_TYPE_G_UINT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT64))
1.204 +#define DBUS_TYPE_G_INT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT64))
1.205 +#define DBUS_TYPE_G_OBJECT_ARRAY (dbus_g_type_get_collection ("GPtrArray", G_TYPE_OBJECT))
1.206 +
1.207 +#define DBUS_TYPE_G_STRING_STRING_HASHTABLE (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING))
1.208 +
1.209 +#ifdef __SYMBIAN32__
1.210 +IMPORT_C
1.211 +#endif
1.212 +GType dbus_g_object_path_get_g_type (void) G_GNUC_CONST;
1.213 +#define DBUS_TYPE_G_OBJECT_PATH (dbus_g_object_path_get_g_type ())
1.214 +
1.215 +#ifdef __SYMBIAN32__
1.216 +IMPORT_C
1.217 +#endif
1.218 +void dbus_g_object_register_marshaller (GClosureMarshal marshaller,
1.219 + GType rettype,
1.220 + ...);
1.221 +void dbus_g_object_register_marshaller_array(GClosureMarshal marshaller,
1.222 + GType rettype,
1.223 + guint n_types,
1.224 + const GType* types);
1.225 +
1.226 +typedef struct _DBusGProxy DBusGProxy;
1.227 +typedef struct _DBusGProxyClass DBusGProxyClass;
1.228 +
1.229 +#define DBUS_TYPE_G_PROXY (dbus_g_proxy_get_type ())
1.230 +#define DBUS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_G_PROXY, DBusGProxy))
1.231 +#define DBUS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_G_PROXY, DBusGProxyClass))
1.232 +#define DBUS_IS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_G_PROXY))
1.233 +#define DBUS_IS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_G_PROXY))
1.234 +#define DBUS_G_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_G_PROXY, DBusGProxyClass))
1.235 +
1.236 +struct _DBusGProxy
1.237 +{
1.238 + GObject parent;
1.239 +};
1.240 +
1.241 +struct _DBusGProxyClass
1.242 +{
1.243 + GObjectClass parent_class; /**< Parent class */
1.244 +};
1.245 +
1.246 +typedef struct _DBusGProxyCall DBusGProxyCall;
1.247 +typedef void (* DBusGProxyCallNotify) (DBusGProxy *proxy,
1.248 + DBusGProxyCall *call_id,
1.249 + void *user_data);
1.250 +
1.251 +#ifdef __SYMBIAN32__
1.252 +IMPORT_C
1.253 +#endif
1.254 +GType dbus_g_proxy_get_type (void) G_GNUC_CONST;
1.255 +#ifdef __SYMBIAN32__
1.256 +IMPORT_C
1.257 +#endif
1.258 +DBusGProxy* dbus_g_proxy_new_for_name (DBusGConnection *connection,
1.259 + const char *name,
1.260 + const char *path,
1.261 + const char *interface);
1.262 +#ifdef __SYMBIAN32__
1.263 +IMPORT_C
1.264 +#endif
1.265 +DBusGProxy* dbus_g_proxy_new_for_name_owner (DBusGConnection *connection,
1.266 + const char *name,
1.267 + const char *path,
1.268 + const char *interface,
1.269 + GError **error);
1.270 +#ifdef __SYMBIAN32__
1.271 +IMPORT_C
1.272 +#endif
1.273 +DBusGProxy* dbus_g_proxy_new_from_proxy (DBusGProxy *proxy,
1.274 + const char *interface,
1.275 + const char *path_name);
1.276 +#ifdef __SYMBIAN32__
1.277 +IMPORT_C
1.278 +#endif
1.279 +DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection,
1.280 + const char *path_name,
1.281 + const char *interface_name);
1.282 +
1.283 +#ifdef __SYMBIAN32__
1.284 +IMPORT_C
1.285 +#endif
1.286 +void dbus_g_proxy_set_interface (DBusGProxy *proxy,
1.287 + const char *interface_name);
1.288 +#ifdef __SYMBIAN32__
1.289 +IMPORT_C
1.290 +#endif
1.291 +void dbus_g_proxy_add_signal (DBusGProxy *proxy,
1.292 + const char *signal_name,
1.293 + GType first_type,
1.294 + ...);
1.295 +
1.296 +#ifdef __SYMBIAN32__
1.297 +IMPORT_C
1.298 +#endif
1.299 +void dbus_g_proxy_connect_signal (DBusGProxy *proxy,
1.300 + const char *signal_name,
1.301 + GCallback handler,
1.302 + void *data,
1.303 + GClosureNotify free_data_func);
1.304 +#ifdef __SYMBIAN32__
1.305 +IMPORT_C
1.306 +#endif
1.307 +void dbus_g_proxy_disconnect_signal (DBusGProxy *proxy,
1.308 + const char *signal_name,
1.309 + GCallback handler,
1.310 + void *data);
1.311 +
1.312 +#ifdef __SYMBIAN32__
1.313 +IMPORT_C
1.314 +#endif
1.315 +gboolean dbus_g_proxy_call (DBusGProxy *proxy,
1.316 + const char *method,
1.317 + GError **error,
1.318 + GType first_arg_type,
1.319 + ...);
1.320 +
1.321 +#ifdef __SYMBIAN32__
1.322 +IMPORT_C
1.323 +#endif
1.324 +gboolean dbus_g_proxy_call_with_timeout (DBusGProxy *proxy,
1.325 + const char *method,
1.326 + int timeout,
1.327 + GError **error,
1.328 + GType first_arg_type,
1.329 + ...);
1.330 +
1.331 +#ifdef __SYMBIAN32__
1.332 +IMPORT_C
1.333 +#endif
1.334 +void dbus_g_proxy_call_no_reply (DBusGProxy *proxy,
1.335 + const char *method,
1.336 + GType first_arg_type,
1.337 + ...);
1.338 +
1.339 +#ifdef __SYMBIAN32__
1.340 +IMPORT_C
1.341 +#endif
1.342 +DBusGProxyCall * dbus_g_proxy_begin_call (DBusGProxy *proxy,
1.343 + const char *method,
1.344 + DBusGProxyCallNotify notify,
1.345 + gpointer data,
1.346 + GDestroyNotify destroy,
1.347 + GType first_arg_type,
1.348 + ...);
1.349 +#ifdef __SYMBIAN32__
1.350 +IMPORT_C
1.351 +#endif
1.352 +DBusGProxyCall * dbus_g_proxy_begin_call_with_timeout (DBusGProxy *proxy,
1.353 + const char *method,
1.354 + DBusGProxyCallNotify notify,
1.355 + gpointer user_data,
1.356 + GDestroyNotify destroy,
1.357 + int timeout,
1.358 + GType first_arg_type,
1.359 + ...);
1.360 +
1.361 +#ifdef __SYMBIAN32__
1.362 +IMPORT_C
1.363 +#endif
1.364 +gboolean dbus_g_proxy_end_call (DBusGProxy *proxy,
1.365 + DBusGProxyCall *call,
1.366 + GError **error,
1.367 + GType first_arg_type,
1.368 + ...);
1.369 +#ifdef __SYMBIAN32__
1.370 +IMPORT_C
1.371 +#endif
1.372 +void dbus_g_proxy_cancel_call (DBusGProxy *proxy,
1.373 + DBusGProxyCall *call);
1.374 +
1.375 +#ifdef __SYMBIAN32__
1.376 +IMPORT_C
1.377 +#endif
1.378 +const char* dbus_g_proxy_get_path (DBusGProxy *proxy);
1.379 +
1.380 +#ifdef __SYMBIAN32__
1.381 +IMPORT_C
1.382 +#endif
1.383 +const char* dbus_g_proxy_get_bus_name (DBusGProxy *proxy);
1.384 +
1.385 +#ifdef __SYMBIAN32__
1.386 +IMPORT_C
1.387 +#endif
1.388 +const char* dbus_g_proxy_get_interface (DBusGProxy *proxy);
1.389 +
1.390 +typedef struct _DBusGMethodInvocation DBusGMethodInvocation;
1.391 +
1.392 +#ifdef __SYMBIAN32__
1.393 +IMPORT_C
1.394 +#endif
1.395 +void dbus_g_method_return (DBusGMethodInvocation *context, ...);
1.396 +
1.397 +#ifdef __SYMBIAN32__
1.398 +IMPORT_C
1.399 +#endif
1.400 +void dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error);
1.401 +
1.402 +/* Probably possible to replace this with a closure */
1.403 +typedef struct {
1.404 + GCallback cb;
1.405 + gpointer userdata;
1.406 +} DBusGAsyncData;
1.407 +
1.408 +#undef DBUS_INSIDE_DBUS_GLIB_H
1.409 +
1.410 +G_END_DECLS
1.411 +
1.412 +#endif /* DBUS_GLIB_H */