diff options
author | Matt Porter <mporter@konsulko.com> | 2018-06-04 14:31:40 -0400 |
---|---|---|
committer | Matt Porter <mporter@konsulko.com> | 2018-06-14 10:58:53 -0400 |
commit | 2cf42de672004e56063f83ad26da8fec1c757e43 (patch) | |
tree | 15b0d0be0f2cf6f716389c3725740aff44ec8f15 /binding/gdbus | |
parent | 830bf99eba883c93cf231b661310da57eeb54a88 (diff) |
Initial Bluetooth PBAP binding
Supports the following features:
- retrieval of phonebook contacts
- retrieval of call history (incoming/outgoing/missed/combined lists)
- retrieval of individual contact entry by handle
- search for contact by phone number
Bug-AGL: SPEC-1437
Change-Id: I1d0d5c4c02e5ba4a5db1bcfc932421fd9d478426
Signed-off-by: Matt Porter <mporter@konsulko.com>
Diffstat (limited to 'binding/gdbus')
-rw-r--r-- | binding/gdbus/api/client1.xml | 12 | ||||
-rw-r--r-- | binding/gdbus/api/org.freedesktop.DBus.Properties.xml | 25 | ||||
-rw-r--r-- | binding/gdbus/api/phonebookaccess1.xml | 45 | ||||
-rw-r--r-- | binding/gdbus/api/session-dump.xml | 54 | ||||
-rw-r--r-- | binding/gdbus/api/session1.xml | 13 | ||||
-rw-r--r-- | binding/gdbus/api/transfer1.xml | 19 | ||||
-rw-r--r-- | binding/gdbus/freedesktop_dbus_properties_interface.c | 1617 | ||||
-rw-r--r-- | binding/gdbus/freedesktop_dbus_properties_interface.h | 263 | ||||
-rwxr-xr-x | binding/gdbus/generate_interfaces.sh | 30 | ||||
-rw-r--r-- | binding/gdbus/obex_client1_interface.c | 1817 | ||||
-rw-r--r-- | binding/gdbus/obex_client1_interface.h | 367 | ||||
-rw-r--r-- | binding/gdbus/obex_phonebookaccess1_interface.c | 3204 | ||||
-rw-r--r-- | binding/gdbus/obex_phonebookaccess1_interface.h | 432 | ||||
-rw-r--r-- | binding/gdbus/obex_session1_interface.c | 1664 | ||||
-rw-r--r-- | binding/gdbus/obex_session1_interface.h | 204 | ||||
-rw-r--r-- | binding/gdbus/obex_transfer1_interface.c | 1307 | ||||
-rw-r--r-- | binding/gdbus/obex_transfer1_interface.h | 223 |
17 files changed, 11296 insertions, 0 deletions
diff --git a/binding/gdbus/api/client1.xml b/binding/gdbus/api/client1.xml new file mode 100644 index 0000000..1bbb1ee --- /dev/null +++ b/binding/gdbus/api/client1.xml @@ -0,0 +1,12 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" +"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.bluez.obex.Client1"> + <method name="CreateSession"><arg name="destination" type="s" direction="in"/> + <arg name="args" type="a{sv}" direction="in"/> + <arg name="session" type="o" direction="out"/> + </method> + <method name="RemoveSession"><arg name="session" type="o" direction="in"/> + </method> + </interface> +</node> diff --git a/binding/gdbus/api/org.freedesktop.DBus.Properties.xml b/binding/gdbus/api/org.freedesktop.DBus.Properties.xml new file mode 100644 index 0000000..5d9c55f --- /dev/null +++ b/binding/gdbus/api/org.freedesktop.DBus.Properties.xml @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.freedesktop.DBus.Properties"> + <method name="Get"> + <arg type="s" name="interface_name" direction="in"/> + <arg type="s" name="property_name" direction="in"/> + <arg type="v" name="value" direction="out"/> + </method> + <method name="GetAll"> + <arg type="s" name="interface_name" direction="in"/> + <arg type="a{sv}" name="properties" direction="out"/> + </method> + <method name="Set"> + <arg type="s" name="interface_name" direction="in"/> + <arg type="s" name="property_name" direction="in"/> + <arg type="v" name="value" direction="in"/> + </method> + <signal name="PropertiesChanged"> + <arg type="s" name="interface_name"/> + <arg type="a{sv}" name="changed_properties"/> + <arg type="as" name="invalidated_properties"/> + </signal> + </interface> +</node> diff --git a/binding/gdbus/api/phonebookaccess1.xml b/binding/gdbus/api/phonebookaccess1.xml new file mode 100644 index 0000000..ec2f5a8 --- /dev/null +++ b/binding/gdbus/api/phonebookaccess1.xml @@ -0,0 +1,45 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" +"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.bluez.obex.PhonebookAccess1"> + <method name="Select"> + <arg name="location" type="s" direction="in"/> + <arg name="phonebook" type="s" direction="in"/> + </method> + <method name="PullAll"> + <arg name="targetfile" type="s" direction="in"/> + <arg name="filters" type="a{sv}" direction="in"/> + <arg name="transfer" type="o" direction="out"/> + <arg name="properties" type="a{sv}" direction="out"/> + </method> + <method name="Pull"> + <arg name="vcard" type="s" direction="in"/> + <arg name="targetfile" type="s" direction="in"/> + <arg name="filters" type="a{sv}" direction="in"/> + <arg name="transfer" type="o" direction="out"/> + <arg name="properties" type="a{sv}" direction="out"/> + </method> + <method name="List"> + <arg name="filters" type="a{sv}" direction="in"/> + <arg name="vcard_listing" type="a(ss)" direction="out"/> + </method> + <method name="Search"> + <arg name="field" type="s" direction="in"/> + <arg name="value" type="s" direction="in"/> + <arg name="filters" type="a{sv}" direction="in"/> + <arg name="vcard_listing" type="a(ss)" direction="out"/> + </method> + <method name="GetSize"> + <arg name="size" type="q" direction="out"/> + </method> + <method name="ListFilterFields"> + <arg name="fields" type="as" direction="out"/> + </method> + <method name="UpdateVersion"></method> + <property name="Folder" type="s" access="read"></property> + <property name="DatabaseIdentifier" type="s" access="read"></property> + <property name="PrimaryCounter" type="s" access="read"></property> + <property name="SecondaryCounter" type="s" access="read"></property> + <property name="FixedImageSize" type="b" access="read"></property> + </interface> +</node> diff --git a/binding/gdbus/api/session-dump.xml b/binding/gdbus/api/session-dump.xml new file mode 100644 index 0000000..1fcf7b8 --- /dev/null +++ b/binding/gdbus/api/session-dump.xml @@ -0,0 +1,54 @@ +('<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection ' + '1.0//EN"\n' + '"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">\n' + '<node><interface name="org.freedesktop.DBus.Introspectable"><method ' + 'name="Introspect"><arg name="xml" type="s" direction="out"/>\n' + '</method></interface><interface name="org.bluez.obex.Session1"><method ' + 'name="GetCapabilities"><arg name="capabilities" type="s" direction="out"/>\n' + '</method><property name="Source" type="s" access="read"></property><property ' + 'name="Destination" type="s" access="read"></property><property ' + 'name="Channel" type="y" access="read"></property><property name="Target" ' + 'type="s" access="read"></property></interface><interface ' + 'name="org.freedesktop.DBus.Properties"><method name="Get"><arg ' + 'name="interface" type="s" direction="in"/>\n' + '<arg name="name" type="s" direction="in"/>\n' + '<arg name="value" type="v" direction="out"/>\n' + '</method><method name="Set"><arg name="interface" type="s" direction="in"/>\n' + '<arg name="name" type="s" direction="in"/>\n' + '<arg name="value" type="v" direction="in"/>\n' + '</method><method name="GetAll"><arg name="interface" type="s" ' + 'direction="in"/>\n' + '<arg name="properties" type="a{sv}" direction="out"/>\n' + '</method><signal name="PropertiesChanged"><arg name="interface" type="s"/>\n' + '<arg name="changed_properties" type="a{sv}"/>\n' + '<arg name="invalidated_properties" type="as"/>\n' + '</signal>\n' + '</interface><interface name="org.bluez.obex.PhonebookAccess1"><method ' + 'name="Select"><arg name="location" type="s" direction="in"/>\n' + '<arg name="phonebook" type="s" direction="in"/>\n' + '</method><method name="PullAll"><arg name="targetfile" type="s" ' + 'direction="in"/>\n' + '<arg name="filters" type="a{sv}" direction="in"/>\n' + '<arg name="transfer" type="o" direction="out"/>\n' + '<arg name="properties" type="a{sv}" direction="out"/>\n' + '</method><method name="Pull"><arg name="vcard" type="s" direction="in"/>\n' + '<arg name="targetfile" type="s" direction="in"/>\n' + '<arg name="filters" type="a{sv}" direction="in"/>\n' + '<arg name="transfer" type="o" direction="out"/>\n' + '<arg name="properties" type="a{sv}" direction="out"/>\n' + '</method><method name="List"><arg name="filters" type="a{sv}" ' + 'direction="in"/>\n' + '<arg name="vcard_listing" type="a(ss)" direction="out"/>\n' + '</method><method name="Search"><arg name="field" type="s" direction="in"/>\n' + '<arg name="value" type="s" direction="in"/>\n' + '<arg name="filters" type="a{sv}" direction="in"/>\n' + '<arg name="vcard_listing" type="a(ss)" direction="out"/>\n' + '</method><method name="GetSize"><arg name="size" type="q" direction="out"/>\n' + '</method><method name="ListFilterFields"><arg name="fields" type="as" ' + 'direction="out"/>\n' + '</method><method name="UpdateVersion"></method><property name="Folder" ' + 'type="s" access="read"></property><property name="DatabaseIdentifier" ' + 'type="s" access="read"></property><property name="PrimaryCounter" type="s" ' + 'access="read"></property><property name="SecondaryCounter" type="s" ' + 'access="read"></property><property name="FixedImageSize" type="b" ' + 'access="read"></property></interface></node>') diff --git a/binding/gdbus/api/session1.xml b/binding/gdbus/api/session1.xml new file mode 100644 index 0000000..69457ef --- /dev/null +++ b/binding/gdbus/api/session1.xml @@ -0,0 +1,13 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" +"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.bluez.obex.Session1"> + <method name="GetCapabilities"> + <arg name="capabilities" type="s" direction="out"/> + </method> + <property name="Source" type="s" access="read"></property> + <property name="Destination" type="s" access="read"></property> + <property name="Channel" type="y" access="read"></property> + <property name="Target" type="s" access="read"></property> + </interface> +</node> diff --git a/binding/gdbus/api/transfer1.xml b/binding/gdbus/api/transfer1.xml new file mode 100644 index 0000000..b1a5e99 --- /dev/null +++ b/binding/gdbus/api/transfer1.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.bluez.obex.Transfer1"> + <method name="Cancel" /> + <method name="Suspend" /> + <method name="Resume" /> +<!-- + <property name="Status" type="s" access="read" /> + <property name="Session" type="o" access="read" /> + <property name="Name" type="s" access="read" /> + <property name="Type" type="s" access="read" /> + <property name="Time" type="t" access="read" /> + <property name="Size" type="t" access="read" /> + <property name="Transferred" type="t" access="read" /> + <property name="Filename" type="s" access="read" /> +--> + </interface> +</node> diff --git a/binding/gdbus/freedesktop_dbus_properties_interface.c b/binding/gdbus/freedesktop_dbus_properties_interface.c new file mode 100644 index 0000000..add3a51 --- /dev/null +++ b/binding/gdbus/freedesktop_dbus_properties_interface.c @@ -0,0 +1,1617 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "freedesktop_dbus_properties_interface.h" + +#include <string.h> +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.freedesktop.DBus.Properties + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:OrgFreedesktopDBusProperties + * @title: OrgFreedesktopDBusProperties + * @short_description: Generated C code for the org.freedesktop.DBus.Properties D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link> D-Bus interface in C. + */ + +/* ---- Introspection data for org.freedesktop.DBus.Properties ---- */ + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_IN_ARG_interface_name = +{ + { + -1, + (gchar *) "interface_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_IN_ARG_property_name = +{ + { + -1, + (gchar *) "property_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_IN_ARG_pointers[] = +{ + &_org_freedesktop_dbus_properties_method_info_get_IN_ARG_interface_name, + &_org_freedesktop_dbus_properties_method_info_get_IN_ARG_property_name, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_OUT_ARG_value = +{ + { + -1, + (gchar *) "value", + (gchar *) "v", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_OUT_ARG_pointers[] = +{ + &_org_freedesktop_dbus_properties_method_info_get_OUT_ARG_value, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_get = +{ + { + -1, + (gchar *) "Get", + (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_get_IN_ARG_pointers, + (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_get_OUT_ARG_pointers, + NULL + }, + "handle-get", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_interface_name = +{ + { + -1, + (gchar *) "interface_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_pointers[] = +{ + &_org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_interface_name, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_properties = +{ + { + -1, + (gchar *) "properties", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_pointers[] = +{ + &_org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_properties, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_get_all = +{ + { + -1, + (gchar *) "GetAll", + (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_get_all_IN_ARG_pointers, + (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_get_all_OUT_ARG_pointers, + NULL + }, + "handle-get-all", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_interface_name = +{ + { + -1, + (gchar *) "interface_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_property_name = +{ + { + -1, + (gchar *) "property_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_method_info_set_IN_ARG_value = +{ + { + -1, + (gchar *) "value", + (gchar *) "v", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_method_info_set_IN_ARG_pointers[] = +{ + &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_interface_name, + &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_property_name, + &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_value, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_freedesktop_dbus_properties_method_info_set = +{ + { + -1, + (gchar *) "Set", + (GDBusArgInfo **) &_org_freedesktop_dbus_properties_method_info_set_IN_ARG_pointers, + NULL, + NULL + }, + "handle-set", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _org_freedesktop_dbus_properties_method_info_pointers[] = +{ + &_org_freedesktop_dbus_properties_method_info_get, + &_org_freedesktop_dbus_properties_method_info_get_all, + &_org_freedesktop_dbus_properties_method_info_set, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_interface_name = +{ + { + -1, + (gchar *) "interface_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_changed_properties = +{ + { + -1, + (gchar *) "changed_properties", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_invalidated_properties = +{ + { + -1, + (gchar *) "invalidated_properties", + (gchar *) "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_pointers[] = +{ + &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_interface_name, + &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_changed_properties, + &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_invalidated_properties, + NULL +}; + +static const _ExtendedGDBusSignalInfo _org_freedesktop_dbus_properties_signal_info_properties_changed = +{ + { + -1, + (gchar *) "PropertiesChanged", + (GDBusArgInfo **) &_org_freedesktop_dbus_properties_signal_info_properties_changed_ARG_pointers, + NULL + }, + "properties-changed" +}; + +static const _ExtendedGDBusSignalInfo * const _org_freedesktop_dbus_properties_signal_info_pointers[] = +{ + &_org_freedesktop_dbus_properties_signal_info_properties_changed, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _org_freedesktop_dbus_properties_interface_info = +{ + { + -1, + (gchar *) "org.freedesktop.DBus.Properties", + (GDBusMethodInfo **) &_org_freedesktop_dbus_properties_method_info_pointers, + (GDBusSignalInfo **) &_org_freedesktop_dbus_properties_signal_info_pointers, + NULL, + NULL + }, + "org-freedesktop-dbus-properties", +}; + + +/** + * org_freedesktop_dbus_properties_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +org_freedesktop_dbus_properties_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct; +} + +/** + * org_freedesktop_dbus_properties_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #OrgFreedesktopDBusProperties interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +org_freedesktop_dbus_properties_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * OrgFreedesktopDBusProperties: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. + */ + +/** + * OrgFreedesktopDBusPropertiesIface: + * @parent_iface: The parent interface. + * @handle_get: Handler for the #OrgFreedesktopDBusProperties::handle-get signal. + * @handle_get_all: Handler for the #OrgFreedesktopDBusProperties::handle-get-all signal. + * @handle_set: Handler for the #OrgFreedesktopDBusProperties::handle-set signal. + * @properties_changed: Handler for the #OrgFreedesktopDBusProperties::properties-changed signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. + */ + +typedef OrgFreedesktopDBusPropertiesIface OrgFreedesktopDBusPropertiesInterface; +G_DEFINE_INTERFACE (OrgFreedesktopDBusProperties, org_freedesktop_dbus_properties, G_TYPE_OBJECT); + +static void +org_freedesktop_dbus_properties_default_init (OrgFreedesktopDBusPropertiesIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * OrgFreedesktopDBusProperties::handle-get: + * @object: A #OrgFreedesktopDBusProperties. + * @invocation: A #GDBusMethodInvocation. + * @arg_interface_name: Argument passed by remote caller. + * @arg_property_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_freedesktop_dbus_properties_complete_get() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_get), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING); + + /** + * OrgFreedesktopDBusProperties::handle-get-all: + * @object: A #OrgFreedesktopDBusProperties. + * @invocation: A #GDBusMethodInvocation. + * @arg_interface_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_freedesktop_dbus_properties_complete_get_all() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-all", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_get_all), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * OrgFreedesktopDBusProperties::handle-set: + * @object: A #OrgFreedesktopDBusProperties. + * @invocation: A #GDBusMethodInvocation. + * @arg_interface_name: Argument passed by remote caller. + * @arg_property_name: Argument passed by remote caller. + * @arg_value: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_freedesktop_dbus_properties_complete_set() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-set", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, handle_set), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 4, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT); + + /* GObject signals for received D-Bus signals: */ + /** + * OrgFreedesktopDBusProperties::properties-changed: + * @object: A #OrgFreedesktopDBusProperties. + * @arg_interface_name: Argument. + * @arg_changed_properties: Argument. + * @arg_invalidated_properties: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-DBus-Properties.PropertiesChanged">"PropertiesChanged"</link> is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("properties-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgFreedesktopDBusPropertiesIface, properties_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 3, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_STRV); + +} + +/** + * org_freedesktop_dbus_properties_emit_properties_changed: + * @object: A #OrgFreedesktopDBusProperties. + * @arg_interface_name: Argument to pass with the signal. + * @arg_changed_properties: Argument to pass with the signal. + * @arg_invalidated_properties: Argument to pass with the signal. + * + * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus-Properties.PropertiesChanged">"PropertiesChanged"</link> D-Bus signal. + */ +void +org_freedesktop_dbus_properties_emit_properties_changed ( + OrgFreedesktopDBusProperties *object, + const gchar *arg_interface_name, + GVariant *arg_changed_properties, + const gchar *const *arg_invalidated_properties) +{ + g_signal_emit_by_name (object, "properties-changed", arg_interface_name, arg_changed_properties, arg_invalidated_properties); +} + +/** + * org_freedesktop_dbus_properties_call_get: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @arg_interface_name: Argument to pass with the method invocation. + * @arg_property_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_freedesktop_dbus_properties_call_get_finish() to get the result of the operation. + * + * See org_freedesktop_dbus_properties_call_get_sync() for the synchronous, blocking version of this method. + */ +void +org_freedesktop_dbus_properties_call_get ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Get", + g_variant_new ("(ss)", + arg_interface_name, + arg_property_name), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_freedesktop_dbus_properties_call_get_finish: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_call_get(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_freedesktop_dbus_properties_call_get(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_dbus_properties_call_get_finish ( + OrgFreedesktopDBusProperties *proxy, + GVariant **out_value, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@v)", + out_value); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_freedesktop_dbus_properties_call_get_sync: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @arg_interface_name: Argument to pass with the method invocation. + * @arg_property_name: Argument to pass with the method invocation. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_freedesktop_dbus_properties_call_get() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_dbus_properties_call_get_sync ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GVariant **out_value, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Get", + g_variant_new ("(ss)", + arg_interface_name, + arg_property_name), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@v)", + out_value); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_freedesktop_dbus_properties_call_get_all: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @arg_interface_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_freedesktop_dbus_properties_call_get_all_finish() to get the result of the operation. + * + * See org_freedesktop_dbus_properties_call_get_all_sync() for the synchronous, blocking version of this method. + */ +void +org_freedesktop_dbus_properties_call_get_all ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetAll", + g_variant_new ("(s)", + arg_interface_name), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_freedesktop_dbus_properties_call_get_all_finish: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @out_properties: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_call_get_all(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_freedesktop_dbus_properties_call_get_all(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_dbus_properties_call_get_all_finish ( + OrgFreedesktopDBusProperties *proxy, + GVariant **out_properties, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_properties); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_freedesktop_dbus_properties_call_get_all_sync: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @arg_interface_name: Argument to pass with the method invocation. + * @out_properties: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_freedesktop_dbus_properties_call_get_all() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_dbus_properties_call_get_all_sync ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + GVariant **out_properties, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetAll", + g_variant_new ("(s)", + arg_interface_name), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_properties); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_freedesktop_dbus_properties_call_set: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @arg_interface_name: Argument to pass with the method invocation. + * @arg_property_name: Argument to pass with the method invocation. + * @arg_value: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_freedesktop_dbus_properties_call_set_finish() to get the result of the operation. + * + * See org_freedesktop_dbus_properties_call_set_sync() for the synchronous, blocking version of this method. + */ +void +org_freedesktop_dbus_properties_call_set ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GVariant *arg_value, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Set", + g_variant_new ("(ss@v)", + arg_interface_name, + arg_property_name, + arg_value), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_freedesktop_dbus_properties_call_set_finish: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_call_set(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_freedesktop_dbus_properties_call_set(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_dbus_properties_call_set_finish ( + OrgFreedesktopDBusProperties *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_freedesktop_dbus_properties_call_set_sync: + * @proxy: A #OrgFreedesktopDBusPropertiesProxy. + * @arg_interface_name: Argument to pass with the method invocation. + * @arg_property_name: Argument to pass with the method invocation. + * @arg_value: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_freedesktop_dbus_properties_call_set() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_dbus_properties_call_set_sync ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GVariant *arg_value, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Set", + g_variant_new ("(ss@v)", + arg_interface_name, + arg_property_name, + arg_value), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_freedesktop_dbus_properties_complete_get: + * @object: A #OrgFreedesktopDBusProperties. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @value: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Get">Get()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_freedesktop_dbus_properties_complete_get ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation, + GVariant *value) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@v)", + value)); +} + +/** + * org_freedesktop_dbus_properties_complete_get_all: + * @object: A #OrgFreedesktopDBusProperties. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @properties: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.GetAll">GetAll()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_freedesktop_dbus_properties_complete_get_all ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation, + GVariant *properties) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sv})", + properties)); +} + +/** + * org_freedesktop_dbus_properties_complete_set: + * @object: A #OrgFreedesktopDBusProperties. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-DBus-Properties.Set">Set()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_freedesktop_dbus_properties_complete_set ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * OrgFreedesktopDBusPropertiesProxy: + * + * The #OrgFreedesktopDBusPropertiesProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgFreedesktopDBusPropertiesProxyClass: + * @parent_class: The parent class. + * + * Class structure for #OrgFreedesktopDBusPropertiesProxy. + */ + +struct _OrgFreedesktopDBusPropertiesProxyPrivate +{ + GData *qdata; +}; + +static void org_freedesktop_dbus_properties_proxy_iface_init (OrgFreedesktopDBusPropertiesIface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPropertiesProxy, org_freedesktop_dbus_properties_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (OrgFreedesktopDBusPropertiesProxy) + G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, org_freedesktop_dbus_properties_proxy_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPropertiesProxy, org_freedesktop_dbus_properties_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, org_freedesktop_dbus_properties_proxy_iface_init)); + +#endif +static void +org_freedesktop_dbus_properties_proxy_finalize (GObject *object) +{ + OrgFreedesktopDBusPropertiesProxy *proxy = ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (org_freedesktop_dbus_properties_proxy_parent_class)->finalize (object); +} + +static void +org_freedesktop_dbus_properties_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +org_freedesktop_dbus_properties_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +org_freedesktop_dbus_properties_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +org_freedesktop_dbus_properties_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + OrgFreedesktopDBusPropertiesProxy *proxy = ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +org_freedesktop_dbus_properties_proxy_init (OrgFreedesktopDBusPropertiesProxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = org_freedesktop_dbus_properties_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, OrgFreedesktopDBusPropertiesProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_freedesktop_dbus_properties_interface_info ()); +} + +static void +org_freedesktop_dbus_properties_proxy_class_init (OrgFreedesktopDBusPropertiesProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_freedesktop_dbus_properties_proxy_finalize; + gobject_class->get_property = org_freedesktop_dbus_properties_proxy_get_property; + gobject_class->set_property = org_freedesktop_dbus_properties_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = org_freedesktop_dbus_properties_proxy_g_signal; + proxy_class->g_properties_changed = org_freedesktop_dbus_properties_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPropertiesProxyPrivate)); +#endif +} + +static void +org_freedesktop_dbus_properties_proxy_iface_init (OrgFreedesktopDBusPropertiesIface *iface) +{ +} + +/** + * org_freedesktop_dbus_properties_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_freedesktop_dbus_properties_proxy_new_finish() to get the result of the operation. + * + * See org_freedesktop_dbus_properties_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +org_freedesktop_dbus_properties_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Properties", NULL); +} + +/** + * org_freedesktop_dbus_properties_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_freedesktop_dbus_properties_proxy_new(). + * + * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set. + */ +OrgFreedesktopDBusProperties * +org_freedesktop_dbus_properties_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret); + else + return NULL; +} + +/** + * org_freedesktop_dbus_properties_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See org_freedesktop_dbus_properties_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set. + */ +OrgFreedesktopDBusProperties * +org_freedesktop_dbus_properties_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Properties", NULL); + if (ret != NULL) + return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret); + else + return NULL; +} + + +/** + * org_freedesktop_dbus_properties_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like org_freedesktop_dbus_properties_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_freedesktop_dbus_properties_proxy_new_for_bus_finish() to get the result of the operation. + * + * See org_freedesktop_dbus_properties_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +org_freedesktop_dbus_properties_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Properties", NULL); +} + +/** + * org_freedesktop_dbus_properties_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_dbus_properties_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_freedesktop_dbus_properties_proxy_new_for_bus(). + * + * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set. + */ +OrgFreedesktopDBusProperties * +org_freedesktop_dbus_properties_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret); + else + return NULL; +} + +/** + * org_freedesktop_dbus_properties_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like org_freedesktop_dbus_properties_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See org_freedesktop_dbus_properties_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesProxy): The constructed proxy object or %NULL if @error is set. + */ +OrgFreedesktopDBusProperties * +org_freedesktop_dbus_properties_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.DBus.Properties", NULL); + if (ret != NULL) + return ORG_FREEDESKTOP_DBUS_PROPERTIES (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * OrgFreedesktopDBusPropertiesSkeleton: + * + * The #OrgFreedesktopDBusPropertiesSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgFreedesktopDBusPropertiesSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #OrgFreedesktopDBusPropertiesSkeleton. + */ + +struct _OrgFreedesktopDBusPropertiesSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_org_freedesktop_dbus_properties_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_org_freedesktop_dbus_properties_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_org_freedesktop_dbus_properties_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_freedesktop_dbus_properties_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _org_freedesktop_dbus_properties_skeleton_vtable = +{ + _org_freedesktop_dbus_properties_skeleton_handle_method_call, + _org_freedesktop_dbus_properties_skeleton_handle_get_property, + _org_freedesktop_dbus_properties_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +org_freedesktop_dbus_properties_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return org_freedesktop_dbus_properties_interface_info (); +} + +static GDBusInterfaceVTable * +org_freedesktop_dbus_properties_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_org_freedesktop_dbus_properties_skeleton_vtable; +} + +static GVariant * +org_freedesktop_dbus_properties_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_org_freedesktop_dbus_properties_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _org_freedesktop_dbus_properties_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _org_freedesktop_dbus_properties_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _org_freedesktop_dbus_properties_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus.Properties", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +org_freedesktop_dbus_properties_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_org_freedesktop_dbus_properties_on_signal_properties_changed ( + OrgFreedesktopDBusProperties *object, + const gchar *arg_interface_name, + GVariant *arg_changed_properties, + const gchar *const *arg_invalidated_properties) +{ + OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(s@a{sv}^as)", + arg_interface_name, + arg_changed_properties, + arg_invalidated_properties)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.DBus.Properties", "PropertiesChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void org_freedesktop_dbus_properties_skeleton_iface_init (OrgFreedesktopDBusPropertiesIface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPropertiesSkeleton, org_freedesktop_dbus_properties_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (OrgFreedesktopDBusPropertiesSkeleton) + G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, org_freedesktop_dbus_properties_skeleton_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopDBusPropertiesSkeleton, org_freedesktop_dbus_properties_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, org_freedesktop_dbus_properties_skeleton_iface_init)); + +#endif +static void +org_freedesktop_dbus_properties_skeleton_finalize (GObject *object) +{ + OrgFreedesktopDBusPropertiesSkeleton *skeleton = ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (org_freedesktop_dbus_properties_skeleton_parent_class)->finalize (object); +} + +static void +org_freedesktop_dbus_properties_skeleton_init (OrgFreedesktopDBusPropertiesSkeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = org_freedesktop_dbus_properties_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, OrgFreedesktopDBusPropertiesSkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +org_freedesktop_dbus_properties_skeleton_class_init (OrgFreedesktopDBusPropertiesSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_freedesktop_dbus_properties_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = org_freedesktop_dbus_properties_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = org_freedesktop_dbus_properties_skeleton_dbus_interface_get_properties; + skeleton_class->flush = org_freedesktop_dbus_properties_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = org_freedesktop_dbus_properties_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgFreedesktopDBusPropertiesSkeletonPrivate)); +#endif +} + +static void +org_freedesktop_dbus_properties_skeleton_iface_init (OrgFreedesktopDBusPropertiesIface *iface) +{ + iface->properties_changed = _org_freedesktop_dbus_properties_on_signal_properties_changed; +} + +/** + * org_freedesktop_dbus_properties_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus-Properties.top_of_page">org.freedesktop.DBus.Properties</link>. + * + * Returns: (transfer full) (type OrgFreedesktopDBusPropertiesSkeleton): The skeleton object. + */ +OrgFreedesktopDBusProperties * +org_freedesktop_dbus_properties_skeleton_new (void) +{ + return ORG_FREEDESKTOP_DBUS_PROPERTIES (g_object_new (TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, NULL)); +} + diff --git a/binding/gdbus/freedesktop_dbus_properties_interface.h b/binding/gdbus/freedesktop_dbus_properties_interface.h new file mode 100644 index 0000000..f1bb44f --- /dev/null +++ b/binding/gdbus/freedesktop_dbus_properties_interface.h @@ -0,0 +1,263 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __FREEDESKTOP_DBUS_PROPERTIES_INTERFACE_H__ +#define __FREEDESKTOP_DBUS_PROPERTIES_INTERFACE_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.freedesktop.DBus.Properties */ + +#define TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES (org_freedesktop_dbus_properties_get_type ()) +#define ORG_FREEDESKTOP_DBUS_PROPERTIES(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, OrgFreedesktopDBusProperties)) +#define IS_ORG_FREEDESKTOP_DBUS_PROPERTIES(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES)) +#define ORG_FREEDESKTOP_DBUS_PROPERTIES_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES, OrgFreedesktopDBusPropertiesIface)) + +struct _OrgFreedesktopDBusProperties; +typedef struct _OrgFreedesktopDBusProperties OrgFreedesktopDBusProperties; +typedef struct _OrgFreedesktopDBusPropertiesIface OrgFreedesktopDBusPropertiesIface; + +struct _OrgFreedesktopDBusPropertiesIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_get) ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation, + const gchar *arg_interface_name, + const gchar *arg_property_name); + + gboolean (*handle_get_all) ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation, + const gchar *arg_interface_name); + + gboolean (*handle_set) ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GVariant *arg_value); + + void (*properties_changed) ( + OrgFreedesktopDBusProperties *object, + const gchar *arg_interface_name, + GVariant *arg_changed_properties, + const gchar *const *arg_invalidated_properties); + +}; + +GType org_freedesktop_dbus_properties_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *org_freedesktop_dbus_properties_interface_info (void); +guint org_freedesktop_dbus_properties_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void org_freedesktop_dbus_properties_complete_get ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation, + GVariant *value); + +void org_freedesktop_dbus_properties_complete_get_all ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation, + GVariant *properties); + +void org_freedesktop_dbus_properties_complete_set ( + OrgFreedesktopDBusProperties *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus signal emissions functions: */ +void org_freedesktop_dbus_properties_emit_properties_changed ( + OrgFreedesktopDBusProperties *object, + const gchar *arg_interface_name, + GVariant *arg_changed_properties, + const gchar *const *arg_invalidated_properties); + + + +/* D-Bus method calls: */ +void org_freedesktop_dbus_properties_call_get ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_freedesktop_dbus_properties_call_get_finish ( + OrgFreedesktopDBusProperties *proxy, + GVariant **out_value, + GAsyncResult *res, + GError **error); + +gboolean org_freedesktop_dbus_properties_call_get_sync ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GVariant **out_value, + GCancellable *cancellable, + GError **error); + +void org_freedesktop_dbus_properties_call_get_all ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_freedesktop_dbus_properties_call_get_all_finish ( + OrgFreedesktopDBusProperties *proxy, + GVariant **out_properties, + GAsyncResult *res, + GError **error); + +gboolean org_freedesktop_dbus_properties_call_get_all_sync ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + GVariant **out_properties, + GCancellable *cancellable, + GError **error); + +void org_freedesktop_dbus_properties_call_set ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GVariant *arg_value, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_freedesktop_dbus_properties_call_set_finish ( + OrgFreedesktopDBusProperties *proxy, + GAsyncResult *res, + GError **error); + +gboolean org_freedesktop_dbus_properties_call_set_sync ( + OrgFreedesktopDBusProperties *proxy, + const gchar *arg_interface_name, + const gchar *arg_property_name, + GVariant *arg_value, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY (org_freedesktop_dbus_properties_proxy_get_type ()) +#define ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, OrgFreedesktopDBusPropertiesProxy)) +#define ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, OrgFreedesktopDBusPropertiesProxyClass)) +#define ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY, OrgFreedesktopDBusPropertiesProxyClass)) +#define IS_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY)) +#define IS_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_PROXY)) + +typedef struct _OrgFreedesktopDBusPropertiesProxy OrgFreedesktopDBusPropertiesProxy; +typedef struct _OrgFreedesktopDBusPropertiesProxyClass OrgFreedesktopDBusPropertiesProxyClass; +typedef struct _OrgFreedesktopDBusPropertiesProxyPrivate OrgFreedesktopDBusPropertiesProxyPrivate; + +struct _OrgFreedesktopDBusPropertiesProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + OrgFreedesktopDBusPropertiesProxyPrivate *priv; +}; + +struct _OrgFreedesktopDBusPropertiesProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType org_freedesktop_dbus_properties_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgFreedesktopDBusPropertiesProxy, g_object_unref) +#endif + +void org_freedesktop_dbus_properties_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgFreedesktopDBusProperties *org_freedesktop_dbus_properties_proxy_new_finish ( + GAsyncResult *res, + GError **error); +OrgFreedesktopDBusProperties *org_freedesktop_dbus_properties_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void org_freedesktop_dbus_properties_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgFreedesktopDBusProperties *org_freedesktop_dbus_properties_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +OrgFreedesktopDBusProperties *org_freedesktop_dbus_properties_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON (org_freedesktop_dbus_properties_skeleton_get_type ()) +#define ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, OrgFreedesktopDBusPropertiesSkeleton)) +#define ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, OrgFreedesktopDBusPropertiesSkeletonClass)) +#define ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON, OrgFreedesktopDBusPropertiesSkeletonClass)) +#define IS_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON)) +#define IS_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_FREEDESKTOP_DBUS_PROPERTIES_SKELETON)) + +typedef struct _OrgFreedesktopDBusPropertiesSkeleton OrgFreedesktopDBusPropertiesSkeleton; +typedef struct _OrgFreedesktopDBusPropertiesSkeletonClass OrgFreedesktopDBusPropertiesSkeletonClass; +typedef struct _OrgFreedesktopDBusPropertiesSkeletonPrivate OrgFreedesktopDBusPropertiesSkeletonPrivate; + +struct _OrgFreedesktopDBusPropertiesSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + OrgFreedesktopDBusPropertiesSkeletonPrivate *priv; +}; + +struct _OrgFreedesktopDBusPropertiesSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType org_freedesktop_dbus_properties_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgFreedesktopDBusPropertiesSkeleton, g_object_unref) +#endif + +OrgFreedesktopDBusProperties *org_freedesktop_dbus_properties_skeleton_new (void); + + +G_END_DECLS + +#endif /* __FREEDESKTOP_DBUS_PROPERTIES_INTERFACE_H__ */ diff --git a/binding/gdbus/generate_interfaces.sh b/binding/gdbus/generate_interfaces.sh new file mode 100755 index 0000000..8c8914d --- /dev/null +++ b/binding/gdbus/generate_interfaces.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +CG=gdbus-codegen +API=api + +$CG \ + --interface-prefix Obex.Client1. \ + --generate-c-code obex_client1_interface \ + --c-generate-object-manager \ + $API/client1.xml + +$CG \ + --interface-prefix Obex.Session1. \ + --generate-c-code obex_session1_interface \ + $API/session1.xml + +$CG \ + --interface-prefix Obex.PhonebookAccess1. \ + --generate-c-code obex_phonebookaccess1_interface \ + $API/phonebookaccess1.xml + +$CG \ + --interface-prefix Obex.Transfer1. \ + --generate-c-code obex_transfer1_interface \ + $API/transfer1.xml + +$CG \ + --interface-prefix org.freedesktop.DBus.Properties. \ + --generate-c-code freedesktop_dbus_properties_interface \ + $API/org.freedesktop.DBus.Properties.xml diff --git a/binding/gdbus/obex_client1_interface.c b/binding/gdbus/obex_client1_interface.c new file mode 100644 index 0000000..f58513d --- /dev/null +++ b/binding/gdbus/obex_client1_interface.c @@ -0,0 +1,1817 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "obex_client1_interface.h" + +#include <string.h> +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.bluez.obex.Client1 + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:OrgBluezObexClient1 + * @title: OrgBluezObexClient1 + * @short_description: Generated C code for the org.bluez.obex.Client1 D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link> D-Bus interface in C. + */ + +/* ---- Introspection data for org.bluez.obex.Client1 ---- */ + +static const _ExtendedGDBusArgInfo _org_bluez_obex_client1_method_info_create_session_IN_ARG_destination = +{ + { + -1, + (gchar *) "destination", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_client1_method_info_create_session_IN_ARG_args = +{ + { + -1, + (gchar *) "args", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_client1_method_info_create_session_IN_ARG_pointers[] = +{ + &_org_bluez_obex_client1_method_info_create_session_IN_ARG_destination, + &_org_bluez_obex_client1_method_info_create_session_IN_ARG_args, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_client1_method_info_create_session_OUT_ARG_session = +{ + { + -1, + (gchar *) "session", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_client1_method_info_create_session_OUT_ARG_pointers[] = +{ + &_org_bluez_obex_client1_method_info_create_session_OUT_ARG_session, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_client1_method_info_create_session = +{ + { + -1, + (gchar *) "CreateSession", + (GDBusArgInfo **) &_org_bluez_obex_client1_method_info_create_session_IN_ARG_pointers, + (GDBusArgInfo **) &_org_bluez_obex_client1_method_info_create_session_OUT_ARG_pointers, + NULL + }, + "handle-create-session", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_client1_method_info_remove_session_IN_ARG_session = +{ + { + -1, + (gchar *) "session", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_client1_method_info_remove_session_IN_ARG_pointers[] = +{ + &_org_bluez_obex_client1_method_info_remove_session_IN_ARG_session, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_client1_method_info_remove_session = +{ + { + -1, + (gchar *) "RemoveSession", + (GDBusArgInfo **) &_org_bluez_obex_client1_method_info_remove_session_IN_ARG_pointers, + NULL, + NULL + }, + "handle-remove-session", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _org_bluez_obex_client1_method_info_pointers[] = +{ + &_org_bluez_obex_client1_method_info_create_session, + &_org_bluez_obex_client1_method_info_remove_session, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _org_bluez_obex_client1_interface_info = +{ + { + -1, + (gchar *) "org.bluez.obex.Client1", + (GDBusMethodInfo **) &_org_bluez_obex_client1_method_info_pointers, + NULL, + NULL, + NULL + }, + "org-bluez-obex-client1", +}; + + +/** + * org_bluez_obex_client1_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +org_bluez_obex_client1_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_org_bluez_obex_client1_interface_info.parent_struct; +} + +/** + * org_bluez_obex_client1_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #OrgBluezObexClient1 interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +org_bluez_obex_client1_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * OrgBluezObexClient1: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link>. + */ + +/** + * OrgBluezObexClient1Iface: + * @parent_iface: The parent interface. + * @handle_create_session: Handler for the #OrgBluezObexClient1::handle-create-session signal. + * @handle_remove_session: Handler for the #OrgBluezObexClient1::handle-remove-session signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link>. + */ + +typedef OrgBluezObexClient1Iface OrgBluezObexClient1Interface; +G_DEFINE_INTERFACE (OrgBluezObexClient1, org_bluez_obex_client1, G_TYPE_OBJECT); + +static void +org_bluez_obex_client1_default_init (OrgBluezObexClient1Iface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * OrgBluezObexClient1::handle-create-session: + * @object: A #OrgBluezObexClient1. + * @invocation: A #GDBusMethodInvocation. + * @arg_destination: Argument passed by remote caller. + * @arg_args: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-Client1.CreateSession">CreateSession()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_client1_complete_create_session() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-create-session", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexClient1Iface, handle_create_session), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT); + + /** + * OrgBluezObexClient1::handle-remove-session: + * @object: A #OrgBluezObexClient1. + * @invocation: A #GDBusMethodInvocation. + * @arg_session: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-Client1.RemoveSession">RemoveSession()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_client1_complete_remove_session() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-remove-session", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexClient1Iface, handle_remove_session), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + +} + +/** + * org_bluez_obex_client1_call_create_session: + * @proxy: A #OrgBluezObexClient1Proxy. + * @arg_destination: Argument to pass with the method invocation. + * @arg_args: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Client1.CreateSession">CreateSession()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_client1_call_create_session_finish() to get the result of the operation. + * + * See org_bluez_obex_client1_call_create_session_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_client1_call_create_session ( + OrgBluezObexClient1 *proxy, + const gchar *arg_destination, + GVariant *arg_args, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "CreateSession", + g_variant_new ("(s@a{sv})", + arg_destination, + arg_args), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_client1_call_create_session_finish: + * @proxy: A #OrgBluezObexClient1Proxy. + * @out_session: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_client1_call_create_session(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_client1_call_create_session(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_client1_call_create_session_finish ( + OrgBluezObexClient1 *proxy, + gchar **out_session, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_session); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_client1_call_create_session_sync: + * @proxy: A #OrgBluezObexClient1Proxy. + * @arg_destination: Argument to pass with the method invocation. + * @arg_args: Argument to pass with the method invocation. + * @out_session: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Client1.CreateSession">CreateSession()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_client1_call_create_session() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_client1_call_create_session_sync ( + OrgBluezObexClient1 *proxy, + const gchar *arg_destination, + GVariant *arg_args, + gchar **out_session, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "CreateSession", + g_variant_new ("(s@a{sv})", + arg_destination, + arg_args), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_session); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_client1_call_remove_session: + * @proxy: A #OrgBluezObexClient1Proxy. + * @arg_session: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Client1.RemoveSession">RemoveSession()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_client1_call_remove_session_finish() to get the result of the operation. + * + * See org_bluez_obex_client1_call_remove_session_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_client1_call_remove_session ( + OrgBluezObexClient1 *proxy, + const gchar *arg_session, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "RemoveSession", + g_variant_new ("(o)", + arg_session), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_client1_call_remove_session_finish: + * @proxy: A #OrgBluezObexClient1Proxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_client1_call_remove_session(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_client1_call_remove_session(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_client1_call_remove_session_finish ( + OrgBluezObexClient1 *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_client1_call_remove_session_sync: + * @proxy: A #OrgBluezObexClient1Proxy. + * @arg_session: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Client1.RemoveSession">RemoveSession()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_client1_call_remove_session() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_client1_call_remove_session_sync ( + OrgBluezObexClient1 *proxy, + const gchar *arg_session, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "RemoveSession", + g_variant_new ("(o)", + arg_session), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_client1_complete_create_session: + * @object: A #OrgBluezObexClient1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @session: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-Client1.CreateSession">CreateSession()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_client1_complete_create_session ( + OrgBluezObexClient1 *object, + GDBusMethodInvocation *invocation, + const gchar *session) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o)", + session)); +} + +/** + * org_bluez_obex_client1_complete_remove_session: + * @object: A #OrgBluezObexClient1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-Client1.RemoveSession">RemoveSession()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_client1_complete_remove_session ( + OrgBluezObexClient1 *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * OrgBluezObexClient1Proxy: + * + * The #OrgBluezObexClient1Proxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgBluezObexClient1ProxyClass: + * @parent_class: The parent class. + * + * Class structure for #OrgBluezObexClient1Proxy. + */ + +struct _OrgBluezObexClient1ProxyPrivate +{ + GData *qdata; +}; + +static void org_bluez_obex_client1_proxy_iface_init (OrgBluezObexClient1Iface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexClient1Proxy, org_bluez_obex_client1_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (OrgBluezObexClient1Proxy) + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_CLIENT1, org_bluez_obex_client1_proxy_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexClient1Proxy, org_bluez_obex_client1_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_CLIENT1, org_bluez_obex_client1_proxy_iface_init)); + +#endif +static void +org_bluez_obex_client1_proxy_finalize (GObject *object) +{ + OrgBluezObexClient1Proxy *proxy = ORG_BLUEZ_OBEX_CLIENT1_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (org_bluez_obex_client1_proxy_parent_class)->finalize (object); +} + +static void +org_bluez_obex_client1_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +org_bluez_obex_client1_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +org_bluez_obex_client1_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_bluez_obex_client1_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_ORG_BLUEZ_OBEX_CLIENT1); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_OBEX_CLIENT1); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +org_bluez_obex_client1_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + OrgBluezObexClient1Proxy *proxy = ORG_BLUEZ_OBEX_CLIENT1_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_client1_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_client1_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +org_bluez_obex_client1_proxy_init (OrgBluezObexClient1Proxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = org_bluez_obex_client1_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY, OrgBluezObexClient1ProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_bluez_obex_client1_interface_info ()); +} + +static void +org_bluez_obex_client1_proxy_class_init (OrgBluezObexClient1ProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_bluez_obex_client1_proxy_finalize; + gobject_class->get_property = org_bluez_obex_client1_proxy_get_property; + gobject_class->set_property = org_bluez_obex_client1_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = org_bluez_obex_client1_proxy_g_signal; + proxy_class->g_properties_changed = org_bluez_obex_client1_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgBluezObexClient1ProxyPrivate)); +#endif +} + +static void +org_bluez_obex_client1_proxy_iface_init (OrgBluezObexClient1Iface *iface) +{ +} + +/** + * org_bluez_obex_client1_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_client1_proxy_new_finish() to get the result of the operation. + * + * See org_bluez_obex_client1_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +org_bluez_obex_client1_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Client1", NULL); +} + +/** + * org_bluez_obex_client1_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_client1_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_bluez_obex_client1_proxy_new(). + * + * Returns: (transfer full) (type OrgBluezObexClient1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexClient1 * +org_bluez_obex_client1_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_BLUEZ_OBEX_CLIENT1 (ret); + else + return NULL; +} + +/** + * org_bluez_obex_client1_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_client1_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgBluezObexClient1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexClient1 * +org_bluez_obex_client1_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Client1", NULL); + if (ret != NULL) + return ORG_BLUEZ_OBEX_CLIENT1 (ret); + else + return NULL; +} + + +/** + * org_bluez_obex_client1_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like org_bluez_obex_client1_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_client1_proxy_new_for_bus_finish() to get the result of the operation. + * + * See org_bluez_obex_client1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +org_bluez_obex_client1_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Client1", NULL); +} + +/** + * org_bluez_obex_client1_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_client1_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_bluez_obex_client1_proxy_new_for_bus(). + * + * Returns: (transfer full) (type OrgBluezObexClient1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexClient1 * +org_bluez_obex_client1_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_BLUEZ_OBEX_CLIENT1 (ret); + else + return NULL; +} + +/** + * org_bluez_obex_client1_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like org_bluez_obex_client1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_client1_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgBluezObexClient1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexClient1 * +org_bluez_obex_client1_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Client1", NULL); + if (ret != NULL) + return ORG_BLUEZ_OBEX_CLIENT1 (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * OrgBluezObexClient1Skeleton: + * + * The #OrgBluezObexClient1Skeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgBluezObexClient1SkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #OrgBluezObexClient1Skeleton. + */ + +struct _OrgBluezObexClient1SkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_org_bluez_obex_client1_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + OrgBluezObexClient1Skeleton *skeleton = ORG_BLUEZ_OBEX_CLIENT1_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_ORG_BLUEZ_OBEX_CLIENT1); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_OBEX_CLIENT1); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_org_bluez_obex_client1_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + OrgBluezObexClient1Skeleton *skeleton = ORG_BLUEZ_OBEX_CLIENT1_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_client1_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_org_bluez_obex_client1_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + OrgBluezObexClient1Skeleton *skeleton = ORG_BLUEZ_OBEX_CLIENT1_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_client1_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _org_bluez_obex_client1_skeleton_vtable = +{ + _org_bluez_obex_client1_skeleton_handle_method_call, + _org_bluez_obex_client1_skeleton_handle_get_property, + _org_bluez_obex_client1_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +org_bluez_obex_client1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return org_bluez_obex_client1_interface_info (); +} + +static GDBusInterfaceVTable * +org_bluez_obex_client1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_org_bluez_obex_client1_skeleton_vtable; +} + +static GVariant * +org_bluez_obex_client1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + OrgBluezObexClient1Skeleton *skeleton = ORG_BLUEZ_OBEX_CLIENT1_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_org_bluez_obex_client1_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _org_bluez_obex_client1_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _org_bluez_obex_client1_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _org_bluez_obex_client1_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.bluez.obex.Client1", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +org_bluez_obex_client1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void org_bluez_obex_client1_skeleton_iface_init (OrgBluezObexClient1Iface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexClient1Skeleton, org_bluez_obex_client1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (OrgBluezObexClient1Skeleton) + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_CLIENT1, org_bluez_obex_client1_skeleton_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexClient1Skeleton, org_bluez_obex_client1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_CLIENT1, org_bluez_obex_client1_skeleton_iface_init)); + +#endif +static void +org_bluez_obex_client1_skeleton_finalize (GObject *object) +{ + OrgBluezObexClient1Skeleton *skeleton = ORG_BLUEZ_OBEX_CLIENT1_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (org_bluez_obex_client1_skeleton_parent_class)->finalize (object); +} + +static void +org_bluez_obex_client1_skeleton_init (OrgBluezObexClient1Skeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = org_bluez_obex_client1_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_BLUEZ_OBEX_CLIENT1_SKELETON, OrgBluezObexClient1SkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +org_bluez_obex_client1_skeleton_class_init (OrgBluezObexClient1SkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_bluez_obex_client1_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = org_bluez_obex_client1_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = org_bluez_obex_client1_skeleton_dbus_interface_get_properties; + skeleton_class->flush = org_bluez_obex_client1_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = org_bluez_obex_client1_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgBluezObexClient1SkeletonPrivate)); +#endif +} + +static void +org_bluez_obex_client1_skeleton_iface_init (OrgBluezObexClient1Iface *iface) +{ +} + +/** + * org_bluez_obex_client1_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link>. + * + * Returns: (transfer full) (type OrgBluezObexClient1Skeleton): The skeleton object. + */ +OrgBluezObexClient1 * +org_bluez_obex_client1_skeleton_new (void) +{ + return ORG_BLUEZ_OBEX_CLIENT1 (g_object_new (TYPE_ORG_BLUEZ_OBEX_CLIENT1_SKELETON, NULL)); +} + +/* ------------------------------------------------------------------------ + * Code for Object, ObjectProxy and ObjectSkeleton + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:Object + * @title: Object + * @short_description: Specialized GDBusObject types + * + * This section contains the #Object, #ObjectProxy, and #ObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces. + */ + +/** + * Object: + * + * The #Object type is a specialized container of interfaces. + */ + +/** + * ObjectIface: + * @parent_iface: The parent interface. + * + * Virtual table for the #Object interface. + */ + +typedef ObjectIface ObjectInterface; +G_DEFINE_INTERFACE_WITH_CODE (Object, object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT)); + +static void +object_default_init (ObjectIface *iface) +{ + /** + * Object:org-bluez-obex-client1: + * + * The #OrgBluezObexClient1 instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link>, if any. + * + * Connect to the #GObject::notify signal to get informed of property changes. + */ + g_object_interface_install_property (iface, g_param_spec_object ("org-bluez-obex-client1", "org-bluez-obex-client1", "org-bluez-obex-client1", TYPE_ORG_BLUEZ_OBEX_CLIENT1, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS)); + +} + +/** + * object_get_org_bluez_obex_client1: + * @object: A #Object. + * + * Gets the #OrgBluezObexClient1 instance for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link> on @object, if any. + * + * Returns: (transfer full): A #OrgBluezObexClient1 that must be freed with g_object_unref() or %NULL if @object does not implement the interface. + */ +OrgBluezObexClient1 *object_get_org_bluez_obex_client1 (Object *object) +{ + GDBusInterface *ret; + ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.bluez.obex.Client1"); + if (ret == NULL) + return NULL; + return ORG_BLUEZ_OBEX_CLIENT1 (ret); +} + + +/** + * object_peek_org_bluez_obex_client1: (skip) + * @object: A #Object. + * + * Like object_get_org_bluez_obex_client1() but doesn't increase the reference count on the returned object. + * + * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning> + * + * Returns: (transfer none): A #OrgBluezObexClient1 or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object. + */ +OrgBluezObexClient1 *object_peek_org_bluez_obex_client1 (Object *object) +{ + GDBusInterface *ret; + ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.bluez.obex.Client1"); + if (ret == NULL) + return NULL; + g_object_unref (ret); + return ORG_BLUEZ_OBEX_CLIENT1 (ret); +} + + +static void +object_notify (GDBusObject *object, GDBusInterface *interface) +{ + _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface); + /* info can be NULL if the other end is using a D-Bus interface we don't know + * anything about, for example old generated code in this process talking to + * newer generated code in the other process. */ + if (info != NULL) + g_object_notify (G_OBJECT (object), info->hyphen_name); +} + +/** + * ObjectProxy: + * + * The #ObjectProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * ObjectProxyClass: + * @parent_class: The parent class. + * + * Class structure for #ObjectProxy. + */ + +static void +object_proxy__object_iface_init (ObjectIface *iface G_GNUC_UNUSED) +{ +} + +static void +object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface) +{ + iface->interface_added = object_notify; + iface->interface_removed = object_notify; +} + + +G_DEFINE_TYPE_WITH_CODE (ObjectProxy, object_proxy, G_TYPE_DBUS_OBJECT_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_proxy__object_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_proxy__g_dbus_object_iface_init)); + +static void +object_proxy_init (ObjectProxy *object G_GNUC_UNUSED) +{ +} + +static void +object_proxy_set_property (GObject *gobject, + guint prop_id, + const GValue *value G_GNUC_UNUSED, + GParamSpec *pspec) +{ + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); +} + +static void +object_proxy_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ObjectProxy *object = OBJECT_PROXY (gobject); + GDBusInterface *interface; + + switch (prop_id) + { + case 1: + interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.bluez.obex.Client1"); + g_value_take_object (value, interface); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +object_proxy_class_init (ObjectProxyClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = object_proxy_set_property; + gobject_class->get_property = object_proxy_get_property; + + g_object_class_override_property (gobject_class, 1, "org-bluez-obex-client1"); +} + +/** + * object_proxy_new: + * @connection: A #GDBusConnection. + * @object_path: An object path. + * + * Creates a new proxy object. + * + * Returns: (transfer full): The proxy object. + */ +ObjectProxy * +object_proxy_new (GDBusConnection *connection, + const gchar *object_path) +{ + g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); + g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); + return OBJECT_PROXY (g_object_new (TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL)); +} + +/** + * ObjectSkeleton: + * + * The #ObjectSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * ObjectSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #ObjectSkeleton. + */ + +static void +object_skeleton__object_iface_init (ObjectIface *iface G_GNUC_UNUSED) +{ +} + + +static void +object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface) +{ + iface->interface_added = object_notify; + iface->interface_removed = object_notify; +} + +G_DEFINE_TYPE_WITH_CODE (ObjectSkeleton, object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_OBJECT, object_skeleton__object_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, object_skeleton__g_dbus_object_iface_init)); + +static void +object_skeleton_init (ObjectSkeleton *object G_GNUC_UNUSED) +{ +} + +static void +object_skeleton_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ObjectSkeleton *object = OBJECT_SKELETON (gobject); + GDBusInterfaceSkeleton *interface; + + switch (prop_id) + { + case 1: + interface = g_value_get_object (value); + if (interface != NULL) + { + g_warn_if_fail (IS_ORG_BLUEZ_OBEX_CLIENT1 (interface)); + g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface); + } + else + { + g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.bluez.obex.Client1"); + } + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +object_skeleton_get_property (GObject *gobject, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ObjectSkeleton *object = OBJECT_SKELETON (gobject); + GDBusInterface *interface; + + switch (prop_id) + { + case 1: + interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.bluez.obex.Client1"); + g_value_take_object (value, interface); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +object_skeleton_class_init (ObjectSkeletonClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = object_skeleton_set_property; + gobject_class->get_property = object_skeleton_get_property; + + g_object_class_override_property (gobject_class, 1, "org-bluez-obex-client1"); +} + +/** + * object_skeleton_new: + * @object_path: An object path. + * + * Creates a new skeleton object. + * + * Returns: (transfer full): The skeleton object. + */ +ObjectSkeleton * +object_skeleton_new (const gchar *object_path) +{ + g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); + return OBJECT_SKELETON (g_object_new (TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL)); +} + +/** + * object_skeleton_set_org_bluez_obex_client1: + * @object: A #ObjectSkeleton. + * @interface_: (allow-none): A #OrgBluezObexClient1 or %NULL to clear the interface. + * + * Sets the #OrgBluezObexClient1 instance for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Client1.top_of_page">org.bluez.obex.Client1</link> on @object. + */ +void object_skeleton_set_org_bluez_obex_client1 (ObjectSkeleton *object, OrgBluezObexClient1 *interface_) +{ + g_object_set (G_OBJECT (object), "org-bluez-obex-client1", interface_, NULL); +} + + +/* ------------------------------------------------------------------------ + * Code for ObjectManager client + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:ObjectManagerClient + * @title: ObjectManagerClient + * @short_description: Generated GDBusObjectManagerClient type + * + * This section contains a #GDBusObjectManagerClient that uses object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. + */ + +/** + * ObjectManagerClient: + * + * The #ObjectManagerClient structure contains only private data and should only be accessed using the provided API. + */ + +/** + * ObjectManagerClientClass: + * @parent_class: The parent class. + * + * Class structure for #ObjectManagerClient. + */ + +G_DEFINE_TYPE (ObjectManagerClient, object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT); + +static void +object_manager_client_init (ObjectManagerClient *manager G_GNUC_UNUSED) +{ +} + +static void +object_manager_client_class_init (ObjectManagerClientClass *klass G_GNUC_UNUSED) +{ +} + +/** + * object_manager_client_get_proxy_type: + * @manager: A #GDBusObjectManagerClient. + * @object_path: The object path of the remote object (unused). + * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType. + * @user_data: User data (unused). + * + * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types. + * + * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #ObjectProxy. + */ +GType +object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED) +{ + static gsize once_init_value = 0; + static GHashTable *lookup_hash; + GType ret; + + if (interface_name == NULL) + return TYPE_OBJECT_PROXY; + if (g_once_init_enter (&once_init_value)) + { + lookup_hash = g_hash_table_new (g_str_hash, g_str_equal); + g_hash_table_insert (lookup_hash, (gpointer) "org.bluez.obex.Client1", GSIZE_TO_POINTER (TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY)); + g_once_init_leave (&once_init_value, 1); + } + ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name)); + if (ret == (GType) 0) + ret = G_TYPE_DBUS_PROXY; + return ret; +} + +/** + * object_manager_client_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call object_manager_client_new_finish() to get the result of the operation. + * + * See object_manager_client_new_sync() for the synchronous, blocking version of this constructor. + */ +void +object_manager_client_new ( + GDBusConnection *connection, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL); +} + +/** + * object_manager_client_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with object_manager_client_new(). + * + * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set. + */ +GDBusObjectManager * +object_manager_client_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return G_DBUS_OBJECT_MANAGER (ret); + else + return NULL; +} + +/** + * object_manager_client_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates #GDBusObjectManagerClient using object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See object_manager_client_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set. + */ +GDBusObjectManager * +object_manager_client_new_sync ( + GDBusConnection *connection, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL); + if (ret != NULL) + return G_DBUS_OBJECT_MANAGER (ret); + else + return NULL; +} + + +/** + * object_manager_client_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call object_manager_client_new_for_bus_finish() to get the result of the operation. + * + * See object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +object_manager_client_new_for_bus ( + GBusType bus_type, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL); +} + +/** + * object_manager_client_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to object_manager_client_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with object_manager_client_new_for_bus(). + * + * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set. + */ +GDBusObjectManager * +object_manager_client_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return G_DBUS_OBJECT_MANAGER (ret); + else + return NULL; +} + +/** + * object_manager_client_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See object_manager_client_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type ObjectManagerClient): The constructed object manager client or %NULL if @error is set. + */ +GDBusObjectManager * +object_manager_client_new_for_bus_sync ( + GBusType bus_type, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", object_manager_client_get_proxy_type, NULL); + if (ret != NULL) + return G_DBUS_OBJECT_MANAGER (ret); + else + return NULL; +} + + diff --git a/binding/gdbus/obex_client1_interface.h b/binding/gdbus/obex_client1_interface.h new file mode 100644 index 0000000..09772a6 --- /dev/null +++ b/binding/gdbus/obex_client1_interface.h @@ -0,0 +1,367 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __OBEX_CLIENT1_INTERFACE_H__ +#define __OBEX_CLIENT1_INTERFACE_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.bluez.obex.Client1 */ + +#define TYPE_ORG_BLUEZ_OBEX_CLIENT1 (org_bluez_obex_client1_get_type ()) +#define ORG_BLUEZ_OBEX_CLIENT1(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1, OrgBluezObexClient1)) +#define IS_ORG_BLUEZ_OBEX_CLIENT1(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1)) +#define ORG_BLUEZ_OBEX_CLIENT1_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1, OrgBluezObexClient1Iface)) + +struct _OrgBluezObexClient1; +typedef struct _OrgBluezObexClient1 OrgBluezObexClient1; +typedef struct _OrgBluezObexClient1Iface OrgBluezObexClient1Iface; + +struct _OrgBluezObexClient1Iface +{ + GTypeInterface parent_iface; + + gboolean (*handle_create_session) ( + OrgBluezObexClient1 *object, + GDBusMethodInvocation *invocation, + const gchar *arg_destination, + GVariant *arg_args); + + gboolean (*handle_remove_session) ( + OrgBluezObexClient1 *object, + GDBusMethodInvocation *invocation, + const gchar *arg_session); + +}; + +GType org_bluez_obex_client1_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *org_bluez_obex_client1_interface_info (void); +guint org_bluez_obex_client1_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void org_bluez_obex_client1_complete_create_session ( + OrgBluezObexClient1 *object, + GDBusMethodInvocation *invocation, + const gchar *session); + +void org_bluez_obex_client1_complete_remove_session ( + OrgBluezObexClient1 *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus method calls: */ +void org_bluez_obex_client1_call_create_session ( + OrgBluezObexClient1 *proxy, + const gchar *arg_destination, + GVariant *arg_args, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_client1_call_create_session_finish ( + OrgBluezObexClient1 *proxy, + gchar **out_session, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_client1_call_create_session_sync ( + OrgBluezObexClient1 *proxy, + const gchar *arg_destination, + GVariant *arg_args, + gchar **out_session, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_client1_call_remove_session ( + OrgBluezObexClient1 *proxy, + const gchar *arg_session, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_client1_call_remove_session_finish ( + OrgBluezObexClient1 *proxy, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_client1_call_remove_session_sync ( + OrgBluezObexClient1 *proxy, + const gchar *arg_session, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY (org_bluez_obex_client1_proxy_get_type ()) +#define ORG_BLUEZ_OBEX_CLIENT1_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY, OrgBluezObexClient1Proxy)) +#define ORG_BLUEZ_OBEX_CLIENT1_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY, OrgBluezObexClient1ProxyClass)) +#define ORG_BLUEZ_OBEX_CLIENT1_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY, OrgBluezObexClient1ProxyClass)) +#define IS_ORG_BLUEZ_OBEX_CLIENT1_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY)) +#define IS_ORG_BLUEZ_OBEX_CLIENT1_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_BLUEZ_OBEX_CLIENT1_PROXY)) + +typedef struct _OrgBluezObexClient1Proxy OrgBluezObexClient1Proxy; +typedef struct _OrgBluezObexClient1ProxyClass OrgBluezObexClient1ProxyClass; +typedef struct _OrgBluezObexClient1ProxyPrivate OrgBluezObexClient1ProxyPrivate; + +struct _OrgBluezObexClient1Proxy +{ + /*< private >*/ + GDBusProxy parent_instance; + OrgBluezObexClient1ProxyPrivate *priv; +}; + +struct _OrgBluezObexClient1ProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType org_bluez_obex_client1_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgBluezObexClient1Proxy, g_object_unref) +#endif + +void org_bluez_obex_client1_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgBluezObexClient1 *org_bluez_obex_client1_proxy_new_finish ( + GAsyncResult *res, + GError **error); +OrgBluezObexClient1 *org_bluez_obex_client1_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_client1_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgBluezObexClient1 *org_bluez_obex_client1_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +OrgBluezObexClient1 *org_bluez_obex_client1_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_ORG_BLUEZ_OBEX_CLIENT1_SKELETON (org_bluez_obex_client1_skeleton_get_type ()) +#define ORG_BLUEZ_OBEX_CLIENT1_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1_SKELETON, OrgBluezObexClient1Skeleton)) +#define ORG_BLUEZ_OBEX_CLIENT1_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_BLUEZ_OBEX_CLIENT1_SKELETON, OrgBluezObexClient1SkeletonClass)) +#define ORG_BLUEZ_OBEX_CLIENT1_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1_SKELETON, OrgBluezObexClient1SkeletonClass)) +#define IS_ORG_BLUEZ_OBEX_CLIENT1_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_CLIENT1_SKELETON)) +#define IS_ORG_BLUEZ_OBEX_CLIENT1_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_BLUEZ_OBEX_CLIENT1_SKELETON)) + +typedef struct _OrgBluezObexClient1Skeleton OrgBluezObexClient1Skeleton; +typedef struct _OrgBluezObexClient1SkeletonClass OrgBluezObexClient1SkeletonClass; +typedef struct _OrgBluezObexClient1SkeletonPrivate OrgBluezObexClient1SkeletonPrivate; + +struct _OrgBluezObexClient1Skeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + OrgBluezObexClient1SkeletonPrivate *priv; +}; + +struct _OrgBluezObexClient1SkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType org_bluez_obex_client1_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgBluezObexClient1Skeleton, g_object_unref) +#endif + +OrgBluezObexClient1 *org_bluez_obex_client1_skeleton_new (void); + + +/* ---- */ + +#define TYPE_OBJECT (object_get_type ()) +#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object)) +#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT)) +#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object)) + +struct _Object; +typedef struct _Object Object; +typedef struct _ObjectIface ObjectIface; + +struct _ObjectIface +{ + GTypeInterface parent_iface; +}; + +GType object_get_type (void) G_GNUC_CONST; + +OrgBluezObexClient1 *object_get_org_bluez_obex_client1 (Object *object); +OrgBluezObexClient1 *object_peek_org_bluez_obex_client1 (Object *object); + +#define TYPE_OBJECT_PROXY (object_proxy_get_type ()) +#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy)) +#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass)) +#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass)) +#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY)) +#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY)) + +typedef struct _ObjectProxy ObjectProxy; +typedef struct _ObjectProxyClass ObjectProxyClass; +typedef struct _ObjectProxyPrivate ObjectProxyPrivate; + +struct _ObjectProxy +{ + /*< private >*/ + GDBusObjectProxy parent_instance; + ObjectProxyPrivate *priv; +}; + +struct _ObjectProxyClass +{ + GDBusObjectProxyClass parent_class; +}; + +GType object_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ObjectProxy, g_object_unref) +#endif + +ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path); + +#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ()) +#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton)) +#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass)) +#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass)) +#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON)) +#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON)) + +typedef struct _ObjectSkeleton ObjectSkeleton; +typedef struct _ObjectSkeletonClass ObjectSkeletonClass; +typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate; + +struct _ObjectSkeleton +{ + /*< private >*/ + GDBusObjectSkeleton parent_instance; + ObjectSkeletonPrivate *priv; +}; + +struct _ObjectSkeletonClass +{ + GDBusObjectSkeletonClass parent_class; +}; + +GType object_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ObjectSkeleton, g_object_unref) +#endif + +ObjectSkeleton *object_skeleton_new (const gchar *object_path); +void object_skeleton_set_org_bluez_obex_client1 (ObjectSkeleton *object, OrgBluezObexClient1 *interface_); + +/* ---- */ + +#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ()) +#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient)) +#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass)) +#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass)) +#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT)) +#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT)) + +typedef struct _ObjectManagerClient ObjectManagerClient; +typedef struct _ObjectManagerClientClass ObjectManagerClientClass; +typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate; + +struct _ObjectManagerClient +{ + /*< private >*/ + GDBusObjectManagerClient parent_instance; + ObjectManagerClientPrivate *priv; +}; + +struct _ObjectManagerClientClass +{ + GDBusObjectManagerClientClass parent_class; +}; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ObjectManagerClient, g_object_unref) +#endif + +GType object_manager_client_get_type (void) G_GNUC_CONST; + +GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data); + +void object_manager_client_new ( + GDBusConnection *connection, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusObjectManager *object_manager_client_new_finish ( + GAsyncResult *res, + GError **error); +GDBusObjectManager *object_manager_client_new_sync ( + GDBusConnection *connection, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void object_manager_client_new_for_bus ( + GBusType bus_type, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +GDBusObjectManager *object_manager_client_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +GDBusObjectManager *object_manager_client_new_for_bus_sync ( + GBusType bus_type, + GDBusObjectManagerClientFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +G_END_DECLS + +#endif /* __OBEX_CLIENT1_INTERFACE_H__ */ diff --git a/binding/gdbus/obex_phonebookaccess1_interface.c b/binding/gdbus/obex_phonebookaccess1_interface.c new file mode 100644 index 0000000..24178bc --- /dev/null +++ b/binding/gdbus/obex_phonebookaccess1_interface.c @@ -0,0 +1,3204 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "obex_phonebookaccess1_interface.h" + +#include <string.h> +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.bluez.obex.PhonebookAccess1 + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:OrgBluezObexPhonebookAccess1 + * @title: OrgBluezObexPhonebookAccess1 + * @short_description: Generated C code for the org.bluez.obex.PhonebookAccess1 D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-org-bluez-obex-PhonebookAccess1.top_of_page">org.bluez.obex.PhonebookAccess1</link> D-Bus interface in C. + */ + +/* ---- Introspection data for org.bluez.obex.PhonebookAccess1 ---- */ + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_select_IN_ARG_location = +{ + { + -1, + (gchar *) "location", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_select_IN_ARG_phonebook = +{ + { + -1, + (gchar *) "phonebook", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_select_IN_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_select_IN_ARG_location, + &_org_bluez_obex_phonebook_access1_method_info_select_IN_ARG_phonebook, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_phonebook_access1_method_info_select = +{ + { + -1, + (gchar *) "Select", + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_select_IN_ARG_pointers, + NULL, + NULL + }, + "handle-select", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_all_IN_ARG_targetfile = +{ + { + -1, + (gchar *) "targetfile", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_all_IN_ARG_filters = +{ + { + -1, + (gchar *) "filters", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_pull_all_IN_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_pull_all_IN_ARG_targetfile, + &_org_bluez_obex_phonebook_access1_method_info_pull_all_IN_ARG_filters, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_all_OUT_ARG_transfer = +{ + { + -1, + (gchar *) "transfer", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_all_OUT_ARG_properties = +{ + { + -1, + (gchar *) "properties", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_pull_all_OUT_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_pull_all_OUT_ARG_transfer, + &_org_bluez_obex_phonebook_access1_method_info_pull_all_OUT_ARG_properties, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_phonebook_access1_method_info_pull_all = +{ + { + -1, + (gchar *) "PullAll", + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_pull_all_IN_ARG_pointers, + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_pull_all_OUT_ARG_pointers, + NULL + }, + "handle-pull-all", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_IN_ARG_vcard = +{ + { + -1, + (gchar *) "vcard", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_IN_ARG_targetfile = +{ + { + -1, + (gchar *) "targetfile", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_IN_ARG_filters = +{ + { + -1, + (gchar *) "filters", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_pull_IN_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_pull_IN_ARG_vcard, + &_org_bluez_obex_phonebook_access1_method_info_pull_IN_ARG_targetfile, + &_org_bluez_obex_phonebook_access1_method_info_pull_IN_ARG_filters, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_OUT_ARG_transfer = +{ + { + -1, + (gchar *) "transfer", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_pull_OUT_ARG_properties = +{ + { + -1, + (gchar *) "properties", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_pull_OUT_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_pull_OUT_ARG_transfer, + &_org_bluez_obex_phonebook_access1_method_info_pull_OUT_ARG_properties, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_phonebook_access1_method_info_pull = +{ + { + -1, + (gchar *) "Pull", + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_pull_IN_ARG_pointers, + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_pull_OUT_ARG_pointers, + NULL + }, + "handle-pull", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_list_IN_ARG_filters = +{ + { + -1, + (gchar *) "filters", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_list_IN_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_list_IN_ARG_filters, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_list_OUT_ARG_vcard_listing = +{ + { + -1, + (gchar *) "vcard_listing", + (gchar *) "a(ss)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_list_OUT_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_list_OUT_ARG_vcard_listing, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_phonebook_access1_method_info_list = +{ + { + -1, + (gchar *) "List", + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_list_IN_ARG_pointers, + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_list_OUT_ARG_pointers, + NULL + }, + "handle-list", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_search_IN_ARG_field = +{ + { + -1, + (gchar *) "field", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_search_IN_ARG_value = +{ + { + -1, + (gchar *) "value", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_search_IN_ARG_filters = +{ + { + -1, + (gchar *) "filters", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_search_IN_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_search_IN_ARG_field, + &_org_bluez_obex_phonebook_access1_method_info_search_IN_ARG_value, + &_org_bluez_obex_phonebook_access1_method_info_search_IN_ARG_filters, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_search_OUT_ARG_vcard_listing = +{ + { + -1, + (gchar *) "vcard_listing", + (gchar *) "a(ss)", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_search_OUT_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_search_OUT_ARG_vcard_listing, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_phonebook_access1_method_info_search = +{ + { + -1, + (gchar *) "Search", + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_search_IN_ARG_pointers, + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_search_OUT_ARG_pointers, + NULL + }, + "handle-search", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_get_size_OUT_ARG_size = +{ + { + -1, + (gchar *) "size", + (gchar *) "q", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_get_size_OUT_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_get_size_OUT_ARG_size, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_phonebook_access1_method_info_get_size = +{ + { + -1, + (gchar *) "GetSize", + NULL, + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_get_size_OUT_ARG_pointers, + NULL + }, + "handle-get-size", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_bluez_obex_phonebook_access1_method_info_list_filter_fields_OUT_ARG_fields = +{ + { + -1, + (gchar *) "fields", + (gchar *) "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_phonebook_access1_method_info_list_filter_fields_OUT_ARG_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_list_filter_fields_OUT_ARG_fields, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_phonebook_access1_method_info_list_filter_fields = +{ + { + -1, + (gchar *) "ListFilterFields", + NULL, + (GDBusArgInfo **) &_org_bluez_obex_phonebook_access1_method_info_list_filter_fields_OUT_ARG_pointers, + NULL + }, + "handle-list-filter-fields", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_phonebook_access1_method_info_update_version = +{ + { + -1, + (gchar *) "UpdateVersion", + NULL, + NULL, + NULL + }, + "handle-update-version", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _org_bluez_obex_phonebook_access1_method_info_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_method_info_select, + &_org_bluez_obex_phonebook_access1_method_info_pull_all, + &_org_bluez_obex_phonebook_access1_method_info_pull, + &_org_bluez_obex_phonebook_access1_method_info_list, + &_org_bluez_obex_phonebook_access1_method_info_search, + &_org_bluez_obex_phonebook_access1_method_info_get_size, + &_org_bluez_obex_phonebook_access1_method_info_list_filter_fields, + &_org_bluez_obex_phonebook_access1_method_info_update_version, + NULL +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_phonebook_access1_property_info_folder = +{ + { + -1, + (gchar *) "Folder", + (gchar *) "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "folder", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_phonebook_access1_property_info_database_identifier = +{ + { + -1, + (gchar *) "DatabaseIdentifier", + (gchar *) "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "database-identifier", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_phonebook_access1_property_info_primary_counter = +{ + { + -1, + (gchar *) "PrimaryCounter", + (gchar *) "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "primary-counter", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_phonebook_access1_property_info_secondary_counter = +{ + { + -1, + (gchar *) "SecondaryCounter", + (gchar *) "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "secondary-counter", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_phonebook_access1_property_info_fixed_image_size = +{ + { + -1, + (gchar *) "FixedImageSize", + (gchar *) "b", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "fixed-image-size", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo * const _org_bluez_obex_phonebook_access1_property_info_pointers[] = +{ + &_org_bluez_obex_phonebook_access1_property_info_folder, + &_org_bluez_obex_phonebook_access1_property_info_database_identifier, + &_org_bluez_obex_phonebook_access1_property_info_primary_counter, + &_org_bluez_obex_phonebook_access1_property_info_secondary_counter, + &_org_bluez_obex_phonebook_access1_property_info_fixed_image_size, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _org_bluez_obex_phonebook_access1_interface_info = +{ + { + -1, + (gchar *) "org.bluez.obex.PhonebookAccess1", + (GDBusMethodInfo **) &_org_bluez_obex_phonebook_access1_method_info_pointers, + NULL, + (GDBusPropertyInfo **) &_org_bluez_obex_phonebook_access1_property_info_pointers, + NULL + }, + "org-bluez-obex-phonebook-access1", +}; + + +/** + * org_bluez_obex_phonebook_access1_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-org-bluez-obex-PhonebookAccess1.top_of_page">org.bluez.obex.PhonebookAccess1</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +org_bluez_obex_phonebook_access1_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_org_bluez_obex_phonebook_access1_interface_info.parent_struct; +} + +/** + * org_bluez_obex_phonebook_access1_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #OrgBluezObexPhonebookAccess1 interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +org_bluez_obex_phonebook_access1_override_properties (GObjectClass *klass, guint property_id_begin) +{ + g_object_class_override_property (klass, property_id_begin++, "folder"); + g_object_class_override_property (klass, property_id_begin++, "database-identifier"); + g_object_class_override_property (klass, property_id_begin++, "primary-counter"); + g_object_class_override_property (klass, property_id_begin++, "secondary-counter"); + g_object_class_override_property (klass, property_id_begin++, "fixed-image-size"); + return property_id_begin - 1; +} + + + +/** + * OrgBluezObexPhonebookAccess1: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-PhonebookAccess1.top_of_page">org.bluez.obex.PhonebookAccess1</link>. + */ + +/** + * OrgBluezObexPhonebookAccess1Iface: + * @parent_iface: The parent interface. + * @handle_get_size: Handler for the #OrgBluezObexPhonebookAccess1::handle-get-size signal. + * @handle_list: Handler for the #OrgBluezObexPhonebookAccess1::handle-list signal. + * @handle_list_filter_fields: Handler for the #OrgBluezObexPhonebookAccess1::handle-list-filter-fields signal. + * @handle_pull: Handler for the #OrgBluezObexPhonebookAccess1::handle-pull signal. + * @handle_pull_all: Handler for the #OrgBluezObexPhonebookAccess1::handle-pull-all signal. + * @handle_search: Handler for the #OrgBluezObexPhonebookAccess1::handle-search signal. + * @handle_select: Handler for the #OrgBluezObexPhonebookAccess1::handle-select signal. + * @handle_update_version: Handler for the #OrgBluezObexPhonebookAccess1::handle-update-version signal. + * @get_database_identifier: Getter for the #OrgBluezObexPhonebookAccess1:database-identifier property. + * @get_fixed_image_size: Getter for the #OrgBluezObexPhonebookAccess1:fixed-image-size property. + * @get_folder: Getter for the #OrgBluezObexPhonebookAccess1:folder property. + * @get_primary_counter: Getter for the #OrgBluezObexPhonebookAccess1:primary-counter property. + * @get_secondary_counter: Getter for the #OrgBluezObexPhonebookAccess1:secondary-counter property. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-PhonebookAccess1.top_of_page">org.bluez.obex.PhonebookAccess1</link>. + */ + +typedef OrgBluezObexPhonebookAccess1Iface OrgBluezObexPhonebookAccess1Interface; +G_DEFINE_INTERFACE (OrgBluezObexPhonebookAccess1, org_bluez_obex_phonebook_access1, G_TYPE_OBJECT); + +static void +org_bluez_obex_phonebook_access1_default_init (OrgBluezObexPhonebookAccess1Iface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * OrgBluezObexPhonebookAccess1::handle-select: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: A #GDBusMethodInvocation. + * @arg_location: Argument passed by remote caller. + * @arg_phonebook: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Select">Select()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_phonebook_access1_complete_select() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-select", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexPhonebookAccess1Iface, handle_select), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING); + + /** + * OrgBluezObexPhonebookAccess1::handle-pull-all: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: A #GDBusMethodInvocation. + * @arg_targetfile: Argument passed by remote caller. + * @arg_filters: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.PullAll">PullAll()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_phonebook_access1_complete_pull_all() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-pull-all", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexPhonebookAccess1Iface, handle_pull_all), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT); + + /** + * OrgBluezObexPhonebookAccess1::handle-pull: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: A #GDBusMethodInvocation. + * @arg_vcard: Argument passed by remote caller. + * @arg_targetfile: Argument passed by remote caller. + * @arg_filters: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Pull">Pull()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_phonebook_access1_complete_pull() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-pull", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexPhonebookAccess1Iface, handle_pull), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 4, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT); + + /** + * OrgBluezObexPhonebookAccess1::handle-list: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: A #GDBusMethodInvocation. + * @arg_filters: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.List">List()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_phonebook_access1_complete_list() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-list", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexPhonebookAccess1Iface, handle_list), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * OrgBluezObexPhonebookAccess1::handle-search: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: A #GDBusMethodInvocation. + * @arg_field: Argument passed by remote caller. + * @arg_value: Argument passed by remote caller. + * @arg_filters: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Search">Search()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_phonebook_access1_complete_search() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-search", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexPhonebookAccess1Iface, handle_search), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 4, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT); + + /** + * OrgBluezObexPhonebookAccess1::handle-get-size: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.GetSize">GetSize()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_phonebook_access1_complete_get_size() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-size", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexPhonebookAccess1Iface, handle_get_size), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * OrgBluezObexPhonebookAccess1::handle-list-filter-fields: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.ListFilterFields">ListFilterFields()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_phonebook_access1_complete_list_filter_fields() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-list-filter-fields", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexPhonebookAccess1Iface, handle_list_filter_fields), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * OrgBluezObexPhonebookAccess1::handle-update-version: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.UpdateVersion">UpdateVersion()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_phonebook_access1_complete_update_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-update-version", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexPhonebookAccess1Iface, handle_update_version), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /* GObject properties for D-Bus properties: */ + /** + * OrgBluezObexPhonebookAccess1:folder: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.Folder">"Folder"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_string ("folder", "Folder", "Folder", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * OrgBluezObexPhonebookAccess1:database-identifier: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.DatabaseIdentifier">"DatabaseIdentifier"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_string ("database-identifier", "DatabaseIdentifier", "DatabaseIdentifier", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * OrgBluezObexPhonebookAccess1:primary-counter: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.PrimaryCounter">"PrimaryCounter"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_string ("primary-counter", "PrimaryCounter", "PrimaryCounter", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * OrgBluezObexPhonebookAccess1:secondary-counter: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.SecondaryCounter">"SecondaryCounter"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_string ("secondary-counter", "SecondaryCounter", "SecondaryCounter", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * OrgBluezObexPhonebookAccess1:fixed-image-size: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.FixedImageSize">"FixedImageSize"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_boolean ("fixed-image-size", "FixedImageSize", "FixedImageSize", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +/** + * org_bluez_obex_phonebook_access1_get_folder: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.Folder">"Folder"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use org_bluez_obex_phonebook_access1_dup_folder() if on another thread.</warning> + * + * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + */ +const gchar * +org_bluez_obex_phonebook_access1_get_folder (OrgBluezObexPhonebookAccess1 *object) +{ + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_GET_IFACE (object)->get_folder (object); +} + +/** + * org_bluez_obex_phonebook_access1_dup_folder: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets a copy of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.Folder">"Folder"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). + */ +gchar * +org_bluez_obex_phonebook_access1_dup_folder (OrgBluezObexPhonebookAccess1 *object) +{ + gchar *value; + g_object_get (G_OBJECT (object), "folder", &value, NULL); + return value; +} + +/** + * org_bluez_obex_phonebook_access1_set_folder: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.Folder">"Folder"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_phonebook_access1_set_folder (OrgBluezObexPhonebookAccess1 *object, const gchar *value) +{ + g_object_set (G_OBJECT (object), "folder", value, NULL); +} + +/** + * org_bluez_obex_phonebook_access1_get_database_identifier: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.DatabaseIdentifier">"DatabaseIdentifier"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use org_bluez_obex_phonebook_access1_dup_database_identifier() if on another thread.</warning> + * + * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + */ +const gchar * +org_bluez_obex_phonebook_access1_get_database_identifier (OrgBluezObexPhonebookAccess1 *object) +{ + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_GET_IFACE (object)->get_database_identifier (object); +} + +/** + * org_bluez_obex_phonebook_access1_dup_database_identifier: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets a copy of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.DatabaseIdentifier">"DatabaseIdentifier"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). + */ +gchar * +org_bluez_obex_phonebook_access1_dup_database_identifier (OrgBluezObexPhonebookAccess1 *object) +{ + gchar *value; + g_object_get (G_OBJECT (object), "database-identifier", &value, NULL); + return value; +} + +/** + * org_bluez_obex_phonebook_access1_set_database_identifier: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.DatabaseIdentifier">"DatabaseIdentifier"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_phonebook_access1_set_database_identifier (OrgBluezObexPhonebookAccess1 *object, const gchar *value) +{ + g_object_set (G_OBJECT (object), "database-identifier", value, NULL); +} + +/** + * org_bluez_obex_phonebook_access1_get_primary_counter: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.PrimaryCounter">"PrimaryCounter"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use org_bluez_obex_phonebook_access1_dup_primary_counter() if on another thread.</warning> + * + * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + */ +const gchar * +org_bluez_obex_phonebook_access1_get_primary_counter (OrgBluezObexPhonebookAccess1 *object) +{ + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_GET_IFACE (object)->get_primary_counter (object); +} + +/** + * org_bluez_obex_phonebook_access1_dup_primary_counter: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets a copy of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.PrimaryCounter">"PrimaryCounter"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). + */ +gchar * +org_bluez_obex_phonebook_access1_dup_primary_counter (OrgBluezObexPhonebookAccess1 *object) +{ + gchar *value; + g_object_get (G_OBJECT (object), "primary-counter", &value, NULL); + return value; +} + +/** + * org_bluez_obex_phonebook_access1_set_primary_counter: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.PrimaryCounter">"PrimaryCounter"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_phonebook_access1_set_primary_counter (OrgBluezObexPhonebookAccess1 *object, const gchar *value) +{ + g_object_set (G_OBJECT (object), "primary-counter", value, NULL); +} + +/** + * org_bluez_obex_phonebook_access1_get_secondary_counter: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.SecondaryCounter">"SecondaryCounter"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use org_bluez_obex_phonebook_access1_dup_secondary_counter() if on another thread.</warning> + * + * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + */ +const gchar * +org_bluez_obex_phonebook_access1_get_secondary_counter (OrgBluezObexPhonebookAccess1 *object) +{ + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_GET_IFACE (object)->get_secondary_counter (object); +} + +/** + * org_bluez_obex_phonebook_access1_dup_secondary_counter: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets a copy of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.SecondaryCounter">"SecondaryCounter"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). + */ +gchar * +org_bluez_obex_phonebook_access1_dup_secondary_counter (OrgBluezObexPhonebookAccess1 *object) +{ + gchar *value; + g_object_get (G_OBJECT (object), "secondary-counter", &value, NULL); + return value; +} + +/** + * org_bluez_obex_phonebook_access1_set_secondary_counter: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.SecondaryCounter">"SecondaryCounter"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_phonebook_access1_set_secondary_counter (OrgBluezObexPhonebookAccess1 *object, const gchar *value) +{ + g_object_set (G_OBJECT (object), "secondary-counter", value, NULL); +} + +/** + * org_bluez_obex_phonebook_access1_get_fixed_image_size: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.FixedImageSize">"FixedImageSize"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: The property value. + */ +gboolean +org_bluez_obex_phonebook_access1_get_fixed_image_size (OrgBluezObexPhonebookAccess1 *object) +{ + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_GET_IFACE (object)->get_fixed_image_size (object); +} + +/** + * org_bluez_obex_phonebook_access1_set_fixed_image_size: (skip) + * @object: A #OrgBluezObexPhonebookAccess1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-PhonebookAccess1.FixedImageSize">"FixedImageSize"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_phonebook_access1_set_fixed_image_size (OrgBluezObexPhonebookAccess1 *object, gboolean value) +{ + g_object_set (G_OBJECT (object), "fixed-image-size", value, NULL); +} + +/** + * org_bluez_obex_phonebook_access1_call_select: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_location: Argument to pass with the method invocation. + * @arg_phonebook: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Select">Select()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_call_select_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_call_select_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_phonebook_access1_call_select ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_location, + const gchar *arg_phonebook, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Select", + g_variant_new ("(ss)", + arg_location, + arg_phonebook), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_phonebook_access1_call_select_finish: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_call_select(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_call_select(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_select_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_select_sync: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_location: Argument to pass with the method invocation. + * @arg_phonebook: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Select">Select()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_call_select() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_select_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_location, + const gchar *arg_phonebook, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Select", + g_variant_new ("(ss)", + arg_location, + arg_phonebook), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_pull_all: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_targetfile: Argument to pass with the method invocation. + * @arg_filters: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.PullAll">PullAll()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_call_pull_all_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_call_pull_all_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_phonebook_access1_call_pull_all ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_targetfile, + GVariant *arg_filters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "PullAll", + g_variant_new ("(s@a{sv})", + arg_targetfile, + arg_filters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_phonebook_access1_call_pull_all_finish: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @out_transfer: (out): Return location for return parameter or %NULL to ignore. + * @out_properties: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_call_pull_all(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_call_pull_all(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_pull_all_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + gchar **out_transfer, + GVariant **out_properties, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o@a{sv})", + out_transfer, + out_properties); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_pull_all_sync: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_targetfile: Argument to pass with the method invocation. + * @arg_filters: Argument to pass with the method invocation. + * @out_transfer: (out): Return location for return parameter or %NULL to ignore. + * @out_properties: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.PullAll">PullAll()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_call_pull_all() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_pull_all_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_targetfile, + GVariant *arg_filters, + gchar **out_transfer, + GVariant **out_properties, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "PullAll", + g_variant_new ("(s@a{sv})", + arg_targetfile, + arg_filters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o@a{sv})", + out_transfer, + out_properties); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_pull: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_vcard: Argument to pass with the method invocation. + * @arg_targetfile: Argument to pass with the method invocation. + * @arg_filters: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Pull">Pull()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_call_pull_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_call_pull_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_phonebook_access1_call_pull ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_vcard, + const gchar *arg_targetfile, + GVariant *arg_filters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Pull", + g_variant_new ("(ss@a{sv})", + arg_vcard, + arg_targetfile, + arg_filters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_phonebook_access1_call_pull_finish: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @out_transfer: (out): Return location for return parameter or %NULL to ignore. + * @out_properties: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_call_pull(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_call_pull(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_pull_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + gchar **out_transfer, + GVariant **out_properties, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o@a{sv})", + out_transfer, + out_properties); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_pull_sync: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_vcard: Argument to pass with the method invocation. + * @arg_targetfile: Argument to pass with the method invocation. + * @arg_filters: Argument to pass with the method invocation. + * @out_transfer: (out): Return location for return parameter or %NULL to ignore. + * @out_properties: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Pull">Pull()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_call_pull() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_pull_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_vcard, + const gchar *arg_targetfile, + GVariant *arg_filters, + gchar **out_transfer, + GVariant **out_properties, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Pull", + g_variant_new ("(ss@a{sv})", + arg_vcard, + arg_targetfile, + arg_filters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o@a{sv})", + out_transfer, + out_properties); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_list: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_filters: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.List">List()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_call_list_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_call_list_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_phonebook_access1_call_list ( + OrgBluezObexPhonebookAccess1 *proxy, + GVariant *arg_filters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "List", + g_variant_new ("(@a{sv})", + arg_filters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_phonebook_access1_call_list_finish: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @out_vcard_listing: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_call_list(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_call_list(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_list_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + GVariant **out_vcard_listing, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a(ss))", + out_vcard_listing); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_list_sync: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_filters: Argument to pass with the method invocation. + * @out_vcard_listing: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.List">List()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_call_list() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_list_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + GVariant *arg_filters, + GVariant **out_vcard_listing, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "List", + g_variant_new ("(@a{sv})", + arg_filters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a(ss))", + out_vcard_listing); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_search: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_field: Argument to pass with the method invocation. + * @arg_value: Argument to pass with the method invocation. + * @arg_filters: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Search">Search()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_call_search_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_call_search_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_phonebook_access1_call_search ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_field, + const gchar *arg_value, + GVariant *arg_filters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Search", + g_variant_new ("(ss@a{sv})", + arg_field, + arg_value, + arg_filters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_phonebook_access1_call_search_finish: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @out_vcard_listing: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_call_search(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_call_search(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_search_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + GVariant **out_vcard_listing, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a(ss))", + out_vcard_listing); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_search_sync: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @arg_field: Argument to pass with the method invocation. + * @arg_value: Argument to pass with the method invocation. + * @arg_filters: Argument to pass with the method invocation. + * @out_vcard_listing: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Search">Search()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_call_search() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_search_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_field, + const gchar *arg_value, + GVariant *arg_filters, + GVariant **out_vcard_listing, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Search", + g_variant_new ("(ss@a{sv})", + arg_field, + arg_value, + arg_filters), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a(ss))", + out_vcard_listing); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_get_size: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.GetSize">GetSize()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_call_get_size_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_call_get_size_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_phonebook_access1_call_get_size ( + OrgBluezObexPhonebookAccess1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetSize", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_phonebook_access1_call_get_size_finish: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @out_size: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_call_get_size(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_call_get_size(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_get_size_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + guint16 *out_size, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(q)", + out_size); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_get_size_sync: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @out_size: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.GetSize">GetSize()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_call_get_size() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_get_size_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + guint16 *out_size, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetSize", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(q)", + out_size); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_list_filter_fields: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.ListFilterFields">ListFilterFields()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_call_list_filter_fields_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_call_list_filter_fields_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_phonebook_access1_call_list_filter_fields ( + OrgBluezObexPhonebookAccess1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "ListFilterFields", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_phonebook_access1_call_list_filter_fields_finish: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @out_fields: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_call_list_filter_fields(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_call_list_filter_fields(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_list_filter_fields_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + gchar ***out_fields, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_fields); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_list_filter_fields_sync: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @out_fields: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.ListFilterFields">ListFilterFields()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_call_list_filter_fields() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_list_filter_fields_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + gchar ***out_fields, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "ListFilterFields", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_fields); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_update_version: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.UpdateVersion">UpdateVersion()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_call_update_version_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_call_update_version_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_phonebook_access1_call_update_version ( + OrgBluezObexPhonebookAccess1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "UpdateVersion", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_phonebook_access1_call_update_version_finish: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_call_update_version(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_call_update_version(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_update_version_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_call_update_version_sync: + * @proxy: A #OrgBluezObexPhonebookAccess1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.UpdateVersion">UpdateVersion()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_call_update_version() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_phonebook_access1_call_update_version_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "UpdateVersion", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_phonebook_access1_complete_select: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Select">Select()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_phonebook_access1_complete_select ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * org_bluez_obex_phonebook_access1_complete_pull_all: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @transfer: Parameter to return. + * @properties: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.PullAll">PullAll()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_phonebook_access1_complete_pull_all ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *transfer, + GVariant *properties) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o@a{sv})", + transfer, + properties)); +} + +/** + * org_bluez_obex_phonebook_access1_complete_pull: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @transfer: Parameter to return. + * @properties: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Pull">Pull()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_phonebook_access1_complete_pull ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *transfer, + GVariant *properties) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o@a{sv})", + transfer, + properties)); +} + +/** + * org_bluez_obex_phonebook_access1_complete_list: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @vcard_listing: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.List">List()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_phonebook_access1_complete_list ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + GVariant *vcard_listing) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a(ss))", + vcard_listing)); +} + +/** + * org_bluez_obex_phonebook_access1_complete_search: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @vcard_listing: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.Search">Search()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_phonebook_access1_complete_search ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + GVariant *vcard_listing) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a(ss))", + vcard_listing)); +} + +/** + * org_bluez_obex_phonebook_access1_complete_get_size: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @size: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.GetSize">GetSize()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_phonebook_access1_complete_get_size ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + guint16 size) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(q)", + size)); +} + +/** + * org_bluez_obex_phonebook_access1_complete_list_filter_fields: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @fields: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.ListFilterFields">ListFilterFields()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_phonebook_access1_complete_list_filter_fields ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *const *fields) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(^as)", + fields)); +} + +/** + * org_bluez_obex_phonebook_access1_complete_update_version: + * @object: A #OrgBluezObexPhonebookAccess1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-PhonebookAccess1.UpdateVersion">UpdateVersion()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_phonebook_access1_complete_update_version ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * OrgBluezObexPhonebookAccess1Proxy: + * + * The #OrgBluezObexPhonebookAccess1Proxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgBluezObexPhonebookAccess1ProxyClass: + * @parent_class: The parent class. + * + * Class structure for #OrgBluezObexPhonebookAccess1Proxy. + */ + +struct _OrgBluezObexPhonebookAccess1ProxyPrivate +{ + GData *qdata; +}; + +static void org_bluez_obex_phonebook_access1_proxy_iface_init (OrgBluezObexPhonebookAccess1Iface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexPhonebookAccess1Proxy, org_bluez_obex_phonebook_access1_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (OrgBluezObexPhonebookAccess1Proxy) + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1, org_bluez_obex_phonebook_access1_proxy_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexPhonebookAccess1Proxy, org_bluez_obex_phonebook_access1_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1, org_bluez_obex_phonebook_access1_proxy_iface_init)); + +#endif +static void +org_bluez_obex_phonebook_access1_proxy_finalize (GObject *object) +{ + OrgBluezObexPhonebookAccess1Proxy *proxy = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (org_bluez_obex_phonebook_access1_proxy_parent_class)->finalize (object); +} + +static void +org_bluez_obex_phonebook_access1_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ + const _ExtendedGDBusPropertyInfo *info; + GVariant *variant; + g_assert (prop_id != 0 && prop_id - 1 < 5); + info = _org_bluez_obex_phonebook_access1_property_info_pointers[prop_id - 1]; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); + if (info->use_gvariant) + { + g_value_set_variant (value, variant); + } + else + { + if (variant != NULL) + g_dbus_gvariant_to_gvalue (variant, value); + } + if (variant != NULL) + g_variant_unref (variant); +} + +static void +org_bluez_obex_phonebook_access1_proxy_set_property_cb (GDBusProxy *proxy, + GAsyncResult *res, + gpointer user_data) +{ + const _ExtendedGDBusPropertyInfo *info = user_data; + GError *error; + GVariant *_ret; + error = NULL; + _ret = g_dbus_proxy_call_finish (proxy, res, &error); + if (!_ret) + { + g_warning ("Error setting property '%s' on interface org.bluez.obex.PhonebookAccess1: %s (%s, %d)", + info->parent_struct.name, + error->message, g_quark_to_string (error->domain), error->code); + g_error_free (error); + } + else + { + g_variant_unref (_ret); + } +} + +static void +org_bluez_obex_phonebook_access1_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ + const _ExtendedGDBusPropertyInfo *info; + GVariant *variant; + g_assert (prop_id != 0 && prop_id - 1 < 5); + info = _org_bluez_obex_phonebook_access1_property_info_pointers[prop_id - 1]; + variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_dbus_proxy_call (G_DBUS_PROXY (object), + "org.freedesktop.DBus.Properties.Set", + g_variant_new ("(ssv)", "org.bluez.obex.PhonebookAccess1", info->parent_struct.name, variant), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, (GAsyncReadyCallback) org_bluez_obex_phonebook_access1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); + g_variant_unref (variant); +} + +static void +org_bluez_obex_phonebook_access1_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_bluez_obex_phonebook_access1_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +org_bluez_obex_phonebook_access1_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + OrgBluezObexPhonebookAccess1Proxy *proxy = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_phonebook_access1_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_phonebook_access1_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static const gchar * +org_bluez_obex_phonebook_access1_proxy_get_folder (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Proxy *proxy = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY (object); + GVariant *variant; + const gchar *value = NULL; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Folder"); + if (variant != NULL) + { + value = g_variant_get_string (variant, NULL); + g_variant_unref (variant); + } + return value; +} + +static const gchar * +org_bluez_obex_phonebook_access1_proxy_get_database_identifier (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Proxy *proxy = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY (object); + GVariant *variant; + const gchar *value = NULL; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "DatabaseIdentifier"); + if (variant != NULL) + { + value = g_variant_get_string (variant, NULL); + g_variant_unref (variant); + } + return value; +} + +static const gchar * +org_bluez_obex_phonebook_access1_proxy_get_primary_counter (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Proxy *proxy = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY (object); + GVariant *variant; + const gchar *value = NULL; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "PrimaryCounter"); + if (variant != NULL) + { + value = g_variant_get_string (variant, NULL); + g_variant_unref (variant); + } + return value; +} + +static const gchar * +org_bluez_obex_phonebook_access1_proxy_get_secondary_counter (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Proxy *proxy = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY (object); + GVariant *variant; + const gchar *value = NULL; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "SecondaryCounter"); + if (variant != NULL) + { + value = g_variant_get_string (variant, NULL); + g_variant_unref (variant); + } + return value; +} + +static gboolean +org_bluez_obex_phonebook_access1_proxy_get_fixed_image_size (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Proxy *proxy = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY (object); + GVariant *variant; + gboolean value = 0; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "FixedImageSize"); + if (variant != NULL) + { + value = g_variant_get_boolean (variant); + g_variant_unref (variant); + } + return value; +} + +static void +org_bluez_obex_phonebook_access1_proxy_init (OrgBluezObexPhonebookAccess1Proxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = org_bluez_obex_phonebook_access1_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY, OrgBluezObexPhonebookAccess1ProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_bluez_obex_phonebook_access1_interface_info ()); +} + +static void +org_bluez_obex_phonebook_access1_proxy_class_init (OrgBluezObexPhonebookAccess1ProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_bluez_obex_phonebook_access1_proxy_finalize; + gobject_class->get_property = org_bluez_obex_phonebook_access1_proxy_get_property; + gobject_class->set_property = org_bluez_obex_phonebook_access1_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = org_bluez_obex_phonebook_access1_proxy_g_signal; + proxy_class->g_properties_changed = org_bluez_obex_phonebook_access1_proxy_g_properties_changed; + + org_bluez_obex_phonebook_access1_override_properties (gobject_class, 1); + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgBluezObexPhonebookAccess1ProxyPrivate)); +#endif +} + +static void +org_bluez_obex_phonebook_access1_proxy_iface_init (OrgBluezObexPhonebookAccess1Iface *iface) +{ + iface->get_folder = org_bluez_obex_phonebook_access1_proxy_get_folder; + iface->get_database_identifier = org_bluez_obex_phonebook_access1_proxy_get_database_identifier; + iface->get_primary_counter = org_bluez_obex_phonebook_access1_proxy_get_primary_counter; + iface->get_secondary_counter = org_bluez_obex_phonebook_access1_proxy_get_secondary_counter; + iface->get_fixed_image_size = org_bluez_obex_phonebook_access1_proxy_get_fixed_image_size; +} + +/** + * org_bluez_obex_phonebook_access1_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-PhonebookAccess1.top_of_page">org.bluez.obex.PhonebookAccess1</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_proxy_new_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +org_bluez_obex_phonebook_access1_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.PhonebookAccess1", NULL); +} + +/** + * org_bluez_obex_phonebook_access1_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_proxy_new(). + * + * Returns: (transfer full) (type OrgBluezObexPhonebookAccess1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexPhonebookAccess1 * +org_bluez_obex_phonebook_access1_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1 (ret); + else + return NULL; +} + +/** + * org_bluez_obex_phonebook_access1_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-PhonebookAccess1.top_of_page">org.bluez.obex.PhonebookAccess1</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgBluezObexPhonebookAccess1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexPhonebookAccess1 * +org_bluez_obex_phonebook_access1_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.PhonebookAccess1", NULL); + if (ret != NULL) + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1 (ret); + else + return NULL; +} + + +/** + * org_bluez_obex_phonebook_access1_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like org_bluez_obex_phonebook_access1_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_phonebook_access1_proxy_new_for_bus_finish() to get the result of the operation. + * + * See org_bluez_obex_phonebook_access1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +org_bluez_obex_phonebook_access1_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.PhonebookAccess1", NULL); +} + +/** + * org_bluez_obex_phonebook_access1_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_phonebook_access1_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_bluez_obex_phonebook_access1_proxy_new_for_bus(). + * + * Returns: (transfer full) (type OrgBluezObexPhonebookAccess1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexPhonebookAccess1 * +org_bluez_obex_phonebook_access1_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1 (ret); + else + return NULL; +} + +/** + * org_bluez_obex_phonebook_access1_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like org_bluez_obex_phonebook_access1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_phonebook_access1_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgBluezObexPhonebookAccess1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexPhonebookAccess1 * +org_bluez_obex_phonebook_access1_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.PhonebookAccess1", NULL); + if (ret != NULL) + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1 (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * OrgBluezObexPhonebookAccess1Skeleton: + * + * The #OrgBluezObexPhonebookAccess1Skeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgBluezObexPhonebookAccess1SkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #OrgBluezObexPhonebookAccess1Skeleton. + */ + +struct _OrgBluezObexPhonebookAccess1SkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_org_bluez_obex_phonebook_access1_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_org_bluez_obex_phonebook_access1_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_phonebook_access1_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_org_bluez_obex_phonebook_access1_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_phonebook_access1_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _org_bluez_obex_phonebook_access1_skeleton_vtable = +{ + _org_bluez_obex_phonebook_access1_skeleton_handle_method_call, + _org_bluez_obex_phonebook_access1_skeleton_handle_get_property, + _org_bluez_obex_phonebook_access1_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +org_bluez_obex_phonebook_access1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return org_bluez_obex_phonebook_access1_interface_info (); +} + +static GDBusInterfaceVTable * +org_bluez_obex_phonebook_access1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_org_bluez_obex_phonebook_access1_skeleton_vtable; +} + +static GVariant * +org_bluez_obex_phonebook_access1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_org_bluez_obex_phonebook_access1_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _org_bluez_obex_phonebook_access1_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _org_bluez_obex_phonebook_access1_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _org_bluez_obex_phonebook_access1_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.bluez.obex.PhonebookAccess1", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static gboolean _org_bluez_obex_phonebook_access1_emit_changed (gpointer user_data); + +static void +org_bluez_obex_phonebook_access1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (_skeleton); + gboolean emit_changed = FALSE; + + g_mutex_lock (&skeleton->priv->lock); + if (skeleton->priv->changed_properties_idle_source != NULL) + { + g_source_destroy (skeleton->priv->changed_properties_idle_source); + skeleton->priv->changed_properties_idle_source = NULL; + emit_changed = TRUE; + } + g_mutex_unlock (&skeleton->priv->lock); + + if (emit_changed) + _org_bluez_obex_phonebook_access1_emit_changed (skeleton); +} + +static void org_bluez_obex_phonebook_access1_skeleton_iface_init (OrgBluezObexPhonebookAccess1Iface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexPhonebookAccess1Skeleton, org_bluez_obex_phonebook_access1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (OrgBluezObexPhonebookAccess1Skeleton) + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1, org_bluez_obex_phonebook_access1_skeleton_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexPhonebookAccess1Skeleton, org_bluez_obex_phonebook_access1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1, org_bluez_obex_phonebook_access1_skeleton_iface_init)); + +#endif +static void +org_bluez_obex_phonebook_access1_skeleton_finalize (GObject *object) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + guint n; + for (n = 0; n < 5; n++) + g_value_unset (&skeleton->priv->properties[n]); + g_free (skeleton->priv->properties); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (org_bluez_obex_phonebook_access1_skeleton_parent_class)->finalize (object); +} + +static void +org_bluez_obex_phonebook_access1_skeleton_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + g_assert (prop_id != 0 && prop_id - 1 < 5); + g_mutex_lock (&skeleton->priv->lock); + g_value_copy (&skeleton->priv->properties[prop_id - 1], value); + g_mutex_unlock (&skeleton->priv->lock); +} + +static gboolean +_org_bluez_obex_phonebook_access1_emit_changed (gpointer user_data) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (user_data); + GList *l; + GVariantBuilder builder; + GVariantBuilder invalidated_builder; + guint num_changes; + + g_mutex_lock (&skeleton->priv->lock); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); + for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) + { + ChangedProperty *cp = l->data; + GVariant *variant; + const GValue *cur_value; + + cur_value = &skeleton->priv->properties[cp->prop_id - 1]; + if (!_g_value_equal (cur_value, &cp->orig_value)) + { + variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); + g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); + g_variant_unref (variant); + num_changes++; + } + } + if (num_changes > 0) + { + GList *connections, *ll; + GVariant *signal_variant; + signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.bluez.obex.PhonebookAccess1", + &builder, &invalidated_builder)); + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + for (ll = connections; ll != NULL; ll = ll->next) + { + GDBusConnection *connection = ll->data; + + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), + "org.freedesktop.DBus.Properties", + "PropertiesChanged", + signal_variant, + NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); + } + else + { + g_variant_builder_clear (&builder); + g_variant_builder_clear (&invalidated_builder); + } + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + skeleton->priv->changed_properties = NULL; + skeleton->priv->changed_properties_idle_source = NULL; + g_mutex_unlock (&skeleton->priv->lock); + return FALSE; +} + +static void +_org_bluez_obex_phonebook_access1_schedule_emit_changed (OrgBluezObexPhonebookAccess1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) +{ + ChangedProperty *cp; + GList *l; + cp = NULL; + for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) + { + ChangedProperty *i_cp = l->data; + if (i_cp->info == info) + { + cp = i_cp; + break; + } + } + if (cp == NULL) + { + cp = g_new0 (ChangedProperty, 1); + cp->prop_id = prop_id; + cp->info = info; + skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); + g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); + g_value_copy (orig_value, &cp->orig_value); + } +} + +static void +org_bluez_obex_phonebook_access1_skeleton_notify (GObject *object, + GParamSpec *pspec G_GNUC_UNUSED) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + g_mutex_lock (&skeleton->priv->lock); + if (skeleton->priv->changed_properties != NULL && + skeleton->priv->changed_properties_idle_source == NULL) + { + skeleton->priv->changed_properties_idle_source = g_idle_source_new (); + g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (skeleton->priv->changed_properties_idle_source, _org_bluez_obex_phonebook_access1_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); + g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _org_bluez_obex_phonebook_access1_emit_changed"); + g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); + g_source_unref (skeleton->priv->changed_properties_idle_source); + } + g_mutex_unlock (&skeleton->priv->lock); +} + +static void +org_bluez_obex_phonebook_access1_skeleton_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + g_assert (prop_id != 0 && prop_id - 1 < 5); + g_mutex_lock (&skeleton->priv->lock); + g_object_freeze_notify (object); + if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) + { + if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL) + _org_bluez_obex_phonebook_access1_schedule_emit_changed (skeleton, _org_bluez_obex_phonebook_access1_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); + g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); + g_object_notify_by_pspec (object, pspec); + } + g_mutex_unlock (&skeleton->priv->lock); + g_object_thaw_notify (object); +} + +static void +org_bluez_obex_phonebook_access1_skeleton_init (OrgBluezObexPhonebookAccess1Skeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = org_bluez_obex_phonebook_access1_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON, OrgBluezObexPhonebookAccess1SkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); + skeleton->priv->properties = g_new0 (GValue, 5); + g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING); + g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING); + g_value_init (&skeleton->priv->properties[2], G_TYPE_STRING); + g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING); + g_value_init (&skeleton->priv->properties[4], G_TYPE_BOOLEAN); +} + +static const gchar * +org_bluez_obex_phonebook_access1_skeleton_get_folder (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + const gchar *value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_string (&(skeleton->priv->properties[0])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static const gchar * +org_bluez_obex_phonebook_access1_skeleton_get_database_identifier (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + const gchar *value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_string (&(skeleton->priv->properties[1])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static const gchar * +org_bluez_obex_phonebook_access1_skeleton_get_primary_counter (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + const gchar *value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_string (&(skeleton->priv->properties[2])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static const gchar * +org_bluez_obex_phonebook_access1_skeleton_get_secondary_counter (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + const gchar *value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_string (&(skeleton->priv->properties[3])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static gboolean +org_bluez_obex_phonebook_access1_skeleton_get_fixed_image_size (OrgBluezObexPhonebookAccess1 *object) +{ + OrgBluezObexPhonebookAccess1Skeleton *skeleton = ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (object); + gboolean value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_boolean (&(skeleton->priv->properties[4])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static void +org_bluez_obex_phonebook_access1_skeleton_class_init (OrgBluezObexPhonebookAccess1SkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_bluez_obex_phonebook_access1_skeleton_finalize; + gobject_class->get_property = org_bluez_obex_phonebook_access1_skeleton_get_property; + gobject_class->set_property = org_bluez_obex_phonebook_access1_skeleton_set_property; + gobject_class->notify = org_bluez_obex_phonebook_access1_skeleton_notify; + + + org_bluez_obex_phonebook_access1_override_properties (gobject_class, 1); + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = org_bluez_obex_phonebook_access1_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = org_bluez_obex_phonebook_access1_skeleton_dbus_interface_get_properties; + skeleton_class->flush = org_bluez_obex_phonebook_access1_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = org_bluez_obex_phonebook_access1_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgBluezObexPhonebookAccess1SkeletonPrivate)); +#endif +} + +static void +org_bluez_obex_phonebook_access1_skeleton_iface_init (OrgBluezObexPhonebookAccess1Iface *iface) +{ + iface->get_folder = org_bluez_obex_phonebook_access1_skeleton_get_folder; + iface->get_database_identifier = org_bluez_obex_phonebook_access1_skeleton_get_database_identifier; + iface->get_primary_counter = org_bluez_obex_phonebook_access1_skeleton_get_primary_counter; + iface->get_secondary_counter = org_bluez_obex_phonebook_access1_skeleton_get_secondary_counter; + iface->get_fixed_image_size = org_bluez_obex_phonebook_access1_skeleton_get_fixed_image_size; +} + +/** + * org_bluez_obex_phonebook_access1_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-PhonebookAccess1.top_of_page">org.bluez.obex.PhonebookAccess1</link>. + * + * Returns: (transfer full) (type OrgBluezObexPhonebookAccess1Skeleton): The skeleton object. + */ +OrgBluezObexPhonebookAccess1 * +org_bluez_obex_phonebook_access1_skeleton_new (void) +{ + return ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1 (g_object_new (TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON, NULL)); +} + diff --git a/binding/gdbus/obex_phonebookaccess1_interface.h b/binding/gdbus/obex_phonebookaccess1_interface.h new file mode 100644 index 0000000..f7c6921 --- /dev/null +++ b/binding/gdbus/obex_phonebookaccess1_interface.h @@ -0,0 +1,432 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __OBEX_PHONEBOOKACCESS1_INTERFACE_H__ +#define __OBEX_PHONEBOOKACCESS1_INTERFACE_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.bluez.obex.PhonebookAccess1 */ + +#define TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1 (org_bluez_obex_phonebook_access1_get_type ()) +#define ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1, OrgBluezObexPhonebookAccess1)) +#define IS_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1)) +#define ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1, OrgBluezObexPhonebookAccess1Iface)) + +struct _OrgBluezObexPhonebookAccess1; +typedef struct _OrgBluezObexPhonebookAccess1 OrgBluezObexPhonebookAccess1; +typedef struct _OrgBluezObexPhonebookAccess1Iface OrgBluezObexPhonebookAccess1Iface; + +struct _OrgBluezObexPhonebookAccess1Iface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_get_size) ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_list) ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + GVariant *arg_filters); + + gboolean (*handle_list_filter_fields) ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_pull) ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *arg_vcard, + const gchar *arg_targetfile, + GVariant *arg_filters); + + gboolean (*handle_pull_all) ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *arg_targetfile, + GVariant *arg_filters); + + gboolean (*handle_search) ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *arg_field, + const gchar *arg_value, + GVariant *arg_filters); + + gboolean (*handle_select) ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *arg_location, + const gchar *arg_phonebook); + + gboolean (*handle_update_version) ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation); + + const gchar * (*get_database_identifier) (OrgBluezObexPhonebookAccess1 *object); + + gboolean (*get_fixed_image_size) (OrgBluezObexPhonebookAccess1 *object); + + const gchar * (*get_folder) (OrgBluezObexPhonebookAccess1 *object); + + const gchar * (*get_primary_counter) (OrgBluezObexPhonebookAccess1 *object); + + const gchar * (*get_secondary_counter) (OrgBluezObexPhonebookAccess1 *object); + +}; + +GType org_bluez_obex_phonebook_access1_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *org_bluez_obex_phonebook_access1_interface_info (void); +guint org_bluez_obex_phonebook_access1_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void org_bluez_obex_phonebook_access1_complete_select ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation); + +void org_bluez_obex_phonebook_access1_complete_pull_all ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *transfer, + GVariant *properties); + +void org_bluez_obex_phonebook_access1_complete_pull ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *transfer, + GVariant *properties); + +void org_bluez_obex_phonebook_access1_complete_list ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + GVariant *vcard_listing); + +void org_bluez_obex_phonebook_access1_complete_search ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + GVariant *vcard_listing); + +void org_bluez_obex_phonebook_access1_complete_get_size ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + guint16 size); + +void org_bluez_obex_phonebook_access1_complete_list_filter_fields ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation, + const gchar *const *fields); + +void org_bluez_obex_phonebook_access1_complete_update_version ( + OrgBluezObexPhonebookAccess1 *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus method calls: */ +void org_bluez_obex_phonebook_access1_call_select ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_location, + const gchar *arg_phonebook, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_phonebook_access1_call_select_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_phonebook_access1_call_select_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_location, + const gchar *arg_phonebook, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_phonebook_access1_call_pull_all ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_targetfile, + GVariant *arg_filters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_phonebook_access1_call_pull_all_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + gchar **out_transfer, + GVariant **out_properties, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_phonebook_access1_call_pull_all_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_targetfile, + GVariant *arg_filters, + gchar **out_transfer, + GVariant **out_properties, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_phonebook_access1_call_pull ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_vcard, + const gchar *arg_targetfile, + GVariant *arg_filters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_phonebook_access1_call_pull_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + gchar **out_transfer, + GVariant **out_properties, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_phonebook_access1_call_pull_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_vcard, + const gchar *arg_targetfile, + GVariant *arg_filters, + gchar **out_transfer, + GVariant **out_properties, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_phonebook_access1_call_list ( + OrgBluezObexPhonebookAccess1 *proxy, + GVariant *arg_filters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_phonebook_access1_call_list_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + GVariant **out_vcard_listing, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_phonebook_access1_call_list_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + GVariant *arg_filters, + GVariant **out_vcard_listing, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_phonebook_access1_call_search ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_field, + const gchar *arg_value, + GVariant *arg_filters, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_phonebook_access1_call_search_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + GVariant **out_vcard_listing, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_phonebook_access1_call_search_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + const gchar *arg_field, + const gchar *arg_value, + GVariant *arg_filters, + GVariant **out_vcard_listing, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_phonebook_access1_call_get_size ( + OrgBluezObexPhonebookAccess1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_phonebook_access1_call_get_size_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + guint16 *out_size, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_phonebook_access1_call_get_size_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + guint16 *out_size, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_phonebook_access1_call_list_filter_fields ( + OrgBluezObexPhonebookAccess1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_phonebook_access1_call_list_filter_fields_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + gchar ***out_fields, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_phonebook_access1_call_list_filter_fields_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + gchar ***out_fields, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_phonebook_access1_call_update_version ( + OrgBluezObexPhonebookAccess1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_phonebook_access1_call_update_version_finish ( + OrgBluezObexPhonebookAccess1 *proxy, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_phonebook_access1_call_update_version_sync ( + OrgBluezObexPhonebookAccess1 *proxy, + GCancellable *cancellable, + GError **error); + + + +/* D-Bus property accessors: */ +const gchar *org_bluez_obex_phonebook_access1_get_folder (OrgBluezObexPhonebookAccess1 *object); +gchar *org_bluez_obex_phonebook_access1_dup_folder (OrgBluezObexPhonebookAccess1 *object); +void org_bluez_obex_phonebook_access1_set_folder (OrgBluezObexPhonebookAccess1 *object, const gchar *value); + +const gchar *org_bluez_obex_phonebook_access1_get_database_identifier (OrgBluezObexPhonebookAccess1 *object); +gchar *org_bluez_obex_phonebook_access1_dup_database_identifier (OrgBluezObexPhonebookAccess1 *object); +void org_bluez_obex_phonebook_access1_set_database_identifier (OrgBluezObexPhonebookAccess1 *object, const gchar *value); + +const gchar *org_bluez_obex_phonebook_access1_get_primary_counter (OrgBluezObexPhonebookAccess1 *object); +gchar *org_bluez_obex_phonebook_access1_dup_primary_counter (OrgBluezObexPhonebookAccess1 *object); +void org_bluez_obex_phonebook_access1_set_primary_counter (OrgBluezObexPhonebookAccess1 *object, const gchar *value); + +const gchar *org_bluez_obex_phonebook_access1_get_secondary_counter (OrgBluezObexPhonebookAccess1 *object); +gchar *org_bluez_obex_phonebook_access1_dup_secondary_counter (OrgBluezObexPhonebookAccess1 *object); +void org_bluez_obex_phonebook_access1_set_secondary_counter (OrgBluezObexPhonebookAccess1 *object, const gchar *value); + +gboolean org_bluez_obex_phonebook_access1_get_fixed_image_size (OrgBluezObexPhonebookAccess1 *object); +void org_bluez_obex_phonebook_access1_set_fixed_image_size (OrgBluezObexPhonebookAccess1 *object, gboolean value); + + +/* ---- */ + +#define TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY (org_bluez_obex_phonebook_access1_proxy_get_type ()) +#define ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY, OrgBluezObexPhonebookAccess1Proxy)) +#define ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY, OrgBluezObexPhonebookAccess1ProxyClass)) +#define ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY, OrgBluezObexPhonebookAccess1ProxyClass)) +#define IS_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY)) +#define IS_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_PROXY)) + +typedef struct _OrgBluezObexPhonebookAccess1Proxy OrgBluezObexPhonebookAccess1Proxy; +typedef struct _OrgBluezObexPhonebookAccess1ProxyClass OrgBluezObexPhonebookAccess1ProxyClass; +typedef struct _OrgBluezObexPhonebookAccess1ProxyPrivate OrgBluezObexPhonebookAccess1ProxyPrivate; + +struct _OrgBluezObexPhonebookAccess1Proxy +{ + /*< private >*/ + GDBusProxy parent_instance; + OrgBluezObexPhonebookAccess1ProxyPrivate *priv; +}; + +struct _OrgBluezObexPhonebookAccess1ProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType org_bluez_obex_phonebook_access1_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgBluezObexPhonebookAccess1Proxy, g_object_unref) +#endif + +void org_bluez_obex_phonebook_access1_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgBluezObexPhonebookAccess1 *org_bluez_obex_phonebook_access1_proxy_new_finish ( + GAsyncResult *res, + GError **error); +OrgBluezObexPhonebookAccess1 *org_bluez_obex_phonebook_access1_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_phonebook_access1_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgBluezObexPhonebookAccess1 *org_bluez_obex_phonebook_access1_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +OrgBluezObexPhonebookAccess1 *org_bluez_obex_phonebook_access1_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON (org_bluez_obex_phonebook_access1_skeleton_get_type ()) +#define ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON, OrgBluezObexPhonebookAccess1Skeleton)) +#define ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON, OrgBluezObexPhonebookAccess1SkeletonClass)) +#define ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON, OrgBluezObexPhonebookAccess1SkeletonClass)) +#define IS_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON)) +#define IS_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_BLUEZ_OBEX_PHONEBOOK_ACCESS1_SKELETON)) + +typedef struct _OrgBluezObexPhonebookAccess1Skeleton OrgBluezObexPhonebookAccess1Skeleton; +typedef struct _OrgBluezObexPhonebookAccess1SkeletonClass OrgBluezObexPhonebookAccess1SkeletonClass; +typedef struct _OrgBluezObexPhonebookAccess1SkeletonPrivate OrgBluezObexPhonebookAccess1SkeletonPrivate; + +struct _OrgBluezObexPhonebookAccess1Skeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + OrgBluezObexPhonebookAccess1SkeletonPrivate *priv; +}; + +struct _OrgBluezObexPhonebookAccess1SkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType org_bluez_obex_phonebook_access1_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgBluezObexPhonebookAccess1Skeleton, g_object_unref) +#endif + +OrgBluezObexPhonebookAccess1 *org_bluez_obex_phonebook_access1_skeleton_new (void); + + +G_END_DECLS + +#endif /* __OBEX_PHONEBOOKACCESS1_INTERFACE_H__ */ diff --git a/binding/gdbus/obex_session1_interface.c b/binding/gdbus/obex_session1_interface.c new file mode 100644 index 0000000..62476a3 --- /dev/null +++ b/binding/gdbus/obex_session1_interface.c @@ -0,0 +1,1664 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "obex_session1_interface.h" + +#include <string.h> +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.bluez.obex.Session1 + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:OrgBluezObexSession1 + * @title: OrgBluezObexSession1 + * @short_description: Generated C code for the org.bluez.obex.Session1 D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-org-bluez-obex-Session1.top_of_page">org.bluez.obex.Session1</link> D-Bus interface in C. + */ + +/* ---- Introspection data for org.bluez.obex.Session1 ---- */ + +static const _ExtendedGDBusArgInfo _org_bluez_obex_session1_method_info_get_capabilities_OUT_ARG_capabilities = +{ + { + -1, + (gchar *) "capabilities", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _org_bluez_obex_session1_method_info_get_capabilities_OUT_ARG_pointers[] = +{ + &_org_bluez_obex_session1_method_info_get_capabilities_OUT_ARG_capabilities, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_session1_method_info_get_capabilities = +{ + { + -1, + (gchar *) "GetCapabilities", + NULL, + (GDBusArgInfo **) &_org_bluez_obex_session1_method_info_get_capabilities_OUT_ARG_pointers, + NULL + }, + "handle-get-capabilities", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _org_bluez_obex_session1_method_info_pointers[] = +{ + &_org_bluez_obex_session1_method_info_get_capabilities, + NULL +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_session1_property_info_source = +{ + { + -1, + (gchar *) "Source", + (gchar *) "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "source", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_session1_property_info_destination = +{ + { + -1, + (gchar *) "Destination", + (gchar *) "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "destination", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_session1_property_info_channel = +{ + { + -1, + (gchar *) "Channel", + (gchar *) "y", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "channel", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _org_bluez_obex_session1_property_info_target = +{ + { + -1, + (gchar *) "Target", + (gchar *) "s", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "target", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo * const _org_bluez_obex_session1_property_info_pointers[] = +{ + &_org_bluez_obex_session1_property_info_source, + &_org_bluez_obex_session1_property_info_destination, + &_org_bluez_obex_session1_property_info_channel, + &_org_bluez_obex_session1_property_info_target, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _org_bluez_obex_session1_interface_info = +{ + { + -1, + (gchar *) "org.bluez.obex.Session1", + (GDBusMethodInfo **) &_org_bluez_obex_session1_method_info_pointers, + NULL, + (GDBusPropertyInfo **) &_org_bluez_obex_session1_property_info_pointers, + NULL + }, + "org-bluez-obex-session1", +}; + + +/** + * org_bluez_obex_session1_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-org-bluez-obex-Session1.top_of_page">org.bluez.obex.Session1</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +org_bluez_obex_session1_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_org_bluez_obex_session1_interface_info.parent_struct; +} + +/** + * org_bluez_obex_session1_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #OrgBluezObexSession1 interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +org_bluez_obex_session1_override_properties (GObjectClass *klass, guint property_id_begin) +{ + g_object_class_override_property (klass, property_id_begin++, "source"); + g_object_class_override_property (klass, property_id_begin++, "destination"); + g_object_class_override_property (klass, property_id_begin++, "channel"); + g_object_class_override_property (klass, property_id_begin++, "target"); + return property_id_begin - 1; +} + + + +/** + * OrgBluezObexSession1: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Session1.top_of_page">org.bluez.obex.Session1</link>. + */ + +/** + * OrgBluezObexSession1Iface: + * @parent_iface: The parent interface. + * @handle_get_capabilities: Handler for the #OrgBluezObexSession1::handle-get-capabilities signal. + * @get_channel: Getter for the #OrgBluezObexSession1:channel property. + * @get_destination: Getter for the #OrgBluezObexSession1:destination property. + * @get_source: Getter for the #OrgBluezObexSession1:source property. + * @get_target: Getter for the #OrgBluezObexSession1:target property. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Session1.top_of_page">org.bluez.obex.Session1</link>. + */ + +typedef OrgBluezObexSession1Iface OrgBluezObexSession1Interface; +G_DEFINE_INTERFACE (OrgBluezObexSession1, org_bluez_obex_session1, G_TYPE_OBJECT); + +static void +org_bluez_obex_session1_default_init (OrgBluezObexSession1Iface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * OrgBluezObexSession1::handle-get-capabilities: + * @object: A #OrgBluezObexSession1. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-Session1.GetCapabilities">GetCapabilities()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_session1_complete_get_capabilities() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-capabilities", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexSession1Iface, handle_get_capabilities), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /* GObject properties for D-Bus properties: */ + /** + * OrgBluezObexSession1:source: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-Session1.Source">"Source"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_string ("source", "Source", "Source", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * OrgBluezObexSession1:destination: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-Session1.Destination">"Destination"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_string ("destination", "Destination", "Destination", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * OrgBluezObexSession1:channel: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-Session1.Channel">"Channel"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_uchar ("channel", "Channel", "Channel", 0, 255, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * OrgBluezObexSession1:target: + * + * Represents the D-Bus property <link linkend="gdbus-property-org-bluez-obex-Session1.Target">"Target"</link>. + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_string ("target", "Target", "Target", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +/** + * org_bluez_obex_session1_get_source: (skip) + * @object: A #OrgBluezObexSession1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-Session1.Source">"Source"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use org_bluez_obex_session1_dup_source() if on another thread.</warning> + * + * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + */ +const gchar * +org_bluez_obex_session1_get_source (OrgBluezObexSession1 *object) +{ + return ORG_BLUEZ_OBEX_SESSION1_GET_IFACE (object)->get_source (object); +} + +/** + * org_bluez_obex_session1_dup_source: (skip) + * @object: A #OrgBluezObexSession1. + * + * Gets a copy of the <link linkend="gdbus-property-org-bluez-obex-Session1.Source">"Source"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). + */ +gchar * +org_bluez_obex_session1_dup_source (OrgBluezObexSession1 *object) +{ + gchar *value; + g_object_get (G_OBJECT (object), "source", &value, NULL); + return value; +} + +/** + * org_bluez_obex_session1_set_source: (skip) + * @object: A #OrgBluezObexSession1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-Session1.Source">"Source"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_session1_set_source (OrgBluezObexSession1 *object, const gchar *value) +{ + g_object_set (G_OBJECT (object), "source", value, NULL); +} + +/** + * org_bluez_obex_session1_get_destination: (skip) + * @object: A #OrgBluezObexSession1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-Session1.Destination">"Destination"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use org_bluez_obex_session1_dup_destination() if on another thread.</warning> + * + * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + */ +const gchar * +org_bluez_obex_session1_get_destination (OrgBluezObexSession1 *object) +{ + return ORG_BLUEZ_OBEX_SESSION1_GET_IFACE (object)->get_destination (object); +} + +/** + * org_bluez_obex_session1_dup_destination: (skip) + * @object: A #OrgBluezObexSession1. + * + * Gets a copy of the <link linkend="gdbus-property-org-bluez-obex-Session1.Destination">"Destination"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). + */ +gchar * +org_bluez_obex_session1_dup_destination (OrgBluezObexSession1 *object) +{ + gchar *value; + g_object_get (G_OBJECT (object), "destination", &value, NULL); + return value; +} + +/** + * org_bluez_obex_session1_set_destination: (skip) + * @object: A #OrgBluezObexSession1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-Session1.Destination">"Destination"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_session1_set_destination (OrgBluezObexSession1 *object, const gchar *value) +{ + g_object_set (G_OBJECT (object), "destination", value, NULL); +} + +/** + * org_bluez_obex_session1_get_channel: (skip) + * @object: A #OrgBluezObexSession1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-Session1.Channel">"Channel"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: The property value. + */ +guchar +org_bluez_obex_session1_get_channel (OrgBluezObexSession1 *object) +{ + return ORG_BLUEZ_OBEX_SESSION1_GET_IFACE (object)->get_channel (object); +} + +/** + * org_bluez_obex_session1_set_channel: (skip) + * @object: A #OrgBluezObexSession1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-Session1.Channel">"Channel"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_session1_set_channel (OrgBluezObexSession1 *object, guchar value) +{ + g_object_set (G_OBJECT (object), "channel", value, NULL); +} + +/** + * org_bluez_obex_session1_get_target: (skip) + * @object: A #OrgBluezObexSession1. + * + * Gets the value of the <link linkend="gdbus-property-org-bluez-obex-Session1.Target">"Target"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use org_bluez_obex_session1_dup_target() if on another thread.</warning> + * + * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + */ +const gchar * +org_bluez_obex_session1_get_target (OrgBluezObexSession1 *object) +{ + return ORG_BLUEZ_OBEX_SESSION1_GET_IFACE (object)->get_target (object); +} + +/** + * org_bluez_obex_session1_dup_target: (skip) + * @object: A #OrgBluezObexSession1. + * + * Gets a copy of the <link linkend="gdbus-property-org-bluez-obex-Session1.Target">"Target"</link> D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free(). + */ +gchar * +org_bluez_obex_session1_dup_target (OrgBluezObexSession1 *object) +{ + gchar *value; + g_object_get (G_OBJECT (object), "target", &value, NULL); + return value; +} + +/** + * org_bluez_obex_session1_set_target: (skip) + * @object: A #OrgBluezObexSession1. + * @value: The value to set. + * + * Sets the <link linkend="gdbus-property-org-bluez-obex-Session1.Target">"Target"</link> D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +org_bluez_obex_session1_set_target (OrgBluezObexSession1 *object, const gchar *value) +{ + g_object_set (G_OBJECT (object), "target", value, NULL); +} + +/** + * org_bluez_obex_session1_call_get_capabilities: + * @proxy: A #OrgBluezObexSession1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Session1.GetCapabilities">GetCapabilities()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_session1_call_get_capabilities_finish() to get the result of the operation. + * + * See org_bluez_obex_session1_call_get_capabilities_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_session1_call_get_capabilities ( + OrgBluezObexSession1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetCapabilities", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_session1_call_get_capabilities_finish: + * @proxy: A #OrgBluezObexSession1Proxy. + * @out_capabilities: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_session1_call_get_capabilities(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_session1_call_get_capabilities(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_session1_call_get_capabilities_finish ( + OrgBluezObexSession1 *proxy, + gchar **out_capabilities, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(s)", + out_capabilities); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_session1_call_get_capabilities_sync: + * @proxy: A #OrgBluezObexSession1Proxy. + * @out_capabilities: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Session1.GetCapabilities">GetCapabilities()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_session1_call_get_capabilities() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_session1_call_get_capabilities_sync ( + OrgBluezObexSession1 *proxy, + gchar **out_capabilities, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetCapabilities", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(s)", + out_capabilities); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_session1_complete_get_capabilities: + * @object: A #OrgBluezObexSession1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @capabilities: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-Session1.GetCapabilities">GetCapabilities()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_session1_complete_get_capabilities ( + OrgBluezObexSession1 *object, + GDBusMethodInvocation *invocation, + const gchar *capabilities) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(s)", + capabilities)); +} + +/* ------------------------------------------------------------------------ */ + +/** + * OrgBluezObexSession1Proxy: + * + * The #OrgBluezObexSession1Proxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgBluezObexSession1ProxyClass: + * @parent_class: The parent class. + * + * Class structure for #OrgBluezObexSession1Proxy. + */ + +struct _OrgBluezObexSession1ProxyPrivate +{ + GData *qdata; +}; + +static void org_bluez_obex_session1_proxy_iface_init (OrgBluezObexSession1Iface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexSession1Proxy, org_bluez_obex_session1_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (OrgBluezObexSession1Proxy) + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_SESSION1, org_bluez_obex_session1_proxy_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexSession1Proxy, org_bluez_obex_session1_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_SESSION1, org_bluez_obex_session1_proxy_iface_init)); + +#endif +static void +org_bluez_obex_session1_proxy_finalize (GObject *object) +{ + OrgBluezObexSession1Proxy *proxy = ORG_BLUEZ_OBEX_SESSION1_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (org_bluez_obex_session1_proxy_parent_class)->finalize (object); +} + +static void +org_bluez_obex_session1_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ + const _ExtendedGDBusPropertyInfo *info; + GVariant *variant; + g_assert (prop_id != 0 && prop_id - 1 < 4); + info = _org_bluez_obex_session1_property_info_pointers[prop_id - 1]; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); + if (info->use_gvariant) + { + g_value_set_variant (value, variant); + } + else + { + if (variant != NULL) + g_dbus_gvariant_to_gvalue (variant, value); + } + if (variant != NULL) + g_variant_unref (variant); +} + +static void +org_bluez_obex_session1_proxy_set_property_cb (GDBusProxy *proxy, + GAsyncResult *res, + gpointer user_data) +{ + const _ExtendedGDBusPropertyInfo *info = user_data; + GError *error; + GVariant *_ret; + error = NULL; + _ret = g_dbus_proxy_call_finish (proxy, res, &error); + if (!_ret) + { + g_warning ("Error setting property '%s' on interface org.bluez.obex.Session1: %s (%s, %d)", + info->parent_struct.name, + error->message, g_quark_to_string (error->domain), error->code); + g_error_free (error); + } + else + { + g_variant_unref (_ret); + } +} + +static void +org_bluez_obex_session1_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ + const _ExtendedGDBusPropertyInfo *info; + GVariant *variant; + g_assert (prop_id != 0 && prop_id - 1 < 4); + info = _org_bluez_obex_session1_property_info_pointers[prop_id - 1]; + variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_dbus_proxy_call (G_DBUS_PROXY (object), + "org.freedesktop.DBus.Properties.Set", + g_variant_new ("(ssv)", "org.bluez.obex.Session1", info->parent_struct.name, variant), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, (GAsyncReadyCallback) org_bluez_obex_session1_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); + g_variant_unref (variant); +} + +static void +org_bluez_obex_session1_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_bluez_obex_session1_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_ORG_BLUEZ_OBEX_SESSION1); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_OBEX_SESSION1); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +org_bluez_obex_session1_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + OrgBluezObexSession1Proxy *proxy = ORG_BLUEZ_OBEX_SESSION1_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_session1_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_session1_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static const gchar * +org_bluez_obex_session1_proxy_get_source (OrgBluezObexSession1 *object) +{ + OrgBluezObexSession1Proxy *proxy = ORG_BLUEZ_OBEX_SESSION1_PROXY (object); + GVariant *variant; + const gchar *value = NULL; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Source"); + if (variant != NULL) + { + value = g_variant_get_string (variant, NULL); + g_variant_unref (variant); + } + return value; +} + +static const gchar * +org_bluez_obex_session1_proxy_get_destination (OrgBluezObexSession1 *object) +{ + OrgBluezObexSession1Proxy *proxy = ORG_BLUEZ_OBEX_SESSION1_PROXY (object); + GVariant *variant; + const gchar *value = NULL; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Destination"); + if (variant != NULL) + { + value = g_variant_get_string (variant, NULL); + g_variant_unref (variant); + } + return value; +} + +static guchar +org_bluez_obex_session1_proxy_get_channel (OrgBluezObexSession1 *object) +{ + OrgBluezObexSession1Proxy *proxy = ORG_BLUEZ_OBEX_SESSION1_PROXY (object); + GVariant *variant; + guchar value = 0; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Channel"); + if (variant != NULL) + { + value = g_variant_get_byte (variant); + g_variant_unref (variant); + } + return value; +} + +static const gchar * +org_bluez_obex_session1_proxy_get_target (OrgBluezObexSession1 *object) +{ + OrgBluezObexSession1Proxy *proxy = ORG_BLUEZ_OBEX_SESSION1_PROXY (object); + GVariant *variant; + const gchar *value = NULL; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Target"); + if (variant != NULL) + { + value = g_variant_get_string (variant, NULL); + g_variant_unref (variant); + } + return value; +} + +static void +org_bluez_obex_session1_proxy_init (OrgBluezObexSession1Proxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = org_bluez_obex_session1_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY, OrgBluezObexSession1ProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_bluez_obex_session1_interface_info ()); +} + +static void +org_bluez_obex_session1_proxy_class_init (OrgBluezObexSession1ProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_bluez_obex_session1_proxy_finalize; + gobject_class->get_property = org_bluez_obex_session1_proxy_get_property; + gobject_class->set_property = org_bluez_obex_session1_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = org_bluez_obex_session1_proxy_g_signal; + proxy_class->g_properties_changed = org_bluez_obex_session1_proxy_g_properties_changed; + + org_bluez_obex_session1_override_properties (gobject_class, 1); + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgBluezObexSession1ProxyPrivate)); +#endif +} + +static void +org_bluez_obex_session1_proxy_iface_init (OrgBluezObexSession1Iface *iface) +{ + iface->get_source = org_bluez_obex_session1_proxy_get_source; + iface->get_destination = org_bluez_obex_session1_proxy_get_destination; + iface->get_channel = org_bluez_obex_session1_proxy_get_channel; + iface->get_target = org_bluez_obex_session1_proxy_get_target; +} + +/** + * org_bluez_obex_session1_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Session1.top_of_page">org.bluez.obex.Session1</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_session1_proxy_new_finish() to get the result of the operation. + * + * See org_bluez_obex_session1_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +org_bluez_obex_session1_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Session1", NULL); +} + +/** + * org_bluez_obex_session1_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_session1_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_bluez_obex_session1_proxy_new(). + * + * Returns: (transfer full) (type OrgBluezObexSession1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexSession1 * +org_bluez_obex_session1_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_BLUEZ_OBEX_SESSION1 (ret); + else + return NULL; +} + +/** + * org_bluez_obex_session1_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Session1.top_of_page">org.bluez.obex.Session1</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_session1_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgBluezObexSession1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexSession1 * +org_bluez_obex_session1_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Session1", NULL); + if (ret != NULL) + return ORG_BLUEZ_OBEX_SESSION1 (ret); + else + return NULL; +} + + +/** + * org_bluez_obex_session1_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like org_bluez_obex_session1_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_session1_proxy_new_for_bus_finish() to get the result of the operation. + * + * See org_bluez_obex_session1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +org_bluez_obex_session1_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Session1", NULL); +} + +/** + * org_bluez_obex_session1_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_session1_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_bluez_obex_session1_proxy_new_for_bus(). + * + * Returns: (transfer full) (type OrgBluezObexSession1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexSession1 * +org_bluez_obex_session1_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_BLUEZ_OBEX_SESSION1 (ret); + else + return NULL; +} + +/** + * org_bluez_obex_session1_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like org_bluez_obex_session1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_session1_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgBluezObexSession1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexSession1 * +org_bluez_obex_session1_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Session1", NULL); + if (ret != NULL) + return ORG_BLUEZ_OBEX_SESSION1 (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * OrgBluezObexSession1Skeleton: + * + * The #OrgBluezObexSession1Skeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgBluezObexSession1SkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #OrgBluezObexSession1Skeleton. + */ + +struct _OrgBluezObexSession1SkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_org_bluez_obex_session1_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_ORG_BLUEZ_OBEX_SESSION1); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_OBEX_SESSION1); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_org_bluez_obex_session1_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_session1_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_org_bluez_obex_session1_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_session1_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _org_bluez_obex_session1_skeleton_vtable = +{ + _org_bluez_obex_session1_skeleton_handle_method_call, + _org_bluez_obex_session1_skeleton_handle_get_property, + _org_bluez_obex_session1_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +org_bluez_obex_session1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return org_bluez_obex_session1_interface_info (); +} + +static GDBusInterfaceVTable * +org_bluez_obex_session1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_org_bluez_obex_session1_skeleton_vtable; +} + +static GVariant * +org_bluez_obex_session1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_org_bluez_obex_session1_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _org_bluez_obex_session1_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _org_bluez_obex_session1_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _org_bluez_obex_session1_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.bluez.obex.Session1", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static gboolean _org_bluez_obex_session1_emit_changed (gpointer user_data); + +static void +org_bluez_obex_session1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (_skeleton); + gboolean emit_changed = FALSE; + + g_mutex_lock (&skeleton->priv->lock); + if (skeleton->priv->changed_properties_idle_source != NULL) + { + g_source_destroy (skeleton->priv->changed_properties_idle_source); + skeleton->priv->changed_properties_idle_source = NULL; + emit_changed = TRUE; + } + g_mutex_unlock (&skeleton->priv->lock); + + if (emit_changed) + _org_bluez_obex_session1_emit_changed (skeleton); +} + +static void org_bluez_obex_session1_skeleton_iface_init (OrgBluezObexSession1Iface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexSession1Skeleton, org_bluez_obex_session1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (OrgBluezObexSession1Skeleton) + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_SESSION1, org_bluez_obex_session1_skeleton_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexSession1Skeleton, org_bluez_obex_session1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_SESSION1, org_bluez_obex_session1_skeleton_iface_init)); + +#endif +static void +org_bluez_obex_session1_skeleton_finalize (GObject *object) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (object); + guint n; + for (n = 0; n < 4; n++) + g_value_unset (&skeleton->priv->properties[n]); + g_free (skeleton->priv->properties); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (org_bluez_obex_session1_skeleton_parent_class)->finalize (object); +} + +static void +org_bluez_obex_session1_skeleton_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (object); + g_assert (prop_id != 0 && prop_id - 1 < 4); + g_mutex_lock (&skeleton->priv->lock); + g_value_copy (&skeleton->priv->properties[prop_id - 1], value); + g_mutex_unlock (&skeleton->priv->lock); +} + +static gboolean +_org_bluez_obex_session1_emit_changed (gpointer user_data) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (user_data); + GList *l; + GVariantBuilder builder; + GVariantBuilder invalidated_builder; + guint num_changes; + + g_mutex_lock (&skeleton->priv->lock); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); + for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) + { + ChangedProperty *cp = l->data; + GVariant *variant; + const GValue *cur_value; + + cur_value = &skeleton->priv->properties[cp->prop_id - 1]; + if (!_g_value_equal (cur_value, &cp->orig_value)) + { + variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); + g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); + g_variant_unref (variant); + num_changes++; + } + } + if (num_changes > 0) + { + GList *connections, *ll; + GVariant *signal_variant; + signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.bluez.obex.Session1", + &builder, &invalidated_builder)); + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + for (ll = connections; ll != NULL; ll = ll->next) + { + GDBusConnection *connection = ll->data; + + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), + "org.freedesktop.DBus.Properties", + "PropertiesChanged", + signal_variant, + NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); + } + else + { + g_variant_builder_clear (&builder); + g_variant_builder_clear (&invalidated_builder); + } + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + skeleton->priv->changed_properties = NULL; + skeleton->priv->changed_properties_idle_source = NULL; + g_mutex_unlock (&skeleton->priv->lock); + return FALSE; +} + +static void +_org_bluez_obex_session1_schedule_emit_changed (OrgBluezObexSession1Skeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) +{ + ChangedProperty *cp; + GList *l; + cp = NULL; + for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) + { + ChangedProperty *i_cp = l->data; + if (i_cp->info == info) + { + cp = i_cp; + break; + } + } + if (cp == NULL) + { + cp = g_new0 (ChangedProperty, 1); + cp->prop_id = prop_id; + cp->info = info; + skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); + g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); + g_value_copy (orig_value, &cp->orig_value); + } +} + +static void +org_bluez_obex_session1_skeleton_notify (GObject *object, + GParamSpec *pspec G_GNUC_UNUSED) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (object); + g_mutex_lock (&skeleton->priv->lock); + if (skeleton->priv->changed_properties != NULL && + skeleton->priv->changed_properties_idle_source == NULL) + { + skeleton->priv->changed_properties_idle_source = g_idle_source_new (); + g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); + g_source_set_callback (skeleton->priv->changed_properties_idle_source, _org_bluez_obex_session1_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); + g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _org_bluez_obex_session1_emit_changed"); + g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); + g_source_unref (skeleton->priv->changed_properties_idle_source); + } + g_mutex_unlock (&skeleton->priv->lock); +} + +static void +org_bluez_obex_session1_skeleton_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (object); + g_assert (prop_id != 0 && prop_id - 1 < 4); + g_mutex_lock (&skeleton->priv->lock); + g_object_freeze_notify (object); + if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) + { + if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL) + _org_bluez_obex_session1_schedule_emit_changed (skeleton, _org_bluez_obex_session1_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]); + g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); + g_object_notify_by_pspec (object, pspec); + } + g_mutex_unlock (&skeleton->priv->lock); + g_object_thaw_notify (object); +} + +static void +org_bluez_obex_session1_skeleton_init (OrgBluezObexSession1Skeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = org_bluez_obex_session1_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_BLUEZ_OBEX_SESSION1_SKELETON, OrgBluezObexSession1SkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); + skeleton->priv->properties = g_new0 (GValue, 4); + g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING); + g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING); + g_value_init (&skeleton->priv->properties[2], G_TYPE_UCHAR); + g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING); +} + +static const gchar * +org_bluez_obex_session1_skeleton_get_source (OrgBluezObexSession1 *object) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (object); + const gchar *value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_string (&(skeleton->priv->properties[0])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static const gchar * +org_bluez_obex_session1_skeleton_get_destination (OrgBluezObexSession1 *object) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (object); + const gchar *value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_string (&(skeleton->priv->properties[1])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static guchar +org_bluez_obex_session1_skeleton_get_channel (OrgBluezObexSession1 *object) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (object); + guchar value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_uchar (&(skeleton->priv->properties[2])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static const gchar * +org_bluez_obex_session1_skeleton_get_target (OrgBluezObexSession1 *object) +{ + OrgBluezObexSession1Skeleton *skeleton = ORG_BLUEZ_OBEX_SESSION1_SKELETON (object); + const gchar *value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_string (&(skeleton->priv->properties[3])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static void +org_bluez_obex_session1_skeleton_class_init (OrgBluezObexSession1SkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_bluez_obex_session1_skeleton_finalize; + gobject_class->get_property = org_bluez_obex_session1_skeleton_get_property; + gobject_class->set_property = org_bluez_obex_session1_skeleton_set_property; + gobject_class->notify = org_bluez_obex_session1_skeleton_notify; + + + org_bluez_obex_session1_override_properties (gobject_class, 1); + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = org_bluez_obex_session1_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = org_bluez_obex_session1_skeleton_dbus_interface_get_properties; + skeleton_class->flush = org_bluez_obex_session1_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = org_bluez_obex_session1_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgBluezObexSession1SkeletonPrivate)); +#endif +} + +static void +org_bluez_obex_session1_skeleton_iface_init (OrgBluezObexSession1Iface *iface) +{ + iface->get_source = org_bluez_obex_session1_skeleton_get_source; + iface->get_destination = org_bluez_obex_session1_skeleton_get_destination; + iface->get_channel = org_bluez_obex_session1_skeleton_get_channel; + iface->get_target = org_bluez_obex_session1_skeleton_get_target; +} + +/** + * org_bluez_obex_session1_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Session1.top_of_page">org.bluez.obex.Session1</link>. + * + * Returns: (transfer full) (type OrgBluezObexSession1Skeleton): The skeleton object. + */ +OrgBluezObexSession1 * +org_bluez_obex_session1_skeleton_new (void) +{ + return ORG_BLUEZ_OBEX_SESSION1 (g_object_new (TYPE_ORG_BLUEZ_OBEX_SESSION1_SKELETON, NULL)); +} + diff --git a/binding/gdbus/obex_session1_interface.h b/binding/gdbus/obex_session1_interface.h new file mode 100644 index 0000000..da8b957 --- /dev/null +++ b/binding/gdbus/obex_session1_interface.h @@ -0,0 +1,204 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __OBEX_SESSION1_INTERFACE_H__ +#define __OBEX_SESSION1_INTERFACE_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.bluez.obex.Session1 */ + +#define TYPE_ORG_BLUEZ_OBEX_SESSION1 (org_bluez_obex_session1_get_type ()) +#define ORG_BLUEZ_OBEX_SESSION1(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1, OrgBluezObexSession1)) +#define IS_ORG_BLUEZ_OBEX_SESSION1(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1)) +#define ORG_BLUEZ_OBEX_SESSION1_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1, OrgBluezObexSession1Iface)) + +struct _OrgBluezObexSession1; +typedef struct _OrgBluezObexSession1 OrgBluezObexSession1; +typedef struct _OrgBluezObexSession1Iface OrgBluezObexSession1Iface; + +struct _OrgBluezObexSession1Iface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_get_capabilities) ( + OrgBluezObexSession1 *object, + GDBusMethodInvocation *invocation); + + guchar (*get_channel) (OrgBluezObexSession1 *object); + + const gchar * (*get_destination) (OrgBluezObexSession1 *object); + + const gchar * (*get_source) (OrgBluezObexSession1 *object); + + const gchar * (*get_target) (OrgBluezObexSession1 *object); + +}; + +GType org_bluez_obex_session1_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *org_bluez_obex_session1_interface_info (void); +guint org_bluez_obex_session1_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void org_bluez_obex_session1_complete_get_capabilities ( + OrgBluezObexSession1 *object, + GDBusMethodInvocation *invocation, + const gchar *capabilities); + + + +/* D-Bus method calls: */ +void org_bluez_obex_session1_call_get_capabilities ( + OrgBluezObexSession1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_session1_call_get_capabilities_finish ( + OrgBluezObexSession1 *proxy, + gchar **out_capabilities, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_session1_call_get_capabilities_sync ( + OrgBluezObexSession1 *proxy, + gchar **out_capabilities, + GCancellable *cancellable, + GError **error); + + + +/* D-Bus property accessors: */ +const gchar *org_bluez_obex_session1_get_source (OrgBluezObexSession1 *object); +gchar *org_bluez_obex_session1_dup_source (OrgBluezObexSession1 *object); +void org_bluez_obex_session1_set_source (OrgBluezObexSession1 *object, const gchar *value); + +const gchar *org_bluez_obex_session1_get_destination (OrgBluezObexSession1 *object); +gchar *org_bluez_obex_session1_dup_destination (OrgBluezObexSession1 *object); +void org_bluez_obex_session1_set_destination (OrgBluezObexSession1 *object, const gchar *value); + +guchar org_bluez_obex_session1_get_channel (OrgBluezObexSession1 *object); +void org_bluez_obex_session1_set_channel (OrgBluezObexSession1 *object, guchar value); + +const gchar *org_bluez_obex_session1_get_target (OrgBluezObexSession1 *object); +gchar *org_bluez_obex_session1_dup_target (OrgBluezObexSession1 *object); +void org_bluez_obex_session1_set_target (OrgBluezObexSession1 *object, const gchar *value); + + +/* ---- */ + +#define TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY (org_bluez_obex_session1_proxy_get_type ()) +#define ORG_BLUEZ_OBEX_SESSION1_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY, OrgBluezObexSession1Proxy)) +#define ORG_BLUEZ_OBEX_SESSION1_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY, OrgBluezObexSession1ProxyClass)) +#define ORG_BLUEZ_OBEX_SESSION1_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY, OrgBluezObexSession1ProxyClass)) +#define IS_ORG_BLUEZ_OBEX_SESSION1_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY)) +#define IS_ORG_BLUEZ_OBEX_SESSION1_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_BLUEZ_OBEX_SESSION1_PROXY)) + +typedef struct _OrgBluezObexSession1Proxy OrgBluezObexSession1Proxy; +typedef struct _OrgBluezObexSession1ProxyClass OrgBluezObexSession1ProxyClass; +typedef struct _OrgBluezObexSession1ProxyPrivate OrgBluezObexSession1ProxyPrivate; + +struct _OrgBluezObexSession1Proxy +{ + /*< private >*/ + GDBusProxy parent_instance; + OrgBluezObexSession1ProxyPrivate *priv; +}; + +struct _OrgBluezObexSession1ProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType org_bluez_obex_session1_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgBluezObexSession1Proxy, g_object_unref) +#endif + +void org_bluez_obex_session1_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgBluezObexSession1 *org_bluez_obex_session1_proxy_new_finish ( + GAsyncResult *res, + GError **error); +OrgBluezObexSession1 *org_bluez_obex_session1_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_session1_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgBluezObexSession1 *org_bluez_obex_session1_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +OrgBluezObexSession1 *org_bluez_obex_session1_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_ORG_BLUEZ_OBEX_SESSION1_SKELETON (org_bluez_obex_session1_skeleton_get_type ()) +#define ORG_BLUEZ_OBEX_SESSION1_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1_SKELETON, OrgBluezObexSession1Skeleton)) +#define ORG_BLUEZ_OBEX_SESSION1_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_BLUEZ_OBEX_SESSION1_SKELETON, OrgBluezObexSession1SkeletonClass)) +#define ORG_BLUEZ_OBEX_SESSION1_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1_SKELETON, OrgBluezObexSession1SkeletonClass)) +#define IS_ORG_BLUEZ_OBEX_SESSION1_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_SESSION1_SKELETON)) +#define IS_ORG_BLUEZ_OBEX_SESSION1_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_BLUEZ_OBEX_SESSION1_SKELETON)) + +typedef struct _OrgBluezObexSession1Skeleton OrgBluezObexSession1Skeleton; +typedef struct _OrgBluezObexSession1SkeletonClass OrgBluezObexSession1SkeletonClass; +typedef struct _OrgBluezObexSession1SkeletonPrivate OrgBluezObexSession1SkeletonPrivate; + +struct _OrgBluezObexSession1Skeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + OrgBluezObexSession1SkeletonPrivate *priv; +}; + +struct _OrgBluezObexSession1SkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType org_bluez_obex_session1_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgBluezObexSession1Skeleton, g_object_unref) +#endif + +OrgBluezObexSession1 *org_bluez_obex_session1_skeleton_new (void); + + +G_END_DECLS + +#endif /* __OBEX_SESSION1_INTERFACE_H__ */ diff --git a/binding/gdbus/obex_transfer1_interface.c b/binding/gdbus/obex_transfer1_interface.c new file mode 100644 index 0000000..4df5323 --- /dev/null +++ b/binding/gdbus/obex_transfer1_interface.c @@ -0,0 +1,1307 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "obex_transfer1_interface.h" + +#include <string.h> +#ifdef G_OS_UNIX +# include <gio/gunixfdlist.h> +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface org.bluez.obex.Transfer1 + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:OrgBluezObexTransfer1 + * @title: OrgBluezObexTransfer1 + * @short_description: Generated C code for the org.bluez.obex.Transfer1 D-Bus interface + * + * This section contains code for working with the <link linkend="gdbus-interface-org-bluez-obex-Transfer1.top_of_page">org.bluez.obex.Transfer1</link> D-Bus interface in C. + */ + +/* ---- Introspection data for org.bluez.obex.Transfer1 ---- */ + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_transfer1_method_info_cancel = +{ + { + -1, + (gchar *) "Cancel", + NULL, + NULL, + NULL + }, + "handle-cancel", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_transfer1_method_info_suspend = +{ + { + -1, + (gchar *) "Suspend", + NULL, + NULL, + NULL + }, + "handle-suspend", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _org_bluez_obex_transfer1_method_info_resume = +{ + { + -1, + (gchar *) "Resume", + NULL, + NULL, + NULL + }, + "handle-resume", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _org_bluez_obex_transfer1_method_info_pointers[] = +{ + &_org_bluez_obex_transfer1_method_info_cancel, + &_org_bluez_obex_transfer1_method_info_suspend, + &_org_bluez_obex_transfer1_method_info_resume, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _org_bluez_obex_transfer1_interface_info = +{ + { + -1, + (gchar *) "org.bluez.obex.Transfer1", + (GDBusMethodInfo **) &_org_bluez_obex_transfer1_method_info_pointers, + NULL, + NULL, + NULL + }, + "org-bluez-obex-transfer1", +}; + + +/** + * org_bluez_obex_transfer1_interface_info: + * + * Gets a machine-readable description of the <link linkend="gdbus-interface-org-bluez-obex-Transfer1.top_of_page">org.bluez.obex.Transfer1</link> D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +org_bluez_obex_transfer1_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_org_bluez_obex_transfer1_interface_info.parent_struct; +} + +/** + * org_bluez_obex_transfer1_override_properties: + * @klass: The class structure for a #GObject<!-- -->-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #OrgBluezObexTransfer1 interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +org_bluez_obex_transfer1_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * OrgBluezObexTransfer1: + * + * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Transfer1.top_of_page">org.bluez.obex.Transfer1</link>. + */ + +/** + * OrgBluezObexTransfer1Iface: + * @parent_iface: The parent interface. + * @handle_cancel: Handler for the #OrgBluezObexTransfer1::handle-cancel signal. + * @handle_resume: Handler for the #OrgBluezObexTransfer1::handle-resume signal. + * @handle_suspend: Handler for the #OrgBluezObexTransfer1::handle-suspend signal. + * + * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Transfer1.top_of_page">org.bluez.obex.Transfer1</link>. + */ + +typedef OrgBluezObexTransfer1Iface OrgBluezObexTransfer1Interface; +G_DEFINE_INTERFACE (OrgBluezObexTransfer1, org_bluez_obex_transfer1, G_TYPE_OBJECT); + +static void +org_bluez_obex_transfer1_default_init (OrgBluezObexTransfer1Iface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * OrgBluezObexTransfer1::handle-cancel: + * @object: A #OrgBluezObexTransfer1. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Cancel">Cancel()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_transfer1_complete_cancel() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-cancel", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexTransfer1Iface, handle_cancel), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * OrgBluezObexTransfer1::handle-suspend: + * @object: A #OrgBluezObexTransfer1. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Suspend">Suspend()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_transfer1_complete_suspend() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-suspend", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexTransfer1Iface, handle_suspend), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * OrgBluezObexTransfer1::handle-resume: + * @object: A #OrgBluezObexTransfer1. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Resume">Resume()</link> D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_obex_transfer1_complete_resume() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-resume", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgBluezObexTransfer1Iface, handle_resume), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + +} + +/** + * org_bluez_obex_transfer1_call_cancel: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Cancel">Cancel()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_transfer1_call_cancel_finish() to get the result of the operation. + * + * See org_bluez_obex_transfer1_call_cancel_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_transfer1_call_cancel ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Cancel", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_transfer1_call_cancel_finish: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_transfer1_call_cancel(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_transfer1_call_cancel(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_transfer1_call_cancel_finish ( + OrgBluezObexTransfer1 *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_transfer1_call_cancel_sync: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Cancel">Cancel()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_transfer1_call_cancel() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_transfer1_call_cancel_sync ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Cancel", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_transfer1_call_suspend: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Suspend">Suspend()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_transfer1_call_suspend_finish() to get the result of the operation. + * + * See org_bluez_obex_transfer1_call_suspend_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_transfer1_call_suspend ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Suspend", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_transfer1_call_suspend_finish: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_transfer1_call_suspend(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_transfer1_call_suspend(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_transfer1_call_suspend_finish ( + OrgBluezObexTransfer1 *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_transfer1_call_suspend_sync: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Suspend">Suspend()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_transfer1_call_suspend() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_transfer1_call_suspend_sync ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Suspend", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_transfer1_call_resume: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Resume">Resume()</link> D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_transfer1_call_resume_finish() to get the result of the operation. + * + * See org_bluez_obex_transfer1_call_resume_sync() for the synchronous, blocking version of this method. + */ +void +org_bluez_obex_transfer1_call_resume ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "Resume", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_bluez_obex_transfer1_call_resume_finish: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_transfer1_call_resume(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_bluez_obex_transfer1_call_resume(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_transfer1_call_resume_finish ( + OrgBluezObexTransfer1 *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_transfer1_call_resume_sync: + * @proxy: A #OrgBluezObexTransfer1Proxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Resume">Resume()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_transfer1_call_resume() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +org_bluez_obex_transfer1_call_resume_sync ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "Resume", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_bluez_obex_transfer1_complete_cancel: + * @object: A #OrgBluezObexTransfer1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Cancel">Cancel()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_transfer1_complete_cancel ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * org_bluez_obex_transfer1_complete_suspend: + * @object: A #OrgBluezObexTransfer1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Suspend">Suspend()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_transfer1_complete_suspend ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * org_bluez_obex_transfer1_complete_resume: + * @object: A #OrgBluezObexTransfer1. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-obex-Transfer1.Resume">Resume()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +org_bluez_obex_transfer1_complete_resume ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * OrgBluezObexTransfer1Proxy: + * + * The #OrgBluezObexTransfer1Proxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgBluezObexTransfer1ProxyClass: + * @parent_class: The parent class. + * + * Class structure for #OrgBluezObexTransfer1Proxy. + */ + +struct _OrgBluezObexTransfer1ProxyPrivate +{ + GData *qdata; +}; + +static void org_bluez_obex_transfer1_proxy_iface_init (OrgBluezObexTransfer1Iface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexTransfer1Proxy, org_bluez_obex_transfer1_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (OrgBluezObexTransfer1Proxy) + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_TRANSFER1, org_bluez_obex_transfer1_proxy_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexTransfer1Proxy, org_bluez_obex_transfer1_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_TRANSFER1, org_bluez_obex_transfer1_proxy_iface_init)); + +#endif +static void +org_bluez_obex_transfer1_proxy_finalize (GObject *object) +{ + OrgBluezObexTransfer1Proxy *proxy = ORG_BLUEZ_OBEX_TRANSFER1_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (org_bluez_obex_transfer1_proxy_parent_class)->finalize (object); +} + +static void +org_bluez_obex_transfer1_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +org_bluez_obex_transfer1_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +org_bluez_obex_transfer1_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_bluez_obex_transfer1_interface_info.parent_struct, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_ORG_BLUEZ_OBEX_TRANSFER1); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_OBEX_TRANSFER1); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +org_bluez_obex_transfer1_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + OrgBluezObexTransfer1Proxy *proxy = ORG_BLUEZ_OBEX_TRANSFER1_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_transfer1_interface_info.parent_struct, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_transfer1_interface_info.parent_struct, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +org_bluez_obex_transfer1_proxy_init (OrgBluezObexTransfer1Proxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = org_bluez_obex_transfer1_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY, OrgBluezObexTransfer1ProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_bluez_obex_transfer1_interface_info ()); +} + +static void +org_bluez_obex_transfer1_proxy_class_init (OrgBluezObexTransfer1ProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_bluez_obex_transfer1_proxy_finalize; + gobject_class->get_property = org_bluez_obex_transfer1_proxy_get_property; + gobject_class->set_property = org_bluez_obex_transfer1_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = org_bluez_obex_transfer1_proxy_g_signal; + proxy_class->g_properties_changed = org_bluez_obex_transfer1_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgBluezObexTransfer1ProxyPrivate)); +#endif +} + +static void +org_bluez_obex_transfer1_proxy_iface_init (OrgBluezObexTransfer1Iface *iface) +{ +} + +/** + * org_bluez_obex_transfer1_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Transfer1.top_of_page">org.bluez.obex.Transfer1</link>. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_transfer1_proxy_new_finish() to get the result of the operation. + * + * See org_bluez_obex_transfer1_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +org_bluez_obex_transfer1_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Transfer1", NULL); +} + +/** + * org_bluez_obex_transfer1_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_transfer1_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_bluez_obex_transfer1_proxy_new(). + * + * Returns: (transfer full) (type OrgBluezObexTransfer1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexTransfer1 * +org_bluez_obex_transfer1_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_BLUEZ_OBEX_TRANSFER1 (ret); + else + return NULL; +} + +/** + * org_bluez_obex_transfer1_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Transfer1.top_of_page">org.bluez.obex.Transfer1</link>. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_transfer1_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgBluezObexTransfer1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexTransfer1 * +org_bluez_obex_transfer1_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Transfer1", NULL); + if (ret != NULL) + return ORG_BLUEZ_OBEX_TRANSFER1 (ret); + else + return NULL; +} + + +/** + * org_bluez_obex_transfer1_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like org_bluez_obex_transfer1_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. + * You can then call org_bluez_obex_transfer1_proxy_new_for_bus_finish() to get the result of the operation. + * + * See org_bluez_obex_transfer1_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +org_bluez_obex_transfer1_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Transfer1", NULL); +} + +/** + * org_bluez_obex_transfer1_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_obex_transfer1_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_bluez_obex_transfer1_proxy_new_for_bus(). + * + * Returns: (transfer full) (type OrgBluezObexTransfer1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexTransfer1 * +org_bluez_obex_transfer1_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return ORG_BLUEZ_OBEX_TRANSFER1 (ret); + else + return NULL; +} + +/** + * org_bluez_obex_transfer1_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like org_bluez_obex_transfer1_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See org_bluez_obex_transfer1_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgBluezObexTransfer1Proxy): The constructed proxy object or %NULL if @error is set. + */ +OrgBluezObexTransfer1 * +org_bluez_obex_transfer1_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.obex.Transfer1", NULL); + if (ret != NULL) + return ORG_BLUEZ_OBEX_TRANSFER1 (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * OrgBluezObexTransfer1Skeleton: + * + * The #OrgBluezObexTransfer1Skeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgBluezObexTransfer1SkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #OrgBluezObexTransfer1Skeleton. + */ + +struct _OrgBluezObexTransfer1SkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_org_bluez_obex_transfer1_skeleton_handle_method_call ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + OrgBluezObexTransfer1Skeleton *skeleton = ORG_BLUEZ_OBEX_TRANSFER1_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_ORG_BLUEZ_OBEX_TRANSFER1); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_OBEX_TRANSFER1); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_org_bluez_obex_transfer1_skeleton_handle_get_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + OrgBluezObexTransfer1Skeleton *skeleton = ORG_BLUEZ_OBEX_TRANSFER1_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_transfer1_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_org_bluez_obex_transfer1_skeleton_handle_set_property ( + GDBusConnection *connection G_GNUC_UNUSED, + const gchar *sender G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + OrgBluezObexTransfer1Skeleton *skeleton = ORG_BLUEZ_OBEX_TRANSFER1_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_obex_transfer1_interface_info.parent_struct, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _org_bluez_obex_transfer1_skeleton_vtable = +{ + _org_bluez_obex_transfer1_skeleton_handle_method_call, + _org_bluez_obex_transfer1_skeleton_handle_get_property, + _org_bluez_obex_transfer1_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +org_bluez_obex_transfer1_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return org_bluez_obex_transfer1_interface_info (); +} + +static GDBusInterfaceVTable * +org_bluez_obex_transfer1_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_org_bluez_obex_transfer1_skeleton_vtable; +} + +static GVariant * +org_bluez_obex_transfer1_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + OrgBluezObexTransfer1Skeleton *skeleton = ORG_BLUEZ_OBEX_TRANSFER1_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_org_bluez_obex_transfer1_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _org_bluez_obex_transfer1_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _org_bluez_obex_transfer1_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _org_bluez_obex_transfer1_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.bluez.obex.Transfer1", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +org_bluez_obex_transfer1_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void org_bluez_obex_transfer1_skeleton_iface_init (OrgBluezObexTransfer1Iface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexTransfer1Skeleton, org_bluez_obex_transfer1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (OrgBluezObexTransfer1Skeleton) + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_TRANSFER1, org_bluez_obex_transfer1_skeleton_iface_init)); + +#else +G_DEFINE_TYPE_WITH_CODE (OrgBluezObexTransfer1Skeleton, org_bluez_obex_transfer1_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_OBEX_TRANSFER1, org_bluez_obex_transfer1_skeleton_iface_init)); + +#endif +static void +org_bluez_obex_transfer1_skeleton_finalize (GObject *object) +{ + OrgBluezObexTransfer1Skeleton *skeleton = ORG_BLUEZ_OBEX_TRANSFER1_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (org_bluez_obex_transfer1_skeleton_parent_class)->finalize (object); +} + +static void +org_bluez_obex_transfer1_skeleton_init (OrgBluezObexTransfer1Skeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = org_bluez_obex_transfer1_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON, OrgBluezObexTransfer1SkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +org_bluez_obex_transfer1_skeleton_class_init (OrgBluezObexTransfer1SkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_bluez_obex_transfer1_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = org_bluez_obex_transfer1_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = org_bluez_obex_transfer1_skeleton_dbus_interface_get_properties; + skeleton_class->flush = org_bluez_obex_transfer1_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = org_bluez_obex_transfer1_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgBluezObexTransfer1SkeletonPrivate)); +#endif +} + +static void +org_bluez_obex_transfer1_skeleton_iface_init (OrgBluezObexTransfer1Iface *iface) +{ +} + +/** + * org_bluez_obex_transfer1_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-bluez-obex-Transfer1.top_of_page">org.bluez.obex.Transfer1</link>. + * + * Returns: (transfer full) (type OrgBluezObexTransfer1Skeleton): The skeleton object. + */ +OrgBluezObexTransfer1 * +org_bluez_obex_transfer1_skeleton_new (void) +{ + return ORG_BLUEZ_OBEX_TRANSFER1 (g_object_new (TYPE_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON, NULL)); +} + diff --git a/binding/gdbus/obex_transfer1_interface.h b/binding/gdbus/obex_transfer1_interface.h new file mode 100644 index 0000000..c152f12 --- /dev/null +++ b/binding/gdbus/obex_transfer1_interface.h @@ -0,0 +1,223 @@ +/* + * Generated by gdbus-codegen 2.50.3. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __OBEX_TRANSFER1_INTERFACE_H__ +#define __OBEX_TRANSFER1_INTERFACE_H__ + +#include <gio/gio.h> + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.bluez.obex.Transfer1 */ + +#define TYPE_ORG_BLUEZ_OBEX_TRANSFER1 (org_bluez_obex_transfer1_get_type ()) +#define ORG_BLUEZ_OBEX_TRANSFER1(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1, OrgBluezObexTransfer1)) +#define IS_ORG_BLUEZ_OBEX_TRANSFER1(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1)) +#define ORG_BLUEZ_OBEX_TRANSFER1_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1, OrgBluezObexTransfer1Iface)) + +struct _OrgBluezObexTransfer1; +typedef struct _OrgBluezObexTransfer1 OrgBluezObexTransfer1; +typedef struct _OrgBluezObexTransfer1Iface OrgBluezObexTransfer1Iface; + +struct _OrgBluezObexTransfer1Iface +{ + GTypeInterface parent_iface; + + gboolean (*handle_cancel) ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_resume) ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_suspend) ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation); + +}; + +GType org_bluez_obex_transfer1_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *org_bluez_obex_transfer1_interface_info (void); +guint org_bluez_obex_transfer1_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void org_bluez_obex_transfer1_complete_cancel ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation); + +void org_bluez_obex_transfer1_complete_suspend ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation); + +void org_bluez_obex_transfer1_complete_resume ( + OrgBluezObexTransfer1 *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus method calls: */ +void org_bluez_obex_transfer1_call_cancel ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_transfer1_call_cancel_finish ( + OrgBluezObexTransfer1 *proxy, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_transfer1_call_cancel_sync ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_transfer1_call_suspend ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_transfer1_call_suspend_finish ( + OrgBluezObexTransfer1 *proxy, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_transfer1_call_suspend_sync ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_transfer1_call_resume ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_bluez_obex_transfer1_call_resume_finish ( + OrgBluezObexTransfer1 *proxy, + GAsyncResult *res, + GError **error); + +gboolean org_bluez_obex_transfer1_call_resume_sync ( + OrgBluezObexTransfer1 *proxy, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY (org_bluez_obex_transfer1_proxy_get_type ()) +#define ORG_BLUEZ_OBEX_TRANSFER1_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY, OrgBluezObexTransfer1Proxy)) +#define ORG_BLUEZ_OBEX_TRANSFER1_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY, OrgBluezObexTransfer1ProxyClass)) +#define ORG_BLUEZ_OBEX_TRANSFER1_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY, OrgBluezObexTransfer1ProxyClass)) +#define IS_ORG_BLUEZ_OBEX_TRANSFER1_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY)) +#define IS_ORG_BLUEZ_OBEX_TRANSFER1_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_PROXY)) + +typedef struct _OrgBluezObexTransfer1Proxy OrgBluezObexTransfer1Proxy; +typedef struct _OrgBluezObexTransfer1ProxyClass OrgBluezObexTransfer1ProxyClass; +typedef struct _OrgBluezObexTransfer1ProxyPrivate OrgBluezObexTransfer1ProxyPrivate; + +struct _OrgBluezObexTransfer1Proxy +{ + /*< private >*/ + GDBusProxy parent_instance; + OrgBluezObexTransfer1ProxyPrivate *priv; +}; + +struct _OrgBluezObexTransfer1ProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType org_bluez_obex_transfer1_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgBluezObexTransfer1Proxy, g_object_unref) +#endif + +void org_bluez_obex_transfer1_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgBluezObexTransfer1 *org_bluez_obex_transfer1_proxy_new_finish ( + GAsyncResult *res, + GError **error); +OrgBluezObexTransfer1 *org_bluez_obex_transfer1_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void org_bluez_obex_transfer1_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgBluezObexTransfer1 *org_bluez_obex_transfer1_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +OrgBluezObexTransfer1 *org_bluez_obex_transfer1_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON (org_bluez_obex_transfer1_skeleton_get_type ()) +#define ORG_BLUEZ_OBEX_TRANSFER1_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON, OrgBluezObexTransfer1Skeleton)) +#define ORG_BLUEZ_OBEX_TRANSFER1_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON, OrgBluezObexTransfer1SkeletonClass)) +#define ORG_BLUEZ_OBEX_TRANSFER1_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON, OrgBluezObexTransfer1SkeletonClass)) +#define IS_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON)) +#define IS_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_BLUEZ_OBEX_TRANSFER1_SKELETON)) + +typedef struct _OrgBluezObexTransfer1Skeleton OrgBluezObexTransfer1Skeleton; +typedef struct _OrgBluezObexTransfer1SkeletonClass OrgBluezObexTransfer1SkeletonClass; +typedef struct _OrgBluezObexTransfer1SkeletonPrivate OrgBluezObexTransfer1SkeletonPrivate; + +struct _OrgBluezObexTransfer1Skeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + OrgBluezObexTransfer1SkeletonPrivate *priv; +}; + +struct _OrgBluezObexTransfer1SkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType org_bluez_obex_transfer1_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgBluezObexTransfer1Skeleton, g_object_unref) +#endif + +OrgBluezObexTransfer1 *org_bluez_obex_transfer1_skeleton_new (void); + + +G_END_DECLS + +#endif /* __OBEX_TRANSFER1_INTERFACE_H__ */ |