I#27 - [IMAPx] Ignore DavMail's CR/LF in BODYSTRUCTURE response
[evolution-data-server.git] / src / libedataserver / e-oauth2-service-base.c
blobae4ddcf05c4162d91bbb0168aa30592a7e5d2172
1 /*
2 * Copyright (C) 2018 Red Hat, Inc. (www.redhat.com)
4 * This library is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * SECTION: e-oauth2-service-base
19 * @include: libebackend/libebackend.h
20 * @short_description: An abstract base class for #EOAuth2Service implementations
22 * An abstract base class, which can be used by any #EOAuth2Service
23 * implementation. It registers itself to #EOAuth2Services at the end
24 * of its constructed method. The descendant implements the #EOAuth2ServiceInterface.
25 **/
27 #include "evolution-data-server-config.h"
29 #include "e-extension.h"
30 #include "e-oauth2-services.h"
32 #include "e-oauth2-service-base.h"
34 G_DEFINE_ABSTRACT_TYPE (EOAuth2ServiceBase, e_oauth2_service_base, E_TYPE_EXTENSION)
36 static void
37 oauth2_service_base_constructed (GObject *object)
39 EExtensible *extensible;
41 extensible = e_extension_get_extensible (E_EXTENSION (object));
43 /* Chain up to parent's method. */
44 G_OBJECT_CLASS (e_oauth2_service_base_parent_class)->constructed (object);
46 e_oauth2_services_add (E_OAUTH2_SERVICES (extensible), E_OAUTH2_SERVICE (object));
49 static void
50 e_oauth2_service_base_class_init (EOAuth2ServiceBaseClass *klass)
52 GObjectClass *object_class;
53 EExtensionClass *extension_class;
55 object_class = G_OBJECT_CLASS (klass);
56 object_class->constructed = oauth2_service_base_constructed;
58 extension_class = E_EXTENSION_CLASS (klass);
59 extension_class->extensible_type = E_TYPE_OAUTH2_SERVICES;
62 static void
63 e_oauth2_service_base_init (EOAuth2ServiceBase *base)