"Fossies" - the Fresh Open Source Software Archive

Member "evolution-mapi-3.46.1/src/collection/e-mapi-backend-factory.c" (2 Dec 2022, 3057 Bytes) of package /linux/misc/evolution-mapi-3.46.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "e-mapi-backend-factory.c" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * e-mapi-backend-factory.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 "e-mapi-backend-factory.h"
   20 
   21 #include "e-mapi-backend.h"
   22 
   23 G_DEFINE_DYNAMIC_TYPE (
   24     EMapiBackendFactory,
   25     e_mapi_backend_factory,
   26     E_TYPE_COLLECTION_BACKEND_FACTORY)
   27 
   28 static void
   29 mapi_backend_prepare_mail_account_source (ESource *source)
   30 {
   31     ESourceBackend *extension;
   32     const gchar *extension_name;
   33 
   34     extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
   35     extension = e_source_get_extension (source, extension_name);
   36     e_source_backend_set_backend_name (extension, "mapi");
   37 }
   38 
   39 static void
   40 mapi_backend_prepare_mail_transport_source (ESource *source)
   41 {
   42     ESourceBackend *extension;
   43     const gchar *extension_name;
   44 
   45     extension_name = E_SOURCE_EXTENSION_MAIL_TRANSPORT;
   46     extension = e_source_get_extension (source, extension_name);
   47     e_source_backend_set_backend_name (extension, "mapi");
   48 }
   49 
   50 static void
   51 mapi_backend_factory_prepare_mail (ECollectionBackendFactory *factory,
   52                                    ESource *mail_account_source,
   53                                    ESource *mail_identity_source,
   54                                    ESource *mail_transport_source)
   55 {
   56     ECollectionBackendFactoryClass *parent_class;
   57 
   58     /* Chain up to parent's prepare_mail() method. */
   59     parent_class =
   60         E_COLLECTION_BACKEND_FACTORY_CLASS (
   61         e_mapi_backend_factory_parent_class);
   62     parent_class->prepare_mail (
   63         factory,
   64         mail_account_source,
   65         mail_identity_source,
   66         mail_transport_source);
   67 
   68     mapi_backend_prepare_mail_account_source (mail_account_source);
   69     mapi_backend_prepare_mail_transport_source (mail_transport_source);
   70 }
   71 
   72 static void
   73 e_mapi_backend_factory_class_init (EMapiBackendFactoryClass *class)
   74 {
   75     ECollectionBackendFactoryClass *factory_class;
   76 
   77     factory_class = E_COLLECTION_BACKEND_FACTORY_CLASS (class);
   78     factory_class->factory_name = "mapi";
   79     factory_class->backend_type = E_TYPE_MAPI_BACKEND;
   80     factory_class->prepare_mail = mapi_backend_factory_prepare_mail;
   81 }
   82 
   83 static void
   84 e_mapi_backend_factory_class_finalize (EMapiBackendFactoryClass *class)
   85 {
   86 }
   87 
   88 static void
   89 e_mapi_backend_factory_init (EMapiBackendFactory *factory)
   90 {
   91 }
   92 
   93 void
   94 e_mapi_backend_factory_type_register (GTypeModule *type_module)
   95 {
   96     /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration
   97      *     function, so we have to wrap it with a public function in
   98      *     order to register types from a separate compilation unit. */
   99     e_mapi_backend_factory_register_type (type_module);
  100 }