2 * e-source-authenticator.h
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
19 #ifndef E_SOURCE_AUTHENTICATOR_H
20 #define E_SOURCE_AUTHENTICATOR_H
22 #include <libedataserver/e-source.h>
23 #include <libedataserver/e-source-enums.h>
25 /* Standard GObject macros */
26 #define E_TYPE_SOURCE_AUTHENTICATOR \
27 (e_source_authenticator_get_type ())
28 #define E_SOURCE_AUTHENTICATOR(obj) \
29 (G_TYPE_CHECK_INSTANCE_CAST \
30 ((obj), E_TYPE_SOURCE_AUTHENTICATOR, ESourceAuthenticator))
31 #define E_IS_SOURCE_AUTHENTICATOR(obj) \
32 (G_TYPE_CHECK_INSTANCE_TYPE \
33 ((obj), E_TYPE_SOURCE_AUTHENTICATOR))
34 #define E_SOURCE_AUTHENTICATOR_GET_INTERFACE(obj) \
35 (G_TYPE_INSTANCE_GET_INTERFACE \
36 ((obj), E_TYPE_SOURCE_AUTHENTICATOR, ESourceAuthenticatorInterface))
41 * ESourceAuthenticator:
45 typedef struct _ESourceAuthenticator ESourceAuthenticator;
46 typedef struct _ESourceAuthenticatorInterface ESourceAuthenticatorInterface;
48 struct _ESourceAuthenticatorInterface {
49 GTypeInterface parent_interface;
51 void (*get_prompt_strings) (ESourceAuthenticator *auth,
54 gchar **prompt_message,
55 gchar **prompt_description);
57 /* Synchronous I/O Methods */
58 ESourceAuthenticationResult
59 (*try_password_sync) (ESourceAuthenticator *auth,
60 const GString *password,
61 GCancellable *cancellable,
64 /* Asynchronous I/O Methods (all have defaults) */
65 void (*try_password) (ESourceAuthenticator *auth,
66 const GString *password,
67 GCancellable *cancellable,
68 GAsyncReadyCallback callback,
70 ESourceAuthenticationResult
71 (*try_password_finish) (ESourceAuthenticator *auth,
76 GType e_source_authenticator_get_type (void) G_GNUC_CONST;
77 void e_source_authenticator_get_prompt_strings
78 (ESourceAuthenticator *auth,
81 gchar **prompt_message,
82 gchar **prompt_description);
83 ESourceAuthenticationResult
84 e_source_authenticator_try_password_sync
85 (ESourceAuthenticator *auth,
86 const GString *password,
87 GCancellable *cancellable,
89 void e_source_authenticator_try_password
90 (ESourceAuthenticator *auth,
91 const GString *password,
92 GCancellable *cancellable,
93 GAsyncReadyCallback callback,
95 ESourceAuthenticationResult
96 e_source_authenticator_try_password_finish
97 (ESourceAuthenticator *auth,
103 #endif /* E_SOURCE_AUTHENTICATOR_H */