goa: Add missing linker flag (for real).
[platform/upstream/evolution-data-server.git] / libedataserver / e-source-authenticator.h
1 /*
2  * e-source-authenticator.h
3  *
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.
8  *
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.
13  *
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/>
16  *
17  */
18
19 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
20 #error "Only <libedataserver/libedataserver.h> should be included directly."
21 #endif
22
23 #ifndef E_SOURCE_AUTHENTICATOR_H
24 #define E_SOURCE_AUTHENTICATOR_H
25
26 #include <libedataserver/e-source.h>
27 #include <libedataserver/e-source-enums.h>
28
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))
41
42 G_BEGIN_DECLS
43
44 /**
45  * ESourceAuthenticator:
46  *
47  * Since: 3.6
48  **/
49 typedef struct _ESourceAuthenticator ESourceAuthenticator;
50 typedef struct _ESourceAuthenticatorInterface ESourceAuthenticatorInterface;
51
52 /**
53  * ESourceAuthenticatorInterface:
54  *
55  * Since: 3.6
56  **/
57 struct _ESourceAuthenticatorInterface {
58         GTypeInterface parent_interface;
59
60         void            (*get_prompt_strings)   (ESourceAuthenticator *auth,
61                                                  ESource *source,
62                                                  gchar **prompt_title,
63                                                  gchar **prompt_message,
64                                                  gchar **prompt_description);
65
66         /* Synchronous I/O Methods */
67         ESourceAuthenticationResult
68                         (*try_password_sync)    (ESourceAuthenticator *auth,
69                                                  const GString *password,
70                                                  GCancellable *cancellable,
71                                                  GError **error);
72
73         /* Asynchronous I/O Methods (all have defaults) */
74         void            (*try_password)         (ESourceAuthenticator *auth,
75                                                  const GString *password,
76                                                  GCancellable *cancellable,
77                                                  GAsyncReadyCallback callback,
78                                                  gpointer user_data);
79         ESourceAuthenticationResult
80                         (*try_password_finish)  (ESourceAuthenticator *auth,
81                                                  GAsyncResult *result,
82                                                  GError **error);
83 };
84
85 GType           e_source_authenticator_get_type (void) G_GNUC_CONST;
86 void            e_source_authenticator_get_prompt_strings
87                                                 (ESourceAuthenticator *auth,
88                                                  ESource *source,
89                                                  gchar **prompt_title,
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,
97                                                  GError **error);
98 void            e_source_authenticator_try_password
99                                                 (ESourceAuthenticator *auth,
100                                                  const GString *password,
101                                                  GCancellable *cancellable,
102                                                  GAsyncReadyCallback callback,
103                                                  gpointer user_data);
104 ESourceAuthenticationResult
105                 e_source_authenticator_try_password_finish
106                                                 (ESourceAuthenticator *auth,
107                                                  GAsyncResult *result,
108                                                  GError **error);
109
110 G_END_DECLS
111
112 #endif /* E_SOURCE_AUTHENTICATOR_H */