Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-data-cache.h
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
3  *
4  * Authors: Michael Zucchi <notzed@ximian.com>
5  *
6  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.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
20  * USA
21  */
22
23 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
24 #error "Only <camel/camel.h> can be included directly."
25 #endif
26
27 #ifndef CAMEL_DATA_CACHE_H
28 #define CAMEL_DATA_CACHE_H
29
30 #include <camel/camel-stream.h>
31
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))
50
51 G_BEGIN_DECLS
52
53 typedef struct _CamelDataCache CamelDataCache;
54 typedef struct _CamelDataCacheClass CamelDataCacheClass;
55 typedef struct _CamelDataCachePrivate CamelDataCachePrivate;
56
57 struct _CamelDataCache {
58         CamelObject parent;
59         CamelDataCachePrivate *priv;
60 };
61
62 struct _CamelDataCacheClass {
63         CamelObjectClass parent_class;
64 };
65
66 GType           camel_data_cache_get_type       (void);
67 CamelDataCache *camel_data_cache_new            (const gchar *path,
68                                                  GError **error);
69 const gchar *   camel_data_cache_get_path       (CamelDataCache *cdc);
70 void            camel_data_cache_set_path       (CamelDataCache *cdc,
71                                                  const gchar *path);
72 void            camel_data_cache_set_expire_age (CamelDataCache *cdc,
73                                                  time_t when);
74 void            camel_data_cache_set_expire_access
75                                                 (CamelDataCache *cdc,
76                                                  time_t when);
77 CamelStream *   camel_data_cache_add            (CamelDataCache *cdc,
78                                                  const gchar *path,
79                                                  const gchar *key,
80                                                  GError **error);
81 CamelStream *   camel_data_cache_get            (CamelDataCache *cdc,
82                                                  const gchar *path,
83                                                  const gchar *key,
84                                                  GError **error);
85 gint            camel_data_cache_remove         (CamelDataCache *cdc,
86                                                  const gchar *path,
87                                                  const gchar *key,
88                                                  GError **error);
89 gchar *         camel_data_cache_get_filename   (CamelDataCache *cdc,
90                                                  const gchar *path,
91                                                  const gchar *key);
92 void            camel_data_cache_clear          (CamelDataCache *cdc,
93                                                  const gchar *path);
94
95 G_END_DECLS
96
97 #endif /* CAMEL_DATA_CACHE_H */