diff -r dbe86d96ce5b -r 2dc6da6fb431 wlanutilities/wlanqtutilities/wrapper/inc/wlanqtutilsconmonwrapper.h --- a/wlanutilities/wlanqtutilities/wrapper/inc/wlanqtutilsconmonwrapper.h Thu May 27 13:59:00 2010 +0300 +++ b/wlanutilities/wlanqtutilities/wrapper/inc/wlanqtutilsconmonwrapper.h 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,173 +12,126 @@ * Contributors: * * Description: -* +* Wrapper for Symbian Connection Monitor library. */ #ifndef WLANQTUTILSCONMONWRAPPER_H #define WLANQTUTILSCONMONWRAPPER_H -// INCLUDES +// System includes + #include #include -#include - -QT_BEGIN_HEADER +#include +#include -QT_BEGIN_NAMESPACE +// User includes -#include "wlanqtutilscommon.h" +#include "wlanqtutils.h" + +// Forward declarations -// FORWARD DECLARATIONS -class WlanQtUtilsWlanAp; -class WlanQtUtilsActiveConn; -class ConnMonScanWlanAps; -class ConnMonConnInfo; -class ConnMonConnDisconnect; +class WlanQtUtilsAp; +class WlanQtUtilsConnection; +class WlanQtUtilsConMonWrapperScan; +class WlanQtUtilsConMonWrapperInfo; +class WlanQtUtilsConMonWrapperDisconnect; -// CLASS DECLARATION +// External data types + +// Constants -/** -* ConMonWrapper class. -*/ -class ConMonWrapper : public QObject +// Class declaration + +class WlanQtUtilsConMonWrapper : public QObject { Q_OBJECT public: - - /** - * Constructor. - */ - ConMonWrapper(QObject *parent = 0); - - /** - * Destructor. - */ - ~ConMonWrapper(); - /** - * Requests wlan scanning - * - * @return ???. - */ - int scanAvailableWlanAPs(); - - /** - * Emits available WLANs to engine. - * - * @param[in] availableWlanAPs Available WLAN access points found in scan. - */ - void emitAvailableWlans(QList &availableWlanAPs); + // Data types - /** - * Emits signal indicating that a new connection has been created. - * - * @param[in] connectionId Connection ID. - */ - void emitConnCreatedEvent(uint connectionId); + WlanQtUtilsConMonWrapper(QObject *parent = 0); - /** - * Emits signal indicating that a connection has been deleted. - * - * @param[in] connectionId Connection ID. - */ - void emitConnDeletedEvent(uint connectionId); - - /** - * Emits signal indicating that status of a connection has changed. - * - * @param[in] connectionId Connection ID. - * @param[in] connectionStatus Connection status. - */ - void emitConnStatusEvent(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus); + ~WlanQtUtilsConMonWrapper(); - /** - * Return active connection information. - * - * @return Information of active connection, if one exists. - */ - WlanQtUtilsActiveConn *activeConnection(); + void scanAvailableWlanAPs(); + + void stopScan(); + + WlanQtUtilsConnection *activeConnection() const; - /** - * Returns information of a connection with the given connection ID. - * - * @param[in] connectionId Connection ID. - * @return Information of the given connection, if one exists. - */ - WlanQtUtilsActiveConn *connectionInfo(uint connectionId); + WlanQtUtilsConnection *connectionInfo(uint connectionId) const; - /** - * Stops given connection regardless of how many applications are using it. - * - * @param[in] iapId IAP ID to disconnect. - */ void disconnectIap(int iapId); signals: - /** - * Signal indicating available WLAN access points. - * - * @param[in] availableWlans Available WLAN access points found in scan. + /*! + Signal indicating available WLAN access points. + + @param [in] availableWlans Available WLAN access points found in scan. */ - void availableWlanApsFromWrapper(QList &availableWlans); + void availableWlanApsFromWrapper( + QList< QSharedPointer > &availableWlans); - /** - * Signal indicating that a new connection has been created. - * - * @param[in] connectionId Connection ID. + /*! + Signal indicating that a new connection has been created. + + @param [in] connectionId Connection ID. */ void connCreatedEventFromWrapper(uint connectionId); - /** - * Signal indicating that a connection has been deleted. - * - * @param[in] connectionId Connection ID. + /*! + Signal indicating that a connection has been deleted. + + @param [in] connectionId Connection ID. */ void connDeletedEventFromWrapper(uint connectionId); - /** - * Signal indicating that status of a connection has changed. - * - * @param[in] connectionId Connection ID. - * @param[in] connectionStatus Connection status. + /*! + Signal indicating that status of a connection has changed. + + @param [in] connectionId Connection ID. + @param [in] connectionStatus Connection status. */ - void connStatusEventFromWrapper(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus); + void connStatusEventFromWrapper( + uint connectionId, + WlanQtUtils::ConnStatus connectionStatus); -private: // Data - - /** - * d_ptrScanWlans pointer to ConMonWrapperPrivate - * Owned by ConMonWrapper object, instantiated in - * constructor. - */ - ConnMonScanWlanAps *d_ptrScanWlans; +public slots: + +protected: + +protected slots: + +private: + +private slots: + +private: // data - /** - * d_ptrConnInfo pointer to ConMonWrapperPrivate - * Owned by ConMonWrapper object, instantiated in - * constructor. - */ - ConnMonConnInfo *d_ptrConnInfo; + // Owned data + + //! Private implementation of scan interface + QScopedPointer d_ptrScan; + + //! Private implementation of connection info interface + QScopedPointer d_ptrInfo; - /** - * d_ptrConnDisconnect pointer to ConMonWrapperPrivate - * Owned by ConMonWrapper object, instantiated in - * constructor. - */ - ConnMonConnDisconnect *d_ptrConnDisconnect; + //! Private implementation of connection disconnect interface + QScopedPointer d_ptrDisconnect; -private: // Friend classes - // TestWlanQtUtils is defined as a friend class in order to be able to - // call event handlers of wrappers. + // Friend classes + + // These are defined as friend classes in order to be able to emit + // public signals directly from private implementation classes. + friend class WlanQtUtilsConMonWrapperScan; + friend class WlanQtUtilsConMonWrapperInfo; + + // This is defined as a friend class in order to be able to call + // event handlers of wrappers from unit tests. friend class TestWlanQtUtils; }; -QT_END_HEADER - -QT_END_NAMESPACE - -#endif /* WLANQTUTILSCONMONWRAPPER_H */ - -// End of file +#endif // WLANQTUTILSCONMONWRAPPER_H