2 * Copyright (C) 2001 Ximian Inc. (www.ximian.com)
4 * Authors: Michael Zucchi <notzed@ximian.com>
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 GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef _CAMEL_SPOOL_SUMMARY_H
22 #define _CAMEL_SPOOL_SUMMARY_H
24 #include <camel/camel-folder-summary.h>
25 #include <camel/camel-folder.h>
26 #include <camel/camel-exception.h>
27 #include <camel/camel-index.h>
28 #include "camel-mbox-summary.h"
30 #define CAMEL_SPOOL_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_spool_summary_get_type (), CamelSpoolSummary)
31 #define CAMEL_SPOOL_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_spool_summary_get_type (), CamelSpoolSummaryClass)
32 #define CAMEL_IS_SPOOL_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_spool_summary_get_type ())
36 typedef struct _CamelSpoolSummary CamelSpoolSummary;
37 typedef struct _CamelSpoolSummaryClass CamelSpoolSummaryClass;
39 struct _CamelSpoolSummary {
40 CamelMboxSummary parent;
44 struct _CamelSpoolSummaryClass {
45 CamelMboxSummaryClass parent_class;
48 CamelType camel_spool_summary_get_type (void);
49 void camel_spool_summary_construct (CamelSpoolSummary *new, const char *filename, const char *spool_name, CamelIndex *index);
51 /* create the summary, in-memory only */
52 CamelSpoolSummary *camel_spool_summary_new(struct _CamelFolder *, const char *filename);
54 /* load/check the summary */
55 int camel_spool_summary_load(CamelSpoolSummary *cls, int forceindex, CamelException *ex);
56 /* check for new/removed messages */
57 int camel_spool_summary_check(CamelSpoolSummary *cls, CamelFolderChangeInfo *, CamelException *ex);
58 /* perform a folder sync or expunge, if needed */
59 int camel_spool_summary_sync(CamelSpoolSummary *cls, gboolean expunge, CamelFolderChangeInfo *, CamelException *ex);
60 /* add a new message to the summary */
61 CamelMessageInfo *camel_spool_summary_add(CamelSpoolSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
63 /* generate an X-Evolution header line */
64 char *camel_spool_summary_encode_x_evolution(CamelSpoolSummary *cls, const CamelMessageInfo *info);
65 int camel_spool_summary_decode_x_evolution(CamelSpoolSummary *cls, const char *xev, CamelMessageInfo *info);
67 /* utility functions - write headers to a file with optional X-Evolution header */
68 int camel_spool_summary_write_headers(int fd, struct _camel_header_raw *header, char *xevline);
72 #endif /* ! _CAMEL_SPOOL_SUMMARY_H */