connectivity-cpp  0.0.1
manager.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authors:
17  * Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
18  */
19 
20 #ifndef COM_UBUNTU_CONNECTIVITY_NETWORKING_MANAGER
21 #define COM_UBUNTU_CONNECTIVITY_NETWORKING_MANAGER
22 
25 
26 #include <core/property.h>
27 #include <core/signal.h>
28 
29 #include <memory>
30 
31 namespace com {
32 namespace ubuntu {
33 namespace connectivity {
34 namespace networking {
35 
36 #ifndef CONNECTIVITY_CPP_EXPORT
37 #define CONNECTIVITY_CPP_EXPORT __attribute ((visibility ("default")))
38 #endif
39 
54 Manager
55 {
56 public:
57  Manager &operator=(const Manager&) = delete;
58  virtual ~Manager() = default;
59  Manager(const Manager&) = delete;
60 
77  static std::unique_ptr<Manager> createInstance();
78 
80  enum class FlightModeStatus {
81  on,
82  off
83  };
84 
90  enum class NetworkingStatus {
92  offline,
93 
95  connecting,
96 
98  online
99  };
100 
102  virtual void enableFlightMode() = 0;
103 
105  virtual void disableFlightMode() = 0;
106 
108  virtual const core::Property<FlightModeStatus>& flightMode() = 0;
109 
111  virtual const core::Property<std::set<Link::Ptr>>& links() = 0;
112 
114  virtual const core::Property<std::set<Service::Ptr>>& services() = 0;
115 
121  virtual const core::Property<NetworkingStatus> &status() = 0;
122 
131  virtual const core::Property<std::uint32_t>& characteristics() = 0;
132 
133 protected:
140  Manager();
141 };
142 
143 }
144 }
145 }
146 }
147 
148 #endif
#define CONNECTIVITY_CPP_EXPORT
Definition: manager.h:37
NetworkingStatus
enum class for networking status
Definition: manager.h:90