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_IMAP_STORE_SUMMARY_H
24 #define _CAMEL_IMAP_STORE_SUMMARY_H
26 #include <camel/camel-object.h>
27 #include <camel/camel-store-summary.h>
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 ())
35 typedef struct _CamelImapStoreSummary CamelImapStoreSummary;
36 typedef struct _CamelImapStoreSummaryClass CamelImapStoreSummaryClass;
38 typedef struct _CamelImapStoreInfo CamelImapStoreInfo;
41 CAMEL_IMAP_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
42 CAMEL_IMAP_STORE_INFO_LAST,
45 struct _CamelImapStoreInfo {
50 typedef struct _CamelImapStoreNamespace CamelImapStoreNamespace;
52 struct _CamelImapStoreNamespace {
53 char *path; /* display path */
54 char *full_name; /* real name */
55 char sep; /* directory separator */
58 struct _CamelImapStoreSummary {
59 CamelStoreSummary summary;
61 struct _CamelImapStoreSummaryPrivate *priv;
64 guint32 version; /* version of base part of file */
66 CamelImapStoreNamespace *namespace; /* eventually to be a list */
69 struct _CamelImapStoreSummaryClass {
70 CamelStoreSummaryClass summary_class;
73 CamelType camel_imap_store_summary_get_type (void);
74 CamelImapStoreSummary *camel_imap_store_summary_new (void);
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);
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);
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);
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);
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))
97 #endif /* ! _CAMEL_IMAP_STORE_SUMMARY_H */