5a8aa33ef186cca38645a29af443d458559e55bc
[platform/upstream/folks.git] / backends / ofono / ofono-backend-factory.vala
1 /*
2  * Copyright (C) 2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
3  * Copyright (C) 2009 Nokia Corporation.
4  * Copyright (C) 2012 Collabora Ltd.
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 2.1 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Authors:
20  *          Jeremy Whiting <jeremy.whiting@collabora.co.uk>
21  *
22  * Based on kf-backend-factory.vala by:
23  *          Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
24  *          Travis Reitter <travis.reitter@collabora.co.uk>
25  *          Philip Withnall <philip.withnall@collabora.co.uk>
26  */
27
28 using Folks;
29 using Folks.Backends.Ofono;
30
31 private BackendFactory? _backend_factory = null;
32
33 /**
34  * The backend module entry point.
35  *
36  * @param backend_store the {@link BackendStore} to use in this factory.
37  *
38  * @since UNRELEASED
39  */
40 public void module_init (BackendStore backend_store)
41 {
42   _backend_factory = new BackendFactory (backend_store);
43 }
44
45 /**
46  * The backend module exit point.
47  *
48  * @param backend_store the {@link BackendStore} used in this factory.
49  *
50  * @since UNRELEASED
51  */
52 public void module_finalize (BackendStore backend_store)
53 {
54   _backend_factory = null;
55 }
56
57 /**
58  * A backend factory to create a single {@link Backend}.
59  *
60  * @since UNRELEASED
61  */
62 public class Folks.Backends.Ofono.BackendFactory : Object
63 {
64   /**
65    * {@inheritDoc}
66    */
67   public BackendFactory (BackendStore backend_store)
68     {
69       backend_store.add_backend (new Backend ());
70     }
71 }