| Top |
| void | e_timezone_cache_add_timezone () |
| ICalTimezone * | e_timezone_cache_get_timezone () |
| GList * | e_timezone_cache_list_timezones () |
ETimezoneCache is implemented by ECalBackend, ECalBackendSync, ECalCache, ECalClient and ECalMetaBackend.
Several classes (both client-side and server-side) cache ICalTimezone instances internally, indexed by their TZID strings. Classes which do this should implement ETimezoneCacheInterface to provide a consistent API for accessing time zone data.
void e_timezone_cache_add_timezone (ETimezoneCache *cache,ICalTimezone *zone);
Adds a copy of zone
to cache
and emits an
“timezone-added” signal. The cache
will use the TZID
string returned by i_cal_timezone_get_tzid() as the lookup key, which can
be passed to e_timezone_cache_get_timezone() to obtain zone
again.
If the cache
already has an ICalTimezone with the same TZID string
as zone
, the cache
will remain unchanged to avoid invalidating any
ICalTimezone pointers which may have already been returned through
e_timezone_cache_get_timezone().
Since: 3.8
ICalTimezone * e_timezone_cache_get_timezone (ETimezoneCache *cache,const gchar *tzid);
Obtains an ICalTimezone by its TZID string. If no match is found,
the function returns NULL. The returned ICalTimezone is owned by
the cache
and should not be modified or freed.
Since: 3.8
GList *
e_timezone_cache_list_timezones (ETimezoneCache *cache);
Returns a list of ICalTimezone instances that were explicitly added to
the cache
through e_timezone_cache_add_timezone(). In particular, any
built-in time zone data that e_timezone_cache_get_timezone() may use to
match a TZID string is excluded from the returned list.
Free the returned list with g_list_free(). The list elements are owned
by the cache
and should not be modified or freed.
Since: 3.8
struct ETimezoneCacheInterface {
/* Methods */
void (*tzcache_add_timezone) (ETimezoneCache *cache,
ICalTimezone *zone);
ICalTimezone * (*tzcache_get_timezone) (ETimezoneCache *cache,
const gchar *tzid);
GList * (*tzcache_list_timezones)
(ETimezoneCache *cache); /* ICalTimezone * */
/* Signals */
void (*timezone_added) (ETimezoneCache *cache,
ICalTimezone *zone);
/* Padding for future expansion */
gpointer reserved_signals[4];
};
Since: 3.8