22 #include <QAbstractListModel>
23 #include <QDBusConnection>
25 #include <QStringList>
29 #include <lomiri/util/DefinesPtrs.h>
33 #include <QDBusObjectPath>
52 static void registerMetaTypes();
80 Connectivity(
const QDBusConnection& sessionConnection = QDBusConnection::sessionBus(), QObject* parent = 0);
82 Connectivity(
const std::function<
void(QObject*)>& objectOwner,
83 const QDBusConnection& sessionConnection = QDBusConnection::sessionBus(),
88 Q_PROPERTY(
bool flightMode READ flightMode WRITE setFlightMode NOTIFY flightModeUpdated)
89 bool flightMode()
const;
91 Q_PROPERTY(
bool online READ online NOTIFY onlineUpdated)
94 Q_PROPERTY(
bool limitedBandwidth READ limitedBandwidth NOTIFY limitedBandwidthUpdated)
95 bool limitedBandwidth()
const;
97 Q_PROPERTY(QVector<connectivityqt::Connectivity::Limitations>
Limitations READ limitations NOTIFY limitationsUpdated)
98 QVector<connectivityqt::Connectivity::Limitations> limitations()
const;
103 Q_PROPERTY(
bool wifiEnabled READ wifiEnabled WRITE setwifiEnabled NOTIFY wifiEnabledUpdated)
104 bool wifiEnabled()
const;
106 Q_PROPERTY(
bool unstoppableOperationHappening READ unstoppableOperationHappening NOTIFY unstoppableOperationHappeningUpdated)
107 bool unstoppableOperationHappening()
const;
109 Q_PROPERTY(
bool flightModeSwitchEnabled READ flightModeSwitchEnabled NOTIFY flightModeSwitchEnabledUpdated)
110 bool flightModeSwitchEnabled()
const;
112 Q_PROPERTY(
bool wifiSwitchEnabled READ wifiSwitchEnabled NOTIFY wifiSwitchEnabledUpdated)
113 bool wifiSwitchEnabled()
const;
115 Q_PROPERTY(
bool hotspotSwitchEnabled READ hotspotSwitchEnabled NOTIFY hotspotSwitchEnabledUpdated)
116 bool hotspotSwitchEnabled()
const;
118 Q_PROPERTY(
bool modemAvailable READ modemAvailable NOTIFY modemAvailableUpdated)
119 bool modemAvailable()
const;
121 Q_PROPERTY(QByteArray hotspotSsid READ hotspotSsid WRITE setHotspotSsid NOTIFY hotspotSsidUpdated)
122 QByteArray hotspotSsid()
const;
124 Q_PROPERTY(QString hotspotPassword READ hotspotPassword WRITE setHotspotPassword NOTIFY hotspotPasswordUpdated)
125 QString hotspotPassword()
const;
127 Q_PROPERTY(
bool hotspotEnabled READ hotspotEnabled WRITE setHotspotEnabled NOTIFY hotspotEnabledUpdated)
128 bool hotspotEnabled()
const;
130 Q_PROPERTY(QString hotspotMode READ hotspotMode WRITE setHotspotMode NOTIFY hotspotModeUpdated)
131 QString hotspotMode()
const;
133 Q_PROPERTY(QString hotspotAuth READ hotspotAuth WRITE setHotspotAuth NOTIFY hotspotAuthUpdated)
134 QString hotspotAuth()
const;
136 Q_PROPERTY(
bool hotspotStored READ hotspotStored NOTIFY hotspotStoredUpdated)
137 bool hotspotStored()
const;
139 Q_PROPERTY(
bool initialized READ isInitialized NOTIFY initialized)
140 bool isInitialized()
const;
142 Q_PROPERTY(QAbstractItemModel* vpnConnections READ vpnConnections NOTIFY vpnConnectionsUpdated)
143 QAbstractItemModel* vpnConnections()
const;
145 Q_PROPERTY(
bool mobileDataEnabled
146 READ mobileDataEnabled
147 WRITE setMobileDataEnabled
148 NOTIFY mobileDataEnabledUpdated)
149 bool mobileDataEnabled()
const;
151 Q_PROPERTY(
Sim* simForMobileData
152 READ simForMobileData
153 WRITE setSimForMobileData
154 NOTIFY simForMobileDataUpdated)
155 Sim* simForMobileData()
const;
157 Q_PROPERTY(QAbstractItemModel* modems
160 QAbstractItemModel* modems()
const;
162 Q_PROPERTY(QAbstractItemModel* sims
165 QAbstractItemModel* sims()
const;
168 void setFlightMode(
bool enabled);
170 void setwifiEnabled(
bool enabled);
172 void setHotspotEnabled(
bool active);
174 void setHotspotSsid(
const QByteArray& ssid);
176 void setHotspotPassword(
const QString& password);
178 void setHotspotMode(
const QString& mode);
180 void setHotspotAuth(
const QString& auth);
182 void setMobileDataEnabled(
bool enabled);
184 void setSimForMobileData(
Sim *sim);
187 void flightModeUpdated(
bool);
189 void onlineUpdated(
bool value);
191 void limitedBandwidthUpdated(
bool value);
193 void limitationsUpdated(
const QVector<connectivityqt::Connectivity::Limitations>&);
197 void wifiEnabledUpdated(
bool);
199 void unstoppableOperationHappeningUpdated(
bool);
201 void flightModeSwitchEnabledUpdated(
bool);
203 void wifiSwitchEnabledUpdated(
bool);
205 void hotspotSwitchEnabledUpdated(
bool);
207 void hotspotSsidUpdated(
const QByteArray& name);
209 void hotspotPasswordUpdated(
const QString& password);
211 void modemAvailableUpdated(
bool);
213 void hotspotEnabledUpdated(
bool);
215 void hotspotModeUpdated(
const QString& mode);
217 void hotspotAuthUpdated(
const QString& auth);
219 void hotspotStoredUpdated(
bool);
221 void reportError(
int reason);
225 void vpnConnectionsUpdated(QAbstractItemModel*);
227 void mobileDataEnabledUpdated(
bool);
229 void simForMobileDataUpdated(
Sim* sim);
233 std::shared_ptr<Priv>
d;
236 void onReportError(
int reason);
242 Q_DECLARE_METATYPE(QVector<connectivityqt::Connectivity::Limitations>)