Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserver / e-source.h
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /* e-source.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_H_
24 #define _E_SOURCE_H_
25
26 #include <glib-object.h>
27 #include <libxml/tree.h>
28
29 G_BEGIN_DECLS
30
31 #define E_TYPE_SOURCE                   (e_source_get_type ())
32 #define E_SOURCE(obj)                   (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SOURCE, ESource))
33 #define E_SOURCE_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SOURCE, ESourceClass))
34 #define E_IS_SOURCE(obj)                (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SOURCE))
35 #define E_IS_SOURCE_CLASS(klass)        (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SOURCE))
36
37
38 typedef struct _ESource        ESource;
39 typedef struct _ESourcePrivate ESourcePrivate;
40 typedef struct _ESourceClass   ESourceClass;
41
42 #include "e-source-group.h"
43
44 struct _ESource {
45         GObject parent;
46
47         ESourcePrivate *priv;
48 };
49
50 struct _ESourceClass {
51         GObjectClass parent_class;
52
53         /* Signals.  */
54         void (* changed) (ESource *source);
55 };
56
57
58 GType    e_source_get_type (void);
59
60 ESource *e_source_new                (const char   *name,
61                                       const char   *relative_uri);
62 ESource *e_source_new_with_absolute_uri(const char   *name,
63                                         const char   *absolute_uri);
64 ESource *e_source_new_from_xml_node  (xmlNodePtr    node);
65 ESource *e_source_new_from_standalone_xml (const char *xml);
66
67 ESource *e_source_copy (ESource *source);
68
69 gboolean e_source_equal (ESource *source_1, ESource *source_2);
70
71 gboolean  e_source_update_from_xml_node  (ESource    *source,
72                                           xmlNodePtr  node,
73                                           gboolean   *changed_return);
74
75 char *e_source_uid_from_xml_node  (xmlNodePtr node);
76
77 void  e_source_set_group         (ESource      *source,
78                                   ESourceGroup *group);
79 void  e_source_set_name          (ESource      *source,
80                                   const char   *name);
81 void  e_source_set_relative_uri  (ESource      *source,
82                                   const char   *relative_uri);
83 void  e_source_set_absolute_uri  (ESource      *source,
84                                   const char   *absolute_uri);
85 void  e_source_set_color_spec    (ESource      *source,
86                                   const gchar  *color_spec);
87 void  e_source_set_readonly      (ESource      *source,
88                                   gboolean      readonly);
89 #ifndef EDS_DISABLE_DEPRECATED
90 void  e_source_set_color         (ESource      *source,
91                                   guint32       color);
92 void  e_source_unset_color       (ESource      *source);
93 #endif
94
95 ESourceGroup *e_source_peek_group         (ESource *source);
96 const char   *e_source_peek_uid           (ESource *source);
97 const char   *e_source_peek_name          (ESource *source);
98 const char   *e_source_peek_relative_uri  (ESource *source);
99 const char   *e_source_peek_absolute_uri  (ESource *source);
100 const char   *e_source_peek_color_spec    (ESource *source);
101 gboolean      e_source_get_readonly       (ESource *source);
102 #ifndef EDS_DISABLE_DEPRECATED
103 gboolean      e_source_get_color          (ESource *source,
104                                            guint32 *color_return);
105 #endif
106
107 char *e_source_get_uri  (ESource *source);
108
109 void  e_source_dump_to_xml_node  (ESource    *source,
110                                   xmlNodePtr  parent_node);
111 char *e_source_to_standalone_xml (ESource *source);
112
113 const gchar *e_source_get_property     (ESource *source,
114                                         const gchar *property);
115 void         e_source_set_property     (ESource *source,
116                                         const gchar *property,
117                                         const gchar *value);
118 void         e_source_foreach_property (ESource *source,
119                                         GHFunc func,
120                                         gpointer data);
121
122 char *e_source_get_duped_property (ESource *source, const char *property);
123 char *e_source_build_absolute_uri (ESource *source);
124
125 G_END_DECLS
126
127 #endif /* _E_SOURCE_H_ */