2 * e-authentication-session.h
4 * This library is free software you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, see <http://www.gnu.org/licenses/>.
18 #if !defined (__LIBEBACKEND_H_INSIDE__) && !defined (LIBEBACKEND_COMPILATION)
19 #error "Only <libebackend/libebackend.h> should be included directly."
22 #ifndef E_AUTHENTICATION_SESSION_H
23 #define E_AUTHENTICATION_SESSION_H
27 #include <libedataserver/libedataserver.h>
29 #include <libebackend/e-backend-enums.h>
31 /* Standard GObject macros */
32 #define E_TYPE_AUTHENTICATION_SESSION \
33 (e_authentication_session_get_type ())
34 #define E_AUTHENTICATION_SESSION(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST \
36 ((obj), E_TYPE_AUTHENTICATION_SESSION, EAuthenticationSession))
37 #define E_AUTHENTICATION_SESSION_CLASS(cls) \
38 (G_TYPE_CHECK_CLASS_CAST \
39 ((cls), E_TYPE_AUTHENTICATION_SESSION, EAuthenticationSessionClass))
40 #define E_IS_AUTHENTICATION_SESSION(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE \
42 ((obj), E_TYPE_AUTHENTICATION_SESSION))
43 #define E_IS_AUTHENTICATION_SESSION_CLASS(cls) \
44 (G_TYPE_CHECK_CLASS_TYPE \
45 ((cls), E_TYPE_AUTHENTICATION_SESSION))
46 #define E_AUTHENTICATION_SESSION_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS \
48 ((obj), E_TYPE_AUTHENTICATION_SESSION, EAuthenticationSessionClass))
52 struct _ESourceRegistryServer;
54 typedef struct _EAuthenticationSession EAuthenticationSession;
55 typedef struct _EAuthenticationSessionClass EAuthenticationSessionClass;
56 typedef struct _EAuthenticationSessionPrivate EAuthenticationSessionPrivate;
59 * EAuthenticationSession:
61 * Contains only private data that should be read and manipulated using the
66 struct _EAuthenticationSession {
69 EAuthenticationSessionPrivate *priv;
73 * EAuthenticationSessionClass:
74 * @execute_sync: Authenticate synchronously
75 * @execute: Initiate authentication
76 * @execute_finish: Complete authentication
78 * Class structure for the #EAuthenticationSession object
82 struct _EAuthenticationSessionClass {
84 GObjectClass parent_class;
89 EAuthenticationSessionResult
90 (*execute_sync) (EAuthenticationSession *session,
91 GCancellable *cancellable,
93 void (*execute) (EAuthenticationSession *session,
95 GCancellable *cancellable,
96 GAsyncReadyCallback callback,
98 EAuthenticationSessionResult
100 (EAuthenticationSession *session,
101 GAsyncResult *result,
105 /* Reserved slots. */
106 gpointer reserved[16];
109 GQuark e_authentication_session_error_quark
111 GType e_authentication_session_get_type
113 struct _ESourceRegistryServer *
114 e_authentication_session_get_server
115 (EAuthenticationSession *session);
116 ESourceAuthenticator *
117 e_authentication_session_get_authenticator
118 (EAuthenticationSession *session);
119 const gchar * e_authentication_session_get_source_uid
120 (EAuthenticationSession *session);
121 const gchar * e_authentication_session_get_prompt_title
122 (EAuthenticationSession *session);
123 gchar * e_authentication_session_dup_prompt_title
124 (EAuthenticationSession *session);
125 void e_authentication_session_set_prompt_title
126 (EAuthenticationSession *session,
127 const gchar *prompt_title);
128 const gchar * e_authentication_session_get_prompt_message
129 (EAuthenticationSession *session);
130 gchar * e_authentication_session_dup_prompt_message
131 (EAuthenticationSession *session);
132 void e_authentication_session_set_prompt_message
133 (EAuthenticationSession *session,
134 const gchar *prompt_message);
135 const gchar * e_authentication_session_get_prompt_description
136 (EAuthenticationSession *session);
137 gchar * e_authentication_session_dup_prompt_description
138 (EAuthenticationSession *session);
139 void e_authentication_session_set_prompt_description
140 (EAuthenticationSession *session,
141 const gchar *prompt_description);
142 EAuthenticationSessionResult
143 e_authentication_session_execute_sync
144 (EAuthenticationSession *session,
145 GCancellable *cancellable,
147 void e_authentication_session_execute
148 (EAuthenticationSession *session,
150 GCancellable *cancellable,
151 GAsyncReadyCallback callback,
153 EAuthenticationSessionResult
154 e_authentication_session_execute_finish
155 (EAuthenticationSession *session,
156 GAsyncResult *result,
159 #ifndef EDS_DISABLE_DEPRECATED
161 * E_AUTHENTICATION_SESSION_KEYRING_ERROR:
163 * Error domain for password storage and retrieval.
169 * Deprecated: 3.8: The #SECRET_ERROR domain is now used instead.
171 #define E_AUTHENTICATION_SESSION_KEYRING_ERROR \
172 (e_authentication_session_error_quark ())
174 EAuthenticationSession *
175 e_authentication_session_new
176 (struct _ESourceRegistryServer *server,
177 ESourceAuthenticator *authenticator,
178 const gchar *source_uid);
179 gboolean e_authentication_session_store_password_sync
180 (EAuthenticationSession *session,
181 const gchar *password,
182 gboolean permanently,
183 GCancellable *cancellable,
185 void e_authentication_session_store_password
186 (EAuthenticationSession *session,
187 const gchar *password,
188 gboolean permanently,
190 GCancellable *cancellable,
191 GAsyncReadyCallback callback,
193 gboolean e_authentication_session_store_password_finish
194 (EAuthenticationSession *session,
195 GAsyncResult *result,
197 gboolean e_authentication_session_lookup_password_sync
198 (EAuthenticationSession *session,
199 GCancellable *cancellable,
202 void e_authentication_session_lookup_password
203 (EAuthenticationSession *session,
205 GCancellable *cancellable,
206 GAsyncReadyCallback callback,
208 gboolean e_authentication_session_lookup_password_finish
209 (EAuthenticationSession *session,
210 GAsyncResult *result,
213 gboolean e_authentication_session_delete_password_sync
214 (EAuthenticationSession *session,
215 GCancellable *cancellable,
217 void e_authentication_session_delete_password
218 (EAuthenticationSession *session,
220 GCancellable *cancellable,
221 GAsyncReadyCallback callback,
223 gboolean e_authentication_session_delete_password_finish
224 (EAuthenticationSession *session,
225 GAsyncResult *result,
227 #endif /* EDS_DISABLE_DEPRECATED */
231 #endif /* E_AUTHENTICATION_SESSION_H */