| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: (C) 1999-2008 Novell, Inc. (www.novell.com) |
| 3 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
*/ |
| 5 |
|
| 6 |
#include "evolution-ews-config.h" |
| 7 |
|
| 8 |
#include <string.h> |
| 9 |
#include <glib/gi18n-lib.h> |
| 10 |
|
| 11 |
#include <libedata-cal/libedata-cal.h> |
| 12 |
|
| 13 |
#include "common/e-oauth2-service-office365.h" |
| 14 |
#include "common/e-source-ews-folder.h" |
| 15 |
|
| 16 |
#include "e-cal-backend-ews.h" |
| 17 |
|
| 18 |
#define FACTORY_NAME "ews" |
| 19 |
|
| 20 |
typedef ECalBackendFactory ECalBackendEwsEventsFactory; |
| 21 |
typedef ECalBackendFactoryClass ECalBackendEwsEventsFactoryClass; |
| 22 |
|
| 23 |
typedef ECalBackendFactory ECalBackendEwsJournalFactory; |
| 24 |
typedef ECalBackendFactoryClass ECalBackendEwsJournalFactoryClass; |
| 25 |
|
| 26 |
typedef ECalBackendFactory ECalBackendEwsTodosFactory; |
| 27 |
typedef ECalBackendFactoryClass ECalBackendEwsTodosFactoryClass; |
| 28 |
|
| 29 |
static EModule *e_module; |
| 30 |
|
| 31 |
/* Module Entry Points */ |
| 32 |
void e_module_load (GTypeModule *type_module); |
| 33 |
void e_module_unload (GTypeModule *type_module); |
| 34 |
|
| 35 |
/* Forward Declarations */ |
| 36 |
GType e_cal_backend_ews_events_factory_get_type (void); |
| 37 |
GType e_cal_backend_ews_journal_factory_get_type (void); |
| 38 |
GType e_cal_backend_ews_todos_factory_get_type (void); |
| 39 |
|
| 40 |
G_DEFINE_DYNAMIC_TYPE ( |
| 41 |
ECalBackendEwsEventsFactory, |
| 42 |
e_cal_backend_ews_events_factory, |
| 43 |
E_TYPE_CAL_BACKEND_FACTORY) |
| 44 |
|
| 45 |
G_DEFINE_DYNAMIC_TYPE ( |
| 46 |
ECalBackendEwsJournalFactory, |
| 47 |
e_cal_backend_ews_journal_factory, |
| 48 |
E_TYPE_CAL_BACKEND_FACTORY) |
| 49 |
|
| 50 |
G_DEFINE_DYNAMIC_TYPE ( |
| 51 |
ECalBackendEwsTodosFactory, |
| 52 |
e_cal_backend_ews_todos_factory, |
| 53 |
E_TYPE_CAL_BACKEND_FACTORY) |
| 54 |
|
| 55 |
static void |
| 56 |
e_cal_backend_ews_events_factory_class_init (ECalBackendFactoryClass *class) |
| 57 |
{ |
| 58 |
EBackendFactoryClass *backend_factory_class; |
| 59 |
|
| 60 |
backend_factory_class = E_BACKEND_FACTORY_CLASS (class); |
| 61 |
backend_factory_class->e_module = e_module; |
| 62 |
backend_factory_class->share_subprocess = TRUE; |
| 63 |
|
| 64 |
class->factory_name = FACTORY_NAME; |
| 65 |
class->component_kind = I_CAL_VEVENT_COMPONENT; |
| 66 |
class->backend_type = E_TYPE_CAL_BACKEND_EWS; |
| 67 |
} |
| 68 |
|
| 69 |
static void |
| 70 |
e_cal_backend_ews_events_factory_class_finalize (ECalBackendFactoryClass *class) |
| 71 |
{ |
| 72 |
} |
| 73 |
|
| 74 |
static void |
| 75 |
e_cal_backend_ews_events_factory_init (ECalBackendFactory *factory) |
| 76 |
{ |
| 77 |
} |
| 78 |
|
| 79 |
static void |
| 80 |
e_cal_backend_ews_journal_factory_class_init (ECalBackendFactoryClass *class) |
| 81 |
{ |
| 82 |
EBackendFactoryClass *backend_factory_class; |
| 83 |
|
| 84 |
backend_factory_class = E_BACKEND_FACTORY_CLASS (class); |
| 85 |
backend_factory_class->e_module = e_module; |
| 86 |
backend_factory_class->share_subprocess = TRUE; |
| 87 |
|
| 88 |
class->factory_name = FACTORY_NAME; |
| 89 |
class->component_kind = I_CAL_VJOURNAL_COMPONENT; |
| 90 |
class->backend_type = E_TYPE_CAL_BACKEND_EWS; |
| 91 |
} |
| 92 |
|
| 93 |
static void |
| 94 |
e_cal_backend_ews_journal_factory_class_finalize (ECalBackendFactoryClass *class) |
| 95 |
{ |
| 96 |
} |
| 97 |
|
| 98 |
static void |
| 99 |
e_cal_backend_ews_journal_factory_init (ECalBackendFactory *factory) |
| 100 |
{ |
| 101 |
} |
| 102 |
|
| 103 |
static void |
| 104 |
e_cal_backend_ews_todos_factory_class_init (ECalBackendFactoryClass *class) |
| 105 |
{ |
| 106 |
EBackendFactoryClass *backend_factory_class; |
| 107 |
|
| 108 |
backend_factory_class = E_BACKEND_FACTORY_CLASS (class); |
| 109 |
backend_factory_class->e_module = e_module; |
| 110 |
backend_factory_class->share_subprocess = TRUE; |
| 111 |
|
| 112 |
class->factory_name = FACTORY_NAME; |
| 113 |
class->component_kind = I_CAL_VTODO_COMPONENT; |
| 114 |
class->backend_type = E_TYPE_CAL_BACKEND_EWS; |
| 115 |
} |
| 116 |
|
| 117 |
static void |
| 118 |
e_cal_backend_ews_todos_factory_class_finalize (ECalBackendFactoryClass *class) |
| 119 |
{ |
| 120 |
} |
| 121 |
|
| 122 |
static void |
| 123 |
e_cal_backend_ews_todos_factory_init (ECalBackendFactory *factory) |
| 124 |
{ |
| 125 |
} |
| 126 |
|
| 127 |
G_MODULE_EXPORT void |
| 128 |
e_module_load (GTypeModule *type_module) |
| 129 |
{ |
| 130 |
bindtextdomain (GETTEXT_PACKAGE, EXCHANGE_EWS_LOCALEDIR); |
| 131 |
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); |
| 132 |
|
| 133 |
e_module = E_MODULE (type_module); |
| 134 |
|
| 135 |
e_source_ews_folder_type_register (type_module); |
| 136 |
e_oauth2_service_office365_type_register (type_module); |
| 137 |
|
| 138 |
e_cal_backend_ews_events_factory_register_type (type_module); |
| 139 |
e_cal_backend_ews_journal_factory_register_type (type_module); |
| 140 |
e_cal_backend_ews_todos_factory_register_type (type_module); |
| 141 |
} |
| 142 |
|
| 143 |
G_MODULE_EXPORT void |
| 144 |
e_module_unload (GTypeModule *type_module) |
| 145 |
{ |
| 146 |
e_module = NULL; |
| 147 |
} |