2 * e-source-authenticator.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 (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
19 #error "Only <libedataserver/libedataserver.h> should be included directly."
22 #ifndef E_SOURCE_AUTHENTICATOR_H
23 #define E_SOURCE_AUTHENTICATOR_H
25 #include <libedataserver/e-source.h>
26 #include <libedataserver/e-source-enums.h>
28 /* Standard GObject macros */
29 #define E_TYPE_SOURCE_AUTHENTICATOR \
30 (e_source_authenticator_get_type ())
31 #define E_SOURCE_AUTHENTICATOR(obj) \
32 (G_TYPE_CHECK_INSTANCE_CAST \
33 ((obj), E_TYPE_SOURCE_AUTHENTICATOR, ESourceAuthenticator))
34 #define E_IS_SOURCE_AUTHENTICATOR(obj) \
35 (G_TYPE_CHECK_INSTANCE_TYPE \
36 ((obj), E_TYPE_SOURCE_AUTHENTICATOR))
37 #define E_SOURCE_AUTHENTICATOR_GET_INTERFACE(obj) \
38 (G_TYPE_INSTANCE_GET_INTERFACE \
39 ((obj), E_TYPE_SOURCE_AUTHENTICATOR, ESourceAuthenticatorInterface))
44 * ESourceAuthenticator:
48 typedef struct _ESourceAuthenticator ESourceAuthenticator;
49 typedef struct _ESourceAuthenticatorInterface ESourceAuthenticatorInterface;
52 * ESourceAuthenticatorInterface:
56 struct _ESourceAuthenticatorInterface {
57 GTypeInterface parent_interface;
59 void (*get_prompt_strings) (ESourceAuthenticator *auth,
62 gchar **prompt_message,
63 gchar **prompt_description);
65 gboolean (*get_without_password) (ESourceAuthenticator *auth);
67 /* Synchronous I/O Methods */
68 ESourceAuthenticationResult
69 (*try_password_sync) (ESourceAuthenticator *auth,
70 const GString *password,
71 GCancellable *cancellable,
74 /* Asynchronous I/O Methods (all have defaults) */
75 void (*try_password) (ESourceAuthenticator *auth,
76 const GString *password,
77 GCancellable *cancellable,
78 GAsyncReadyCallback callback,
80 ESourceAuthenticationResult
81 (*try_password_finish) (ESourceAuthenticator *auth,
86 GType e_source_authenticator_get_type (void) G_GNUC_CONST;
87 void e_source_authenticator_get_prompt_strings
88 (ESourceAuthenticator *auth,
91 gchar **prompt_message,
92 gchar **prompt_description);
93 gboolean e_source_authenticator_get_without_password
94 (ESourceAuthenticator *auth);
95 ESourceAuthenticationResult
96 e_source_authenticator_try_password_sync
97 (ESourceAuthenticator *auth,
98 const GString *password,
99 GCancellable *cancellable,
101 void e_source_authenticator_try_password
102 (ESourceAuthenticator *auth,
103 const GString *password,
104 GCancellable *cancellable,
105 GAsyncReadyCallback callback,
107 ESourceAuthenticationResult
108 e_source_authenticator_try_password_finish
109 (ESourceAuthenticator *auth,
110 GAsyncResult *result,
115 #endif /* E_SOURCE_AUTHENTICATOR_H */