1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright (C) 2009, 2010 Igalia, S.L.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library 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 GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
24 #define SOUP_CACHE_H 1
26 #include <libsoup/soup-types.h>
31 #define SOUP_TYPE_CACHE (soup_cache_get_type ())
32 #define SOUP_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_CACHE, SoupCache))
33 #define SOUP_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_CACHE, SoupCacheClass))
34 #define SOUP_IS_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_CACHE))
35 #define SOUP_IS_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_CACHE))
36 #define SOUP_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_CACHE, SoupCacheClass))
38 typedef struct _SoupCache SoupCache;
39 typedef struct _SoupCachePrivate SoupCachePrivate;
42 SOUP_CACHE_CACHEABLE = (1 << 0),
43 SOUP_CACHE_UNCACHEABLE = (1 << 1),
44 SOUP_CACHE_INVALIDATES = (1 << 2),
45 SOUP_CACHE_VALIDATES = (1 << 3)
49 SOUP_CACHE_RESPONSE_FRESH,
50 SOUP_CACHE_RESPONSE_NEEDS_VALIDATION,
51 SOUP_CACHE_RESPONSE_STALE
55 SOUP_CACHE_SINGLE_USER,
60 GObject parent_instance;
62 SoupCachePrivate *priv;
66 GObjectClass parent_class;
69 SoupCacheability (*get_cacheability) (SoupCache *cache,
72 /* Padding for future expansion */
73 void (*_libsoup_reserved1)(void);
74 void (*_libsoup_reserved2)(void);
75 void (*_libsoup_reserved3)(void);
78 SOUP_AVAILABLE_IN_2_34
79 GType soup_cache_get_type (void);
80 SOUP_AVAILABLE_IN_2_34
81 SoupCache *soup_cache_new (const char *cache_dir,
82 SoupCacheType cache_type);
83 SOUP_AVAILABLE_IN_2_34
84 void soup_cache_flush (SoupCache *cache);
85 SOUP_AVAILABLE_IN_2_34
86 void soup_cache_clear (SoupCache *cache);
88 SOUP_AVAILABLE_IN_2_34
89 void soup_cache_dump (SoupCache *cache);
90 SOUP_AVAILABLE_IN_2_34
91 void soup_cache_load (SoupCache *cache);
93 SOUP_AVAILABLE_IN_2_34
94 void soup_cache_set_max_size (SoupCache *cache,
96 SOUP_AVAILABLE_IN_2_34
97 guint soup_cache_get_max_size (SoupCache *cache);
101 #endif /* SOUP_CACHE_H */