Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-subscribable.h
1 /*
2  * camel-subscribable.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 (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
20 #error "Only <camel/camel.h> can be included directly."
21 #endif
22
23 #ifndef CAMEL_SUBSCRIBABLE_H
24 #define CAMEL_SUBSCRIBABLE_H
25
26 #include <camel/camel-store.h>
27
28 /* Standard GObject macros */
29 #define CAMEL_TYPE_SUBSCRIBABLE \
30         (camel_subscribable_get_type ())
31 #define CAMEL_SUBSCRIBABLE(obj) \
32         (G_TYPE_CHECK_INSTANCE_CAST \
33         ((obj), CAMEL_TYPE_SUBSCRIBABLE, CamelSubscribable))
34 #define CAMEL_SUBSCRIBABLE_INTERFACE(cls) \
35         (G_TYPE_CHECK_CLASS_CAST \
36         ((cls), CAMEL_TYPE_SUBSCRIBABLE, CamelSubscribableInterface))
37 #define CAMEL_IS_SUBSCRIBABLE(obj) \
38         (G_TYPE_CHECK_INSTANCE_TYPE \
39         ((obj), CAMEL_TYPE_SUBSCRIBABLE))
40 #define CAMEL_IS_SUBSCRIBABLE_INTERFACE(cls) \
41         (G_TYPE_CHECK_CLASS_TYPE \
42         ((cls), CAMEL_TYPE_SUBSCRIBABLE))
43 #define CAMEL_SUBSCRIBABLE_GET_INTERFACE(obj) \
44         (G_TYPE_INSTANCE_GET_INTERFACE \
45         ((obj), CAMEL_TYPE_SUBSCRIBABLE, CamelSubscribableInterface))
46
47 G_BEGIN_DECLS
48
49 /**
50  * CamelSubscribable:
51  *
52  * Since: 3.2
53  **/
54 typedef struct _CamelSubscribable CamelSubscribable;
55 typedef struct _CamelSubscribableInterface CamelSubscribableInterface;
56
57 struct _CamelSubscribableInterface {
58         GTypeInterface parent_interface;
59
60         /* Non-Blocking Methods */
61         gboolean        (*folder_is_subscribed)
62                                         (CamelSubscribable *subscribable,
63                                          const gchar *folder_name);
64
65         /* Synchronous I/O Methods */
66         gboolean        (*subscribe_folder_sync)
67                                         (CamelSubscribable *subscribable,
68                                          const gchar *folder_name,
69                                          GCancellable *cancellable,
70                                          GError **error);
71         gboolean        (*unsubscribe_folder_sync)
72                                         (CamelSubscribable *subscribable,
73                                          const gchar *folder_name,
74                                          GCancellable *cancellable,
75                                          GError **error);
76
77         /* Asynchronous I/O Methods (all have defaults) */
78         void            (*subscribe_folder)
79                                         (CamelSubscribable *subscribable,
80                                          const gchar *folder_name,
81                                          gint io_priority,
82                                          GCancellable *cancellable,
83                                          GAsyncReadyCallback callback,
84                                          gpointer user_data);
85         gboolean        (*subscribe_folder_finish)
86                                         (CamelSubscribable *subscribable,
87                                          GAsyncResult *result,
88                                          GError **error);
89         void            (*unsubscribe_folder)
90                                         (CamelSubscribable *subscribable,
91                                          const gchar *folder_name,
92                                          gint io_priority,
93                                          GCancellable *cancellable,
94                                          GAsyncReadyCallback callback,
95                                          gpointer user_data);
96         gboolean        (*unsubscribe_folder_finish)
97                                         (CamelSubscribable *subscribable,
98                                          GAsyncResult *result,
99                                          GError **error);
100
101         /* Signals */
102         void            (*folder_subscribed)
103                                         (CamelSubscribable *subscribable,
104                                          CamelFolderInfo *folder_info);
105         void            (*folder_unsubscribed)
106                                         (CamelSubscribable *subscribable,
107                                          CamelFolderInfo *folder_info);
108 };
109
110 GType           camel_subscribable_get_type
111                                         (void) G_GNUC_CONST;
112 gboolean        camel_subscribable_folder_is_subscribed
113                                         (CamelSubscribable *subscribable,
114                                          const gchar *folder_name);
115 gboolean        camel_subscribable_subscribe_folder_sync
116                                         (CamelSubscribable *subscribable,
117                                          const gchar *folder_name,
118                                          GCancellable *cancellable,
119                                          GError **error);
120 void            camel_subscribable_subscribe_folder
121                                         (CamelSubscribable *subscribable,
122                                          const gchar *folder_name,
123                                          gint io_priority,
124                                          GCancellable *cancellable,
125                                          GAsyncReadyCallback callback,
126                                          gpointer user_data);
127 gboolean        camel_subscribable_subscribe_folder_finish
128                                         (CamelSubscribable *subscribable,
129                                          GAsyncResult *result,
130                                          GError **error);
131 gboolean        camel_subscribable_unsubscribe_folder_sync
132                                         (CamelSubscribable *subscribable,
133                                          const gchar *folder_name,
134                                          GCancellable *cancellable,
135                                          GError **error);
136 void            camel_subscribable_unsubscribe_folder
137                                         (CamelSubscribable *subscribable,
138                                          const gchar *folder_name,
139                                          gint io_priority,
140                                          GCancellable *cancellable,
141                                          GAsyncReadyCallback callback,
142                                          gpointer user_data);
143 gboolean        camel_subscribable_unsubscribe_folder_finish
144                                         (CamelSubscribable *subscribable,
145                                          GAsyncResult *result,
146                                          GError **error);
147 void            camel_subscribable_folder_subscribed
148                                         (CamelSubscribable *subscribable,
149                                          CamelFolderInfo *folder_info);
150 void            camel_subscribable_folder_unsubscribed
151                                         (CamelSubscribable *subscribable,
152                                          CamelFolderInfo *folder_info);
153
154 G_END_DECLS
155
156 #endif /* CAMEL_SUBSCRIBABLE_H */