No issues found
1 /*
2 * camel-null-store.c
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
16 *
17 */
18
19 #include "camel-null-store.h"
20
21 #include <config.h>
22 #include <glib/gi18n-lib.h>
23
24 G_DEFINE_TYPE (CamelNullStore, camel_null_store, CAMEL_TYPE_STORE)
25
26 static CamelProvider null_provider = {
27 /* protocol: */ "none",
28 /* name: */ N_("None"),
29 /* description: */ NULL,
30 /* domain: */ "mail",
31
32 /* XXX This provider is not really a "source", the
33 * flag just gets it shown in the account editor. */
34 (CamelProviderFlags) CAMEL_PROVIDER_IS_SOURCE,
35
36 (CamelProviderURLFlags) 0,
37 (CamelProviderConfEntry *) NULL,
38 (CamelProviderPortEntry *) NULL,
39 (CamelProviderAutoDetectFunc) NULL,
40 /* object_types: */ { 0, 0 }, /* see below */
41 /* authtypes: */ NULL,
42 (GHashFunc) camel_url_hash,
43 (GEqualFunc) camel_url_equal,
44 GETTEXT_PACKAGE
45 };
46
47 static void
48 camel_null_store_class_init (CamelNullStoreClass *class)
49 {
50 CamelServiceClass *service_class;
51
52 /* We should never be invoking methods on a CamelNullStore,
53 * but thankfully, in case we do, CamelStore has NULL function
54 * pointer checks in all of its wrapper functions. So it will
55 * emit a runtime warning, which is what we want, and frees us
56 * from having to override any class methods here. */
57
58 service_class = CAMEL_SERVICE_CLASS (class);
59 service_class->settings_type = CAMEL_TYPE_SETTINGS;
60 }
61
62 static void
63 camel_null_store_init (CamelNullStore *store)
64 {
65 /* nothing to do */
66 }
67
68 void
69 camel_null_store_register_provider (void)
70 {
71 GType object_type;
72
73 object_type = CAMEL_TYPE_NULL_STORE;
74 null_provider.object_types[CAMEL_PROVIDER_STORE] = object_type;
75
76 object_type = G_TYPE_INVALID;
77 null_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = object_type;
78
79 camel_provider_register (&null_provider);
80 }