1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Authors: Jeffrey Stedfast <fejj@ximian.com>
5 * Copyright 2002 Ximian, Inc. (www.ximian.com)
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
30 #include "camel-exception.h"
31 #include "camel-digest-store.h"
32 #include "camel-digest-folder.h"
34 #include "camel-private.h"
38 static CamelFolder *digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
39 static void digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
40 static void digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex);
41 static void digest_init_trash (CamelStore *store);
42 static CamelFolder *digest_get_trash (CamelStore *store, CamelException *ex);
44 static CamelFolderInfo *digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
46 static void camel_digest_store_class_init (CamelDigestStoreClass *klass);
47 static void camel_digest_store_init (CamelDigestStore *obj);
48 static void camel_digest_store_finalise (CamelObject *obj);
50 static CamelStoreClass *camel_digest_store_parent = NULL;
54 camel_digest_store_get_type (void)
56 static CamelType type = CAMEL_INVALID_TYPE;
58 if (type == CAMEL_INVALID_TYPE) {
59 type = camel_type_register (camel_store_get_type (),
61 sizeof (CamelDigestStore),
62 sizeof (CamelDigestStoreClass),
63 (CamelObjectClassInitFunc) camel_digest_store_class_init,
65 (CamelObjectInitFunc) camel_digest_store_init,
66 (CamelObjectFinalizeFunc) camel_digest_store_finalise);
73 camel_digest_store_class_init (CamelDigestStoreClass *klass)
75 CamelStoreClass *store_class = (CamelStoreClass *) klass;
77 camel_digest_store_parent = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ()));
79 /* virtual method overload */
80 store_class->get_folder = digest_get_folder;
81 store_class->rename_folder = digest_rename_folder;
82 store_class->delete_folder = digest_delete_folder;
83 store_class->get_folder_info = digest_get_folder_info;
84 store_class->free_folder_info = camel_store_free_folder_info_full;
86 store_class->init_trash = digest_init_trash;
87 store_class->get_trash = digest_get_trash;
91 camel_digest_store_init (CamelDigestStore *obj)
93 CamelStore *store = (CamelStore *) obj;
95 /* we dont want a vtrash on this one */
96 store->flags &= ~(CAMEL_STORE_VTRASH);
100 camel_digest_store_finalise (CamelObject *obj)
107 * camel_digest_store_new:
109 * Create a new CamelDigestStore object.
111 * Return value: A new CamelDigestStore widget.
114 camel_digest_store_new (void)
116 CamelStore *store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ()));
122 digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
128 digest_init_trash (CamelStore *store)
135 digest_get_trash (CamelStore *store, CamelException *ex)
140 static CamelFolderInfo *
141 digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
147 digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
153 digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)