Debian Codegraph @

src/Microsoft365/addressbook/e-book-backend-m365-factory.c

raw
1 /*
2 * SPDX-FileCopyrightText: (C) 2020 Red Hat (www.redhat.com)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6 #include "evolution-ews-config.h"
7
8 #include <glib/gi18n-lib.h>
9
10 #include <libedata-book/libedata-book.h>
11
12 #include "common/e-oauth2-service-microsoft365.h"
13 #include "common/e-source-m365-folder.h"
14
15 #include "e-book-backend-m365.h"
16
17 typedef EBookBackendFactory EBookBackendM365Factory;
18 typedef EBookBackendFactoryClass EBookBackendM365FactoryClass;
19
20 static EModule *e_module;
21
22 /* Module Entry Points */
23 void e_module_load (GTypeModule *type_module);
24 void e_module_unload (GTypeModule *type_module);
25
26 /* Forward Declarations */
27 GType e_book_backend_m365_factory_get_type (void);
28
29 G_DEFINE_DYNAMIC_TYPE (EBookBackendM365Factory, e_book_backend_m365_factory, E_TYPE_BOOK_BACKEND_FACTORY)
30
31 static void
32 e_book_backend_m365_factory_class_init (EBookBackendFactoryClass *class)
33 {
34 EBackendFactoryClass *backend_factory_class;
35
36 backend_factory_class = E_BACKEND_FACTORY_CLASS (class);
37 backend_factory_class->e_module = e_module;
38 backend_factory_class->share_subprocess = TRUE;
39
40 class->factory_name = "microsoft365";
41 class->backend_type = E_TYPE_BOOK_BACKEND_M365;
42 }
43
44 static void
45 e_book_backend_m365_factory_class_finalize (EBookBackendFactoryClass *class)
46 {
47 }
48
49 static void
50 e_book_backend_m365_factory_init (EBookBackendFactory *factory)
51 {
52 }
53
54 G_MODULE_EXPORT void
55 e_module_load (GTypeModule *type_module)
56 {
57 bindtextdomain (GETTEXT_PACKAGE, M365_LOCALEDIR);
58 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
59
60 e_module = E_MODULE (type_module);
61
62 e_oauth2_service_microsoft365_type_register (type_module);
63 e_source_m365_folder_type_register (type_module);
64 e_book_backend_m365_factory_register_type (type_module);
65 }
66
67 G_MODULE_EXPORT void
68 e_module_unload (GTypeModule *type_module)
69 {
70 e_module = NULL;
71 }