A pretty empty store implementation to be the parent store of a
[platform/upstream/evolution-data-server.git] / camel / camel-digest-store.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Authors: Jeffrey Stedfast <fejj@ximian.com>
4  *
5  *  Copyright 2002 Ximian, Inc. (www.ximian.com)
6  *
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.
11  *
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.
16  *
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.
20  *
21  */
22
23
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27
28 #include <string.h>
29
30 #include "camel-exception.h"
31 #include "camel-digest-store.h"
32 #include "camel-digest-folder.h"
33
34 #include "camel-private.h"
35
36 #define d(x)
37
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);
43
44 static CamelFolderInfo *digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
45
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);
49
50 static CamelStoreClass *camel_digest_store_parent = NULL;
51
52
53 CamelType
54 camel_digest_store_get_type (void)
55 {
56         static CamelType type = CAMEL_INVALID_TYPE;
57         
58         if (type == CAMEL_INVALID_TYPE) {
59                 type = camel_type_register (camel_store_get_type (),
60                                             "CamelDigestStore",
61                                             sizeof (CamelDigestStore),
62                                             sizeof (CamelDigestStoreClass),
63                                             (CamelObjectClassInitFunc) camel_digest_store_class_init,
64                                             NULL,
65                                             (CamelObjectInitFunc) camel_digest_store_init,
66                                             (CamelObjectFinalizeFunc) camel_digest_store_finalise);
67         }
68         
69         return type;
70 }
71
72 static void
73 camel_digest_store_class_init (CamelDigestStoreClass *klass)
74 {
75         CamelStoreClass *store_class = (CamelStoreClass *) klass;
76         
77         camel_digest_store_parent = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ()));
78         
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;
85         
86         store_class->init_trash = digest_init_trash;
87         store_class->get_trash = digest_get_trash;
88 }
89
90 static void
91 camel_digest_store_init (CamelDigestStore *obj)
92 {
93         CamelStore *store = (CamelStore *) obj;
94         
95         /* we dont want a vtrash on this one */
96         store->flags &= ~(CAMEL_STORE_VTRASH);  
97 }
98
99 static void
100 camel_digest_store_finalise (CamelObject *obj)
101 {
102         
103 }
104
105
106 /**
107  * camel_digest_store_new:
108  *
109  * Create a new CamelDigestStore object.
110  * 
111  * Return value: A new CamelDigestStore widget.
112  **/
113 CamelStore *
114 camel_digest_store_new (void)
115 {
116         CamelStore *store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ()));
117         
118         return store;
119 }
120
121 static CamelFolder *
122 digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
123 {
124         return NULL;
125 }
126
127 static void
128 digest_init_trash (CamelStore *store)
129 {
130         /* no-op */
131         ;
132 }
133
134 static CamelFolder *
135 digest_get_trash (CamelStore *store, CamelException *ex)
136 {
137         return NULL;
138 }
139
140 static CamelFolderInfo *
141 digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
142 {
143         return NULL;
144 }
145
146 static void
147 digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
148 {
149         
150 }
151
152 static void
153 digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
154 {
155         
156 }