Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserver / e-source-list.h
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /* e-source-list.h
3  *
4  * Copyright (C) 2003  Ximian, Inc.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of version 2 of the GNU Lesser General Public
8  * License as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  *
20  * Author: Ettore Perazzoli <ettore@ximian.com>
21  */
22
23 #ifndef _E_SOURCE_LIST_H_
24 #define _E_SOURCE_LIST_H_
25
26 #include <libxml/tree.h>
27 #include <gconf/gconf-client.h>
28
29 #include "e-source-group.h"
30
31 G_BEGIN_DECLS
32
33 #define E_TYPE_SOURCE_LIST                      (e_source_list_get_type ())
34 #define E_SOURCE_LIST(obj)                      (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SOURCE_LIST, ESourceList))
35 #define E_SOURCE_LIST_CLASS(klass)              (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SOURCE_LIST, ESourceListClass))
36 #define E_IS_SOURCE_LIST(obj)                   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SOURCE_LIST))
37 #define E_IS_SOURCE_LIST_CLASS(klass)           (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SOURCE_LIST))
38
39
40 typedef struct _ESourceList        ESourceList;
41 typedef struct _ESourceListPrivate ESourceListPrivate;
42 typedef struct _ESourceListClass   ESourceListClass;
43
44 struct _ESourceList {
45         GObject parent;
46
47         ESourceListPrivate *priv;
48 };
49
50 struct _ESourceListClass {
51         GObjectClass parent_class;
52
53         /* Signals.  */
54
55         void (* changed) (ESourceList *source_list);
56
57         void (* group_removed) (ESourceList *source_list, ESourceGroup *group);
58         void (* group_added) (ESourceList *source_list, ESourceGroup *group);
59 };
60
61
62 GType    e_source_list_get_type (void);
63
64 ESourceList *e_source_list_new            (void);
65 ESourceList *e_source_list_new_for_gconf  (GConfClient *client,
66                                            const char  *path);
67 ESourceList *e_source_list_new_for_gconf_default  (const char  *path);
68
69 GSList       *e_source_list_peek_groups         (ESourceList *list);
70 ESourceGroup *e_source_list_peek_group_by_uid   (ESourceList *list,
71                                                  const char  *uid);
72 ESourceGroup *e_source_list_peek_group_by_name  (ESourceList *list,
73                                                  const char *name);
74 ESource      *e_source_list_peek_source_by_uid  (ESourceList *list,
75                                                  const char  *uid);
76 ESource      *e_source_list_peek_source_any     (ESourceList *list);
77 gboolean  e_source_list_add_group             (ESourceList  *list,
78                                                ESourceGroup *group,
79                                                int           position);
80 gboolean  e_source_list_remove_group          (ESourceList  *list,
81                                                ESourceGroup *group);
82 gboolean  e_source_list_remove_group_by_uid   (ESourceList  *list,
83                                                const char   *uid);
84 gboolean  e_source_list_remove_source_by_uid  (ESourceList  *list,
85                                                const char   *uidj);
86
87 gboolean  e_source_list_sync  (ESourceList  *list,
88                                GError      **error);
89
90 gboolean e_source_list_is_gconf_updated (ESourceList *list);
91
92 G_END_DECLS
93
94 #endif /* _E_SOURCE_LIST_H_ */