3b97922debf6eca265010bc133ad8a8696bded32
[platform/upstream/evolution-data-server.git] / libebackend / e-collection-backend.h
1 /*
2  * e-collection-backend.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 (__LIBEBACKEND_H_INSIDE__) && !defined (LIBEBACKEND_COMPILATION)
20 #error "Only <libebackend/libebackend.h> should be included directly."
21 #endif
22
23 #ifndef E_COLLECTION_BACKEND_H
24 #define E_COLLECTION_BACKEND_H
25
26 #include <libebackend/e-backend.h>
27
28 /* Standard GObject macros */
29 #define E_TYPE_COLLECTION_BACKEND \
30         (e_collection_backend_get_type ())
31 #define E_COLLECTION_BACKEND(obj) \
32         (G_TYPE_CHECK_INSTANCE_CAST \
33         ((obj), E_TYPE_COLLECTION_BACKEND, ECollectionBackend))
34 #define E_COLLECTION_BACKEND_CLASS(cls) \
35         (G_TYPE_CHECK_CLASS_CAST \
36         ((cls), E_TYPE_COLLECTION_BACKEND, ECollectionBackendClass))
37 #define E_IS_COLLECTION_BACKEND(obj) \
38         (G_TYPE_CHECK_INSTANCE_TYPE \
39         ((obj), E_TYPE_COLLECTION_BACKEND))
40 #define E_IS_COLLECTION_BACKEND_CLASS(cls) \
41         (G_TYPE_CHECK_CLASS_TYPE \
42         ((cls), E_TYPE_COLLECTION_BACKEND))
43 #define E_COLLECTION_BACKEND_GET_CLASS(obj) \
44         (G_TYPE_INSTANCE_GET_CLASS \
45         ((obj), E_TYPE_COLLECTION_BACKEND, ECollectionBackendClass))
46
47 G_BEGIN_DECLS
48
49 struct _ESourceRegistryServer;
50
51 typedef struct _ECollectionBackend ECollectionBackend;
52 typedef struct _ECollectionBackendClass ECollectionBackendClass;
53 typedef struct _ECollectionBackendPrivate ECollectionBackendPrivate;
54
55 /**
56  * ECollectionBackend:
57  *
58  * Contains only private data that should be read and manipulated using the
59  * functions below.
60  *
61  * Since: 3.6
62  **/
63 struct _ECollectionBackend {
64         EBackend parent;
65         ECollectionBackendPrivate *priv;
66 };
67
68 struct _ECollectionBackendClass {
69         EBackendClass parent_class;
70
71         /* Methods */
72         void            (*populate)             (ECollectionBackend *backend);
73         gchar *         (*dup_resource_id)      (ECollectionBackend *backend,
74                                                  ESource *child_source);
75
76         /* Signals */
77         void            (*child_added)          (ECollectionBackend *backend,
78                                                  ESource *child_source);
79         void            (*child_removed)        (ECollectionBackend *backend,
80                                                  ESource *child_source);
81
82         gpointer reserved[16];
83 };
84
85 GType           e_collection_backend_get_type   (void) G_GNUC_CONST;
86 ESource *       e_collection_backend_new_child  (ECollectionBackend *backend,
87                                                  const gchar *resource_id);
88 struct _ESourceRegistryServer *
89                 e_collection_backend_ref_server (ECollectionBackend *backend);
90 const gchar *   e_collection_backend_get_cache_dir
91                                                 (ECollectionBackend *backend);
92 GList *         e_collection_backend_list_calendar_sources
93                                                 (ECollectionBackend *backend);
94 GList *         e_collection_backend_list_contacts_sources
95                                                 (ECollectionBackend *backend);
96 GList *         e_collection_backend_list_mail_sources
97                                                 (ECollectionBackend *backend);
98
99 G_END_DECLS
100
101 #endif /* E_COLLECTION_BACKEND_H */
102