1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2002 Ximian Inc.
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.
23 #ifndef _CAMEL_IMAPP_STORE_SUMMARY_H
24 #define _CAMEL_IMAPP_STORE_SUMMARY_H
26 #include <camel/camel-object.h>
27 #include <camel/camel-store-summary.h>
29 #define CAMEL_IMAPP_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imapp_store_summary_get_type (), CamelIMAPPStoreSummary)
30 #define CAMEL_IMAPP_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapp_store_summary_get_type (), CamelIMAPPStoreSummaryClass)
31 #define CAMEL_IS_IMAP_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imapp_store_summary_get_type ())
35 typedef struct _CamelIMAPPStoreSummary CamelIMAPPStoreSummary;
36 typedef struct _CamelIMAPPStoreSummaryClass CamelIMAPPStoreSummaryClass;
38 typedef struct _CamelIMAPPStoreInfo CamelIMAPPStoreInfo;
41 CAMEL_IMAPP_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
42 CAMEL_IMAPP_STORE_INFO_LAST,
45 struct _CamelIMAPPStoreInfo {
50 typedef struct _CamelIMAPPStoreNamespace CamelIMAPPStoreNamespace;
52 struct _CamelIMAPPStoreNamespace {
53 char *path; /* display path */
54 char *full_name; /* real name */
55 char sep; /* directory separator */
58 struct _CamelIMAPPStoreSummary {
59 CamelStoreSummary summary;
61 struct _CamelIMAPPStoreSummaryPrivate *priv;
64 guint32 version; /* version of base part of file */
66 CamelIMAPPStoreNamespace *namespace; /* eventually to be a list */
69 struct _CamelIMAPPStoreSummaryClass {
70 CamelStoreSummaryClass summary_class;
73 CamelType camel_imapp_store_summary_get_type (void);
74 CamelIMAPPStoreSummary *camel_imapp_store_summary_new (void);
76 /* TODO: this api needs some more work, needs to support lists */
77 CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_new(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
78 void camel_imapp_store_summary_namespace_set(CamelIMAPPStoreSummary *s, CamelIMAPPStoreNamespace *ns);
79 CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_find_path(CamelIMAPPStoreSummary *s, const char *path);
80 CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_find_full(CamelIMAPPStoreSummary *s, const char *full_name);
82 /* converts to/from utf8 canonical nasmes */
83 char *camel_imapp_store_summary_full_to_path(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
84 char *camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const char *path, char dir_sep);
86 CamelIMAPPStoreInfo *camel_imapp_store_summary_full_name(CamelIMAPPStoreSummary *s, const char *full_name);
87 CamelIMAPPStoreInfo *camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
89 /* a convenience lookup function. always use this if path known */
90 char *camel_imapp_store_summary_full_from_path(CamelIMAPPStoreSummary *s, const char *path);
93 #define camel_imapp_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAPP_STORE_INFO_FULL_NAME))
97 #endif /* ! _CAMEL_IMAPP_STORE_SUMMARY_H */