diff -r ab513c8439db -r e8f4211554fb wlanutilities/wlanqtutilities/base/inc/wlanqtutils_p.h --- a/wlanutilities/wlanqtutilities/base/inc/wlanqtutils_p.h Fri May 14 10:30:51 2010 +0300 +++ b/wlanutilities/wlanqtutilities/base/inc/wlanqtutils_p.h Mon May 24 21:11:39 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,228 +12,157 @@ * Contributors: * * Description: +* WLAN Qt Utilities private implementation interface. */ #ifndef WLANQTUTILS_P_H #define WLANQTUTILS_P_H +// System includes + #include -#include +#include +#include -#include "wlanqtutilscommon.h" +// User includes + +#include "wlanqtutils.h" + +// Forward declarations class WlanQtUtils; class WlanQtUtilsIap; -class WlanQtUtilsWlanIap; -class WlanQtUtilsWlanAp; -class WlanQtUtilsActiveConn; -class ConMonWrapper; -class CmmWrapper; -class EsockWrapper; +class WlanQtUtilsAp; +class WlanQtUtilsConnection; +class WlanQtUtilsIapSettings; +class WlanQtUtilsConMonWrapper; +class WlanQtUtilsEsockWrapper; class ConnTestWrapper; -/** - * Private implementation of Wlan Qt Utilities. - */ +// External data types + +// Constants + +// Class declaration + class WlanQtUtilsPrivate : public QObject { Q_OBJECT public: - - /** - * Constructor. - */ - WlanQtUtilsPrivate(WlanQtUtils *publicPtr); - - /** - * Destructor. - */ - ~WlanQtUtilsPrivate(); + + // Data types - // Functions duplicating WlanQtUtils public interface - - /** - * Function to request details of available WLAN networks. Can be called at any time, calling right - * after wlanScanReady() signal ensures you get the most recent results. - * - * @param[out] wlanIapList List of available WLAN IAPs. - * @param[out] wlanApList List of unknown WLAN APs. - */ - void availableWlanAps( - QList &wlanIapList, - QList &wlanApList); + explicit WlanQtUtilsPrivate(WlanQtUtils *q_ptr); - /** - * Function to create an IAP from the given WLAN access point. - * - * @param[in] wlanAp Access point containing parameters to include in the new IAP. - * @return ID of the newly created IAP. - */ - int createWlanIap(const WlanQtUtilsWlanAp *wlanAp); - - /** - * Function to start connection creation for the given IAP. connectionStatus() signal will be emitted - * when connection creation succeeds or fails. - * - * @param[in] iapId ID of the IAP to be connected. - */ - void connectIap(int iapId); + virtual ~WlanQtUtilsPrivate(); - /** - * Function to disconnect the given IAP. - * - * @param[in] iapId ID of the IAP to be disconnected. - */ - void disconnectIap(int iapId); - - /** - * Function to retrieve a pointer to the IAP with the given ID. - * - * @param[in] iapId ID of the requested IAP. - * @return Pointer to the found IAP, NULL if not found. - */ - WlanQtUtilsIap *iap(int iapId) const; - - /** - * Function for getting the master WLAN status. - * - * @return Master WLAN status: true if enabled, otherwise false. - */ - bool masterWlan() const; - - /** - * Function for switching the master WLAN status ON or OFF. - * - * @param[in] enabled If set to true, WLAN is switched ON, and vice versa. - */ - void setMasterWlan(bool enabled); - - /** - * Function for getting the ID of the (possibly) connected WLAN IAP. - * - * @return ID of the connected IAP, WlanQtUtilsInvalidIapId if not valid. - */ - int connectedWlanId() const; - - /** - * Function for requesting a WLAN scan to be triggered. Currently triggers - * only a single scan, but can be extended to perform also periodic scans, - * if needed in the future. - * - * Signal wlanScanReady() is emitted when new scan results are available. - */ void scanWlans(); + void scanWlanAps(); + + void scanWlanDirect(const QString &ssid); + + void stopWlanScan(); + + void availableWlans( + QList< QSharedPointer > &wlanIapList, + QList< QSharedPointer > &wlanApList) const; + + void availableWlanAps( + QList< QSharedPointer > &wlanApList) const; + + int createIap(const WlanQtUtilsAp *wlanAp); + + bool updateIap(int iapId, const WlanQtUtilsAp *wlanAp); + + void deleteIap(int iapId); + + void connectIap(int iapId, bool runIct); + + void disconnectIap(int iapId); + + WlanQtUtils::ConnStatus connectionStatus() const; + + int activeIap() const; + + QString iapName(int iapId) const; + +signals: + +public slots: + +protected: + +protected slots: + +private: + + Q_DISABLE_COPY(WlanQtUtilsPrivate) + + bool wlanIapExists( + const QList< QSharedPointer > list, + const WlanQtUtilsAp *ap) const; + + void traceIapsAndAps( + const QList< QSharedPointer > &iaps, + const QList< QSharedPointer > &aps) const; + private slots: - /** - * Slot for handling WLAN scan result event from wrapper. Results are stored in member variable - * (possible duplicates are removed). - * - * @param[in] availableWlans WLAN networks found in scan. - */ - void updateAvailableWlanAps(QList &availableWlans); - - /** - * Slot for handling connection setup status event from wrapper. - * - * @param[in] isOpened Was connection setup successful? - */ + void updateAvailableWlanAps( + QList< QSharedPointer > &availableWlans); + void updateConnectionStatus(bool isOpened); - - /** - * Slot for handling connectivity test result event from wrapper. Tested IAP is stored to - * Internet SNAP, if test was successful. - * - * @param[in] result Was the test successful? - */ + void updateConnectivityTestResult(bool result); - /** - * Slot for updating active connection status from wrapper. - * - * @param[in] connectionId ID of the new connection. - */ void addActiveConnection(uint connectionId); - /** - * Slot for updating active connection status from wrapper. - * - * @param[in] connectionId ID of the deleted connection. - */ void removeActiveConnection(uint connectionId); - /** - * Slot for updating active connection status from wrapper. - * - * @param[in] connectionId ID of the updated connection. - * @param[in] connectionStatus New status of the connection. - */ - void updateActiveConnection(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus); - -private: + void updateActiveConnection( + uint connectionId, + WlanQtUtils::ConnStatus connectionStatus); + +private: // data + + // Not owned data - int fetchIaps(); + //! Pointer to public implementation. + WlanQtUtils *q_ptr; + + // Owned data + + //! Iap settings handler. + WlanQtUtilsIapSettings *mSettings; - /** - * This function searches for a WLAN IAP with the given WLAN parameters. - * - * @param[in] ssid SSID to search for. - * @param[in] secMode Security mode to search for. - * @return True, if suitable WLAN IAP found, false otherwise. - */ - bool wlanIapExists(QString ssid, WlanQtUtilsWlanSecMode secMode); - - /** - * This function updates the connection status of: - * - IAP with the given ID - * - all other IAPs, which represent the same network (SSID & security mode match) - * - * @param[in] iapId ID of the IAP whose status is to be updated. - * @param[in] status Updated connection status. - */ - void updateIapConnectionStatuses(int iapId, WlanQtUtilsConnectionStatus status); - -private: // Data + //! Wrapper object for Connection Monitor and other parts of connmon library. + WlanQtUtilsConMonWrapper *mConMonWrapper; - /** Pointer to public implementation */ - WlanQtUtils *q_ptr; - - /** Wrapper object for Connection Method Manager. */ - CmmWrapper *cmmWrapper_; - - /** Wrapper object for Connection Monitor and other parts of connmon library. */ - ConMonWrapper *conMonWrapper_; - - /** Wrapper object for esock library. */ - EsockWrapper *esockWrapper_; + //! Wrapper object for esock library. + WlanQtUtilsEsockWrapper *mEsockWrapper; - /** Wrapper object for Internet Connectivity Test library. */ - ConnTestWrapper *connTestWrapper_; + //! Wrapper object for Internet Connectivity Test library. + ConnTestWrapper *mConnTestWrapper; + + //! List of available WLAN APs according to the latest scan. + QList< QSharedPointer > mWlanScanList; - /** List of available WLAN APs according to the latest scan. */ - QList wlanScanList_; + //! ID of IAP requiring ICT running, IapIdNone if not valid. + int mToBeTestedIapId; - /** List of WLAN IAPs configured to the device. */ - QMap wlanIapList_; - - /** ID of IAP requiring ICT running, -1 if not valid. */ - int toBeTestedIapId_; + //! ID of IAP being connected by us (requested by UI), IapIdNone if not valid. + int mConnectingIapId; - /** ID of IAP being connected by us (requested by UI), -1 if not valid. */ - int connectingIapId_; + //! Information of possible active connection. + QSharedPointer mConnection; + + // Friend classes - /** Information of possible active connection. */ - WlanQtUtilsActiveConn *activeConnection_; - -private: // Friend classes - // This is defined as a friend class in order to be able to // call event handlers of wrappers from test code. friend class TestWlanQtUtils; }; -#endif /* WLANQTUTILS_P_H */ - -// End of File +#endif // WLANQTUTILS_P_H