Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / providers / imap / camel-imap-store-summary.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2002 Ximian Inc.
4  *
5  * Authors: Michael Zucchi <notzed@ximian.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of version 2 of the GNU Lesser General Public
9  * License as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22
23 #ifndef _CAMEL_IMAP_STORE_SUMMARY_H
24 #define _CAMEL_IMAP_STORE_SUMMARY_H
25
26 #include <camel/camel-object.h>
27 #include <camel/camel-store-summary.h>
28
29 #define CAMEL_IMAP_STORE_SUMMARY(obj)         CAMEL_CHECK_CAST (obj, camel_imap_store_summary_get_type (), CamelImapStoreSummary)
30 #define CAMEL_IMAP_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap_store_summary_get_type (), CamelImapStoreSummaryClass)
31 #define CAMEL_IS_IMAP_STORE_SUMMARY(obj)      CAMEL_CHECK_TYPE (obj, camel_imap_store_summary_get_type ())
32
33 G_BEGIN_DECLS
34
35 typedef struct _CamelImapStoreSummary      CamelImapStoreSummary;
36 typedef struct _CamelImapStoreSummaryClass CamelImapStoreSummaryClass;
37
38 typedef struct _CamelImapStoreInfo CamelImapStoreInfo;
39
40 enum {
41         CAMEL_IMAP_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
42         CAMEL_IMAP_STORE_INFO_LAST,
43 };
44
45 struct _CamelImapStoreInfo {
46         CamelStoreInfo info;
47         char *full_name;
48 };
49
50 typedef struct _CamelImapStoreNamespace CamelImapStoreNamespace;
51
52 struct _CamelImapStoreNamespace {
53         char *path;             /* display path */
54         char *full_name;        /* real name */
55         char sep;               /* directory separator */
56 };
57
58 struct _CamelImapStoreSummary {
59         CamelStoreSummary summary;
60
61         struct _CamelImapStoreSummaryPrivate *priv;
62
63         /* header info */
64         guint32 version;        /* version of base part of file */
65         guint32 capabilities;
66         CamelImapStoreNamespace *namespace; /* eventually to be a list */
67 };
68
69 struct _CamelImapStoreSummaryClass {
70         CamelStoreSummaryClass summary_class;
71 };
72
73 CamelType                        camel_imap_store_summary_get_type      (void);
74 CamelImapStoreSummary      *camel_imap_store_summary_new        (void);
75
76 /* TODO: this api needs some more work, needs to support lists */
77 CamelImapStoreNamespace *camel_imap_store_summary_namespace_new(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
78 void camel_imap_store_summary_namespace_set(CamelImapStoreSummary *s, CamelImapStoreNamespace *ns);
79 CamelImapStoreNamespace *camel_imap_store_summary_namespace_find_path(CamelImapStoreSummary *s, const char *path);
80 CamelImapStoreNamespace *camel_imap_store_summary_namespace_find_full(CamelImapStoreSummary *s, const char *full_name);
81
82 /* converts to/from utf8 canonical nasmes */
83 char *camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
84 char *camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path, char dir_sep);
85
86 CamelImapStoreInfo *camel_imap_store_summary_full_name(CamelImapStoreSummary *s, const char *full_name);
87 CamelImapStoreInfo *camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
88
89 /* a convenience lookup function. always use this if path known */
90 char *camel_imap_store_summary_full_from_path(CamelImapStoreSummary *s, const char *path);
91
92 /* helper macro's */
93 #define camel_imap_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAP_STORE_INFO_FULL_NAME))
94
95 G_END_DECLS
96
97 #endif /* ! _CAMEL_IMAP_STORE_SUMMARY_H */