diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-10-27 05:22:17 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-10-27 05:22:17 +0800 |
commit | aad2d708c31bc7b238fc4f7027e5c48fcee5f062 (patch) | |
tree | 5b68028a7a5dc5a7f6c5106ea51f7287b9980644 /camel/providers/imap4/camel-imap4-store-summary.h | |
parent | 99cbfb261554f038d9b709d2b3dab26a7f0e7bef (diff) | |
download | gsoc2013-evolution-aad2d708c31bc7b238fc4f7027e5c48fcee5f062.tar.gz gsoc2013-evolution-aad2d708c31bc7b238fc4f7027e5c48fcee5f062.tar.zst gsoc2013-evolution-aad2d708c31bc7b238fc4f7027e5c48fcee5f062.zip |
New files implementing a folder-info cache for offline mode (and faster
2004-10-26 Jeffrey Stedfast <fejj@novell.com>
* providers/imap4/camel-imap4-store-summary.[c,h]: New files
implementing a folder-info cache for offline mode (and faster
startup I guess).
* providers/imap4/camel-imap4-store.c (imap4_build_folder_info):
Cache the folder-info for later use in offline mode.
* providers/imap4/camel-imap4-utils.c
(camel_imap4_get_path_delim): Instead of assigning top = "INBOX",
do strcpy (top, "INBOX") so that we can later modify the
string. Fixes bug #68814.
2004-10-25 Jeffrey Stedfast <fejj@novell.com>
* providers/imap4/camel-imap4-engine.c (engine_parse_namespace):
Updated to use the public function in camel-imap4-utils.c
(camel_imap4_engine_finalize): Same.
* providers/imap4/camel-imap4-store.c (imap4_construct): Setup and
load the store summary.
(camel_imap4_store_finalize): Unref the store summary.
(imap4_get_folder): Implemented offline support.
(imap4_folder_utf7_name): Pass the summary to get_delim rather
than the engine.
(imap4_create_folder): Same.
(imap4_reconnect): Update the namespaces on the store summary.
(connect_to_server): Update the store summary capabilities.
* providers/imap4/camel-imap4-utils.c
(camel_imap4_get_path_delim): Now takes a store-summary rather
than an engine so that it will work in offline mode.
(camel_imap4_namespace_clear): Moved here from
camel-imap4-engine.c
(camel_imap4_namespace_list_copy): New convenience function.
(camel_imap4_namespace_list_free): New.
* providers/imap4/camel-imap4-folder.c (camel_imap4_folder_new):
Check the return value of summary loading in offline mode (if it
fails, we can't get the folder).
svn path=/trunk/; revision=27730
Diffstat (limited to 'camel/providers/imap4/camel-imap4-store-summary.h')
-rw-r--r-- | camel/providers/imap4/camel-imap4-store-summary.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/camel/providers/imap4/camel-imap4-store-summary.h b/camel/providers/imap4/camel-imap4-store-summary.h new file mode 100644 index 0000000000..f9ddc54f19 --- /dev/null +++ b/camel/providers/imap4/camel-imap4-store-summary.h @@ -0,0 +1,90 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: Jeffrey Stedfast <fejj@novell.com> + * + * Copyright 2004 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. + * + */ + + +#ifndef __CAMEL_IMAP_STORE_SUMMARY_H__ +#define __CAMEL_IMAP_STORE_SUMMARY_H__ + +#include <camel/camel-store-summary.h> +#include "camel-imap4-engine.h" + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus */ + +#define CAMEL_IMAP4_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imap4_store_summary_get_type (), CamelIMAP4StoreSummary) +#define CAMEL_IMAP4_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap4_store_summary_get_type (), CamelIMAP4StoreSummaryClass) +#define CAMEL_IS_IMAP4_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imap4_store_summary_get_type ()) + +typedef struct _CamelIMAP4StoreSummary CamelIMAP4StoreSummary; +typedef struct _CamelIMAP4StoreSummaryClass CamelIMAP4StoreSummaryClass; + +typedef struct _CamelIMAP4StoreInfo CamelIMAP4StoreInfo; + +enum { + CAMEL_IMAP4_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST, + CAMEL_IMAP4_STORE_INFO_LAST, +}; + + +struct _CamelFolderInfo; + + +struct _CamelIMAP4StoreInfo { + CamelStoreInfo info; +}; + +struct _CamelIMAP4StoreSummary { + CamelStoreSummary summary; + + struct _CamelIMAP4StoreSummaryPrivate *priv; + + /* header info */ + guint32 version; + + CamelIMAP4NamespaceList *namespaces; + guint32 capa; +}; + +struct _CamelIMAP4StoreSummaryClass { + CamelStoreSummaryClass summary_class; +}; + + +CamelType camel_imap4_store_summary_get_type (void); + +CamelIMAP4StoreSummary *camel_imap4_store_summary_new (void); + +void camel_imap4_store_summary_set_capabilities (CamelIMAP4StoreSummary *s, guint32 capa); +void camel_imap4_store_summary_set_namespaces (CamelIMAP4StoreSummary *s, const CamelIMAP4NamespaceList *ns); + +/* add the info to the cache if we don't already have it, otherwise do nothing */ +void camel_imap4_store_summary_note_info (CamelIMAP4StoreSummary *s, struct _CamelFolderInfo *fi); + +struct _CamelFolderInfo *camel_imap4_store_summary_get_folder_info (CamelIMAP4StoreSummary *s, const char *top, guint32 flags); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __CAMEL_IMAP4_STORE_SUMMARY_H__ */ |