1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-data-cache.h: Class for a Camel filesystem cache
4 * Authors: Michael Zucchi <notzed@ximian.com>
6 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
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.
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.
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
23 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
24 #error "Only <camel/camel.h> can be included directly."
27 #ifndef CAMEL_DATA_CACHE_H
28 #define CAMEL_DATA_CACHE_H
30 #include <camel/camel-stream.h>
32 /* Standard GObject macros */
33 #define CAMEL_TYPE_DATA_CACHE \
34 (camel_data_cache_get_type ())
35 #define CAMEL_DATA_CACHE(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST \
37 ((obj), CAMEL_TYPE_DATA_CACHE, CamelDataCache))
38 #define CAMEL_DATA_CACHE_CLASS(cls) \
39 (G_TYPE_CHECK_CLASS_CAST \
40 ((cls), CAMEL_TYPE_DATA_CACHE, CamelDataCacheClass))
41 #define CAMEL_IS_DATA_CACHE(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE \
43 ((obj), CAMEL_TYPE_DATA_CACHE))
44 #define CAMEL_IS_DATA_CACHE_CLASS(cls) \
45 (G_TYPE_CHECK_CLASS_TYPE \
46 ((cls), CAMEL_TYPE_DATA_CACHE))
47 #define CAMEL_DATA_CACHE_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS \
49 ((obj), CAMEL_TYPE_DATA_CACHE, CamelDataCacheClass))
53 typedef struct _CamelDataCache CamelDataCache;
54 typedef struct _CamelDataCacheClass CamelDataCacheClass;
55 typedef struct _CamelDataCachePrivate CamelDataCachePrivate;
57 struct _CamelDataCache {
59 CamelDataCachePrivate *priv;
62 struct _CamelDataCacheClass {
63 CamelObjectClass parent_class;
66 GType camel_data_cache_get_type (void);
67 CamelDataCache *camel_data_cache_new (const gchar *path,
69 const gchar * camel_data_cache_get_path (CamelDataCache *cdc);
70 void camel_data_cache_set_path (CamelDataCache *cdc,
72 void camel_data_cache_set_expire_age (CamelDataCache *cdc,
74 void camel_data_cache_set_expire_access
77 CamelStream * camel_data_cache_add (CamelDataCache *cdc,
81 CamelStream * camel_data_cache_get (CamelDataCache *cdc,
85 gint camel_data_cache_remove (CamelDataCache *cdc,
89 gchar * camel_data_cache_get_filename (CamelDataCache *cdc,
92 void camel_data_cache_clear (CamelDataCache *cdc,
97 #endif /* CAMEL_DATA_CACHE_H */