changes: Bump to 3.8.1
[platform/upstream/evolution-data-server.git] / libedataserver / e-source-refresh.h
1 /*
2  * e-source-refresh.h
3  *
4  * This library is free software you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
19 #error "Only <libedataserver/libedataserver.h> should be included directly."
20 #endif
21
22 #ifndef E_SOURCE_REFRESH_H
23 #define E_SOURCE_REFRESH_H
24
25 #include <libedataserver/e-source-extension.h>
26
27 /* Standard GObject macros */
28 #define E_TYPE_SOURCE_REFRESH \
29         (e_source_refresh_get_type ())
30 #define E_SOURCE_REFRESH(obj) \
31         (G_TYPE_CHECK_INSTANCE_CAST \
32         ((obj), E_TYPE_SOURCE_REFRESH, ESourceRefresh))
33 #define E_SOURCE_REFRESH_CLASS(cls) \
34         (G_TYPE_CHECK_CLASS_CAST \
35         ((cls), E_TYPE_SOURCE_REFRESH, ESourceRefreshClass))
36 #define E_IS_SOURCE_REFRESH(obj) \
37         (G_TYPE_CHECK_INSTANCE_TYPE \
38         ((obj), E_TYPE_SOURCE_REFRESH))
39 #define E_IS_SOURCE_REFRESH_CLASS(cls) \
40         (G_TYPE_CHECK_CLASS_TYPE \
41         ((cls), E_TYPE_SOURCE_REFRESH))
42 #define E_SOURCE_REFRESH_GET_CLASS(obj) \
43         (G_TYPE_INSTANCE_GET_CLASS \
44         ((obj), E_TYPE_SOURCE_REFRESH, ESourceRefreshClass))
45
46 /**
47  * E_SOURCE_EXTENSION_REFRESH:
48  *
49  * Pass this extension name to e_source_get_extension() to access
50  * #ESourceRefresh.  This is also used as a group name in key files.
51  *
52  * Since: 3.6
53  **/
54 #define E_SOURCE_EXTENSION_REFRESH "Refresh"
55
56 G_BEGIN_DECLS
57
58 typedef struct _ESourceRefresh ESourceRefresh;
59 typedef struct _ESourceRefreshClass ESourceRefreshClass;
60 typedef struct _ESourceRefreshPrivate ESourceRefreshPrivate;
61
62 /**
63  * ESourceRefresh:
64  *
65  * Contains only private data that should be read and manipulated using the
66  * functions below.
67  *
68  * Since: 3.6
69  **/
70 struct _ESourceRefresh {
71         ESourceExtension parent;
72         ESourceRefreshPrivate *priv;
73 };
74
75 struct _ESourceRefreshClass {
76         ESourceExtensionClass parent_class;
77 };
78
79 /**
80  * ESourceRefreshFunc:
81  * @source: an #ESource
82  * @user_data: user data provided to the callback function
83  *
84  * Since: 3.6
85  **/
86 typedef void    (*ESourceRefreshFunc)           (ESource *source,
87                                                  gpointer user_data);
88
89 GType           e_source_refresh_get_type       (void) G_GNUC_CONST;
90 gboolean        e_source_refresh_get_enabled    (ESourceRefresh *extension);
91 void            e_source_refresh_set_enabled    (ESourceRefresh *extension,
92                                                  gboolean enabled);
93 guint           e_source_refresh_get_interval_minutes
94                                                 (ESourceRefresh *extension);
95 void            e_source_refresh_set_interval_minutes
96                                                 (ESourceRefresh *extension,
97                                                  guint interval_minutes);
98
99 guint           e_source_refresh_add_timeout    (ESource *source,
100                                                  GMainContext *context,
101                                                  ESourceRefreshFunc callback,
102                                                  gpointer user_data,
103                                                  GDestroyNotify notify);
104 void            e_source_refresh_force_timeout  (ESource *source);
105 gboolean        e_source_refresh_remove_timeout (ESource *source,
106                                                  guint refresh_timeout_id);
107 guint           e_source_refresh_remove_timeouts_by_data
108                                                 (ESource *source,
109                                                  gpointer user_data);
110
111 G_END_DECLS
112
113 #endif /* E_SOURCE_REFRESH_H */