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."
26 #ifndef CAMEL_IMAPX_STORE_SUMMARY_H
27 #define CAMEL_IMAPX_STORE_SUMMARY_H
29 #include <camel/camel-store-summary.h>
31 /* Standard GObject macros */
32 #define CAMEL_TYPE_IMAPX_STORE_SUMMARY \
33 (camel_imapx_store_summary_get_type ())
34 #define CAMEL_IMAPX_STORE_SUMMARY(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST \
36 ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummary))
37 #define CAMEL_IMAPX_STORE_SUMMARY_CLASS(cls) \
38 (G_TYPE_CHECK_CLASS_CAST \
39 ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass))
40 #define CAMEL_IS_IMAPX_STORE_SUMMARY(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE \
42 ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY))
43 #define CAMEL_IS_IMAPX_STORE_SUMMARY_CLASS(cls) \
44 (G_TYPE_CHECK_CLASS_TYPE \
45 ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY))
46 #define CAMEL_IMAPX_STORE_SUMMARY_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS \
48 ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass))
52 typedef struct _CamelIMAPXStoreSummary CamelIMAPXStoreSummary;
53 typedef struct _CamelIMAPXStoreSummaryClass CamelIMAPXStoreSummaryClass;
55 typedef struct _CamelIMAPXStoreInfo CamelIMAPXStoreInfo;
58 CAMEL_IMAPX_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
59 CAMEL_IMAPX_STORE_INFO_LAST
62 struct _CamelIMAPXStoreInfo {
67 typedef struct _CamelIMAPXStoreNamespace CamelIMAPXStoreNamespace;
69 struct _CamelIMAPXStoreNamespace {
70 CamelIMAPXStoreNamespace *next;
71 gchar *path; /* display path */
72 gchar *full_name; /* real name */
73 gchar sep; /* directory separator */
76 typedef struct _CamelIMAPXNamespaceList {
77 CamelIMAPXStoreNamespace *personal;
78 CamelIMAPXStoreNamespace *other;
79 CamelIMAPXStoreNamespace *shared;
80 } CamelIMAPXNamespaceList;
82 struct _CamelIMAPXStoreSummary {
83 CamelStoreSummary parent;
86 guint32 version; /* version of base part of file */
88 CamelIMAPXNamespaceList *namespaces; /* eventually to be a list */
91 struct _CamelIMAPXStoreSummaryClass {
92 CamelStoreSummaryClass parent_class;
95 GType camel_imapx_store_summary_get_type (void);
96 CamelIMAPXStoreSummary *
97 camel_imapx_store_summary_new (void);
99 /* TODO: this api needs some more work, needs to support lists */
100 CamelIMAPXStoreNamespace *
101 camel_imapx_store_summary_namespace_new
102 (CamelIMAPXStoreSummary *s,
103 const gchar *full_name,
105 void camel_imapx_store_summary_namespace_set
106 (CamelIMAPXStoreSummary *s,
107 CamelIMAPXStoreNamespace *ns);
108 CamelIMAPXStoreNamespace *
109 camel_imapx_store_summary_namespace_find_path
110 (CamelIMAPXStoreSummary *s,
112 CamelIMAPXStoreNamespace *
113 camel_imapx_store_summary_namespace_find_full
114 (CamelIMAPXStoreSummary *s,
115 const gchar *full_name);
117 /* converts to/from utf8 canonical nasmes */
118 gchar * camel_imapx_store_summary_full_to_path
119 (CamelIMAPXStoreSummary *s,
120 const gchar *full_name,
122 gchar * camel_imapx_store_summary_path_to_full
123 (CamelIMAPXStoreSummary *s,
127 CamelIMAPXStoreInfo *
128 camel_imapx_store_summary_full_name
129 (CamelIMAPXStoreSummary *s,
130 const gchar *full_name);
131 CamelIMAPXStoreInfo *
132 camel_imapx_store_summary_add_from_full
133 (CamelIMAPXStoreSummary *s,
134 const gchar *full_name,
137 /* a convenience lookup function. always use this if path known */
138 gchar * camel_imapx_store_summary_full_from_path
139 (CamelIMAPXStoreSummary *s,
142 void camel_imapx_store_summary_set_namespaces
143 (CamelIMAPXStoreSummary *summary,
144 const CamelIMAPXNamespaceList *nsl);
147 #define camel_imapx_store_info_full_name(s, i) \
148 (camel_store_info_string ( \
149 (CamelStoreSummary *) s, (const CamelStoreInfo *) i, \
150 CAMEL_IMAPX_STORE_INFO_FULL_NAME))
154 #endif /* CAMEL_IMAP_STORE_SUMMARY_H */