summaryrefslogtreecommitdiffstats
path: root/tdecore/tdenetworkconnections.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-27 11:52:10 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-27 11:52:10 -0500
commit2a415e33e054e00a9b1a3385d3883f36c9c1b6d4 (patch)
treeb9025bd120d65d48067e2f29ce13cf550580b119 /tdecore/tdenetworkconnections.cpp
parentcfbdd55bb39f6e2012103a506d8d2506145cc936 (diff)
downloadtdelibs-2a415e33e054e00a9b1a3385d3883f36c9c1b6d4.tar.gz
tdelibs-2a415e33e054e00a9b1a3385d3883f36c9c1b6d4.zip
Add network manager global object to kinstance
This breaks the ABI
Diffstat (limited to 'tdecore/tdenetworkconnections.cpp')
-rw-r--r--tdecore/tdenetworkconnections.cpp96
1 files changed, 96 insertions, 0 deletions
diff --git a/tdecore/tdenetworkconnections.cpp b/tdecore/tdenetworkconnections.cpp
index 0a3893f1f..70d528e9b 100644
--- a/tdecore/tdenetworkconnections.cpp
+++ b/tdecore/tdenetworkconnections.cpp
@@ -19,6 +19,12 @@
#include "tdehardwaredevices.h"
#include "tdenetworkconnections.h"
+#include "config.h"
+
+#ifdef WITH_NETWORK_MANAGER_BACKEND
+#include "networkbackends/network-manager/network-manager.h"
+#endif // WITH_NETWORK_MANAGER_BACKEND
+
#define SET_BIT(x, y) (x |= 1 << y)
#define TEST_BIT(x, y) ((x & (1 << y)) >> y)
@@ -466,6 +472,96 @@ void TDENetworkConnectionManager::internalNetworkDeviceStateChanged(TDENetworkCo
}
/*================================================================================================*/
+/* TDEGlobalNetworkManager */
+/*================================================================================================*/
+
+TDEGlobalNetworkManager::TDEGlobalNetworkManager() : m_internalConnectionManager(NULL) {
+#ifdef WITH_NETWORK_MANAGER_BACKEND
+ m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(TQString::null);
+#endif // WITH_NETWORK_MANAGER_BACKEND
+ connect(m_internalConnectionManager, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
+}
+
+TDEGlobalNetworkManager::~TDEGlobalNetworkManager() {
+ delete m_internalConnectionManager;
+}
+
+TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags TDEGlobalNetworkManager::backendStatus() {
+ if (!m_internalConnectionManager) return TDENetworkGlobalManagerFlags::Unknown;
+ return m_internalConnectionManager->backendStatus();
+}
+
+void TDEGlobalNetworkManager::loadConnectionInformation() {
+ if (!m_internalConnectionManager) return;
+ return m_internalConnectionManager->loadConnectionInformation();
+}
+
+bool TDEGlobalNetworkManager::loadConnectionSecrets(TQString uuid) {
+ if (!m_internalConnectionManager) return false;
+ return m_internalConnectionManager->loadConnectionSecrets(uuid);
+}
+
+bool TDEGlobalNetworkManager::saveConnection(TDENetworkConnection* connection) {
+ if (!m_internalConnectionManager) return false;
+ return m_internalConnectionManager->saveConnection(connection);
+}
+
+bool TDEGlobalNetworkManager::deleteConnection(TQString uuid) {
+ if (!m_internalConnectionManager) return false;
+ return m_internalConnectionManager->deleteConnection(uuid);
+}
+
+TDENetworkConnectionStatus::TDENetworkConnectionStatus TDEGlobalNetworkManager::initiateConnection(TQString uuid) {
+ if (!m_internalConnectionManager) return TDENetworkConnectionStatus::Invalid;
+ return m_internalConnectionManager->initiateConnection(uuid);
+}
+
+TDENetworkConnectionStatus::TDENetworkConnectionStatus TDEGlobalNetworkManager::checkConnectionStatus(TQString uuid) {
+ if (!m_internalConnectionManager) return TDENetworkConnectionStatus::Invalid;
+ return m_internalConnectionManager->checkConnectionStatus(uuid);
+}
+
+TDENetworkConnectionStatus::TDENetworkConnectionStatus TDEGlobalNetworkManager::deactivateConnection(TQString uuid) {
+ if (!m_internalConnectionManager) return TDENetworkConnectionStatus::Invalid;
+ return m_internalConnectionManager->deactivateConnection(uuid);
+}
+
+TDENetworkHWNeighborList* TDEGlobalNetworkManager::siteSurvey() {
+ if (!m_internalConnectionManager) return NULL;
+ return m_internalConnectionManager->siteSurvey();
+}
+
+bool TDEGlobalNetworkManager::networkingEnabled() {
+ if (!m_internalConnectionManager) return false;
+ return m_internalConnectionManager->networkingEnabled();
+}
+
+bool TDEGlobalNetworkManager::wiFiHardwareEnabled() {
+ if (!m_internalConnectionManager) return false;
+ return m_internalConnectionManager->wiFiHardwareEnabled();
+}
+
+bool TDEGlobalNetworkManager::enableWiFi(bool enable) {
+ if (!m_internalConnectionManager) return false;
+ return m_internalConnectionManager->enableWiFi(enable);
+}
+
+bool TDEGlobalNetworkManager::wiFiEnabled() {
+ if (!m_internalConnectionManager) return false;
+ return m_internalConnectionManager->wiFiEnabled();
+}
+
+TDENetworkConnectionList* TDEGlobalNetworkManager::connections() {
+ if (!m_internalConnectionManager) return NULL;
+ return m_internalConnectionManager->connections();
+}
+
+TDENetworkConnection* TDEGlobalNetworkManager::findConnectionByUUID(TQString uuid) {
+ if (!m_internalConnectionManager) return NULL;
+ return m_internalConnectionManager->findConnectionByUUID(uuid);
+}
+
+/*================================================================================================*/
/* End */
/*================================================================================================*/