Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / calendar / libedata-cal / e-cal-backend-cache.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* Evolution calendar - generic backend class
3  *
4  * Copyright (C) 2003 Novell, Inc.
5  *
6  * Authors: Rodrigo Moya <rodrigo@ximian.com>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of version 2 of the GNU Lesser General Public
10  * License as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21
22 #ifndef E_CAL_BACKEND_CACHE_H
23 #define E_CAL_BACKEND_CACHE_H
24
25 #include "libedataserver/e-file-cache.h"
26 #include <libecal/e-cal-component.h>
27 #include <libecal/e-cal.h>
28
29 G_BEGIN_DECLS
30
31 #define E_TYPE_CAL_BACKEND_CACHE            (e_cal_backend_cache_get_type ())
32 #define E_CAL_BACKEND_CACHE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_BACKEND_CACHE, ECalBackendCache))
33 #define E_CAL_BACKEND_CACHE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_BACKEND_CACHE, ECalBackendCacheClass))
34 #define E_IS_CAL_BACKEND_CACHE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_BACKEND_CACHE))
35 #define E_IS_CAL_BACKEND_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_BACKEND_CACHE))
36
37 typedef struct _ECalBackendCachePrivate ECalBackendCachePrivate;
38
39 typedef struct {
40         EFileCache parent;
41         ECalBackendCachePrivate *priv;
42 } ECalBackendCache;
43
44 typedef struct {
45         EFileCacheClass parent_class;
46 } ECalBackendCacheClass;
47
48 GType               e_cal_backend_cache_get_type (void);
49
50 ECalBackendCache   *e_cal_backend_cache_new (const char *uri, ECalSourceType source_type);
51 ECalComponent      *e_cal_backend_cache_get_component (ECalBackendCache *cache,
52                                                        const char *uid,
53                                                        const char *rid);
54 gboolean            e_cal_backend_cache_put_component (ECalBackendCache *cache, ECalComponent *comp);
55 gboolean            e_cal_backend_cache_remove_component (ECalBackendCache *cache,
56                                                           const char *uid,
57                                                           const char *rid);
58 GList              *e_cal_backend_cache_get_components (ECalBackendCache *cache);
59 GSList             *e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const char *uid);
60
61
62
63 const icaltimezone *e_cal_backend_cache_get_timezone (ECalBackendCache *cache, const char *tzid);
64 gboolean            e_cal_backend_cache_put_timezone (ECalBackendCache *cache, const icaltimezone *zone);
65 gboolean            e_cal_backend_cache_remove_timezone (ECalBackendCache *cache, const char *tzid);
66
67 gboolean            e_cal_backend_cache_put_default_timezone (ECalBackendCache *cache, icaltimezone *default_zone);
68 icaltimezone       *e_cal_backend_cache_get_default_timezone (ECalBackendCache *cache);
69
70 GSList             *e_cal_backend_cache_get_keys (ECalBackendCache *cache);
71
72 const char         *e_cal_backend_cache_get_marker (ECalBackendCache *cache);
73 void                e_cal_backend_cache_set_marker (ECalBackendCache *cache);
74
75 gboolean e_cal_backend_cache_put_server_utc_time (ECalBackendCache *cache, const char *utc_str);
76 const char * e_cal_backend_cache_get_server_utc_time (ECalBackendCache *cache);
77
78 gboolean e_cal_backend_cache_put_key_value (ECalBackendCache *cache, const char *key, const char *value);
79 const char * e_cal_backend_cache_get_key_value (ECalBackendCache *cache, const char *key);
80
81 G_END_DECLS
82
83 #endif