Fix FSF address (Tobias Mueller, #470445)
[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 Lesser 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 Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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-digest-folder.h"
31 #include "camel-digest-store.h"
32 #include "camel-exception.h"
33 #include "camel-private.h"
34
35 #define d(x)
36
37 static CamelFolder *digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
38 static void digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
39 static void digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex);
40 static CamelFolder *digest_get_trash  (CamelStore *store, CamelException *ex);
41 static CamelFolder *digest_get_junk  (CamelStore *store, CamelException *ex);
42
43 static CamelFolderInfo *digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
44
45 static void camel_digest_store_class_init (CamelDigestStoreClass *klass);
46 static void camel_digest_store_init       (CamelDigestStore *obj);
47 static void camel_digest_store_finalise   (CamelObject *obj);
48
49 static int digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
50 static int digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
51
52 static CamelStoreClass *parent_class = NULL;
53
54
55 CamelType
56 camel_digest_store_get_type (void)
57 {
58         static CamelType type = CAMEL_INVALID_TYPE;
59         
60         if (type == CAMEL_INVALID_TYPE) {
61                 type = camel_type_register (camel_store_get_type (),
62                                             "CamelDigestStore",
63                                             sizeof (CamelDigestStore),
64                                             sizeof (CamelDigestStoreClass),
65                                             (CamelObjectClassInitFunc) camel_digest_store_class_init,
66                                             NULL,
67                                             (CamelObjectInitFunc) camel_digest_store_init,
68                                             (CamelObjectFinalizeFunc) camel_digest_store_finalise);
69         }
70         
71         return type;
72 }
73
74 static void
75 camel_digest_store_class_init (CamelDigestStoreClass *klass)
76 {
77         CamelObjectClass *object_class = (CamelObjectClass *) klass;
78         CamelStoreClass *store_class = (CamelStoreClass *) klass;
79         
80         parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ()));
81         
82         /* virtual method overload */
83         object_class->setv = digest_setv;
84         object_class->getv = digest_getv;
85         
86         store_class->get_folder = digest_get_folder;
87         store_class->rename_folder = digest_rename_folder;
88         store_class->delete_folder = digest_delete_folder;
89         store_class->get_folder_info = digest_get_folder_info;
90         store_class->free_folder_info = camel_store_free_folder_info_full;
91         
92         store_class->get_trash = digest_get_trash;
93         store_class->get_junk = digest_get_junk;
94 }
95
96 static void
97 camel_digest_store_init (CamelDigestStore *obj)
98 {
99         CamelStore *store = (CamelStore *) obj;
100         
101         /* we dont want a vtrash and vjunk on this one */
102         store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);      
103 }
104
105 static void
106 camel_digest_store_finalise (CamelObject *obj)
107 {
108         
109 }
110
111 static int
112 digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
113 {
114         /* CamelDigestStore doesn't currently have anything to set */
115         return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
116 }
117
118 static int
119 digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
120 {
121         /* CamelDigestStore doesn't currently have anything to get */
122         return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
123 }
124
125
126 /**
127  * camel_digest_store_new:
128  * @url:
129  *
130  * Create a new CamelDigestStore object.
131  * 
132  * Return value: A new CamelDigestStore widget.
133  **/
134 CamelStore *
135 camel_digest_store_new (const char *url)
136 {
137         CamelStore *store;
138         CamelURL *uri;
139         
140         uri = camel_url_new (url, NULL);
141         if (!uri)
142                 return NULL;
143         
144         store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ()));
145         CAMEL_SERVICE (store)->url = uri;
146         
147         return store;
148 }
149
150 static CamelFolder *
151 digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
152 {
153         return NULL;
154 }
155
156 static CamelFolder *
157 digest_get_trash (CamelStore *store, CamelException *ex)
158 {
159         return NULL;
160 }
161
162 static CamelFolder *
163 digest_get_junk (CamelStore *store, CamelException *ex)
164 {
165         return NULL;
166 }
167
168 static CamelFolderInfo *
169 digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
170 {
171         return NULL;
172 }
173
174 static void
175 digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
176 {
177         
178 }
179
180 static void
181 digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
182 {
183         
184 }