1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
5 * Authors: Michael Zucchi <notzed@ximian.com>
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.
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.
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.
22 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
23 #error "Only <camel/camel.h> can be included directly."
27 #ifndef CAMEL_IMAPX_STORE_SUMMARY_H
28 #define CAMEL_IMAPX_STORE_SUMMARY_H
30 #include <camel/camel-store-summary.h>
32 /* Standard GObject macros */
33 #define CAMEL_TYPE_IMAPX_STORE_SUMMARY \
34 (camel_imapx_store_summary_get_type ())
35 #define CAMEL_IMAPX_STORE_SUMMARY(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST \
37 ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummary))
38 #define CAMEL_IMAPX_STORE_SUMMARY_CLASS(cls) \
39 (G_TYPE_CHECK_CLASS_CAST \
40 ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass))
41 #define CAMEL_IS_IMAPX_STORE_SUMMARY(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE \
43 ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY))
44 #define CAMEL_IS_IMAPX_STORE_SUMMARY_CLASS(cls) \
45 (G_TYPE_CHECK_CLASS_TYPE \
46 ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY))
47 #define CAMEL_IMAPX_STORE_SUMMARY_GET_CLASS(obj) \
48 (G_TYPE_INSTANCE_GET_CLASS \
49 ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass))
53 typedef struct _CamelIMAPXStoreSummary CamelIMAPXStoreSummary;
54 typedef struct _CamelIMAPXStoreSummaryClass CamelIMAPXStoreSummaryClass;
56 typedef struct _CamelIMAPXStoreInfo CamelIMAPXStoreInfo;
59 CAMEL_IMAPX_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
60 CAMEL_IMAPX_STORE_INFO_LAST
63 struct _CamelIMAPXStoreInfo {
68 typedef struct _CamelIMAPXStoreNamespace CamelIMAPXStoreNamespace;
70 struct _CamelIMAPXStoreNamespace {
71 CamelIMAPXStoreNamespace *next;
72 gchar *path; /* display path */
73 gchar *full_name; /* real name */
74 gchar sep; /* directory separator */
77 typedef struct _CamelIMAPXNamespaceList {
78 CamelIMAPXStoreNamespace *personal;
79 CamelIMAPXStoreNamespace *other;
80 CamelIMAPXStoreNamespace *shared;
81 } CamelIMAPXNamespaceList;
83 struct _CamelIMAPXStoreSummary {
84 CamelStoreSummary parent;
87 guint32 version; /* version of base part of file */
89 CamelIMAPXNamespaceList *namespaces; /* eventually to be a list */
92 struct _CamelIMAPXStoreSummaryClass {
93 CamelStoreSummaryClass parent_class;
96 GType camel_imapx_store_summary_get_type (void);
97 CamelIMAPXStoreSummary *
98 camel_imapx_store_summary_new (void);
100 /* TODO: this api needs some more work, needs to support lists */
101 CamelIMAPXStoreNamespace *
102 camel_imapx_store_summary_namespace_new
103 (CamelIMAPXStoreSummary *s,
104 const gchar *full_name,
106 void camel_imapx_store_summary_namespace_set
107 (CamelIMAPXStoreSummary *s,
108 CamelIMAPXStoreNamespace *ns);
109 CamelIMAPXStoreNamespace *
110 camel_imapx_store_summary_namespace_find_path
111 (CamelIMAPXStoreSummary *s,
113 CamelIMAPXStoreNamespace *
114 camel_imapx_store_summary_namespace_find_full
115 (CamelIMAPXStoreSummary *s,
116 const gchar *full_name);
118 /* converts to/from utf8 canonical nasmes */
119 gchar * camel_imapx_store_summary_full_to_path
120 (CamelIMAPXStoreSummary *s,
121 const gchar *full_name,
123 gchar * camel_imapx_store_summary_path_to_full
124 (CamelIMAPXStoreSummary *s,
128 CamelIMAPXStoreInfo *
129 camel_imapx_store_summary_full_name
130 (CamelIMAPXStoreSummary *s,
131 const gchar *full_name);
132 CamelIMAPXStoreInfo *
133 camel_imapx_store_summary_add_from_full
134 (CamelIMAPXStoreSummary *s,
135 const gchar *full_name,
138 /* a convenience lookup function. always use this if path known */
139 gchar * camel_imapx_store_summary_full_from_path
140 (CamelIMAPXStoreSummary *s,
143 void camel_imapx_store_summary_set_namespaces
144 (CamelIMAPXStoreSummary *summary,
145 const CamelIMAPXNamespaceList *nsl);
148 #define camel_imapx_store_info_full_name(s, i) \
149 (camel_store_info_string ( \
150 (CamelStoreSummary *) s, (const CamelStoreInfo *) i, \
151 CAMEL_IMAPX_STORE_INFO_FULL_NAME))
155 #endif /* CAMEL_IMAP_STORE_SUMMARY_H */