2011-09-25 06:22:36 +00:00
|
|
|
/* GSecret - GLib wrapper for Secret Service
|
|
|
|
*
|
|
|
|
* Copyright 2011 Collabora Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published
|
|
|
|
* by the Free Software Foundation; either version 2 of the licence or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*
|
|
|
|
* See the included COPYING file for more information.
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifndef __GSECRET_PRIVATE_H__
|
|
|
|
#define __GSECRET_PRIVATE_H__
|
|
|
|
|
|
|
|
#include <gio/gio.h>
|
|
|
|
|
|
|
|
#include "gsecret-service.h"
|
|
|
|
#include "gsecret-value.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2011-11-12 07:08:12 +00:00
|
|
|
typedef struct {
|
2012-01-20 14:10:35 +00:00
|
|
|
GAsyncResult *result;
|
|
|
|
GMainContext *context;
|
|
|
|
GMainLoop *loop;
|
|
|
|
} GSecretSync;
|
2011-11-12 07:08:12 +00:00
|
|
|
|
2012-01-23 16:20:18 +00:00
|
|
|
typedef struct _GSecretSession GSecretSession;
|
|
|
|
|
2011-09-25 16:39:03 +00:00
|
|
|
#define GSECRET_SERVICE_PATH "/org/freedesktop/secrets"
|
|
|
|
|
|
|
|
#define GSECRET_SERVICE_BUS_NAME "org.freedesktop.Secret.Service"
|
|
|
|
|
2012-01-11 06:44:32 +00:00
|
|
|
#define GSECRET_ITEM_INTERFACE "org.freedesktop.Secret.Item"
|
|
|
|
#define GSECRET_COLLECTION_INTERFACE "org.freedesktop.Secret.Collection"
|
|
|
|
#define GSECRET_PROMPT_INTERFACE "org.freedesktop.Secret.Prompt"
|
2011-09-25 16:39:03 +00:00
|
|
|
#define GSECRET_SERVICE_INTERFACE "org.freedesktop.Secret.Service"
|
|
|
|
|
2012-01-11 06:44:32 +00:00
|
|
|
#define GSECRET_PROMPT_SIGNAL_COMPLETED "Completed"
|
2011-09-25 06:22:36 +00:00
|
|
|
|
2012-01-16 14:08:46 +00:00
|
|
|
#define GSECRET_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
|
|
|
|
|
2012-01-20 14:10:35 +00:00
|
|
|
GSecretSync * _gsecret_sync_new (void);
|
2011-11-12 07:08:12 +00:00
|
|
|
|
2012-01-20 14:10:35 +00:00
|
|
|
void _gsecret_sync_free (gpointer data);
|
|
|
|
|
|
|
|
void _gsecret_sync_on_result (GObject *source,
|
|
|
|
GAsyncResult *result,
|
|
|
|
gpointer user_data);
|
2011-11-12 07:08:12 +00:00
|
|
|
|
2012-01-11 06:44:32 +00:00
|
|
|
GSecretPrompt * _gsecret_prompt_instance (GDBusConnection *connection,
|
|
|
|
const gchar *object_path);
|
|
|
|
|
2012-01-26 17:23:12 +00:00
|
|
|
gchar * _gsecret_util_parent_path (const gchar *path);
|
2011-09-25 06:22:36 +00:00
|
|
|
|
2012-01-11 06:44:32 +00:00
|
|
|
gboolean _gsecret_util_empty_path (const gchar *path);
|
|
|
|
|
2012-01-20 14:10:35 +00:00
|
|
|
GType _gsecret_list_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2011-11-05 20:50:01 +00:00
|
|
|
GVariant * _gsecret_util_variant_for_attributes (GHashTable *attributes);
|
|
|
|
|
2012-01-16 14:08:29 +00:00
|
|
|
GHashTable * _gsecret_util_attributes_for_variant (GVariant *variant);
|
|
|
|
|
2012-01-11 06:44:32 +00:00
|
|
|
GHashTable * _gsecret_util_attributes_for_varargs (const GSecretSchema *schema,
|
|
|
|
va_list va);
|
|
|
|
|
2012-01-26 17:23:12 +00:00
|
|
|
GVariant * _gsecret_util_variant_for_properties (GHashTable *properties);
|
|
|
|
|
2012-01-20 14:10:35 +00:00
|
|
|
void _gsecret_util_get_properties (GDBusProxy *proxy,
|
|
|
|
gpointer result_tag,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
gboolean _gsecret_util_get_properties_finish (GDBusProxy *proxy,
|
|
|
|
gpointer result_tag,
|
|
|
|
GAsyncResult *result,
|
|
|
|
GError **error);
|
|
|
|
|
2012-01-16 14:08:29 +00:00
|
|
|
void _gsecret_util_set_property (GDBusProxy *proxy,
|
|
|
|
const gchar *property,
|
|
|
|
GVariant *value,
|
|
|
|
gpointer result_tag,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
gboolean _gsecret_util_set_property_finish (GDBusProxy *proxy,
|
|
|
|
gpointer result_tag,
|
|
|
|
GAsyncResult *result,
|
|
|
|
GError **error);
|
|
|
|
|
|
|
|
gboolean _gsecret_util_set_property_sync (GDBusProxy *proxy,
|
|
|
|
const gchar *property,
|
|
|
|
GVariant *value,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GError **error);
|
|
|
|
|
2012-01-23 16:20:18 +00:00
|
|
|
gboolean _gsecret_util_have_cached_properties (GDBusProxy *proxy);
|
|
|
|
|
2012-01-11 06:44:32 +00:00
|
|
|
void _gsecret_service_set_default_bus_name (const gchar *bus_name);
|
|
|
|
|
2012-01-23 16:20:18 +00:00
|
|
|
GSecretSession * _gsecret_service_get_session (GSecretService *self);
|
2011-09-25 06:22:36 +00:00
|
|
|
|
2012-01-23 16:20:18 +00:00
|
|
|
void _gsecret_service_take_session (GSecretService *self,
|
|
|
|
GSecretSession *session);
|
2011-09-25 06:22:36 +00:00
|
|
|
|
2012-01-26 13:34:37 +00:00
|
|
|
void _gsecret_service_delete_path (GSecretService *self,
|
|
|
|
const gchar *object_path,
|
|
|
|
gboolean is_an_item,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2012-01-20 14:10:35 +00:00
|
|
|
GSecretItem * _gsecret_service_find_item_instance (GSecretService *self,
|
|
|
|
const gchar *item_path);
|
|
|
|
|
|
|
|
GSecretItem * _gsecret_collection_find_item_instance (GSecretCollection *self,
|
|
|
|
const gchar *item_path);
|
|
|
|
|
2012-01-16 14:08:29 +00:00
|
|
|
gchar * _gsecret_value_unref_to_password (GSecretValue *value);
|
|
|
|
|
2012-01-23 16:20:18 +00:00
|
|
|
void _gsecret_session_free (gpointer data);
|
|
|
|
|
|
|
|
const gchar * _gsecret_session_get_algorithms (GSecretSession *session);
|
|
|
|
|
|
|
|
const gchar * _gsecret_session_get_path (GSecretSession *session);
|
|
|
|
|
|
|
|
void _gsecret_session_open (GSecretService *service,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2012-01-25 13:26:52 +00:00
|
|
|
gboolean _gsecret_session_open_finish (GAsyncResult *result,
|
2012-01-23 16:20:18 +00:00
|
|
|
GError **error);
|
|
|
|
|
|
|
|
GVariant * _gsecret_session_encode_secret (GSecretSession *session,
|
|
|
|
GSecretValue *value);
|
|
|
|
|
|
|
|
GSecretValue * _gsecret_session_decode_secret (GSecretSession *session,
|
|
|
|
GVariant *encoded);
|
|
|
|
|
2011-09-25 06:22:36 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __G_SERVICE_H___ */
|