Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / providers / local / camel-spool-summary.h
1 /*
2  *  Copyright (C) 2001 Ximian Inc. (www.ximian.com)
3  *
4  *  Authors: Michael Zucchi <notzed@ximian.com>
5  *
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.
9  *
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.
14  *
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.
19  */
20
21 #ifndef _CAMEL_SPOOL_SUMMARY_H
22 #define _CAMEL_SPOOL_SUMMARY_H
23
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"
29
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 ())
33
34 G_BEGIN_DECLS
35
36 typedef struct _CamelSpoolSummary      CamelSpoolSummary;
37 typedef struct _CamelSpoolSummaryClass CamelSpoolSummaryClass;
38
39 struct _CamelSpoolSummary {
40         CamelMboxSummary parent;
41         
42 };
43
44 struct _CamelSpoolSummaryClass {
45         CamelMboxSummaryClass parent_class;
46 };
47
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);
50
51 /* create the summary, in-memory only */
52 CamelSpoolSummary *camel_spool_summary_new(struct _CamelFolder *, const char *filename);
53
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);
62
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);
66
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);
69
70 G_END_DECLS
71
72 #endif /* ! _CAMEL_SPOOL_SUMMARY_H */