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 (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
20 #error "Only <camel/camel.h> can be included directly."
23 #ifndef CAMEL_SUBSCRIBABLE_H
24 #define CAMEL_SUBSCRIBABLE_H
26 #include <camel/camel-store.h>
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))
54 typedef struct _CamelSubscribable CamelSubscribable;
55 typedef struct _CamelSubscribableInterface CamelSubscribableInterface;
57 struct _CamelSubscribableInterface {
58 GTypeInterface parent_interface;
60 /* Non-Blocking Methods */
61 gboolean (*folder_is_subscribed)
62 (CamelSubscribable *subscribable,
63 const gchar *folder_name);
65 /* Synchronous I/O Methods */
66 gboolean (*subscribe_folder_sync)
67 (CamelSubscribable *subscribable,
68 const gchar *folder_name,
69 GCancellable *cancellable,
71 gboolean (*unsubscribe_folder_sync)
72 (CamelSubscribable *subscribable,
73 const gchar *folder_name,
74 GCancellable *cancellable,
77 /* Asynchronous I/O Methods (all have defaults) */
78 void (*subscribe_folder)
79 (CamelSubscribable *subscribable,
80 const gchar *folder_name,
82 GCancellable *cancellable,
83 GAsyncReadyCallback callback,
85 gboolean (*subscribe_folder_finish)
86 (CamelSubscribable *subscribable,
89 void (*unsubscribe_folder)
90 (CamelSubscribable *subscribable,
91 const gchar *folder_name,
93 GCancellable *cancellable,
94 GAsyncReadyCallback callback,
96 gboolean (*unsubscribe_folder_finish)
97 (CamelSubscribable *subscribable,
102 void (*folder_subscribed)
103 (CamelSubscribable *subscribable,
104 CamelFolderInfo *folder_info);
105 void (*folder_unsubscribed)
106 (CamelSubscribable *subscribable,
107 CamelFolderInfo *folder_info);
110 GType camel_subscribable_get_type
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,
120 void camel_subscribable_subscribe_folder
121 (CamelSubscribable *subscribable,
122 const gchar *folder_name,
124 GCancellable *cancellable,
125 GAsyncReadyCallback callback,
127 gboolean camel_subscribable_subscribe_folder_finish
128 (CamelSubscribable *subscribable,
129 GAsyncResult *result,
131 gboolean camel_subscribable_unsubscribe_folder_sync
132 (CamelSubscribable *subscribable,
133 const gchar *folder_name,
134 GCancellable *cancellable,
136 void camel_subscribable_unsubscribe_folder
137 (CamelSubscribable *subscribable,
138 const gchar *folder_name,
140 GCancellable *cancellable,
141 GAsyncReadyCallback callback,
143 gboolean camel_subscribable_unsubscribe_folder_finish
144 (CamelSubscribable *subscribable,
145 GAsyncResult *result,
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);
156 #endif /* CAMEL_SUBSCRIBABLE_H */