goa: Add missing linker flag (for real).
[platform/upstream/evolution-data-server.git] / libedataserver / e-source.h
1 /*
2  * e-source.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_H
24 #define E_SOURCE_H
25
26 #include <gio/gio.h>
27
28 /* Standard GObject macros */
29 #define E_TYPE_SOURCE \
30         (e_source_get_type ())
31 #define E_SOURCE(obj) \
32         (G_TYPE_CHECK_INSTANCE_CAST \
33         ((obj), E_TYPE_SOURCE, ESource))
34 #define E_SOURCE_CLASS(cls) \
35         (G_TYPE_CHECK_CLASS_CAST \
36         ((cls), E_TYPE_SOURCE, ESourceClass))
37 #define E_IS_SOURCE(obj) \
38         (G_TYPE_CHECK_INSTANCE_TYPE \
39         ((obj), E_TYPE_SOURCE))
40 #define E_IS_SOURCE_CLASS(cls) \
41         (G_TYPE_CHECK_CLASS_TYPE \
42         ((cls), E_TYPE_SOURCE))
43 #define E_SOURCE_GET_CLASS(obj) \
44         (G_TYPE_INSTANCE_GET_CLASS \
45         ((obj), E_TYPE_SOURCE, ESourceClass))
46
47 /**
48  * E_SOURCE_PARAM_SETTING:
49  *
50  * Extends #GParamFlags to indicate the #GObject property is associated
51  * with a key file value.  Use this flag when installing #GObject properties
52  * in #ESourceExtension subclasses.
53  *
54  * Since: 3.6
55  **/
56 #define E_SOURCE_PARAM_SETTING (1 << G_PARAM_USER_SHIFT)
57
58 G_BEGIN_DECLS
59
60 typedef struct _ESource ESource;
61 typedef struct _ESourceClass ESourceClass;
62 typedef struct _ESourcePrivate ESourcePrivate;
63
64 /**
65  * ESource:
66  *
67  * Contains only private data that should be read and manipulated using the
68  * functions below.
69  *
70  * Since: 3.6
71  **/
72 struct _ESource {
73         GObject parent;
74         ESourcePrivate *priv;
75 };
76
77 struct _ESourceClass {
78         GObjectClass parent_class;
79
80         /* Signals */
81         void            (*changed)              (ESource *source);
82
83         /* Methods */
84         gboolean        (*remove_sync)          (ESource *source,
85                                                  GCancellable *cancellable,
86                                                  GError **error);
87         void            (*remove)               (ESource *source,
88                                                  GCancellable *cancellable,
89                                                  GAsyncReadyCallback callback,
90                                                  gpointer user_data);
91         gboolean        (*remove_finish)        (ESource *source,
92                                                  GAsyncResult *result,
93                                                  GError **error);
94         gboolean        (*write_sync)           (ESource *source,
95                                                  GCancellable *cancellable,
96                                                  GError **error);
97         void            (*write)                (ESource *source,
98                                                  GCancellable *cancellable,
99                                                  GAsyncReadyCallback callback,
100                                                  gpointer user_data);
101         gboolean        (*write_finish)         (ESource *source,
102                                                  GAsyncResult *result,
103                                                  GError **error);
104         gboolean        (*remote_create_sync)   (ESource *source,
105                                                  ESource *scratch_source,
106                                                  GCancellable *cancellable,
107                                                  GError **error);
108         void            (*remote_create)        (ESource *source,
109                                                  ESource *scratch_source,
110                                                  GCancellable *cancellable,
111                                                  GAsyncReadyCallback callback,
112                                                  gpointer user_data);
113         gboolean        (*remote_create_finish) (ESource *source,
114                                                  GAsyncResult *result,
115                                                  GError **error);
116         gboolean        (*remote_delete_sync)   (ESource *source,
117                                                  GCancellable *cancellable,
118                                                  GError **error);
119         void            (*remote_delete)        (ESource *source,
120                                                  GCancellable *cancellable,
121                                                  GAsyncReadyCallback callback,
122                                                  gpointer user_data);
123         gboolean        (*remote_delete_finish) (ESource *source,
124                                                  GAsyncResult *result,
125                                                  GError **error);
126         gboolean        (*get_oauth2_access_token_sync)
127                                                 (ESource *source,
128                                                  GCancellable *cancellable,
129                                                  gchar **out_access_token,
130                                                  gint *out_expires_in,
131                                                  GError **error);
132         void            (*get_oauth2_access_token)
133                                                 (ESource *source,
134                                                  GCancellable *cancellable,
135                                                  GAsyncReadyCallback callback,
136                                                  gpointer user_data);
137         gboolean        (*get_oauth2_access_token_finish)
138                                                 (ESource *source,
139                                                  GAsyncResult *result,
140                                                  gchar **out_access_token,
141                                                  gint *out_expires_in,
142                                                  GError **error);
143
144         /* Reserved slots. */
145         gpointer reserved[7];
146 };
147
148 GType           e_source_get_type               (void) G_GNUC_CONST;
149 ESource *       e_source_new                    (GDBusObject *dbus_object,
150                                                  GMainContext *main_context,
151                                                  GError **error);
152 ESource *       e_source_new_with_uid           (const gchar *uid,
153                                                  GMainContext *main_context,
154                                                  GError **error);
155 guint           e_source_hash                   (ESource *source);
156 gboolean        e_source_equal                  (ESource *source1,
157                                                  ESource *source2);
158 void            e_source_changed                (ESource *source);
159 const gchar *   e_source_get_uid                (ESource *source);
160 gchar *         e_source_dup_uid                (ESource *source);
161 const gchar *   e_source_get_parent             (ESource *source);
162 gchar *         e_source_dup_parent             (ESource *source);
163 void            e_source_set_parent             (ESource *source,
164                                                  const gchar *parent);
165 gboolean        e_source_get_enabled            (ESource *source);
166 void            e_source_set_enabled            (ESource *source,
167                                                  gboolean enabled);
168 gboolean        e_source_get_writable           (ESource *source);
169 gboolean        e_source_get_removable          (ESource *source);
170 gboolean        e_source_get_remote_creatable   (ESource *source);
171 gboolean        e_source_get_remote_deletable   (ESource *source);
172 gpointer        e_source_get_extension          (ESource *source,
173                                                  const gchar *extension_name);
174 gboolean        e_source_has_extension          (ESource *source,
175                                                  const gchar *extension_name);
176 GDBusObject *   e_source_ref_dbus_object        (ESource *source);
177 GMainContext *  e_source_ref_main_context       (ESource *source);
178 const gchar *   e_source_get_display_name       (ESource *source);
179 gchar *         e_source_dup_display_name       (ESource *source);
180 void            e_source_set_display_name       (ESource *source,
181                                                  const gchar *display_name);
182 gint            e_source_compare_by_display_name
183                                                 (ESource *source1,
184                                                  ESource *source2);
185 gchar *         e_source_to_string              (ESource *source,
186                                                  gsize *length);
187 gchar *         e_source_parameter_to_key       (const gchar *param_name);
188 gboolean        e_source_remove_sync            (ESource *source,
189                                                  GCancellable *cancellable,
190                                                  GError **error);
191 void            e_source_remove                 (ESource *source,
192                                                  GCancellable *cancellable,
193                                                  GAsyncReadyCallback callback,
194                                                  gpointer user_data);
195 gboolean        e_source_remove_finish          (ESource *source,
196                                                  GAsyncResult *result,
197                                                  GError **error);
198 gboolean        e_source_write_sync             (ESource *source,
199                                                  GCancellable *cancellable,
200                                                  GError **error);
201 void            e_source_write                  (ESource *source,
202                                                  GCancellable *cancellable,
203                                                  GAsyncReadyCallback callback,
204                                                  gpointer user_data);
205 gboolean        e_source_write_finish           (ESource *source,
206                                                  GAsyncResult *result,
207                                                  GError **error);
208 gboolean        e_source_remote_create_sync     (ESource *source,
209                                                  ESource *scratch_source,
210                                                  GCancellable *cancellable,
211                                                  GError **error);
212 void            e_source_remote_create          (ESource *source,
213                                                  ESource *scratch_source,
214                                                  GCancellable *cancellable,
215                                                  GAsyncReadyCallback callback,
216                                                  gpointer user_data);
217 gboolean        e_source_remote_create_finish   (ESource *source,
218                                                  GAsyncResult *result,
219                                                  GError **error);
220 gboolean        e_source_remote_delete_sync     (ESource *source,
221                                                  GCancellable *cancellable,
222                                                  GError **error);
223 void            e_source_remote_delete          (ESource *source,
224                                                  GCancellable *cancellable,
225                                                  GAsyncReadyCallback callback,
226                                                  gpointer user_data);
227 gboolean        e_source_remote_delete_finish   (ESource *source,
228                                                  GAsyncResult *result,
229                                                  GError **error);
230 gboolean        e_source_get_oauth2_access_token_sync
231                                                 (ESource *source,
232                                                  GCancellable *cancellable,
233                                                  gchar **out_access_token,
234                                                  gint *out_expires_in,
235                                                  GError **error);
236 void            e_source_get_oauth2_access_token
237                                                 (ESource *source,
238                                                  GCancellable *cancellable,
239                                                  GAsyncReadyCallback callback,
240                                                  gpointer user_data);
241 gboolean        e_source_get_oauth2_access_token_finish
242                                                 (ESource *source,
243                                                  GAsyncResult *result,
244                                                  gchar **out_access_token,
245                                                  gint *out_expires_in,
246                                                  GError **error);
247
248 G_END_DECLS
249
250 #endif /* E_SOURCE_H */