Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / providers / imap / camel-imap-summary.h
1 /*
2  *  Copyright (C) 2000 Ximian Inc.
3  *
4  *  Authors:
5  *    Michael Zucchi <notzed@ximian.com>
6  *    Dan Winship <danw@ximian.com>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of version 2 of the GNU Lesser General Public
10  * License as published by the Free Software Foundation.
11  *
12  * This program 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  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this program; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 #ifndef _CAMEL_IMAP_SUMMARY_H
24 #define _CAMEL_IMAP_SUMMARY_H
25
26 #include "camel-imap-types.h"
27 #include <camel/camel-folder-summary.h>
28 #include <camel/camel-exception.h>
29
30 #define CAMEL_IMAP_SUMMARY(obj)         CAMEL_CHECK_CAST (obj, camel_imap_summary_get_type (), CamelImapSummary)
31 #define CAMEL_IMAP_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap_summary_get_type (), CamelImapSummaryClass)
32 #define CAMEL_IS_IMAP_SUMMARY(obj)      CAMEL_CHECK_TYPE (obj, camel_imap_summary_get_type ())
33
34 #define CAMEL_IMAP_SERVER_FLAGS (CAMEL_MESSAGE_ANSWERED | \
35                                  CAMEL_MESSAGE_DELETED | \
36                                  CAMEL_MESSAGE_DRAFT | \
37                                  CAMEL_MESSAGE_FLAGGED | \
38                                  CAMEL_MESSAGE_SEEN)
39
40 G_BEGIN_DECLS
41
42 enum {
43         CAMEL_IMAP_MESSAGE_RECENT = 1<<17,
44
45         /* We store the label in flags too, to ease processing.
46            TODO: Move this to camel-folder-summary, BUT don't use
47            1 bit per label, instead use a bitfield of 3 bits */
48
49         CAMEL_IMAP_MESSAGE_LABEL1 = 1<<18,
50         CAMEL_IMAP_MESSAGE_LABEL2 = 1<<19,
51         CAMEL_IMAP_MESSAGE_LABEL3 = 1<<20,
52         CAMEL_IMAP_MESSAGE_LABEL4 = 1<<21,
53         CAMEL_IMAP_MESSAGE_LABEL5 = 1<<22,
54         CAMEL_IMAP_MESSAGE_LABEL_MASK = 31<<18
55 };
56
57 typedef struct _CamelImapSummaryClass CamelImapSummaryClass;
58
59 typedef struct _CamelImapMessageContentInfo {
60         CamelMessageContentInfo info;
61
62 } CamelImapMessageContentInfo;
63
64 typedef struct _CamelImapMessageInfo {
65         CamelMessageInfoBase info;
66
67         guint32 server_flags;
68 } CamelImapMessageInfo;
69
70 struct _CamelImapSummary {
71         CamelFolderSummary parent;
72
73         guint32 version;
74         guint32 validity;
75 };
76
77 struct _CamelImapSummaryClass {
78         CamelFolderSummaryClass parent_class;
79
80 };
81
82 CamelType               camel_imap_summary_get_type     (void);
83 CamelFolderSummary *camel_imap_summary_new          (struct _CamelFolder *folder, const char *filename);
84
85 void camel_imap_summary_add_offline (CamelFolderSummary *summary,
86                                      const char *uid,
87                                      CamelMimeMessage *message,
88                                      const CamelMessageInfo *info);
89
90 void camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary, 
91                                               const char *uid,
92                                               const CamelMessageInfo *info);
93
94 G_END_DECLS
95
96 #endif /* ! _CAMEL_IMAP_SUMMARY_H */