connectivity-api
networking-status.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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 CONNECTIVITY_NETWORKING_STATUS_H
21 #define CONNECTIVITY_NETWORKING_STATUS_H
22 
23 #include <QObject>
24 #include <QScopedPointer>
25 #include <QVector>
26 
27 namespace ubuntu {
28 namespace connectivity {
29 
41 class Q_DECL_EXPORT NetworkingStatus : public QObject
42 {
43  Q_OBJECT
44  Q_DISABLE_COPY(NetworkingStatus)
45 
46  Q_ENUMS(Limitations)
47  Q_ENUMS(Status)
48 
58  Q_PROPERTY(QVector<Limitations> limitations
59  READ limitations
60  NOTIFY limitationsChanged)
61 
71  Q_PROPERTY(Status status
72  READ status
73  NOTIFY statusChanged)
74 
75 public:
76  explicit NetworkingStatus(QObject *parent = 0);
77  virtual ~NetworkingStatus();
78 
84  enum Limitations {
89  Bandwith
90  };
91 
97  enum Status {
100  Online
101  };
102 
103 
105  QVector<Limitations> limitations() const;
106 
108  Status status() const;
109 
110 Q_SIGNALS:
112  void limitationsChanged();
113 
115  void statusChanged(Status value);
116 
117 private:
118  class Private;
119  QScopedPointer<Private> d;
120 };
121 
122 }
123 }
124 
126 Q_DECLARE_METATYPE(QVector<ubuntu::connectivity::NetworkingStatus::Limitations>)
127 Q_DECLARE_METATYPE(ubuntu::connectivity::NetworkingStatus::Status)
128 
129 #endif // CONNECTIVITY_NETWORKING_STATUS_H
Overall system networking status.
Definition: networking-status.cpp:32
Definition: networking-status.h:98
Definition: networking-status.cpp:27
Status
enum for networking status
Definition: networking-status.h:97
Definition: networking-status.h:99
Limitations
enum for networking limitations
Definition: networking-status.h:84