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.
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.
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/>
24 /* Standard GObject macros */
25 #define E_TYPE_SOURCE \
26 (e_source_get_type ())
27 #define E_SOURCE(obj) \
28 (G_TYPE_CHECK_INSTANCE_CAST \
29 ((obj), E_TYPE_SOURCE, ESource))
30 #define E_SOURCE_CLASS(cls) \
31 (G_TYPE_CHECK_CLASS_CAST \
32 ((cls), E_TYPE_SOURCE, ESourceClass))
33 #define E_IS_SOURCE(obj) \
34 (G_TYPE_CHECK_INSTANCE_TYPE \
35 ((obj), E_TYPE_SOURCE))
36 #define E_IS_SOURCE_CLASS(cls) \
37 (G_TYPE_CHECK_CLASS_TYPE \
38 ((cls), E_TYPE_SOURCE))
39 #define E_SOURCE_GET_CLASS(obj) \
40 (G_TYPE_INSTANCE_GET_CLASS \
41 ((obj), E_TYPE_SOURCE, ESourceClass))
44 * E_SOURCE_PARAM_SETTING:
46 * Extends #GParamFlags to indicate the #GObject property is associated
47 * with a key file value. Use this flag when installing #GObject properties
48 * in #ESourceExtension subclasses.
52 #define E_SOURCE_PARAM_SETTING (1 << G_PARAM_USER_SHIFT)
56 typedef struct _ESource ESource;
57 typedef struct _ESourceClass ESourceClass;
58 typedef struct _ESourcePrivate ESourcePrivate;
63 * Contains only private data that should be read and manipulated using the
73 struct _ESourceClass {
74 GObjectClass parent_class;
77 void (*changed) (ESource *source);
80 gboolean (*remove_sync) (ESource *source,
81 GCancellable *cancellable,
83 void (*remove) (ESource *source,
84 GCancellable *cancellable,
85 GAsyncReadyCallback callback,
87 gboolean (*remove_finish) (ESource *source,
90 gboolean (*write_sync) (ESource *source,
91 GCancellable *cancellable,
93 void (*write) (ESource *source,
94 GCancellable *cancellable,
95 GAsyncReadyCallback callback,
97 gboolean (*write_finish) (ESource *source,
101 /* Reserved slots. */
102 gpointer reserved[16];
105 GType e_source_get_type (void) G_GNUC_CONST;
106 ESource * e_source_new (GDBusObject *dbus_object,
107 GMainContext *main_context,
109 guint e_source_hash (ESource *source);
110 gboolean e_source_equal (ESource *source1,
112 void e_source_changed (ESource *source);
113 const gchar * e_source_get_uid (ESource *source);
114 gchar * e_source_dup_uid (ESource *source);
115 const gchar * e_source_get_parent (ESource *source);
116 gchar * e_source_dup_parent (ESource *source);
117 void e_source_set_parent (ESource *source,
118 const gchar *parent);
119 gboolean e_source_get_enabled (ESource *source);
120 void e_source_set_enabled (ESource *source,
122 gboolean e_source_get_writable (ESource *source);
123 gboolean e_source_get_removable (ESource *source);
124 gpointer e_source_get_extension (ESource *source,
125 const gchar *extension_name);
126 gboolean e_source_has_extension (ESource *source,
127 const gchar *extension_name);
128 GDBusObject * e_source_ref_dbus_object (ESource *source);
129 GMainContext * e_source_ref_main_context (ESource *source);
130 const gchar * e_source_get_display_name (ESource *source);
131 gchar * e_source_dup_display_name (ESource *source);
132 void e_source_set_display_name (ESource *source,
133 const gchar *display_name);
134 gint e_source_compare_by_display_name
137 gchar * e_source_to_string (ESource *source,
139 gchar * e_source_parameter_to_key (const gchar *param_name);
140 gboolean e_source_remove_sync (ESource *source,
141 GCancellable *cancellable,
143 void e_source_remove (ESource *source,
144 GCancellable *cancellable,
145 GAsyncReadyCallback callback,
147 gboolean e_source_remove_finish (ESource *source,
148 GAsyncResult *result,
150 gboolean e_source_write_sync (ESource *source,
151 GCancellable *cancellable,
153 void e_source_write (ESource *source,
154 GCancellable *cancellable,
155 GAsyncReadyCallback callback,
157 gboolean e_source_write_finish (ESource *source,
158 GAsyncResult *result,
163 #endif /* E_SOURCE_H */