1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
4 * Copyright (C) 2003 Ximian, Inc.
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.
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.
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.
20 * Author: Ettore Perazzoli <ettore@ximian.com>
23 #ifndef _E_SOURCE_GROUP_H_
24 #define _E_SOURCE_GROUP_H_
26 #include <glib-object.h>
27 #include <libxml/tree.h>
31 #define E_TYPE_SOURCE_GROUP (e_source_group_get_type ())
32 #define E_SOURCE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SOURCE_GROUP, ESourceGroup))
33 #define E_SOURCE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SOURCE_GROUP, ESourceGroupClass))
34 #define E_IS_SOURCE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SOURCE_GROUP))
35 #define E_IS_SOURCE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SOURCE_GROUP))
38 typedef struct _ESourceGroup ESourceGroup;
39 typedef struct _ESourceGroupPrivate ESourceGroupPrivate;
40 typedef struct _ESourceGroupClass ESourceGroupClass;
44 struct _ESourceGroup {
47 ESourceGroupPrivate *priv;
50 struct _ESourceGroupClass {
51 GObjectClass parent_class;
55 void (* changed) (ESourceGroup *group);
57 void (* source_removed) (ESourceGroup *source_list, ESource *source);
58 void (* source_added) (ESourceGroup *source_list, ESource *source);
62 GType e_source_group_get_type (void);
64 ESourceGroup *e_source_group_new (const char *name,
65 const char *base_uri);
66 ESourceGroup *e_source_group_new_from_xml (const char *xml);
67 ESourceGroup *e_source_group_new_from_xmldoc (xmlDocPtr doc);
69 gboolean e_source_group_update_from_xml (ESourceGroup *group,
71 gboolean *changed_return);
72 gboolean e_source_group_update_from_xmldoc (ESourceGroup *group,
74 gboolean *changed_return);
76 char *e_source_group_uid_from_xmldoc (xmlDocPtr doc);
78 void e_source_group_set_name (ESourceGroup *group,
80 void e_source_group_set_base_uri (ESourceGroup *group,
81 const char *base_uri);
83 void e_source_group_set_readonly (ESourceGroup *group,
86 const char *e_source_group_peek_uid (ESourceGroup *group);
87 const char *e_source_group_peek_name (ESourceGroup *group);
88 const char *e_source_group_peek_base_uri (ESourceGroup *group);
89 gboolean e_source_group_get_readonly (ESourceGroup *group);
91 GSList *e_source_group_peek_sources (ESourceGroup *group);
92 ESource *e_source_group_peek_source_by_uid (ESourceGroup *group,
93 const char *source_uid);
94 ESource *e_source_group_peek_source_by_name (ESourceGroup *group,
95 const char *source_name);
97 gboolean e_source_group_add_source (ESourceGroup *group,
100 gboolean e_source_group_remove_source (ESourceGroup *group,
102 gboolean e_source_group_remove_source_by_uid (ESourceGroup *group,
105 gchar *e_source_group_get_property (ESourceGroup *source,
106 const gchar *property);
107 void e_source_group_set_property (ESourceGroup *source,
108 const gchar *property,
110 void e_source_group_foreach_property (ESourceGroup *source,
114 char *e_source_group_to_xml (ESourceGroup *group);
118 #endif /* _E_SOURCE_GROUP_H_ */