summaryrefslogtreecommitdiff
path: root/gcr/gcr-system-prompter.h
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-11-21 08:46:47 +0100
committerStef Walter <stefw@collabora.co.uk>2011-12-17 12:00:19 +0100
commitb548891251edd0bf2afc9651c36ac3c7d1248e00 (patch)
tree7157655a0daa48835cc2c7df3356caf365a62e81 /gcr/gcr-system-prompter.h
parent4f19ddbf4e1f9c84594e6967584e4ad60254f828 (diff)
downloadgcr-b548891251edd0bf2afc9651c36ac3c7d1248e00.tar.gz
gcr: Rework how prompter works by introducing GcrPrompt interface
* GcrSystemPrompt is an implementation of GcrPrompt which calls to GcrSystemPrompter * GcrSystemPrompter creates GcrPrompt objects on its side which do the actual prompting.
Diffstat (limited to 'gcr/gcr-system-prompter.h')
-rw-r--r--gcr/gcr-system-prompter.h63
1 files changed, 17 insertions, 46 deletions
diff --git a/gcr/gcr-system-prompter.h b/gcr/gcr-system-prompter.h
index b697473..8549924 100644
--- a/gcr/gcr-system-prompter.h
+++ b/gcr/gcr-system-prompter.h
@@ -28,12 +28,18 @@
#ifndef __GCR_SYSTEM_PROMPTER_H__
#define __GCR_SYSTEM_PROMPTER_H__
+#include "gcr-secret-exchange.h"
#include "gcr-types.h"
#include <glib-object.h>
G_BEGIN_DECLS
+typedef enum {
+ GCR_SYSTEM_PROMPTER_SINGLE,
+ GCR_SYSTEM_PROMPTER_MULTIPLE
+} GcrSystemPrompterMode;
+
#define GCR_TYPE_SYSTEM_PROMPTER (gcr_system_prompter_get_type ())
#define GCR_SYSTEM_PROMPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_SYSTEM_PROMPTER, GcrSystemPrompter))
#define GCR_SYSTEM_PROMPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_SYSTEM_PROMPTER, GcrSystemPrompterClass))
@@ -52,61 +58,26 @@ struct _GcrSystemPrompter {
struct _GcrSystemPrompterClass {
GObjectClass parent_class;
-
- void (*open) (GcrSystemPrompter *self);
-
- gboolean (*prompt_password) (GcrSystemPrompter *self);
-
- gboolean (*prompt_confirm) (GcrSystemPrompter *self);
-
- void (*responded) (GcrSystemPrompter *self);
-
- void (*close) (GcrSystemPrompter *self);
};
-GType gcr_system_prompter_get_type (void) G_GNUC_CONST;
-
-GcrSystemPrompter * gcr_system_prompter_new (void);
-
-void gcr_system_prompter_register (GcrSystemPrompter *self,
- GDBusConnection *connection);
-
-void gcr_system_prompter_unregister (GcrSystemPrompter *self,
- GDBusConnection *connection);
-
-const gchar * gcr_system_prompter_get_title (GcrSystemPrompter *self);
-
-const gchar * gcr_system_prompter_get_message (GcrSystemPrompter *self);
-
-const gchar * gcr_system_prompter_get_description (GcrSystemPrompter *self);
-
-const gchar * gcr_system_prompter_get_warning (GcrSystemPrompter *self);
+GType gcr_system_prompter_get_type (void) G_GNUC_CONST;
-void gcr_system_prompter_set_warning (GcrSystemPrompter *self,
- const gchar *warning);
+GcrSystemPrompter * gcr_system_prompter_new (GcrSystemPrompterMode mode,
+ GType prompt_type);
-gboolean gcr_system_prompter_get_password_new (GcrSystemPrompter *self);
+GcrSystemPrompterMode gcr_system_prompter_get_mode (GcrSystemPrompter *self);
-gint gcr_system_prompter_get_password_strength (GcrSystemPrompter *self);
+GType gcr_system_prompter_get_prompt_type (GcrSystemPrompter *self);
-void gcr_system_prompter_set_password_strength (GcrSystemPrompter *self,
- gint strength);
+gint gcr_system_prompter_get_showing (GcrSystemPrompter *self);
-const gchar * gcr_system_prompter_get_choice_label (GcrSystemPrompter *self);
+void gcr_system_prompter_stop_all (GcrSystemPrompter *self);
-gboolean gcr_system_prompter_get_choice_chosen (GcrSystemPrompter *self);
-
-void gcr_system_prompter_set_choice_chosen (GcrSystemPrompter *self,
- gboolean chosen);
-
-const gchar * gcr_system_prompter_get_caller_window (GcrSystemPrompter *self);
-
-void gcr_system_prompter_respond_cancelled (GcrSystemPrompter *self);
-
-void gcr_system_prompter_respond_with_password (GcrSystemPrompter *self,
- const gchar *password);
+void gcr_system_prompter_register (GcrSystemPrompter *self,
+ GDBusConnection *connection);
-void gcr_system_prompter_respond_confirmed (GcrSystemPrompter *self);
+void gcr_system_prompter_unregister (GcrSystemPrompter *self,
+ gboolean wait);
G_END_DECLS