Changeset View
Changeset View
Standalone View
Standalone View
libs/handler.h
Show All 39 Lines | |||||
40 | public: | 40 | public: | ||
41 | enum HandlerAction { | 41 | enum HandlerAction { | ||
42 | ActivateConnection, | 42 | ActivateConnection, | ||
43 | AddAndActivateConnection, | 43 | AddAndActivateConnection, | ||
44 | AddConnection, | 44 | AddConnection, | ||
45 | DeactivateConnection, | 45 | DeactivateConnection, | ||
46 | RemoveConnection, | 46 | RemoveConnection, | ||
47 | RequestScan, | 47 | RequestScan, | ||
48 | UpdateConnection | 48 | UpdateConnection, | ||
49 | CreateHotspot, | ||||
49 | }; | 50 | }; | ||
50 | 51 | | |||
51 | explicit Handler(QObject* parent = nullptr); | 52 | explicit Handler(QObject* parent = nullptr); | ||
52 | ~Handler() override; | 53 | ~Handler() override; | ||
53 | 54 | | |||
55 | Q_PROPERTY(bool hotspotSupported READ hotspotSupported NOTIFY hotspotSupportedChanged); | ||||
56 | public: | ||||
57 | bool hotspotSupported() const { return m_hotspotSupported; }; | ||||
58 | | ||||
54 | public Q_SLOTS: | 59 | public Q_SLOTS: | ||
55 | /** | 60 | /** | ||
56 | * Activates given connection | 61 | * Activates given connection | ||
57 | * @connection - d-bus path of the connection you want to activate | 62 | * @connection - d-bus path of the connection you want to activate | ||
58 | * @device - d-bus path of the device where the connection should be activated | 63 | * @device - d-bus path of the device where the connection should be activated | ||
59 | * @specificParameter - d-bus path of the specific object you want to use for this activation, i.e access point | 64 | * @specificParameter - d-bus path of the specific object you want to use for this activation, i.e access point | ||
60 | */ | 65 | */ | ||
61 | void activateConnection(const QString &connection, const QString &device, const QString &specificParameter); | 66 | void activateConnection(const QString &connection, const QString &device, const QString &specificParameter); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
111 | /** | 116 | /** | ||
112 | * Updates given connection | 117 | * Updates given connection | ||
113 | * @connection - connection which should be updated | 118 | * @connection - connection which should be updated | ||
114 | * @map - NMVariantMapMap with new connection settings | 119 | * @map - NMVariantMapMap with new connection settings | ||
115 | */ | 120 | */ | ||
116 | void updateConnection(const NetworkManager::Connection::Ptr &connection, const NMVariantMapMap &map); | 121 | void updateConnection(const NetworkManager::Connection::Ptr &connection, const NMVariantMapMap &map); | ||
117 | void requestScan(const QString &interface = QString()); | 122 | void requestScan(const QString &interface = QString()); | ||
118 | 123 | | |||
124 | void createHotspot(); | ||||
125 | void stopHotspot(); | ||||
126 | | ||||
119 | private Q_SLOTS: | 127 | private Q_SLOTS: | ||
120 | void initKdedModule(); | 128 | void initKdedModule(); | ||
121 | void secretAgentError(const QString &connectionPath, const QString &message); | 129 | void secretAgentError(const QString &connectionPath, const QString &message); | ||
122 | void replyFinished(QDBusPendingCallWatcher *watcher); | 130 | void replyFinished(QDBusPendingCallWatcher *watcher); | ||
131 | void hotspotCreated(QDBusPendingCallWatcher *watcher); | ||||
123 | #if WITH_MODEMMANAGER_SUPPORT | 132 | #if WITH_MODEMMANAGER_SUPPORT | ||
124 | void unlockRequiredChanged(MMModemLock modemLock); | 133 | void unlockRequiredChanged(MMModemLock modemLock); | ||
125 | #endif | 134 | #endif | ||
126 | 135 | | |||
127 | Q_SIGNALS: | 136 | Q_SIGNALS: | ||
128 | void connectionActivationFailed(const QString &connectionPath, const QString &message); | 137 | void connectionActivationFailed(const QString &connectionPath, const QString &message); | ||
138 | void hotspotCreated(); | ||||
139 | void hotspotDisabled(); | ||||
140 | void hotspotSupportedChanged(bool hotspotSupported); | ||||
129 | private: | 141 | private: | ||
142 | bool m_hotspotSupported; | ||||
130 | bool m_tmpWirelessEnabled; | 143 | bool m_tmpWirelessEnabled; | ||
131 | bool m_tmpWwanEnabled; | 144 | bool m_tmpWwanEnabled; | ||
132 | #if WITH_MODEMMANAGER_SUPPORT | 145 | #if WITH_MODEMMANAGER_SUPPORT | ||
133 | QString m_tmpConnectionPath; | 146 | QString m_tmpConnectionPath; | ||
134 | #endif | 147 | #endif | ||
135 | QString m_tmpConnectionUuid; | 148 | QString m_tmpConnectionUuid; | ||
136 | QString m_tmpDevicePath; | 149 | QString m_tmpDevicePath; | ||
137 | QString m_tmpSpecificPath; | 150 | QString m_tmpSpecificPath; | ||
138 | QMap<QString, bool> m_bluetoothAdapters; | 151 | QMap<QString, bool> m_bluetoothAdapters; | ||
139 | QMap<QString, QTimer*> m_wirelessScanRetryTimer; | 152 | QMap<QString, QTimer*> m_wirelessScanRetryTimer; | ||
140 | 153 | | |||
141 | void enableBluetooth(bool enable); | 154 | void enableBluetooth(bool enable); | ||
142 | void scanRequestFailed(const QString &interface); | 155 | void scanRequestFailed(const QString &interface); | ||
143 | bool checkRequestScanRateLimit(const NetworkManager::WirelessDevice::Ptr &wifiDevice); | 156 | bool checkRequestScanRateLimit(const NetworkManager::WirelessDevice::Ptr &wifiDevice); | ||
157 | bool checkHotspotSupported(); | ||||
144 | void scheduleRequestScan(const QString &interface, int timeout); | 158 | void scheduleRequestScan(const QString &interface, int timeout); | ||
145 | }; | 159 | }; | ||
146 | 160 | | |||
147 | #endif // PLASMA_NM_HANDLER_H | 161 | #endif // PLASMA_NM_HANDLER_H |