diff options
author | Raquel Medina <raquel.medina@konsulko.com> | 2019-06-17 19:39:23 +0200 |
---|---|---|
committer | raquel medina <raquel.medina@konsulko.com> | 2019-06-18 11:20:43 +0000 |
commit | e89c4886888a322a21cf7c89c1ee2864dbb4e815 (patch) | |
tree | 1f943c3afd60bf56f79d4e28803ffe1aca55f654 /network/networkadapter.h | |
parent | 9d896c9c8f5622370362091f38bbc5d1f4189901 (diff) |
network: add wired adapter & model
-Add WiredAdapter implementation
-Add WiredNetworkModel implementation
Bug-AGL: SPEC-2293
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: Ibed93ae3a3cca1bc8e7a23c872c7ab3b8271e586
Diffstat (limited to 'network/networkadapter.h')
-rw-r--r-- | network/networkadapter.h | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/network/networkadapter.h b/network/networkadapter.h index 4aac701..b3291f0 100644 --- a/network/networkadapter.h +++ b/network/networkadapter.h @@ -24,6 +24,7 @@ class Network; class WifiNetworkModel; +class WiredNetworkModel; class AdapterIf { @@ -33,47 +34,10 @@ class AdapterIf virtual bool addService(QString id, QJsonObject properties) = 0; virtual void removeService(QString id) = 0; virtual void updateProperties(QString service, QJsonObject properties) = 0; + virtual QString getType() = 0; + virtual void updateStatus(QJsonObject properties) = 0; }; - Q_DECLARE_INTERFACE(AdapterIf, "AdapterIf") -class WifiAdapter : public QObject, public AdapterIf -{ - Q_OBJECT - Q_INTERFACES(AdapterIf) - Q_PROPERTY(bool wifiConnected READ wifiConnected NOTIFY wifiConnectedChanged) - Q_PROPERTY(bool wifiEnabled READ wifiEnabled NOTIFY wifiEnabledChanged) - Q_PROPERTY(int wifiStrength READ wifiStrength NOTIFY wifiStrengthChanged) - - public: - explicit WifiAdapter(Network *network, QQmlContext *context, QObject *parent); - virtual ~WifiAdapter(); - - bool wifiConnected() const { return m_wifiConnected; } - bool wifiEnabled() const { return m_wifiEnabled; } - int wifiStrength() const { return m_wifiStrength; } - void updateWifiStatus(QJsonObject properties); - - bool addService(QString id, QJsonObject properties) override; - void removeService(QString id) override; - void updateProperties(QString service, QJsonObject properties) override; - QString getType() override { return "wifi"; } - - //slots - void updateWifiStrength(int); - - signals: - void wifiConnectedChanged(bool connected); - void wifiEnabledChanged(bool enabled); - void wifiStrengthChanged(int strength); - - private: - bool m_wifiConnected; - bool m_wifiEnabled; - int m_wifiStrength; - WifiNetworkModel *m_model; - Network *nw; -}; - #endif // ADAPTER_H |