22 #include <QAbstractListModel> 23 #include <QDBusConnection> 25 #include <QStringList> 29 #include <unity/util/DefinesPtrs.h> 48 static void registerMetaTypes();
76 Connectivity(
const QDBusConnection& sessionConnection = QDBusConnection::sessionBus(), QObject* parent = 0);
78 Connectivity(
const std::function<
void(QObject*)>& objectOwner,
79 const QDBusConnection& sessionConnection = QDBusConnection::sessionBus(),
84 Q_PROPERTY(
bool flightMode READ flightMode WRITE setFlightMode NOTIFY flightModeUpdated)
85 bool flightMode()
const;
87 Q_PROPERTY(
bool online READ online NOTIFY onlineUpdated)
90 Q_PROPERTY(
bool limitedBandwith READ limitedBandwith NOTIFY limitedBandwithUpdated)
91 bool limitedBandwith()
const;
93 Q_PROPERTY(QVector<Limitations>
Limitations READ limitations NOTIFY limitationsUpdated)
94 QVector<Limitations> limitations()
const;
99 Q_PROPERTY(
bool wifiEnabled READ wifiEnabled WRITE setwifiEnabled NOTIFY wifiEnabledUpdated)
100 bool wifiEnabled()
const;
102 Q_PROPERTY(
bool unstoppableOperationHappening READ unstoppableOperationHappening NOTIFY unstoppableOperationHappeningUpdated)
103 bool unstoppableOperationHappening()
const;
105 Q_PROPERTY(
bool flightModeSwitchEnabled READ flightModeSwitchEnabled NOTIFY flightModeSwitchEnabledUpdated)
106 bool flightModeSwitchEnabled()
const;
108 Q_PROPERTY(
bool wifiSwitchEnabled READ wifiSwitchEnabled NOTIFY wifiSwitchEnabledUpdated)
109 bool wifiSwitchEnabled()
const;
111 Q_PROPERTY(
bool hotspotSwitchEnabled READ hotspotSwitchEnabled NOTIFY hotspotSwitchEnabledUpdated)
112 bool hotspotSwitchEnabled()
const;
114 Q_PROPERTY(
bool modemAvailable READ modemAvailable NOTIFY modemAvailableUpdated)
115 bool modemAvailable()
const;
117 Q_PROPERTY(QByteArray hotspotSsid READ hotspotSsid WRITE setHotspotSsid NOTIFY hotspotSsidUpdated)
118 QByteArray hotspotSsid()
const;
120 Q_PROPERTY(QString hotspotPassword READ hotspotPassword WRITE setHotspotPassword NOTIFY hotspotPasswordUpdated)
121 QString hotspotPassword()
const;
123 Q_PROPERTY(
bool hotspotEnabled READ hotspotEnabled WRITE setHotspotEnabled NOTIFY hotspotEnabledUpdated)
124 bool hotspotEnabled()
const;
126 Q_PROPERTY(QString hotspotMode READ hotspotMode WRITE setHotspotMode NOTIFY hotspotModeUpdated)
127 QString hotspotMode()
const;
129 Q_PROPERTY(QString hotspotAuth READ hotspotAuth WRITE setHotspotAuth NOTIFY hotspotAuthUpdated)
130 QString hotspotAuth()
const;
132 Q_PROPERTY(
bool hotspotStored READ hotspotStored NOTIFY hotspotStoredUpdated)
133 bool hotspotStored()
const;
135 Q_PROPERTY(
bool initialized READ isInitialized NOTIFY initialized)
136 bool isInitialized()
const;
138 Q_PROPERTY(QAbstractItemModel* vpnConnections READ vpnConnections NOTIFY vpnConnectionsUpdated)
139 QAbstractItemModel* vpnConnections()
const;
142 void setFlightMode(
bool enabled);
144 void setwifiEnabled(
bool enabled);
146 void setHotspotEnabled(
bool active);
148 void setHotspotSsid(
const QByteArray& ssid);
150 void setHotspotPassword(
const QString& password);
152 void setHotspotMode(
const QString& mode);
154 void setHotspotAuth(
const QString& auth);
157 void flightModeUpdated(
bool);
159 void onlineUpdated(
bool value);
161 void limitedBandwithUpdated(
bool value);
163 void limitationsUpdated(
const QVector<Limitations>&);
167 void wifiEnabledUpdated(
bool);
169 void unstoppableOperationHappeningUpdated(
bool);
171 void flightModeSwitchEnabledUpdated(
bool);
173 void wifiSwitchEnabledUpdated(
bool);
175 void hotspotSwitchEnabledUpdated(
bool);
177 void hotspotSsidUpdated(
const QByteArray& name);
179 void hotspotPasswordUpdated(
const QString& password);
181 void modemAvailableUpdated(
bool);
183 void hotspotEnabledUpdated(
bool);
185 void hotspotModeUpdated(
const QString& mode);
187 void hotspotAuthUpdated(
const QString& auth);
189 void hotspotStoredUpdated(
bool);
191 void reportError(
int reason);
195 void vpnConnectionsUpdated(QAbstractItemModel*);
199 std::shared_ptr<Priv>
d;
Definition: connectivity.cpp:32
Definition: connectivity.h:36
Limitations
enum for networking limitations
Definition: connectivity.h:55
Status
enum for networking status
Definition: connectivity.h:69
std::shared_ptr< Priv > d
Definition: connectivity.h:198