diff --git a/gdbus/SecretAgent/NetworkManagerSecretAgent.c b/gdbus/SecretAgent/NetworkManagerSecretAgent.c new file mode 100644 index 0000000..082a49f --- /dev/null +++ b/gdbus/SecretAgent/NetworkManagerSecretAgent.c @@ -0,0 +1,108 @@ +#include +#include "secret_agent.h" // Generated by gdbus-codegen + + +// gcc -o secret_agent NetworkManagerSecretAgent.c secret_agent.c $(pkg-config --cflags --libs gio-2.0) +GMainLoop *loop; +// Handler for the GetSecrets method +static gboolean handle_get_secrets( + OrgFreedesktopNetworkManagerSecretAgent *object, + GDBusMethodInvocation *invocation, + GVariant *connection, + const gchar *connection_path, + const gchar *setting_name, + const gchar *const *hints, + guint flags, + gpointer user_data) +{ + // Log the method call + // Log the method call + g_print("cancel_get_secrets called: connection_path='%s', setting_name='%s'\n", + connection_path, setting_name); + flags & 0x01/* NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION */ + ? g_print("Allow interaction\n") + : g_print("Disallow interaction\n"); + flags & 0x08 /* NM_SECRET_AGENT_GET_SECRETS_FLAG_WPS_PBC_ACTIVE */ + ? g_print("wps pbc active\n") + : g_print("not a wps request\n"); + + + // Return dummy secrets as a{sa{sv}} + GVariantBuilder secrets_builder; + g_variant_builder_init(&secrets_builder, G_VARIANT_TYPE("a{sa{sv}}")); + + g_variant_builder_open(&secrets_builder, G_VARIANT_TYPE("sa{sv}")); + g_variant_builder_add(&secrets_builder, "s", "dummy-setting"); + g_variant_builder_open(&secrets_builder, G_VARIANT_TYPE("a{sv}")); + g_variant_builder_add(&secrets_builder, "{sv}", "key", g_variant_new_string("secret-value")); + g_variant_builder_close(&secrets_builder); + g_variant_builder_close(&secrets_builder); + + GVariant *secrets = g_variant_builder_end(&secrets_builder); + org_freedesktop_network_manager_secret_agent_complete_get_secrets(object, invocation, secrets); + + return TRUE; +} + +// Handler for the CancelGetSecrets() method +static gboolean handle_cancel_get_secrets( + OrgFreedesktopNetworkManagerSecretAgent *object, + GDBusMethodInvocation *invocation, + const gchar *connection_path, + const gchar *setting_name, + gpointer user_data) +{ + // Log the method call + g_print("cancel_get_secrets called: connection_path='%s', setting_name='%s'\n", + connection_path, setting_name); + + org_freedesktop_network_manager_secret_agent_complete_cancel_get_secrets(object, invocation); + + return TRUE; +} + +// Start the secret agent +void main() +{ + GError *error = NULL; + + // Create a connection to the session bus + GDBusConnection *connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error); + if (error != NULL) { + g_printerr("Error connecting to D-Bus: %s\n", error->message); + g_error_free(error); + return; + } + + // Create an instance of the interface + OrgFreedesktopNetworkManagerSecretAgent *agent = org_freedesktop_network_manager_secret_agent_skeleton_new(); + + // Connect the method handler + g_signal_connect(agent, "handle-get-secrets", G_CALLBACK(handle_get_secrets), NULL); + // Connect the method handler + g_signal_connect(agent, "handle-cancel-get-secrets", G_CALLBACK(handle_cancel_get_secrets), NULL); + + // Export the object on the D-Bus + if (!g_dbus_interface_skeleton_export( + G_DBUS_INTERFACE_SKELETON(agent), + connection, + "/org/freedesktop/NetworkManager/SecretAgent", + &error)) { + g_printerr("Error exporting object: %s\n", error->message); + g_error_free(error); + g_object_unref(agent); + return; + } + + g_print("SecretAgent running at /org/freedesktop/NetworkManager/SecretAgent\n"); + + // Run the main loop + loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(loop); + g_main_loop_quit(loop); + // Cleanup + g_object_unref(agent); + g_main_loop_unref(loop); + g_object_unref(connection); + +} diff --git a/gdbus/SecretAgent/secretAgent.xml b/gdbus/SecretAgent/secretAgent.xml new file mode 100644 index 0000000..be14d40 --- /dev/null +++ b/gdbus/SecretAgent/secretAgent.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + diff --git a/gdbus/SecretAgent/secret_agent b/gdbus/SecretAgent/secret_agent new file mode 100755 index 0000000..2ca68c1 Binary files /dev/null and b/gdbus/SecretAgent/secret_agent differ diff --git a/gdbus/SecretAgent/secret_agent.c b/gdbus/SecretAgent/secret_agent.c new file mode 100644 index 0000000..08864e1 --- /dev/null +++ b/gdbus/SecretAgent/secret_agent.c @@ -0,0 +1,1504 @@ +/* + * This file is generated by gdbus-codegen, do not modify it. + * + * The license of this code is the same as for the D-Bus interface description + * it was derived from. Note that it links to GLib, so must comply with the + * LGPL linking clauses. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "secret_agent.h" + +#include +#ifdef G_OS_UNIX +# include +#endif + +#ifdef G_ENABLE_DEBUG +#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) +#define g_marshal_value_peek_char(v) g_value_get_schar (v) +#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) +#define g_marshal_value_peek_int(v) g_value_get_int (v) +#define g_marshal_value_peek_uint(v) g_value_get_uint (v) +#define g_marshal_value_peek_long(v) g_value_get_long (v) +#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) +#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) +#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) +#define g_marshal_value_peek_enum(v) g_value_get_enum (v) +#define g_marshal_value_peek_flags(v) g_value_get_flags (v) +#define g_marshal_value_peek_float(v) g_value_get_float (v) +#define g_marshal_value_peek_double(v) g_value_get_double (v) +#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) +#define g_marshal_value_peek_param(v) g_value_get_param (v) +#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) +#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) +#define g_marshal_value_peek_object(v) g_value_get_object (v) +#define g_marshal_value_peek_variant(v) g_value_get_variant (v) +#else /* !G_ENABLE_DEBUG */ +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. + * Do not access GValues directly in your code. Instead, use the + * g_value_get_*() functions + */ +#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int +#define g_marshal_value_peek_char(v) (v)->data[0].v_int +#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint +#define g_marshal_value_peek_int(v) (v)->data[0].v_int +#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint +#define g_marshal_value_peek_long(v) (v)->data[0].v_long +#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 +#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 +#define g_marshal_value_peek_enum(v) (v)->data[0].v_long +#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_float(v) (v)->data[0].v_float +#define g_marshal_value_peek_double(v) (v)->data[0].v_double +#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer +#endif /* !G_ENABLE_DEBUG */ + +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; + guint use_gvariant : 1; + guint emits_changed_signal : 1; +} _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; +} + +static void +_g_dbus_codegen_marshal_BOOLEAN__OBJECT_VARIANT_STRING_STRING_BOXED_UINT ( + GClosure *closure, + GValue *return_value, + unsigned int n_param_values, + const GValue *param_values, + void *invocation_hint G_GNUC_UNUSED, + void *marshal_data) +{ + typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectVariantStringStringBoxedUintFunc) + (void *data1, + GDBusMethodInvocation *arg_method_invocation, + GVariant *arg_connection, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + const gchar *const *arg_hints, + guint arg_flags, + void *data2); + _GDbusCodegenMarshalBoolean_ObjectVariantStringStringBoxedUintFunc callback; + GCClosure *cc = (GCClosure*) closure; + void *data1, *data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 7); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + + callback = (_GDbusCodegenMarshalBoolean_ObjectVariantStringStringBoxedUintFunc) + (marshal_data ? marshal_data : cc->callback); + + v_return = + callback (data1, + g_marshal_value_peek_object (param_values + 1), + g_marshal_value_peek_variant (param_values + 2), + g_marshal_value_peek_string (param_values + 3), + g_marshal_value_peek_string (param_values + 4), + g_marshal_value_peek_boxed (param_values + 5), + g_marshal_value_peek_uint (param_values + 6), + data2); + + g_value_set_boolean (return_value, v_return); +} + +static void +_g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_STRING ( + GClosure *closure, + GValue *return_value, + unsigned int n_param_values, + const GValue *param_values, + void *invocation_hint G_GNUC_UNUSED, + void *marshal_data) +{ + typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectStringStringFunc) + (void *data1, + GDBusMethodInvocation *arg_method_invocation, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + void *data2); + _GDbusCodegenMarshalBoolean_ObjectStringStringFunc callback; + GCClosure *cc = (GCClosure*) closure; + void *data1, *data2; + gboolean v_return; + + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 4); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + + callback = (_GDbusCodegenMarshalBoolean_ObjectStringStringFunc) + (marshal_data ? marshal_data : cc->callback); + + v_return = + callback (data1, + g_marshal_value_peek_object (param_values + 1), + g_marshal_value_peek_string (param_values + 2), + g_marshal_value_peek_string (param_values + 3), + data2); + + g_value_set_boolean (return_value, v_return); +} + +/* ------------------------------------------------------------------------ + * Code for interface org.freedesktop.NetworkManager.SecretAgent + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:OrgFreedesktopNetworkManagerSecretAgent + * @title: OrgFreedesktopNetworkManagerSecretAgent + * @short_description: Generated C code for the org.freedesktop.NetworkManager.SecretAgent D-Bus interface + * + * This section contains code for working with the org.freedesktop.NetworkManager.SecretAgent D-Bus interface in C. + */ + +/* ---- Introspection data for org.freedesktop.NetworkManager.SecretAgent ---- */ + +static const _ExtendedGDBusArgInfo _org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_connection = +{ + { + -1, + (gchar *) "connection", + (gchar *) "a{sa{sv}}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_connection_path = +{ + { + -1, + (gchar *) "connection_path", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_setting_name = +{ + { + -1, + (gchar *) "setting_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_hints = +{ + { + -1, + (gchar *) "hints", + (gchar *) "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_flags = +{ + { + -1, + (gchar *) "flags", + (gchar *) "u", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_pointers[] = +{ + &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_connection.parent_struct, + &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_connection_path.parent_struct, + &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_setting_name.parent_struct, + &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_hints.parent_struct, + &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_flags.parent_struct, + NULL +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_network_manager_secret_agent_method_info_get_secrets_OUT_ARG_secrets = +{ + { + -1, + (gchar *) "secrets", + (gchar *) "a{sa{sv}}", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _org_freedesktop_network_manager_secret_agent_method_info_get_secrets_OUT_ARG_pointers[] = +{ + &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets_OUT_ARG_secrets.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_freedesktop_network_manager_secret_agent_method_info_get_secrets = +{ + { + -1, + (gchar *) "GetSecrets", + (GDBusArgInfo **) &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets_IN_ARG_pointers, + (GDBusArgInfo **) &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets_OUT_ARG_pointers, + NULL + }, + "handle-get-secrets", + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_network_manager_secret_agent_method_info_cancel_get_secrets_IN_ARG_connection_path = +{ + { + -1, + (gchar *) "connection_path", + (gchar *) "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _org_freedesktop_network_manager_secret_agent_method_info_cancel_get_secrets_IN_ARG_setting_name = +{ + { + -1, + (gchar *) "setting_name", + (gchar *) "s", + NULL + }, + FALSE +}; + +static const GDBusArgInfo * const _org_freedesktop_network_manager_secret_agent_method_info_cancel_get_secrets_IN_ARG_pointers[] = +{ + &_org_freedesktop_network_manager_secret_agent_method_info_cancel_get_secrets_IN_ARG_connection_path.parent_struct, + &_org_freedesktop_network_manager_secret_agent_method_info_cancel_get_secrets_IN_ARG_setting_name.parent_struct, + NULL +}; + +static const _ExtendedGDBusMethodInfo _org_freedesktop_network_manager_secret_agent_method_info_cancel_get_secrets = +{ + { + -1, + (gchar *) "CancelGetSecrets", + (GDBusArgInfo **) &_org_freedesktop_network_manager_secret_agent_method_info_cancel_get_secrets_IN_ARG_pointers, + NULL, + NULL + }, + "handle-cancel-get-secrets", + FALSE +}; + +static const GDBusMethodInfo * const _org_freedesktop_network_manager_secret_agent_method_info_pointers[] = +{ + &_org_freedesktop_network_manager_secret_agent_method_info_get_secrets.parent_struct, + &_org_freedesktop_network_manager_secret_agent_method_info_cancel_get_secrets.parent_struct, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _org_freedesktop_network_manager_secret_agent_interface_info = +{ + { + -1, + (gchar *) "org.freedesktop.NetworkManager.SecretAgent", + (GDBusMethodInfo **) &_org_freedesktop_network_manager_secret_agent_method_info_pointers, + NULL, + NULL, + NULL + }, + "org-freedesktop-network-manager-secret-agent", +}; + + +/** + * org_freedesktop_network_manager_secret_agent_interface_info: + * + * Gets a machine-readable description of the org.freedesktop.NetworkManager.SecretAgent D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +org_freedesktop_network_manager_secret_agent_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_org_freedesktop_network_manager_secret_agent_interface_info.parent_struct; +} + +/** + * org_freedesktop_network_manager_secret_agent_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 #OrgFreedesktopNetworkManagerSecretAgent interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +org_freedesktop_network_manager_secret_agent_override_properties (GObjectClass *klass G_GNUC_UNUSED, guint property_id_begin) +{ + return property_id_begin - 1; +} + + +inline static void +org_freedesktop_network_manager_secret_agent_method_marshal_get_secrets ( + GClosure *closure, + GValue *return_value, + unsigned int n_param_values, + const GValue *param_values, + void *invocation_hint, + void *marshal_data) +{ + _g_dbus_codegen_marshal_BOOLEAN__OBJECT_VARIANT_STRING_STRING_BOXED_UINT (closure, + return_value, n_param_values, param_values, invocation_hint, marshal_data); +} + +inline static void +org_freedesktop_network_manager_secret_agent_method_marshal_cancel_get_secrets ( + GClosure *closure, + GValue *return_value, + unsigned int n_param_values, + const GValue *param_values, + void *invocation_hint, + void *marshal_data) +{ + _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_STRING (closure, + return_value, n_param_values, param_values, invocation_hint, marshal_data); +} + + +/** + * OrgFreedesktopNetworkManagerSecretAgent: + * + * Abstract interface type for the D-Bus interface org.freedesktop.NetworkManager.SecretAgent. + */ + +/** + * OrgFreedesktopNetworkManagerSecretAgentIface: + * @parent_iface: The parent interface. + * @handle_cancel_get_secrets: Handler for the #OrgFreedesktopNetworkManagerSecretAgent::handle-cancel-get-secrets signal. + * @handle_get_secrets: Handler for the #OrgFreedesktopNetworkManagerSecretAgent::handle-get-secrets signal. + * + * Virtual table for the D-Bus interface org.freedesktop.NetworkManager.SecretAgent. + */ + +typedef OrgFreedesktopNetworkManagerSecretAgentIface OrgFreedesktopNetworkManagerSecretAgentInterface; +G_DEFINE_INTERFACE (OrgFreedesktopNetworkManagerSecretAgent, org_freedesktop_network_manager_secret_agent, G_TYPE_OBJECT) + +static void +org_freedesktop_network_manager_secret_agent_default_init (OrgFreedesktopNetworkManagerSecretAgentIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * OrgFreedesktopNetworkManagerSecretAgent::handle-get-secrets: + * @object: A #OrgFreedesktopNetworkManagerSecretAgent. + * @invocation: A #GDBusMethodInvocation. + * @arg_connection: Argument passed by remote caller. + * @arg_connection_path: Argument passed by remote caller. + * @arg_setting_name: Argument passed by remote caller. + * @arg_hints: Argument passed by remote caller. + * @arg_flags: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetSecrets() 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_network_manager_secret_agent_complete_get_secrets() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-secrets", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgFreedesktopNetworkManagerSecretAgentIface, handle_get_secrets), + g_signal_accumulator_true_handled, + NULL, + org_freedesktop_network_manager_secret_agent_method_marshal_get_secrets, + G_TYPE_BOOLEAN, + 6, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV, G_TYPE_UINT); + + /** + * OrgFreedesktopNetworkManagerSecretAgent::handle-cancel-get-secrets: + * @object: A #OrgFreedesktopNetworkManagerSecretAgent. + * @invocation: A #GDBusMethodInvocation. + * @arg_connection_path: Argument passed by remote caller. + * @arg_setting_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the CancelGetSecrets() 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_network_manager_secret_agent_complete_cancel_get_secrets() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-cancel-get-secrets", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (OrgFreedesktopNetworkManagerSecretAgentIface, handle_cancel_get_secrets), + g_signal_accumulator_true_handled, + NULL, + org_freedesktop_network_manager_secret_agent_method_marshal_cancel_get_secrets, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING); + +} + +/** + * org_freedesktop_network_manager_secret_agent_call_get_secrets: + * @proxy: A #OrgFreedesktopNetworkManagerSecretAgentProxy. + * @arg_connection: Argument to pass with the method invocation. + * @arg_connection_path: Argument to pass with the method invocation. + * @arg_setting_name: Argument to pass with the method invocation. + * @arg_hints: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @cancellable: (nullable): 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 GetSecrets() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). + * You can then call org_freedesktop_network_manager_secret_agent_call_get_secrets_finish() to get the result of the operation. + * + * See org_freedesktop_network_manager_secret_agent_call_get_secrets_sync() for the synchronous, blocking version of this method. + */ +void +org_freedesktop_network_manager_secret_agent_call_get_secrets ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + GVariant *arg_connection, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + const gchar *const *arg_hints, + guint arg_flags, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "GetSecrets", + g_variant_new ("(@a{sa{sv}}os^asu)", + arg_connection, + arg_connection_path, + arg_setting_name, + arg_hints, + arg_flags), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_freedesktop_network_manager_secret_agent_call_get_secrets_finish: + * @proxy: A #OrgFreedesktopNetworkManagerSecretAgentProxy. + * @out_secrets: (out) (optional): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_network_manager_secret_agent_call_get_secrets(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_freedesktop_network_manager_secret_agent_call_get_secrets(). + * + * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_network_manager_secret_agent_call_get_secrets_finish ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + GVariant **out_secrets, + 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{sa{sv}})", + out_secrets); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_freedesktop_network_manager_secret_agent_call_get_secrets_sync: + * @proxy: A #OrgFreedesktopNetworkManagerSecretAgentProxy. + * @arg_connection: Argument to pass with the method invocation. + * @arg_connection_path: Argument to pass with the method invocation. + * @arg_setting_name: Argument to pass with the method invocation. + * @arg_hints: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @out_secrets: (out) (optional): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetSecrets() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_freedesktop_network_manager_secret_agent_call_get_secrets() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_network_manager_secret_agent_call_get_secrets_sync ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + GVariant *arg_connection, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + const gchar *const *arg_hints, + guint arg_flags, + GVariant **out_secrets, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "GetSecrets", + g_variant_new ("(@a{sa{sv}}os^asu)", + arg_connection, + arg_connection_path, + arg_setting_name, + arg_hints, + arg_flags), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sa{sv}})", + out_secrets); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets: + * @proxy: A #OrgFreedesktopNetworkManagerSecretAgentProxy. + * @arg_connection_path: Argument to pass with the method invocation. + * @arg_setting_name: Argument to pass with the method invocation. + * @cancellable: (nullable): 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 CancelGetSecrets() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). + * You can then call org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets_finish() to get the result of the operation. + * + * See org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets_sync() for the synchronous, blocking version of this method. + */ +void +org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "CancelGetSecrets", + g_variant_new ("(os)", + arg_connection_path, + arg_setting_name), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets_finish: + * @proxy: A #OrgFreedesktopNetworkManagerSecretAgentProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets(). + * + * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets_finish ( + OrgFreedesktopNetworkManagerSecretAgent *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_network_manager_secret_agent_call_cancel_get_secrets_sync: + * @proxy: A #OrgFreedesktopNetworkManagerSecretAgentProxy. + * @arg_connection_path: Argument to pass with the method invocation. + * @arg_setting_name: Argument to pass with the method invocation. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the CancelGetSecrets() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. + */ +gboolean +org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets_sync ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "CancelGetSecrets", + g_variant_new ("(os)", + arg_connection_path, + arg_setting_name), + 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_network_manager_secret_agent_complete_get_secrets: + * @object: A #OrgFreedesktopNetworkManagerSecretAgent. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @secrets: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetSecrets() 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_network_manager_secret_agent_complete_get_secrets ( + OrgFreedesktopNetworkManagerSecretAgent *object G_GNUC_UNUSED, + GDBusMethodInvocation *invocation, + GVariant *secrets) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sa{sv}})", + secrets)); +} + +/** + * org_freedesktop_network_manager_secret_agent_complete_cancel_get_secrets: + * @object: A #OrgFreedesktopNetworkManagerSecretAgent. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the CancelGetSecrets() 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_network_manager_secret_agent_complete_cancel_get_secrets ( + OrgFreedesktopNetworkManagerSecretAgent *object G_GNUC_UNUSED, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * OrgFreedesktopNetworkManagerSecretAgentProxy: + * + * The #OrgFreedesktopNetworkManagerSecretAgentProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgFreedesktopNetworkManagerSecretAgentProxyClass: + * @parent_class: The parent class. + * + * Class structure for #OrgFreedesktopNetworkManagerSecretAgentProxy. + */ + +struct _OrgFreedesktopNetworkManagerSecretAgentProxyPrivate +{ + GData *qdata; +}; + +static void org_freedesktop_network_manager_secret_agent_proxy_iface_init (OrgFreedesktopNetworkManagerSecretAgentIface *iface); + +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopNetworkManagerSecretAgentProxy, org_freedesktop_network_manager_secret_agent_proxy, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (OrgFreedesktopNetworkManagerSecretAgentProxy) + G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT, org_freedesktop_network_manager_secret_agent_proxy_iface_init)) + +#else +G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopNetworkManagerSecretAgentProxy, org_freedesktop_network_manager_secret_agent_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT, org_freedesktop_network_manager_secret_agent_proxy_iface_init)) + +#endif +static void +org_freedesktop_network_manager_secret_agent_proxy_finalize (GObject *object) +{ + OrgFreedesktopNetworkManagerSecretAgentProxy *proxy = ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (org_freedesktop_network_manager_secret_agent_proxy_parent_class)->finalize (object); +} + +static void +org_freedesktop_network_manager_secret_agent_proxy_get_property (GObject *object G_GNUC_UNUSED, + guint prop_id G_GNUC_UNUSED, + GValue *value G_GNUC_UNUSED, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +org_freedesktop_network_manager_secret_agent_proxy_set_property (GObject *object G_GNUC_UNUSED, + guint prop_id G_GNUC_UNUSED, + const GValue *value G_GNUC_UNUSED, + GParamSpec *pspec G_GNUC_UNUSED) +{ +} + +static void +org_freedesktop_network_manager_secret_agent_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; + gsize num_params; + gsize n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_freedesktop_network_manager_secret_agent_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_NETWORK_MANAGER_SECRET_AGENT); + 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_NETWORK_MANAGER_SECRET_AGENT); + 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_network_manager_secret_agent_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + OrgFreedesktopNetworkManagerSecretAgentProxy *proxy = ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_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_network_manager_secret_agent_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_network_manager_secret_agent_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_network_manager_secret_agent_proxy_init (OrgFreedesktopNetworkManagerSecretAgentProxy *proxy) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + proxy->priv = org_freedesktop_network_manager_secret_agent_proxy_get_instance_private (proxy); +#else + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY, OrgFreedesktopNetworkManagerSecretAgentProxyPrivate); +#endif + + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_freedesktop_network_manager_secret_agent_interface_info ()); +} + +static void +org_freedesktop_network_manager_secret_agent_proxy_class_init (OrgFreedesktopNetworkManagerSecretAgentProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_freedesktop_network_manager_secret_agent_proxy_finalize; + gobject_class->get_property = org_freedesktop_network_manager_secret_agent_proxy_get_property; + gobject_class->set_property = org_freedesktop_network_manager_secret_agent_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = org_freedesktop_network_manager_secret_agent_proxy_g_signal; + proxy_class->g_properties_changed = org_freedesktop_network_manager_secret_agent_proxy_g_properties_changed; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgFreedesktopNetworkManagerSecretAgentProxyPrivate)); +#endif +} + +static void +org_freedesktop_network_manager_secret_agent_proxy_iface_init (OrgFreedesktopNetworkManagerSecretAgentIface *iface G_GNUC_UNUSED) +{ +} + +/** + * org_freedesktop_network_manager_secret_agent_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (nullable): 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 org.freedesktop.NetworkManager.SecretAgent. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). + * You can then call org_freedesktop_network_manager_secret_agent_proxy_new_finish() to get the result of the operation. + * + * See org_freedesktop_network_manager_secret_agent_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +org_freedesktop_network_manager_secret_agent_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_NETWORK_MANAGER_SECRET_AGENT_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.NetworkManager.SecretAgent", NULL); +} + +/** + * org_freedesktop_network_manager_secret_agent_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_network_manager_secret_agent_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_freedesktop_network_manager_secret_agent_proxy_new(). + * + * Returns: (transfer full) (type OrgFreedesktopNetworkManagerSecretAgentProxy): The constructed proxy object or %NULL if @error is set. + */ +OrgFreedesktopNetworkManagerSecretAgent * +org_freedesktop_network_manager_secret_agent_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_NETWORK_MANAGER_SECRET_AGENT (ret); + else + return NULL; +} + +/** + * org_freedesktop_network_manager_secret_agent_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface org.freedesktop.NetworkManager.SecretAgent. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See org_freedesktop_network_manager_secret_agent_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgFreedesktopNetworkManagerSecretAgentProxy): The constructed proxy object or %NULL if @error is set. + */ +OrgFreedesktopNetworkManagerSecretAgent * +org_freedesktop_network_manager_secret_agent_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_NETWORK_MANAGER_SECRET_AGENT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.NetworkManager.SecretAgent", NULL); + if (ret != NULL) + return ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT (ret); + else + return NULL; +} + + +/** + * org_freedesktop_network_manager_secret_agent_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: (nullable): 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_network_manager_secret_agent_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()). + * You can then call org_freedesktop_network_manager_secret_agent_proxy_new_for_bus_finish() to get the result of the operation. + * + * See org_freedesktop_network_manager_secret_agent_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +org_freedesktop_network_manager_secret_agent_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_NETWORK_MANAGER_SECRET_AGENT_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.NetworkManager.SecretAgent", NULL); +} + +/** + * org_freedesktop_network_manager_secret_agent_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_freedesktop_network_manager_secret_agent_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with org_freedesktop_network_manager_secret_agent_proxy_new_for_bus(). + * + * Returns: (transfer full) (type OrgFreedesktopNetworkManagerSecretAgentProxy): The constructed proxy object or %NULL if @error is set. + */ +OrgFreedesktopNetworkManagerSecretAgent * +org_freedesktop_network_manager_secret_agent_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_NETWORK_MANAGER_SECRET_AGENT (ret); + else + return NULL; +} + +/** + * org_freedesktop_network_manager_secret_agent_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: (nullable): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like org_freedesktop_network_manager_secret_agent_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See org_freedesktop_network_manager_secret_agent_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type OrgFreedesktopNetworkManagerSecretAgentProxy): The constructed proxy object or %NULL if @error is set. + */ +OrgFreedesktopNetworkManagerSecretAgent * +org_freedesktop_network_manager_secret_agent_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_NETWORK_MANAGER_SECRET_AGENT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.NetworkManager.SecretAgent", NULL); + if (ret != NULL) + return ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * OrgFreedesktopNetworkManagerSecretAgentSkeleton: + * + * The #OrgFreedesktopNetworkManagerSecretAgentSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * OrgFreedesktopNetworkManagerSecretAgentSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #OrgFreedesktopNetworkManagerSecretAgentSkeleton. + */ + +struct _OrgFreedesktopNetworkManagerSecretAgentSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_org_freedesktop_network_manager_secret_agent_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) +{ + OrgFreedesktopNetworkManagerSecretAgentSkeleton *skeleton = ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + gsize num_params; + guint num_extra; + gsize 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_NETWORK_MANAGER_SECRET_AGENT); + 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_NETWORK_MANAGER_SECRET_AGENT); + 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_network_manager_secret_agent_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) +{ + OrgFreedesktopNetworkManagerSecretAgentSkeleton *skeleton = ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_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_network_manager_secret_agent_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_network_manager_secret_agent_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) +{ + OrgFreedesktopNetworkManagerSecretAgentSkeleton *skeleton = ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_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_network_manager_secret_agent_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_network_manager_secret_agent_skeleton_vtable = +{ + _org_freedesktop_network_manager_secret_agent_skeleton_handle_method_call, + _org_freedesktop_network_manager_secret_agent_skeleton_handle_get_property, + _org_freedesktop_network_manager_secret_agent_skeleton_handle_set_property, + {NULL} +}; + +static GDBusInterfaceInfo * +org_freedesktop_network_manager_secret_agent_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return org_freedesktop_network_manager_secret_agent_interface_info (); +} + +static GDBusInterfaceVTable * +org_freedesktop_network_manager_secret_agent_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) +{ + return (GDBusInterfaceVTable *) &_org_freedesktop_network_manager_secret_agent_skeleton_vtable; +} + +static GVariant * +org_freedesktop_network_manager_secret_agent_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + OrgFreedesktopNetworkManagerSecretAgentSkeleton *skeleton = ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_org_freedesktop_network_manager_secret_agent_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _org_freedesktop_network_manager_secret_agent_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _org_freedesktop_network_manager_secret_agent_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _org_freedesktop_network_manager_secret_agent_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.NetworkManager.SecretAgent", 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_network_manager_secret_agent_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton G_GNUC_UNUSED) +{ +} + +static void org_freedesktop_network_manager_secret_agent_skeleton_iface_init (OrgFreedesktopNetworkManagerSecretAgentIface *iface); +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 +G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopNetworkManagerSecretAgentSkeleton, org_freedesktop_network_manager_secret_agent_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_ADD_PRIVATE (OrgFreedesktopNetworkManagerSecretAgentSkeleton) + G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT, org_freedesktop_network_manager_secret_agent_skeleton_iface_init)) + +#else +G_DEFINE_TYPE_WITH_CODE (OrgFreedesktopNetworkManagerSecretAgentSkeleton, org_freedesktop_network_manager_secret_agent_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT, org_freedesktop_network_manager_secret_agent_skeleton_iface_init)) + +#endif +static void +org_freedesktop_network_manager_secret_agent_skeleton_finalize (GObject *object) +{ + OrgFreedesktopNetworkManagerSecretAgentSkeleton *skeleton = ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_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_network_manager_secret_agent_skeleton_parent_class)->finalize (object); +} + +static void +org_freedesktop_network_manager_secret_agent_skeleton_init (OrgFreedesktopNetworkManagerSecretAgentSkeleton *skeleton) +{ +#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + skeleton->priv = org_freedesktop_network_manager_secret_agent_skeleton_get_instance_private (skeleton); +#else + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON, OrgFreedesktopNetworkManagerSecretAgentSkeletonPrivate); +#endif + + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +org_freedesktop_network_manager_secret_agent_skeleton_class_init (OrgFreedesktopNetworkManagerSecretAgentSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = org_freedesktop_network_manager_secret_agent_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = org_freedesktop_network_manager_secret_agent_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = org_freedesktop_network_manager_secret_agent_skeleton_dbus_interface_get_properties; + skeleton_class->flush = org_freedesktop_network_manager_secret_agent_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = org_freedesktop_network_manager_secret_agent_skeleton_dbus_interface_get_vtable; + +#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 + g_type_class_add_private (klass, sizeof (OrgFreedesktopNetworkManagerSecretAgentSkeletonPrivate)); +#endif +} + +static void +org_freedesktop_network_manager_secret_agent_skeleton_iface_init (OrgFreedesktopNetworkManagerSecretAgentIface *iface G_GNUC_UNUSED) +{ +} + +/** + * org_freedesktop_network_manager_secret_agent_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface org.freedesktop.NetworkManager.SecretAgent. + * + * Returns: (transfer full) (type OrgFreedesktopNetworkManagerSecretAgentSkeleton): The skeleton object. + */ +OrgFreedesktopNetworkManagerSecretAgent * +org_freedesktop_network_manager_secret_agent_skeleton_new (void) +{ + return ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT (g_object_new (TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON, NULL)); +} + diff --git a/gdbus/SecretAgent/secret_agent.h b/gdbus/SecretAgent/secret_agent.h new file mode 100644 index 0000000..7fe53d7 --- /dev/null +++ b/gdbus/SecretAgent/secret_agent.h @@ -0,0 +1,225 @@ +/* + * This file is generated by gdbus-codegen, do not modify it. + * + * The license of this code is the same as for the D-Bus interface description + * it was derived from. Note that it links to GLib, so must comply with the + * LGPL linking clauses. + */ + +#ifndef __SECRET_AGENT_H__ +#define __SECRET_AGENT_H__ + +#include + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for org.freedesktop.NetworkManager.SecretAgent */ + +#define TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT (org_freedesktop_network_manager_secret_agent_get_type ()) +#define ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT, OrgFreedesktopNetworkManagerSecretAgent)) +#define IS_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT)) +#define ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT, OrgFreedesktopNetworkManagerSecretAgentIface)) + +struct _OrgFreedesktopNetworkManagerSecretAgent; +typedef struct _OrgFreedesktopNetworkManagerSecretAgent OrgFreedesktopNetworkManagerSecretAgent; +typedef struct _OrgFreedesktopNetworkManagerSecretAgentIface OrgFreedesktopNetworkManagerSecretAgentIface; + +struct _OrgFreedesktopNetworkManagerSecretAgentIface +{ + GTypeInterface parent_iface; + + gboolean (*handle_cancel_get_secrets) ( + OrgFreedesktopNetworkManagerSecretAgent *object, + GDBusMethodInvocation *invocation, + const gchar *arg_connection_path, + const gchar *arg_setting_name); + + gboolean (*handle_get_secrets) ( + OrgFreedesktopNetworkManagerSecretAgent *object, + GDBusMethodInvocation *invocation, + GVariant *arg_connection, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + const gchar *const *arg_hints, + guint arg_flags); + +}; + +GType org_freedesktop_network_manager_secret_agent_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *org_freedesktop_network_manager_secret_agent_interface_info (void); +guint org_freedesktop_network_manager_secret_agent_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void org_freedesktop_network_manager_secret_agent_complete_get_secrets ( + OrgFreedesktopNetworkManagerSecretAgent *object, + GDBusMethodInvocation *invocation, + GVariant *secrets); + +void org_freedesktop_network_manager_secret_agent_complete_cancel_get_secrets ( + OrgFreedesktopNetworkManagerSecretAgent *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus method calls: */ +void org_freedesktop_network_manager_secret_agent_call_get_secrets ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + GVariant *arg_connection, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + const gchar *const *arg_hints, + guint arg_flags, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_freedesktop_network_manager_secret_agent_call_get_secrets_finish ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + GVariant **out_secrets, + GAsyncResult *res, + GError **error); + +gboolean org_freedesktop_network_manager_secret_agent_call_get_secrets_sync ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + GVariant *arg_connection, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + const gchar *const *arg_hints, + guint arg_flags, + GVariant **out_secrets, + GCancellable *cancellable, + GError **error); + +void org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets_finish ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + GAsyncResult *res, + GError **error); + +gboolean org_freedesktop_network_manager_secret_agent_call_cancel_get_secrets_sync ( + OrgFreedesktopNetworkManagerSecretAgent *proxy, + const gchar *arg_connection_path, + const gchar *arg_setting_name, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY (org_freedesktop_network_manager_secret_agent_proxy_get_type ()) +#define ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY, OrgFreedesktopNetworkManagerSecretAgentProxy)) +#define ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY, OrgFreedesktopNetworkManagerSecretAgentProxyClass)) +#define ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY, OrgFreedesktopNetworkManagerSecretAgentProxyClass)) +#define IS_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY)) +#define IS_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_PROXY)) + +typedef struct _OrgFreedesktopNetworkManagerSecretAgentProxy OrgFreedesktopNetworkManagerSecretAgentProxy; +typedef struct _OrgFreedesktopNetworkManagerSecretAgentProxyClass OrgFreedesktopNetworkManagerSecretAgentProxyClass; +typedef struct _OrgFreedesktopNetworkManagerSecretAgentProxyPrivate OrgFreedesktopNetworkManagerSecretAgentProxyPrivate; + +struct _OrgFreedesktopNetworkManagerSecretAgentProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + OrgFreedesktopNetworkManagerSecretAgentProxyPrivate *priv; +}; + +struct _OrgFreedesktopNetworkManagerSecretAgentProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType org_freedesktop_network_manager_secret_agent_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgFreedesktopNetworkManagerSecretAgentProxy, g_object_unref) +#endif + +void org_freedesktop_network_manager_secret_agent_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgFreedesktopNetworkManagerSecretAgent *org_freedesktop_network_manager_secret_agent_proxy_new_finish ( + GAsyncResult *res, + GError **error); +OrgFreedesktopNetworkManagerSecretAgent *org_freedesktop_network_manager_secret_agent_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void org_freedesktop_network_manager_secret_agent_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +OrgFreedesktopNetworkManagerSecretAgent *org_freedesktop_network_manager_secret_agent_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +OrgFreedesktopNetworkManagerSecretAgent *org_freedesktop_network_manager_secret_agent_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_NETWORK_MANAGER_SECRET_AGENT_SKELETON (org_freedesktop_network_manager_secret_agent_skeleton_get_type ()) +#define ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON, OrgFreedesktopNetworkManagerSecretAgentSkeleton)) +#define ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON, OrgFreedesktopNetworkManagerSecretAgentSkeletonClass)) +#define ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON, OrgFreedesktopNetworkManagerSecretAgentSkeletonClass)) +#define IS_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON)) +#define IS_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_ORG_FREEDESKTOP_NETWORK_MANAGER_SECRET_AGENT_SKELETON)) + +typedef struct _OrgFreedesktopNetworkManagerSecretAgentSkeleton OrgFreedesktopNetworkManagerSecretAgentSkeleton; +typedef struct _OrgFreedesktopNetworkManagerSecretAgentSkeletonClass OrgFreedesktopNetworkManagerSecretAgentSkeletonClass; +typedef struct _OrgFreedesktopNetworkManagerSecretAgentSkeletonPrivate OrgFreedesktopNetworkManagerSecretAgentSkeletonPrivate; + +struct _OrgFreedesktopNetworkManagerSecretAgentSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + OrgFreedesktopNetworkManagerSecretAgentSkeletonPrivate *priv; +}; + +struct _OrgFreedesktopNetworkManagerSecretAgentSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType org_freedesktop_network_manager_secret_agent_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (OrgFreedesktopNetworkManagerSecretAgentSkeleton, g_object_unref) +#endif + +OrgFreedesktopNetworkManagerSecretAgent *org_freedesktop_network_manager_secret_agent_skeleton_new (void); + + +G_END_DECLS + +#endif /* __SECRET_AGENT_H__ */