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;
52
struct _ESourceAuthenticatorInterface {
53
GTypeInterface parent_interface;
55
void (*get_prompt_strings) (ESourceAuthenticator *auth,
58
gchar **prompt_message,
59
gchar **prompt_description);
61
/* Synchronous I/O Methods */
62
ESourceAuthenticationResult
63
(*try_password_sync) (ESourceAuthenticator *auth,
64
const GString *password,
65
GCancellable *cancellable,
68
/* Asynchronous I/O Methods (all have defaults) */
69
void (*try_password) (ESourceAuthenticator *auth,
70
const GString *password,
71
GCancellable *cancellable,
72
GAsyncReadyCallback callback,
74
ESourceAuthenticationResult
75
(*try_password_finish) (ESourceAuthenticator *auth,
80
GType e_source_authenticator_get_type (void) G_GNUC_CONST;
81
void e_source_authenticator_get_prompt_strings
82
(ESourceAuthenticator *auth,
85
gchar **prompt_message,
86
gchar **prompt_description);
87
ESourceAuthenticationResult
88
e_source_authenticator_try_password_sync
89
(ESourceAuthenticator *auth,
90
const GString *password,
91
GCancellable *cancellable,
93
void e_source_authenticator_try_password
94
(ESourceAuthenticator *auth,
95
const GString *password,
96
GCancellable *cancellable,
97
GAsyncReadyCallback callback,
99
ESourceAuthenticationResult
100
e_source_authenticator_try_password_finish
101
(ESourceAuthenticator *auth,
102
GAsyncResult *result,
107
#endif /* E_SOURCE_AUTHENTICATOR_H */