diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-02-13 20:29:38 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-02-13 20:29:38 +0000 |
commit | bec86c3c96d3bdafffc119bda107bd966bff7af7 (patch) | |
tree | bef0ddd0cca3787bb76242b262eaefa677556059 /telepathy-glib/dbus-properties-mixin.h | |
parent | a8d776e3729997092a4ab3d78b0d234f3999b613 (diff) | |
download | telepathy-glib-bec86c3c96d3bdafffc119bda107bd966bff7af7.tar.gz |
Add D-Bus core Properties mixin
20080213202938-53eee-e98844c0381d3d918a09ea4ed0bd357504eff122.gz
Diffstat (limited to 'telepathy-glib/dbus-properties-mixin.h')
-rw-r--r-- | telepathy-glib/dbus-properties-mixin.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/telepathy-glib/dbus-properties-mixin.h b/telepathy-glib/dbus-properties-mixin.h new file mode 100644 index 000000000..b37850ee4 --- /dev/null +++ b/telepathy-glib/dbus-properties-mixin.h @@ -0,0 +1,105 @@ +/* + * dbus-properties-mixin.h - D-Bus core Properties + * Copyright (C) 2008 Collabora Ltd. + * Copyright (C) 2008 Nokia Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __TP_DBUS_PROPERTIES_MIXIN_H__ +#define __TP_DBUS_PROPERTIES_MIXIN_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS + +/* ---- Semi-abstract property definition (used in TpSvc*) ---------- */ + +typedef enum { + TP_DBUS_PROPERTIES_MIXIN_FLAG_READ = 1, + TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE = 2 +} TpDBusPropertiesMixinFlags; + +typedef struct { + GQuark name; + TpDBusPropertiesMixinFlags flags; + gchar *dbus_signature; + GType type; + gpointer _1; + gpointer _2; +} TpDBusPropertiesMixinPropInfo; + +typedef struct { + GQuark dbus_interface; + TpDBusPropertiesMixinPropInfo *props; + gpointer _1; + gpointer _2; +} TpDBusPropertiesMixinIfaceInfo; + +void tp_svc_interface_set_dbus_properties_info (GType g_interface, + TpDBusPropertiesMixinIfaceInfo *info); + +TpDBusPropertiesMixinIfaceInfo *tp_svc_interface_get_dbus_properties_info + (GType g_interface); + +/* ---- Concrete implementation (in GObject subclasses) ------------- */ + +typedef void (*TpDBusPropertiesMixinGetter) (GObject *object, + GQuark interface, GQuark name, GValue *value, gpointer user_data); + +typedef gboolean (*TpDBusPropertiesMixinSetter) (GObject *object, + GQuark interface, GQuark name, const GValue *value, gpointer user_data, + GError **error); + +typedef struct { + const gchar *name; + gpointer data; + gpointer _1; + gpointer mixin_priv; +} TpDBusPropertiesMixinPropImpl; + +typedef struct { + GQuark dbus_interface; + GType svc_interface; + TpDBusPropertiesMixinGetter getter; + TpDBusPropertiesMixinSetter setter; + TpDBusPropertiesMixinPropImpl *props; + gpointer _1; + gpointer _2; + gpointer _3; +} TpDBusPropertiesMixinIfaceImpl; + +struct _TpDBusPropertiesMixinClass { + TpDBusPropertiesMixinIfaceImpl *interfaces; + gpointer _1; + gpointer _2; + gpointer _3; + gpointer _4; + gpointer _5; + gpointer _6; + gpointer _7; +}; + +typedef struct _TpDBusPropertiesMixinClass TpDBusPropertiesMixinClass; + +void tp_dbus_properties_mixin_class_init (GObjectClass *cls, + gsize offset); + +void tp_dbus_properties_mixin_iface_init (gpointer g_iface, + gpointer iface_data); + +G_END_DECLS + +#endif /* #ifndef __TP_DBUS_PROPERTIES_MIXIN_H__ */ |