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 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
20 #error "Only <libedataserver/libedataserver.h> should be included directly."
23 #ifndef E_SOURCE_AUTHENTICATOR_H
24 #define E_SOURCE_AUTHENTICATOR_H
26 #include <libedataserver/e-source.h>
27 #include <libedataserver/e-source-enums.h>
29 /* Standard GObject macros */
30 #define E_TYPE_SOURCE_AUTHENTICATOR \
31 (e_source_authenticator_get_type ())
32 #define E_SOURCE_AUTHENTICATOR(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST \
34 ((obj), E_TYPE_SOURCE_AUTHENTICATOR, ESourceAuthenticator))
35 #define E_IS_SOURCE_AUTHENTICATOR(obj) \
36 (G_TYPE_CHECK_INSTANCE_TYPE \
37 ((obj), E_TYPE_SOURCE_AUTHENTICATOR))
38 #define E_SOURCE_AUTHENTICATOR_GET_INTERFACE(obj) \
39 (G_TYPE_INSTANCE_GET_INTERFACE \
40 ((obj), E_TYPE_SOURCE_AUTHENTICATOR, ESourceAuthenticatorInterface))
45 * ESourceAuthenticator:
49 typedef struct _ESourceAuthenticator ESourceAuthenticator;
50 typedef struct _ESourceAuthenticatorInterface ESourceAuthenticatorInterface;
53 * ESourceAuthenticatorInterface:
57 struct _ESourceAuthenticatorInterface {
58 GTypeInterface parent_interface;
60 void (*get_prompt_strings) (ESourceAuthenticator *auth,
63 gchar **prompt_message,
64 gchar **prompt_description);
66 /* Synchronous I/O Methods */
67 ESourceAuthenticationResult
68 (*try_password_sync) (ESourceAuthenticator *auth,
69 const GString *password,
70 GCancellable *cancellable,
73 /* Asynchronous I/O Methods (all have defaults) */
74 void (*try_password) (ESourceAuthenticator *auth,
75 const GString *password,
76 GCancellable *cancellable,
77 GAsyncReadyCallback callback,
79 ESourceAuthenticationResult
80 (*try_password_finish) (ESourceAuthenticator *auth,
85 GType e_source_authenticator_get_type (void) G_GNUC_CONST;
86 void e_source_authenticator_get_prompt_strings
87 (ESourceAuthenticator *auth,
90 gchar **prompt_message,
91 gchar **prompt_description);
92 ESourceAuthenticationResult
93 e_source_authenticator_try_password_sync
94 (ESourceAuthenticator *auth,
95 const GString *password,
96 GCancellable *cancellable,
98 void e_source_authenticator_try_password
99 (ESourceAuthenticator *auth,
100 const GString *password,
101 GCancellable *cancellable,
102 GAsyncReadyCallback callback,
104 ESourceAuthenticationResult
105 e_source_authenticator_try_password_finish
106 (ESourceAuthenticator *auth,
107 GAsyncResult *result,
112 #endif /* E_SOURCE_AUTHENTICATOR_H */