1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
4 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
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>
26 #include <glib-object.h>
27 #include <libxml/tree.h>
29 /* Standard GObject macros */
30 #define E_TYPE_SOURCE \
31 (e_source_get_type ())
32 #define E_SOURCE(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST \
34 ((obj), E_TYPE_SOURCE, ESource))
35 #define E_SOURCE_CLASS(cls) \
36 (G_TYPE_CHECK_CLASS_CAST \
37 ((cls), E_TYPE_SOURCE, ESourceClass))
38 #define E_IS_SOURCE(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE \
40 ((obj), E_TYPE_SOURCE))
41 #define E_IS_SOURCE_CLASS(cls) \
42 (G_TYPE_CHECK_CLASS_TYPE \
43 ((cls), E_TYPE_SOURCE))
44 #define E_SOURCE_GET_CLASS(obj) \
45 (G_TYPE_INSTANCE_GET_CLASS \
46 ((obj), E_TYPE_SOURCE, ESourceClass))
50 typedef struct _ESource ESource;
51 typedef struct _ESourceClass ESourceClass;
52 typedef struct _ESourcePrivate ESourcePrivate;
54 /* Avoids a cyclic dependency. */
60 * Contains only private data that should be read and manipulated using the
68 struct _ESourceClass {
69 GObjectClass parent_class;
72 void (*changed) (ESource *source);
75 GType e_source_get_type (void) G_GNUC_CONST;
76 ESource * e_source_new (const gchar *name,
77 const gchar *relative_uri);
78 ESource * e_source_new_with_absolute_uri (const gchar *name,
79 const gchar *absolute_uri);
80 ESource * e_source_new_from_xml_node (xmlNodePtr node);
81 ESource * e_source_new_from_standalone_xml
83 ESource * e_source_copy (ESource *source);
84 gboolean e_source_update_from_xml_node (ESource *source,
86 gboolean *changed_return);
87 gchar * e_source_uid_from_xml_node (xmlNodePtr node);
88 void e_source_set_group (ESource *source,
89 struct _ESourceGroup *group);
90 void e_source_set_name (ESource *source,
92 void e_source_set_relative_uri (ESource *source,
93 const gchar *relative_uri);
94 void e_source_set_absolute_uri (ESource *source,
95 const gchar *absolute_uri);
96 void e_source_set_color_spec (ESource *source,
97 const gchar *color_spec);
98 void e_source_set_readonly (ESource *source,
100 struct _ESourceGroup *
101 e_source_peek_group (ESource *source);
102 const gchar * e_source_peek_uid (ESource *source);
103 const gchar * e_source_peek_name (ESource *source);
104 const gchar * e_source_peek_relative_uri (ESource *source);
105 const gchar * e_source_peek_absolute_uri (ESource *source);
106 const gchar * e_source_peek_color_spec (ESource *source);
107 gboolean e_source_get_readonly (ESource *source);
108 gchar * e_source_get_uri (ESource *source);
109 void e_source_dump_to_xml_node (ESource *source,
110 xmlNodePtr parent_node);
111 gchar * e_source_to_standalone_xml (ESource *source);
112 const gchar * e_source_get_property (ESource *source,
113 const gchar *property_name);
114 void e_source_set_property (ESource *source,
115 const gchar *property_name,
116 const gchar *property_value);
117 void e_source_foreach_property (ESource *source,
120 gchar * e_source_get_duped_property (ESource *source,
121 const gchar *property_name);
122 gchar * e_source_build_absolute_uri (ESource *source);
123 gboolean e_source_equal (ESource *a,
125 gboolean e_source_xmlstr_equal (const gchar *a,
128 /* New names to be used in the upcoming ESource rewrite. */
129 #define e_source_get_uid e_source_peek_uid
130 #define e_source_get_display_name e_source_peek_name
134 #endif /* E_SOURCE_H */