updated changelog
[platform/upstream/evolution-data-server.git] / libebackend / e-oauth2-support.h
1 /*
2  * e-oauth2-support.h
3  *
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.
7  *
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
11  * for more details.
12  *
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/>.
15  *
16  */
17
18 #if !defined (__LIBEBACKEND_H_INSIDE__) && !defined (LIBEBACKEND_COMPILATION)
19 #error "Only <libebackend/libebackend.h> should be included directly."
20 #endif
21
22 #ifndef E_OAUTH2_SUPPORT_H
23 #define E_OAUTH2_SUPPORT_H
24
25 #include <libedataserver/libedataserver.h>
26
27 /* Standard GObject macros */
28 #define E_TYPE_OAUTH2_SUPPORT \
29         (e_oauth2_support_get_type ())
30 #define E_OAUTH2_SUPPORT(obj) \
31         (G_TYPE_CHECK_INSTANCE_CAST \
32         ((obj), E_TYPE_OAUTH2_SUPPORT, EOAuth2Support))
33 #define E_IS_OAUTH2_SUPPORT(obj) \
34         (G_TYPE_CHECK_INSTANCE_TYPE \
35         ((obj), E_TYPE_OAUTH2_SUPPORT))
36 #define E_OAUTH2_SUPPORT_GET_INTERFACE(obj) \
37         (G_TYPE_INSTANCE_GET_INTERFACE \
38         ((obj), E_TYPE_OAUTH2_SUPPORT, EOAuth2SupportInterface))
39
40 G_BEGIN_DECLS
41
42 /**
43  * EOAuth2Support:
44  *
45  * Since: 3.8
46  **/
47 typedef struct _EOAuth2Support EOAuth2Support;
48 typedef struct _EOAuth2SupportInterface EOAuth2SupportInterface;
49
50 /**
51  * EOAuth2SupportInterface:
52  *
53  * Since: 3.8
54  **/
55 struct _EOAuth2SupportInterface {
56         GTypeInterface parent_interface;
57
58         /* Synchronous I/O Methods */
59         gboolean        (*get_access_token_sync)
60                                                 (EOAuth2Support *support,
61                                                  ESource *source,
62                                                  GCancellable *cancellable,
63                                                  gchar **out_access_token,
64                                                  gint *out_expires_in,
65                                                  GError **error);
66
67         /* Asynchronous I/O Methods (all have defaults) */
68         void            (*get_access_token)     (EOAuth2Support *support,
69                                                  ESource *source,
70                                                  GCancellable *cancellable,
71                                                  GAsyncReadyCallback callback,
72                                                  gpointer user_data);
73         gboolean        (*get_access_token_finish)
74                                                 (EOAuth2Support *support,
75                                                  GAsyncResult *result,
76                                                  gchar **out_access_token,
77                                                  gint *out_expires_in,
78                                                  GError **error);
79 };
80
81 GType           e_oauth2_support_get_type       (void) G_GNUC_CONST;
82 gboolean        e_oauth2_support_get_access_token_sync
83                                                 (EOAuth2Support *support,
84                                                  ESource *source,
85                                                  GCancellable *cancellable,
86                                                  gchar **out_access_token,
87                                                  gint *out_expires_in,
88                                                  GError **error);
89 void            e_oauth2_support_get_access_token
90                                                 (EOAuth2Support *support,
91                                                  ESource *source,
92                                                  GCancellable *cancellable,
93                                                  GAsyncReadyCallback callback,
94                                                  gpointer user_data);
95 gboolean        e_oauth2_support_get_access_token_finish
96                                                 (EOAuth2Support *support,
97                                                  GAsyncResult *result,
98                                                  gchar **out_access_token,
99                                                  gint *out_expires_in,
100                                                  GError **error);
101
102 G_END_DECLS
103
104 #endif /* E_OAUTH2_SUPPORT_H */
105