wlanutilities/wlanqtutilities/wrapper/inc/wlanqtutilsconmonwrapper.h
changeset 38 2dc6da6fb431
parent 19 10810c91db26
child 39 7b3e49e4608a
equal deleted inserted replaced
29:dbe86d96ce5b 38:2dc6da6fb431
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 * Wrapper for Symbian Connection Monitor library.
    16 */
    16 */
    17 
    17 
    18 #ifndef WLANQTUTILSCONMONWRAPPER_H
    18 #ifndef WLANQTUTILSCONMONWRAPPER_H
    19 #define WLANQTUTILSCONMONWRAPPER_H
    19 #define WLANQTUTILSCONMONWRAPPER_H
    20 
    20 
    21 // INCLUDES
    21 // System includes
       
    22 
    22 #include <QObject>
    23 #include <QObject>
    23 #include <QList>
    24 #include <QList>
    24 #include <QStringList>
    25 #include <QSharedPointer>
       
    26 #include <QScopedPointer>
    25 
    27 
    26 QT_BEGIN_HEADER
    28 // User includes
    27 
    29 
    28 QT_BEGIN_NAMESPACE
    30 #include "wlanqtutils.h"
    29 
    31 
    30 #include "wlanqtutilscommon.h"
    32 // Forward declarations
    31 
    33 
    32 // FORWARD DECLARATIONS
    34 class WlanQtUtilsAp;
    33 class WlanQtUtilsWlanAp;
    35 class WlanQtUtilsConnection;
    34 class WlanQtUtilsActiveConn;
    36 class WlanQtUtilsConMonWrapperScan;
    35 class ConnMonScanWlanAps;
    37 class WlanQtUtilsConMonWrapperInfo;
    36 class ConnMonConnInfo;
    38 class WlanQtUtilsConMonWrapperDisconnect;
    37 class ConnMonConnDisconnect;
       
    38 
    39 
    39 // CLASS DECLARATION
    40 // External data types
    40 
    41 
    41 /**
    42 // Constants
    42 * ConMonWrapper class.
    43 
    43 */
    44 // Class declaration
    44 class ConMonWrapper : public QObject
    45 
       
    46 class WlanQtUtilsConMonWrapper : public QObject
    45 {
    47 {
    46     Q_OBJECT
    48     Q_OBJECT
    47     
    49     
    48 public:
    50 public:
    49         
    51 
    50     /**
    52     // Data types
    51      * Constructor.
    53 
    52      */
    54     WlanQtUtilsConMonWrapper(QObject *parent = 0);
    53     ConMonWrapper(QObject *parent = 0);
       
    54     
    55     
    55     /**
    56     ~WlanQtUtilsConMonWrapper();
    56     * Destructor.
       
    57     */
       
    58     ~ConMonWrapper();
       
    59 
    57 
    60     /**
    58     void scanAvailableWlanAPs();
    61      * Requests wlan scanning
       
    62      *
       
    63      * @return ???.
       
    64      */
       
    65     int scanAvailableWlanAPs();
       
    66     
    59     
    67     /**
    60     void stopScan();
    68      * Emits available WLANs to engine.
    61     
    69      * 
    62     WlanQtUtilsConnection *activeConnection() const;
    70      * @param[in] availableWlanAPs Available WLAN access points found in scan.
       
    71      */
       
    72     void emitAvailableWlans(QList<WlanQtUtilsWlanAp *> &availableWlanAPs);
       
    73 
    63 
    74     /**
    64     WlanQtUtilsConnection *connectionInfo(uint connectionId) const;
    75      * Emits signal indicating that a new connection has been created.
       
    76      * 
       
    77      * @param[in] connectionId Connection ID.
       
    78      */
       
    79     void emitConnCreatedEvent(uint connectionId);
       
    80     
       
    81     /**
       
    82      * Emits signal indicating that a connection has been deleted.
       
    83      * 
       
    84      * @param[in] connectionId Connection ID.
       
    85      */
       
    86     void emitConnDeletedEvent(uint connectionId);
       
    87     
       
    88     /**
       
    89      * Emits signal indicating that status of a connection has changed.
       
    90      * 
       
    91      * @param[in] connectionId Connection ID.
       
    92      * @param[in] connectionStatus Connection status.
       
    93      */
       
    94     void emitConnStatusEvent(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus);
       
    95 
    65 
    96     /**
       
    97      * Return active connection information.
       
    98      * 
       
    99      * @return Information of active connection, if one exists.
       
   100      */ 
       
   101     WlanQtUtilsActiveConn *activeConnection();
       
   102 
       
   103     /**
       
   104      * Returns information of a connection with the given connection ID.
       
   105      * 
       
   106      * @param[in] connectionId Connection ID.
       
   107      * @return Information of the given connection, if one exists.
       
   108      */ 
       
   109     WlanQtUtilsActiveConn *connectionInfo(uint connectionId);
       
   110 
       
   111     /**
       
   112      * Stops given connection regardless of how many applications are using it.
       
   113      * 
       
   114      * @param[in] iapId IAP ID to disconnect.
       
   115      */ 
       
   116     void disconnectIap(int iapId);
    66     void disconnectIap(int iapId);
   117         
    67         
   118 signals:
    68 signals:
   119 
    69 
   120     /**
    70     /*!
   121      * Signal indicating available WLAN access points.
    71        Signal indicating available WLAN access points.
   122      * 
    72 
   123      * @param[in] availableWlans Available WLAN access points found in scan.
    73        @param [in] availableWlans Available WLAN access points found in scan.
   124      */
    74      */
   125     void availableWlanApsFromWrapper(QList<WlanQtUtilsWlanAp *> &availableWlans);
    75     void availableWlanApsFromWrapper(
       
    76         QList< QSharedPointer<WlanQtUtilsAp> > &availableWlans);
   126     
    77     
   127     /**
    78     /*!
   128      * Signal indicating that a new connection has been created.
    79        Signal indicating that a new connection has been created.
   129      * 
    80 
   130      * @param[in] connectionId Connection ID.
    81        @param [in] connectionId Connection ID.
   131      */
    82      */
   132     void connCreatedEventFromWrapper(uint connectionId);
    83     void connCreatedEventFromWrapper(uint connectionId);
   133 
    84 
   134     /**
    85     /*!
   135      * Signal indicating that a connection has been deleted.
    86        Signal indicating that a connection has been deleted.
   136      * 
    87 
   137      * @param[in] connectionId Connection ID.
    88        @param [in] connectionId Connection ID.
   138      */
    89      */
   139     void connDeletedEventFromWrapper(uint connectionId);
    90     void connDeletedEventFromWrapper(uint connectionId);
   140 
    91 
   141     /**
    92     /*!
   142      * Signal indicating that status of a connection has changed.
    93        Signal indicating that status of a connection has changed.
   143      * 
    94 
   144      * @param[in] connectionId Connection ID.
    95        @param [in] connectionId Connection ID.
   145      * @param[in] connectionStatus Connection status.
    96        @param [in] connectionStatus Connection status.
   146      */
    97      */
   147     void connStatusEventFromWrapper(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus);
    98     void connStatusEventFromWrapper(
       
    99         uint connectionId,
       
   100         WlanQtUtils::ConnStatus connectionStatus);
   148 
   101 
   149 private: // Data
   102 public slots:
       
   103 
       
   104 protected:
       
   105 
       
   106 protected slots:
       
   107 
       
   108 private:
       
   109 
       
   110 private slots:
       
   111 
       
   112 private: // data
   150     
   113     
   151     /**
   114     // Owned data
   152     * d_ptrScanWlans pointer to ConMonWrapperPrivate
       
   153     * Owned by ConMonWrapper object, instantiated in
       
   154     * constructor.
       
   155     */
       
   156     ConnMonScanWlanAps *d_ptrScanWlans;
       
   157     
   115     
   158     /**
   116     //! Private implementation of scan interface
   159     * d_ptrConnInfo pointer to ConMonWrapperPrivate
   117     QScopedPointer<WlanQtUtilsConMonWrapperScan> d_ptrScan;
   160     * Owned by ConMonWrapper object, instantiated in
   118     
   161     * constructor.
   119     //! Private implementation of connection info interface
   162     */
   120     QScopedPointer<WlanQtUtilsConMonWrapperInfo> d_ptrInfo;
   163     ConnMonConnInfo *d_ptrConnInfo;
       
   164 
   121 
   165     /**
   122     //! Private implementation of connection disconnect interface
   166     * d_ptrConnDisconnect pointer to ConMonWrapperPrivate
   123     QScopedPointer<WlanQtUtilsConMonWrapperDisconnect> d_ptrDisconnect;
   167     * Owned by ConMonWrapper object, instantiated in
       
   168     * constructor.
       
   169     */
       
   170     ConnMonConnDisconnect *d_ptrConnDisconnect;
       
   171 
   124 
   172 private: // Friend classes
   125     // Friend classes
   173     // TestWlanQtUtils is defined as a friend class in order to be able to
   126     
   174     // call event handlers of wrappers.
   127     // These are defined as friend classes in order to be able to emit
       
   128     // public signals directly from private implementation classes.
       
   129     friend class WlanQtUtilsConMonWrapperScan;
       
   130     friend class WlanQtUtilsConMonWrapperInfo;
       
   131     
       
   132     // This is defined as a friend class in order to be able to call
       
   133     // event handlers of wrappers from unit tests.
   175     friend class TestWlanQtUtils;
   134     friend class TestWlanQtUtils;
   176 };
   135 };
   177 
   136 
   178 QT_END_HEADER
   137 #endif // WLANQTUTILSCONMONWRAPPER_H
   179 
       
   180 QT_END_NAMESPACE
       
   181 
       
   182 #endif /* WLANQTUTILSCONMONWRAPPER_H */
       
   183 
       
   184 // End of file