Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserver / e-file-cache.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* e-file-cache.h
3  *
4  * Copyright (C) 2003 Novell, Inc.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of version 2 of the GNU Lesser General Public
8  * License as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * Authors: Rodrigo Moya <rodrigo@ximian.com>
20  */
21
22 #ifndef E_FILE_CACHE_H
23 #define E_FILE_CACHE_H
24
25 #include <glib-object.h>
26
27 G_BEGIN_DECLS
28
29 #define E_TYPE_FILE_CACHE            (e_file_cache_get_type ())
30 #define E_FILE_CACHE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_FILE_CACHE, EFileCache))
31 #define E_FILE_CACHE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_FILE_CACHE, EFileCacheClass))
32 #define E_IS_FILE_CACHE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_FILE_CACHE))
33 #define E_IS_FILE_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_FILE_CACHE))
34
35 typedef struct _EFileCachePrivate EFileCachePrivate;
36
37 typedef struct {
38         GObject parent;
39         EFileCachePrivate *priv;
40 } EFileCache;
41
42 typedef struct {
43         GObjectClass parent_class;
44 } EFileCacheClass;
45
46 GType       e_file_cache_get_type (void);
47
48 EFileCache *e_file_cache_new (const char *filename);
49 gboolean    e_file_cache_remove (EFileCache *cache);
50 gboolean    e_file_cache_clean (EFileCache *cache);
51
52 const char *e_file_cache_get_object (EFileCache *cache, const char *key);
53 GSList     *e_file_cache_get_objects (EFileCache *cache);
54 GSList     *e_file_cache_get_keys (EFileCache *cache);
55 gboolean    e_file_cache_add_object (EFileCache *cache, const char *key, const char *value);
56 gboolean    e_file_cache_replace_object (EFileCache *cache, const char *key, const char *new_value);
57 gboolean    e_file_cache_remove_object (EFileCache *cache, const char *key);
58
59 void        e_file_cache_freeze_changes (EFileCache *cache);
60 void        e_file_cache_thaw_changes (EFileCache *cache);
61 const char *e_file_cache_get_filename (EFileCache *cache);
62
63 G_END_DECLS
64
65 #endif