Top |
ESourceRefreshESourceRefresh — ESource extension for refresh settings |
Functions
Description
The ESourceRefresh extension tracks the interval for fetching updates from a remote server.
Access the extension as follows:
1 2 3 4 5 |
#include <libedataserver/libedataserver.h> ESourceRefresh *extension; extension = e_source_get_extension (source, E_SOURCE_EXTENSION_REFRESH); |
Functions
e_source_refresh_get_enabled ()
gboolean
e_source_refresh_get_enabled (ESourceRefresh *extension
);
Returns whether to periodically fetch updates from a remote server.
The refresh interval is determined by the “interval-minutes” property.
Since: 3.6
e_source_refresh_set_enabled ()
void e_source_refresh_set_enabled (ESourceRefresh *extension
,gboolean enabled
);
Sets whether to periodically fetch updates from a remote server.
The refresh interval is determined by the “interval-minutes” property.
Since: 3.6
e_source_refresh_get_interval_minutes ()
guint
e_source_refresh_get_interval_minutes (ESourceRefresh *extension
);
Returns the interval for fetching updates from a remote server.
Note this value is only effective when the “enabled”
property is TRUE
.
Since: 3.6
e_source_refresh_set_interval_minutes ()
void e_source_refresh_set_interval_minutes (ESourceRefresh *extension
,guint interval_minutes
);
Sets the interval for fetching updates from a remote server.
Note this value is only effective when the “enabled”
property is TRUE
.
Since: 3.6
e_source_refresh_add_timeout ()
guint e_source_refresh_add_timeout (ESource *source
,GMainContext *context
,ESourceRefreshFunc callback
,gpointer user_data
,GDestroyNotify notify
);
This is a simple way to schedule a periodic data source refresh.
Adds a timeout GSource to context
and handles all the bookkeeping
if source
's refresh “enabled” state or its refresh
“interval-minutes” value changes. The callback
is
expected to dispatch an asynchronous job to connect to and fetch
updates from a remote server.
The returned ID can be passed to e_source_refresh_remove_timeout()
to
remove the timeout from context
. Note the ID is a private handle and
cannot be passed to g_source_remove()
.
Parameters
source |
an ESource |
|
context |
a GMainContext, or |
[allow-none] |
callback |
function to call on each timeout |
|
user_data |
data to pass to |
|
notify |
function to call when the timeout is removed,
or |
[allow-none] |
Since: 3.6
e_source_refresh_force_timeout ()
void
e_source_refresh_force_timeout (ESource *source
);
For all timeouts added with e_source_refresh_add_timeout()
, invokes
the ESourceRefreshFunc callback immediately and then, if the refresh
“enabled” state is TRUE, reschedules the timeout.
This function is called automatically when the ESource switches from disabled to enabled, but can also be useful when a network connection becomes available or when waking up from hibernation or suspend.
Since: 3.6
e_source_refresh_remove_timeout ()
gboolean e_source_refresh_remove_timeout (ESource *source
,guint refresh_timeout_id
);
Removes a timeout GSource added by e_source_refresh_add_timeout()
.
Since: 3.6
Types and Values
E_SOURCE_EXTENSION_REFRESH
#define E_SOURCE_EXTENSION_REFRESH "Refresh"
Pass this extension name to e_source_get_extension()
to access
ESourceRefresh. This is also used as a group name in key files.
Since: 3.6
struct ESourceRefresh
struct ESourceRefresh;
Contains only private data that should be read and manipulated using the functions below.
Since: 3.6