1 /* 2 * e-timezone-cache.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 Lesser 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 (__LIBECAL_H_INSIDE__) && !defined (LIBECAL_COMPILATION) 19 #error "Only <libecal/libecal.h> should be included directly." 20 #endif 21 22 #ifndef E_TIMEZONE_CACHE_H 23 #define E_TIMEZONE_CACHE_H 24 25 #include <glib-object.h> 26 #include <libical-glib/libical-glib.h> 27 28 /* Standard GObject macros */ 29 #define E_TYPE_TIMEZONE_CACHE \ 30 (e_timezone_cache_get_type ()) 31 #define E_TIMEZONE_CACHE(obj) \ 32 (G_TYPE_CHECK_INSTANCE_CAST \ 33 ((obj), E_TYPE_TIMEZONE_CACHE, ETimezoneCache)) 34 #define E_IS_TIMEZONE_CACHE(obj) \ 35 (G_TYPE_CHECK_INSTANCE_TYPE \ 36 ((obj), E_TYPE_TIMEZONE_CACHE)) 37 #define E_TIMEZONE_CACHE_GET_INTERFACE(obj) \ 38 (G_TYPE_INSTANCE_GET_INTERFACE \ 39 ((obj), E_TYPE_TIMEZONE_CACHE, ETimezoneCacheInterface)) 40 41 G_BEGIN_DECLS 42 43 /** 44 * ETimezoneCache: 45 * 46 * Since: 3.8 47 **/ 48 typedef struct _ETimezoneCache ETimezoneCache; 49 typedef struct _ETimezoneCacheInterface ETimezoneCacheInterface; 50 51 /** 52 * ETimezoneCacheInterface: 53 * @impl_add_timezone: a method to add timezone to the cache 54 * @impl_get_timezone: a method to get timezone from the cache, identified by its timezone id 55 * @impl_list_timezones: a method to get list of all stored timezones 56 * @impl_timezone_added: a signal emitted when a timezone is added to the cache 57 * 58 * Since: 3.8 59 **/ 60 struct _ETimezoneCacheInterface { 61 /*< private >*/ 62 GTypeInterface parent_interface; 63 64 /*< public >*/ 65 /* Methods */ 66 void (*tzcache_add_timezone) (ETimezoneCache *cache, 67 ICalTimezone *zone); 68 ICalTimezone * (*tzcache_get_timezone) (ETimezoneCache *cache, 69 const gchar *tzid); 70 GList * (*tzcache_list_timezones) 71 (ETimezoneCache *cache); /* ICalTimezone * */ 72 73 /* Signals */ 74 void (*timezone_added) (ETimezoneCache *cache, 75 ICalTimezone *zone); 76 77 /* Padding for future expansion */ 78 gpointer reserved_signals[4]; 79 }; 80 81 GType e_timezone_cache_get_type (void) G_GNUC_CONST; 82 void e_timezone_cache_add_timezone (ETimezoneCache *cache, 83 ICalTimezone *zone); 84 ICalTimezone * e_timezone_cache_get_timezone (ETimezoneCache *cache, 85 const gchar *tzid); 86 GList * e_timezone_cache_list_timezones (ETimezoneCache *cache); /* ICalTimezone * */ 87 88 G_END_DECLS 89 90 #endif /* E_TIMEZONE_CACHE_H */ 91 92