Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / providers / local / camel-mbox-summary.h
1 /*
2  *  Copyright (C) 2000 Ximian Inc.
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_MBOX_SUMMARY_H
22 #define _CAMEL_MBOX_SUMMARY_H
23
24 #include "camel-local-summary.h"
25
26 /* Enable the use of elm/pine style "Status" & "X-Status" headers */
27 #define STATUS_PINE
28
29 #define CAMEL_MBOX_SUMMARY(obj)         CAMEL_CHECK_CAST (obj, camel_mbox_summary_get_type (), CamelMboxSummary)
30 #define CAMEL_MBOX_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mbox_summary_get_type (), CamelMboxSummaryClass)
31 #define CAMEL_IS_MBOX_SUMMARY(obj)      CAMEL_CHECK_TYPE (obj, camel_mbox_summary_get_type ())
32
33 G_BEGIN_DECLS
34
35 typedef struct _CamelMboxSummary      CamelMboxSummary;
36 typedef struct _CamelMboxSummaryClass CamelMboxSummaryClass;
37
38 typedef struct _CamelMboxMessageContentInfo {
39         CamelMessageContentInfo info;
40 } CamelMboxMessageContentInfo;
41
42 typedef struct _CamelMboxMessageInfo {
43         CamelLocalMessageInfo info;
44
45         off_t frompos;
46 } CamelMboxMessageInfo;
47
48 struct _CamelMboxSummary {
49         CamelLocalSummary parent;
50
51         CamelFolderChangeInfo *changes; /* used to build change sets */
52
53         guint32 version;
54         size_t folder_size;     /* size of the mbox file, last sync */
55
56         unsigned int xstatus:1; /* do we store/honour xstatus/status headers */
57 };
58
59 struct _CamelMboxSummaryClass {
60         CamelLocalSummaryClass parent_class;
61
62         /* sync in-place */
63         int (*sync_quick)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
64         /* sync requires copy */
65         int (*sync_full)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
66 };
67
68 CamelType               camel_mbox_summary_get_type     (void);
69 CamelMboxSummary      *camel_mbox_summary_new   (struct _CamelFolder *, const char *filename, const char *mbox_name, CamelIndex *index);
70
71 /* do we honour/use xstatus headers, etc */
72 void camel_mbox_summary_xstatus(CamelMboxSummary *mbs, int state);
73
74 /* build a new mbox from an existing mbox storing summary information */
75 int camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderChangeInfo *changeinfo, int fd, int fdout, CamelException *ex);
76
77 G_END_DECLS
78
79 #endif /* ! _CAMEL_MBOX_SUMMARY_H */