diff -r dbe86d96ce5b -r 2dc6da6fb431 wlanutilities/wlanqtutilities/wrapper/src/wlanqtutilsconmonwrapper.cpp --- a/wlanutilities/wlanqtutilities/wrapper/src/wlanqtutilsconmonwrapper.cpp Thu May 27 13:59:00 2010 +0300 +++ b/wlanutilities/wlanqtutilities/wrapper/src/wlanqtutilsconmonwrapper.cpp Fri Jun 11 14:43:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -12,68 +12,109 @@ * Contributors: * * Description: -* +* Wrapper for Symbian Connection Monitor library. +*/ + +// System includes + +#include +#include + +// User includes + +#include "wlanqtutilsconmonwrapperdisconnect_s60_p.h" +#include "wlanqtutilsconmonwrapperinfo_s60_p.h" +#include "wlanqtutilsconmonwrapperscan_s60_p.h" +#include "wlanqtutilsconmonwrapper.h" + +/*! + \class WlanQtUtilsConMonWrapper + \brief Wrapper for Symbian Connection Monitor library. + + Provides functionality to scan WLAN networks, to retrieve connection + information, and to disconnect connections. */ -// INCLUDE FILES -#include -#include -#include "wlanqtutilsconmonwrapper.h" -#include "wlanqtutilsconmonwrapper_s60_p.h" +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== -// ================= MEMBER FUNCTIONS ======================= +/*! + Constructor. + + @param [in] parent Parent object. +*/ -ConMonWrapper::ConMonWrapper(QObject *parent) - : QObject(parent) +WlanQtUtilsConMonWrapper::WlanQtUtilsConMonWrapper(QObject *parent) : + QObject(parent), + d_ptrScan(new WlanQtUtilsConMonWrapperScan(this)), + d_ptrInfo(new WlanQtUtilsConMonWrapperInfo(this)), + d_ptrDisconnect(new WlanQtUtilsConMonWrapperDisconnect(this)) { - d_ptrScanWlans = new ConnMonScanWlanAps(this); - d_ptrConnInfo = new ConnMonConnInfo(this); - d_ptrConnDisconnect = new ConnMonConnDisconnect(this); } -ConMonWrapper::~ConMonWrapper() +/*! + Destructor. +*/ + +WlanQtUtilsConMonWrapper::~WlanQtUtilsConMonWrapper() { - delete d_ptrScanWlans; - delete d_ptrConnInfo; - delete d_ptrConnDisconnect; -} - -int ConMonWrapper::scanAvailableWlanAPs() -{ - return d_ptrScanWlans->scanAvailableWlanAPs(); } -void ConMonWrapper::emitAvailableWlans(QList &availableWlanAPs) +/*! + Start a WLAN scan. +*/ + +void WlanQtUtilsConMonWrapper::scanAvailableWlanAPs() { - emit availableWlanApsFromWrapper(availableWlanAPs); + d_ptrScan->ScanAvailableWlanAPs(); } -void ConMonWrapper::emitConnCreatedEvent(uint connectionId) +/*! + Stop a (possibly) ongoing WLAN scan. +*/ + +void WlanQtUtilsConMonWrapper::stopScan() { - emit connCreatedEventFromWrapper(connectionId); -} - -void ConMonWrapper::emitConnDeletedEvent(uint connectionId) -{ - emit connDeletedEventFromWrapper(connectionId); + d_ptrScan->StopScan(); } -void ConMonWrapper::emitConnStatusEvent(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus) +/*! + Return active connection information. + + @return Information of active connection, 0 if not found. +*/ + +WlanQtUtilsConnection *WlanQtUtilsConMonWrapper::activeConnection() const { - emit connStatusEventFromWrapper(connectionId, connectionStatus); -} - -WlanQtUtilsActiveConn *ConMonWrapper::activeConnection() -{ - return d_ptrConnInfo->activeConnection(); + return d_ptrInfo->ActiveConnection(); } -WlanQtUtilsActiveConn* ConMonWrapper::connectionInfo(uint connectionId) +/*! + Returns information of a connection with the given connection ID. + + @param [in] connectionId Connection ID. + + @return Information of the given connection, 0 if not found. +*/ + +WlanQtUtilsConnection* WlanQtUtilsConMonWrapper::connectionInfo( + uint connectionId) const { - return d_ptrConnInfo->connectionInfo(connectionId); + return d_ptrInfo->ConnectionInfo(connectionId); } -void ConMonWrapper::disconnectIap(int iapId) +/*! + Stops given connection regardless of how many applications are using it. + + @param [in] iapId IAP ID to disconnect. +*/ + +void WlanQtUtilsConMonWrapper::disconnectIap(int iapId) { - d_ptrConnDisconnect->disconnectConnection(iapId); + d_ptrDisconnect->DisconnectConnection(iapId); }