1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-imap-message-cache.h: Class for an IMAP message cache */
6 * Dan Winship <danw@ximian.com>
8 * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU Lesser General Public
12 * License as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
26 #ifndef CAMEL_IMAP_MESSAGE_CACHE_H
27 #define CAMEL_IMAP_MESSAGE_CACHE_H 1
29 #include "camel-imap-types.h"
30 #include "camel-folder.h"
31 #include <camel/camel-folder-search.h>
33 #define CAMEL_IMAP_MESSAGE_CACHE_TYPE (camel_imap_message_cache_get_type ())
34 #define CAMEL_IMAP_MESSAGE_CACHE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_MESSAGE_CACHE_TYPE, CamelImapFolder))
35 #define CAMEL_IMAP_MESSAGE_CACHE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_MESSAGE_CACHE_TYPE, CamelImapFolderClass))
36 #define CAMEL_IS_IMAP_MESSAGE_CACHE(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_MESSAGE_CACHE_TYPE))
40 struct _CamelImapMessageCache {
41 CamelObject parent_object;
44 GHashTable *parts, *cached;
50 CamelFolderClass parent_class;
54 } CamelImapMessageCacheClass;
58 CamelImapMessageCache *camel_imap_message_cache_new (const char *path,
59 CamelFolderSummary *summ,
62 void camel_imap_message_cache_set_path (CamelImapMessageCache *cache,
65 guint32 camel_imap_message_cache_max_uid (CamelImapMessageCache *cache);
67 CamelStream *camel_imap_message_cache_insert (CamelImapMessageCache *cache,
69 const char *part_spec,
73 void camel_imap_message_cache_insert_stream (CamelImapMessageCache *cache,
75 const char *part_spec,
76 CamelStream *data_stream,
78 void camel_imap_message_cache_insert_wrapper (CamelImapMessageCache *cache,
80 const char *part_spec,
81 CamelDataWrapper *wrapper,
84 CamelStream *camel_imap_message_cache_get (CamelImapMessageCache *cache,
86 const char *part_spec,
89 void camel_imap_message_cache_remove (CamelImapMessageCache *cache,
92 void camel_imap_message_cache_clear (CamelImapMessageCache *cache);
94 void camel_imap_message_cache_copy (CamelImapMessageCache *source,
95 const char *source_uid,
96 CamelImapMessageCache *dest,
100 /* Standard Camel function */
101 CamelType camel_imap_message_cache_get_type (void);
105 #endif /* CAMEL_IMAP_MESSAGE_CACHE_H */