Branch data Line data Source code
1 : : /*
2 : : * gnome-keyring
3 : : *
4 : : * Copyright (C) 2011 Stefan Walter
5 : : *
6 : : * This program is free software; you can redistribute it and/or modify
7 : : * it under the terms of the GNU Lesser General Public License as
8 : : * published by the Free Software Foundation; either version 2.1 of
9 : : * the License, or (at your option) any later version.
10 : : *
11 : : * This program is distributed in the hope that it will be useful, but
12 : : * WITHOUT ANY WARRANTY; without even the implied warranty of
13 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 : : * Lesser General Public License for more details.
15 : : *
16 : : * You should have received a copy of the GNU Lesser General Public
17 : : * License along with this program; if not, see <http://www.gnu.org/licenses/>.
18 : : *
19 : : * Author: Stef Walter <stef@thewalter.net>
20 : : */
21 : :
22 : : #ifndef __GCR_PROMPT_H__
23 : : #define __GCR_PROMPT_H__
24 : :
25 : : #if !defined (__GCR_INSIDE_HEADER__) && !defined (GCR_COMPILATION)
26 : : #error "Only <gcr/gcr.h> can be included directly."
27 : : #endif
28 : :
29 : : #include "gcr-types.h"
30 : :
31 : : #include <glib-object.h>
32 : :
33 : : G_BEGIN_DECLS
34 : :
35 : : typedef enum {
36 : : GCR_PROMPT_REPLY_CANCEL = 0,
37 : : GCR_PROMPT_REPLY_CONTINUE = 1,
38 : : } GcrPromptReply;
39 : :
40 : : #define GCR_TYPE_PROMPT gcr_prompt_get_type ()
41 [ - + + - : 370 : G_DECLARE_INTERFACE (GcrPrompt, gcr_prompt, GCR, PROMPT, GObject)
- + ]
42 : :
43 : : struct _GcrPromptInterface {
44 : : GTypeInterface parent_iface;
45 : :
46 : : void (* prompt_password_async) (GcrPrompt *prompt,
47 : : GCancellable *cancellable,
48 : : GAsyncReadyCallback callback,
49 : : gpointer user_data);
50 : :
51 : : const gchar * (* prompt_password_finish) (GcrPrompt *prompt,
52 : : GAsyncResult *result,
53 : : GError **error);
54 : :
55 : : void (* prompt_confirm_async) (GcrPrompt *prompt,
56 : : GCancellable *cancellable,
57 : : GAsyncReadyCallback callback,
58 : : gpointer user_data);
59 : :
60 : : GcrPromptReply (* prompt_confirm_finish) (GcrPrompt *prompt,
61 : : GAsyncResult *result,
62 : : GError **error);
63 : :
64 : : void (* prompt_close) (GcrPrompt *prompt);
65 : : };
66 : :
67 : : void gcr_prompt_reset (GcrPrompt *prompt);
68 : :
69 : : gchar * gcr_prompt_get_title (GcrPrompt *prompt);
70 : :
71 : : void gcr_prompt_set_title (GcrPrompt *prompt,
72 : : const gchar *title);
73 : :
74 : : gchar * gcr_prompt_get_message (GcrPrompt *prompt);
75 : :
76 : : void gcr_prompt_set_message (GcrPrompt *prompt,
77 : : const gchar *message);
78 : :
79 : : gchar * gcr_prompt_get_description (GcrPrompt *prompt);
80 : :
81 : : void gcr_prompt_set_description (GcrPrompt *prompt,
82 : : const gchar *description);
83 : :
84 : : gchar * gcr_prompt_get_warning (GcrPrompt *prompt);
85 : :
86 : : void gcr_prompt_set_warning (GcrPrompt *prompt,
87 : : const gchar *warning);
88 : :
89 : : gchar * gcr_prompt_get_choice_label (GcrPrompt *prompt);
90 : :
91 : : void gcr_prompt_set_choice_label (GcrPrompt *prompt,
92 : : const gchar *choice_label);
93 : :
94 : : gboolean gcr_prompt_get_choice_chosen (GcrPrompt *prompt);
95 : :
96 : : void gcr_prompt_set_choice_chosen (GcrPrompt *prompt,
97 : : gboolean chosen);
98 : :
99 : : gboolean gcr_prompt_get_password_new (GcrPrompt *prompt);
100 : :
101 : : void gcr_prompt_set_password_new (GcrPrompt *prompt,
102 : : gboolean new_password);
103 : :
104 : : gint gcr_prompt_get_password_strength (GcrPrompt *prompt);
105 : :
106 : : gchar * gcr_prompt_get_caller_window (GcrPrompt *prompt);
107 : :
108 : : void gcr_prompt_set_caller_window (GcrPrompt *prompt,
109 : : const gchar *window_id);
110 : :
111 : : gchar * gcr_prompt_get_continue_label (GcrPrompt *prompt);
112 : :
113 : : void gcr_prompt_set_continue_label (GcrPrompt *prompt,
114 : : const gchar *continue_label);
115 : :
116 : : gchar * gcr_prompt_get_cancel_label (GcrPrompt *prompt);
117 : :
118 : : void gcr_prompt_set_cancel_label (GcrPrompt *prompt,
119 : : const gchar *cancel_label);
120 : :
121 : : void gcr_prompt_password_async (GcrPrompt *prompt,
122 : : GCancellable *cancellable,
123 : : GAsyncReadyCallback callback,
124 : : gpointer user_data);
125 : :
126 : : const gchar * gcr_prompt_password_finish (GcrPrompt *prompt,
127 : : GAsyncResult *result,
128 : : GError **error);
129 : :
130 : : const gchar * gcr_prompt_password (GcrPrompt *prompt,
131 : : GCancellable *cancellable,
132 : : GError **error);
133 : :
134 : : const gchar * gcr_prompt_password_run (GcrPrompt *prompt,
135 : : GCancellable *cancellable,
136 : : GError **error);
137 : :
138 : : void gcr_prompt_confirm_async (GcrPrompt *prompt,
139 : : GCancellable *cancellable,
140 : : GAsyncReadyCallback callback,
141 : : gpointer user_data);
142 : :
143 : : GcrPromptReply gcr_prompt_confirm_finish (GcrPrompt *prompt,
144 : : GAsyncResult *result,
145 : : GError **error);
146 : :
147 : : GcrPromptReply gcr_prompt_confirm (GcrPrompt *prompt,
148 : : GCancellable *cancellable,
149 : : GError **error);
150 : :
151 : : GcrPromptReply gcr_prompt_confirm_run (GcrPrompt *prompt,
152 : : GCancellable *cancellable,
153 : : GError **error);
154 : :
155 : : void gcr_prompt_close (GcrPrompt *prompt);
156 : :
157 : : G_END_DECLS
158 : :
159 : : #endif /* __GCR_PROMPT_H__ */
|