diff options
Diffstat (limited to 'tdecore/tdenetworkconnections.cpp')
-rw-r--r-- | tdecore/tdenetworkconnections.cpp | 96 |
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 */ /*================================================================================================*/ |