1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4 * Copyright (C) 2003 Novell, Inc.
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.
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.
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.
19 * Authors: Rodrigo Moya <rodrigo@ximian.com>
22 #ifndef E_FILE_CACHE_H
23 #define E_FILE_CACHE_H
25 #include <glib-object.h>
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))
35 typedef struct _EFileCachePrivate EFileCachePrivate;
39 EFileCachePrivate *priv;
43 GObjectClass parent_class;
46 GType e_file_cache_get_type (void);
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);
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);
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);