gcr: Fix up documentation for recent prompting work
[platform/upstream/gcr.git] / gcr / gcr-system-prompt.h
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, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19  * 02111-1307, USA.
20  *
21  * Author: Stef Walter <stef@thewalter.net>
22  */
23
24 #if !defined (__GCR_INSIDE_HEADER__) && !defined (GCR_COMPILATION)
25 #error "Only <gcr/gcr.h> or <gcr/gcr-base.h> can be included directly."
26 #endif
27
28 #ifndef __GCR_SYSTEM_PROMPT_H__
29 #define __GCR_SYSTEM_PROMPT_H__
30
31 #include "gcr-types.h"
32 #include "gcr-secret-exchange.h"
33
34 #include <glib-object.h>
35
36 G_BEGIN_DECLS
37
38 typedef enum {
39         GCR_SYSTEM_PROMPT_IN_PROGRESS = 1,
40 } GcrSystemPromptError;
41
42 #define GCR_SYSTEM_PROMPT_ERROR              (gcr_system_prompt_error_get_domain ())
43
44 GQuark           gcr_system_prompt_error_get_domain     (void) G_GNUC_CONST;
45
46 #define GCR_TYPE_SYSTEM_PROMPT               (gcr_system_prompt_get_type ())
47 #define GCR_SYSTEM_PROMPT(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_SYSTEM_PROMPT, GcrSystemPrompt))
48 #define GCR_SYSTEM_PROMPT_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_SYSTEM_PROMPT, GcrSystemPromptClass))
49 #define GCR_IS_SYSTEM_PROMPT(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_SYSTEM_PROMPT))
50 #define GCR_IS_SYSTEM_PROMPT_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GCR_TYPE_SYSTEM_PROMPT))
51 #define GCR_SYSTEM_PROMPT_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GCR_TYPE_SYSTEM_PROMPT, GcrSystemPromptClass))
52
53 typedef struct _GcrSystemPrompt GcrSystemPrompt;
54 typedef struct _GcrSystemPromptClass GcrSystemPromptClass;
55 typedef struct _GcrSystemPromptPrivate GcrSystemPromptPrivate;
56
57 struct _GcrSystemPrompt {
58         GObject parent;
59
60         /*< private >*/
61         GcrSystemPromptPrivate *pv;
62 };
63
64 struct _GcrSystemPromptClass {
65         GObjectClass parent_class;
66 };
67
68 GType                gcr_system_prompt_get_type                  (void);
69
70 GcrSecretExchange *  gcr_system_prompt_get_secret_exchange       (GcrSystemPrompt *self);
71
72 void                 gcr_system_prompt_open_async                (gint timeout_seconds,
73                                                                   GCancellable *cancellable,
74                                                                   GAsyncReadyCallback callback,
75                                                                   gpointer user_data);
76
77 void                 gcr_system_prompt_open_for_prompter_async   (const gchar *prompter_name,
78                                                                   gint timeout_seconds,
79                                                                   GCancellable *cancellable,
80                                                                   GAsyncReadyCallback callback,
81                                                                   gpointer user_data);
82
83
84 GcrSystemPrompt *    gcr_system_prompt_open_finish               (GAsyncResult *result,
85                                                                   GError **error);
86
87 GcrSystemPrompt *    gcr_system_prompt_open_for_prompter         (const gchar *prompter_name,
88                                                                   gint timeout_seconds,
89                                                                   GCancellable *cancellable,
90                                                                   GError **error);
91
92 GcrSystemPrompt *    gcr_system_prompt_open                      (gint timeout_seconds,
93                                                                   GCancellable *cancellable,
94                                                                   GError **error);
95
96 gboolean             gcr_system_prompt_close                     (GcrSystemPrompt *self,
97                                                                   GCancellable *cancellable,
98                                                                   GError **error);
99
100 void                 gcr_system_prompt_close_async               (GcrSystemPrompt *self,
101                                                                   GCancellable *cancellable,
102                                                                   GAsyncReadyCallback callback,
103                                                                   gpointer user_data);
104
105 gboolean             gcr_system_prompt_close_finish              (GcrSystemPrompt *self,
106                                                                   GAsyncResult *result,
107                                                                   GError **error);
108
109 G_END_DECLS
110
111 #endif /* __GCR_SYSTEM_PROMPT_H__ */