fc1f289ce69112a0c7166e0cb4bf3eac345911c2
[profile/ivi/settings-daemon.git] / plugins / connman / service.hpp
1 /**
2  * @file service.hpp
3  *
4  * @brief Connman service request handling.
5  *
6  * @author Ossama Othman @<ossama.othman@@intel.com@>
7  *
8  * @copyright @par
9  * Copyright 2013 Intel Corporation All Rights Reserved.
10  * @par
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation;
14  * version 2.1 of the License.
15  * @par
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  * @par
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
24  * Boston, MA  02110-1301  USA
25  */
26
27 #ifndef IVI_SETTINGS_CONNMAN_SERVICE_HPP
28 #define IVI_SETTINGS_CONNMAN_SERVICE_HPP
29
30 #include "connman.hpp"
31 #include "connman_manager.hpp"
32
33
34 namespace ivi
35 {
36   namespace settings
37   {
38     class response_callback;
39
40     /**
41      * @class service
42      *
43      * @brief Connman Service object proxy.
44      *
45      * This class exposes functionality found in the connman
46      * @c Service interface to the caller.
47      */
48     class service
49     {
50     public:
51
52       /**
53        * Constructor.
54        *
55        * @param[in] service_path The D-Bus object path for connman
56        *                         service.
57        * @param[in] e            Callback through which events will be
58        *                         sent to clients.
59        */
60       service(std::string service_path,
61               event_callback const & e);
62
63       /// Connect to the service.
64       void connect(response_callback response);
65
66       /// Disconnect from the service.
67       void disconnect(response_callback response);
68
69     private:
70
71       /**
72        * Call the method @a name on the connman Service object.
73        *
74        * @param[in]    name     The connman Service object method
75        *                        name.
76        * @param[inout] response Callback used to inform the caller of
77        *                        success or failure.
78        */
79       void call_method(char const * name,
80                        response_callback response);
81
82     private:
83
84       /// The proxy used to access the connman Service D-Bus API.
85       connman connman_;
86
87     };
88
89   }
90 }
91
92
93 #endif  /* IVI_SETTINGS_CONNMAN_SERVICE_HPP */
94
95
96 // Local Variables:
97 // mode:c++
98 // c-basic-offset:2
99 // indent-tabs-mode: nil
100 // End: