Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / providers / local / camel-maildir-summary.h
1 /*
2  *  Copyright (C) 2000 Ximian Inc.
3  *
4  *  Authors: Not Zed <notzed@lostzed.mmc.com.au>
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_MAILDIR_SUMMARY_H
22 #define _CAMEL_MAILDIR_SUMMARY_H
23
24 #include "camel-local-summary.h"
25 #include <camel/camel-folder.h>
26 #include <camel/camel-exception.h>
27 #include <camel/camel-index.h>
28
29 #define CAMEL_MAILDIR_SUMMARY(obj)      CAMEL_CHECK_CAST (obj, camel_maildir_summary_get_type (), CamelMaildirSummary)
30 #define CAMEL_MAILDIR_SUMMARY_CLASS(klass)      CAMEL_CHECK_CLASS_CAST (klass, camel_maildir_summary_get_type (), CamelMaildirSummaryClass)
31 #define CAMEL_IS_MAILDIR_SUMMARY(obj)      CAMEL_CHECK_TYPE (obj, camel_maildir_summary_get_type ())
32
33 G_BEGIN_DECLS
34
35 typedef struct _CamelMaildirSummary     CamelMaildirSummary;
36 typedef struct _CamelMaildirSummaryClass        CamelMaildirSummaryClass;
37
38 typedef struct _CamelMaildirMessageContentInfo {
39         CamelMessageContentInfo info;
40 } CamelMaildirMessageContentInfo;
41
42 enum {
43         CAMEL_MAILDIR_INFO_FILENAME = CAMEL_MESSAGE_INFO_LAST,
44         CAMEL_MAILDIR_INFO_LAST,
45 };
46
47 typedef struct _CamelMaildirMessageInfo {
48         CamelLocalMessageInfo info;
49
50         char *filename;         /* maildir has this annoying status shit on the end of the filename, use this to get the real message id */
51 } CamelMaildirMessageInfo;
52
53 struct _CamelMaildirSummary {
54         CamelLocalSummary parent;
55         struct _CamelMaildirSummaryPrivate *priv;
56 };
57
58 struct _CamelMaildirSummaryClass {
59         CamelLocalSummaryClass parent_class;
60
61         /* virtual methods */
62
63         /* signals */
64 };
65
66 CamelType        camel_maildir_summary_get_type (void);
67 CamelMaildirSummary     *camel_maildir_summary_new      (struct _CamelFolder *folder, const char *filename, const char *maildirdir, CamelIndex *index);
68
69 /* convert some info->flags to/from the messageinfo */
70 char *camel_maildir_summary_info_to_name(const CamelMaildirMessageInfo *info);
71 int camel_maildir_summary_name_to_info(CamelMaildirMessageInfo *info, const char *name);
72
73 /* TODO: could proably use get_string stuff */
74 #define camel_maildir_info_filename(x) (((CamelMaildirMessageInfo *)x)->filename)
75 #define camel_maildir_info_set_filename(x, s) (g_free(((CamelMaildirMessageInfo *)x)->filename),((CamelMaildirMessageInfo *)x)->filename = s)
76
77 G_END_DECLS
78
79 #endif /* ! _CAMEL_MAILDIR_SUMMARY_H */