summaryrefslogtreecommitdiff
path: root/camel/camel-digest-store.c
blob: c5fe7071b125ca8ba3fde462fed271c4387c7c51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 *  Authors: Jeffrey Stedfast <fejj@ximian.com>
 *
 *  Copyright 2002 Ximian, Inc. (www.ximian.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.
 *
 */


#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <string.h>

#include "camel-exception.h"
#include "camel-digest-store.h"
#include "camel-digest-folder.h"

#include "camel-private.h"

#define d(x)

static CamelFolder *digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
static void digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
static void digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex);
static CamelFolder *digest_get_trash  (CamelStore *store, CamelException *ex);
static CamelFolder *digest_get_junk  (CamelStore *store, CamelException *ex);

static CamelFolderInfo *digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);

static void camel_digest_store_class_init (CamelDigestStoreClass *klass);
static void camel_digest_store_init       (CamelDigestStore *obj);
static void camel_digest_store_finalise   (CamelObject *obj);

static int digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
static int digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);

static CamelStoreClass *parent_class = NULL;


CamelType
camel_digest_store_get_type (void)
{
	static CamelType type = CAMEL_INVALID_TYPE;
	
	if (type == CAMEL_INVALID_TYPE) {
		type = camel_type_register (camel_store_get_type (),
					    "CamelDigestStore",
					    sizeof (CamelDigestStore),
					    sizeof (CamelDigestStoreClass),
					    (CamelObjectClassInitFunc) camel_digest_store_class_init,
					    NULL,
					    (CamelObjectInitFunc) camel_digest_store_init,
					    (CamelObjectFinalizeFunc) camel_digest_store_finalise);
	}
	
	return type;
}

static void
camel_digest_store_class_init (CamelDigestStoreClass *klass)
{
	CamelObjectClass *object_class = (CamelObjectClass *) klass;
	CamelStoreClass *store_class = (CamelStoreClass *) klass;
	
	parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ()));
	
	/* virtual method overload */
	object_class->setv = digest_setv;
	object_class->getv = digest_getv;
	
	store_class->get_folder = digest_get_folder;
	store_class->rename_folder = digest_rename_folder;
	store_class->delete_folder = digest_delete_folder;
	store_class->get_folder_info = digest_get_folder_info;
	store_class->free_folder_info = camel_store_free_folder_info_full;
	
	store_class->get_trash = digest_get_trash;
	store_class->get_junk = digest_get_junk;
}

static void
camel_digest_store_init (CamelDigestStore *obj)
{
	CamelStore *store = (CamelStore *) obj;
	
	/* we dont want a vtrash and vjunk on this one */
	store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);	
}

static void
camel_digest_store_finalise (CamelObject *obj)
{
	
}

static int
digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
{
	/* CamelDigestStore doesn't currently have anything to set */
	return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
}

static int
digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
	/* CamelDigestStore doesn't currently have anything to get */
	return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
}


/**
 * camel_digest_store_new:
 * @url:
 *
 * Create a new CamelDigestStore object.
 * 
 * Return value: A new CamelDigestStore widget.
 **/
CamelStore *
camel_digest_store_new (const char *url)
{
	CamelStore *store;
	CamelURL *uri;
	
	uri = camel_url_new (url, NULL);
	if (!uri)
		return NULL;
	
	store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ()));
	CAMEL_SERVICE (store)->url = uri;
	
	return store;
}

static CamelFolder *
digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
{
	return NULL;
}

static CamelFolder *
digest_get_trash (CamelStore *store, CamelException *ex)
{
	return NULL;
}

static CamelFolder *
digest_get_junk (CamelStore *store, CamelException *ex)
{
	return NULL;
}

static CamelFolderInfo *
digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
{
	return NULL;
}

static void
digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
{
	
}

static void
digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
{
	
}