wlanutilities/wlanqtutilities/base/inc/wlanqtutils_p.h
branchRCL_3
changeset 24 63be7eb3fc78
equal deleted inserted replaced
23:b852595f5cbe 24:63be7eb3fc78
       
     1 /*
       
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * WLAN Qt Utilities private implementation interface.
       
    16 */
       
    17 
       
    18 #ifndef WLANQTUTILS_P_H
       
    19 #define WLANQTUTILS_P_H
       
    20 
       
    21 // System includes
       
    22 
       
    23 #include <QObject>
       
    24 #include <QSharedPointer>
       
    25 #include <QList>
       
    26 
       
    27 // User includes
       
    28 
       
    29 #include "wlanqtutils.h"
       
    30 #include "ictswlanlogininterface.h"
       
    31 
       
    32 // Forward declarations
       
    33 
       
    34 class WlanQtUtils;
       
    35 class WlanQtUtilsIap;
       
    36 class WlanQtUtilsAp;
       
    37 class WlanQtUtilsConnection;
       
    38 class WlanQtUtilsIapSettings;
       
    39 class WlanQtUtilsConMonWrapper;
       
    40 class WlanQtUtilsEsockWrapper;
       
    41 class WlanQtUtilsScan;
       
    42 
       
    43 // External data types
       
    44 
       
    45 // Constants
       
    46 
       
    47 // Class declaration
       
    48 
       
    49 class WlanQtUtilsPrivate : public QObject
       
    50 {
       
    51     Q_OBJECT
       
    52 
       
    53 public:
       
    54 
       
    55     // Data types
       
    56 
       
    57     explicit WlanQtUtilsPrivate(WlanQtUtils *q_ptr);
       
    58 
       
    59     virtual ~WlanQtUtilsPrivate();
       
    60     
       
    61     void scanWlans();
       
    62     
       
    63     void scanWlanAps();
       
    64     
       
    65     void scanWlanDirect(const QString &ssid);
       
    66 
       
    67     void stopWlanScan();
       
    68 
       
    69     void availableWlans(
       
    70         QList< QSharedPointer<WlanQtUtilsIap> > &wlanIapList,
       
    71         QList< QSharedPointer<WlanQtUtilsAp> > &wlanApList) const;
       
    72 
       
    73     void availableWlanAps(
       
    74         QList< QSharedPointer<WlanQtUtilsAp> > &wlanApList) const;  
       
    75 
       
    76     int createIap(const WlanQtUtilsAp *wlanAp);
       
    77 
       
    78     bool updateIap(int iapId, const WlanQtUtilsAp *wlanAp);
       
    79 
       
    80     void deleteIap(int iapId);
       
    81 
       
    82     void connectIap(int iapId, bool runIct);
       
    83 
       
    84     void disconnectIap(int iapId);
       
    85 
       
    86     WlanQtUtils::ConnStatus connectionStatus() const;
       
    87 
       
    88     int activeIap() const;
       
    89 
       
    90     QString iapName(int iapId) const;
       
    91 
       
    92 signals:
       
    93 
       
    94 public slots:
       
    95 
       
    96 protected:
       
    97 
       
    98 protected slots:
       
    99 
       
   100 private:
       
   101 
       
   102     Q_DISABLE_COPY(WlanQtUtilsPrivate)
       
   103 
       
   104     bool wlanIapExists(
       
   105         const QList< QSharedPointer<WlanQtUtilsIap> > list,
       
   106         const WlanQtUtilsAp *ap) const;
       
   107     
       
   108     void traceIapsAndAps(
       
   109         const QList< QSharedPointer<WlanQtUtilsIap> > &iaps,
       
   110         const QList< QSharedPointer<WlanQtUtilsAp> > &aps) const;
       
   111 
       
   112 private slots:
       
   113 
       
   114     void updateAvailableWlanIaps(
       
   115         QList< QSharedPointer<WlanQtUtilsIap> > &availableIaps);
       
   116 
       
   117     void updateAvailableWlanAps(
       
   118         QList< QSharedPointer<WlanQtUtilsAp> > &availableWlans);
       
   119     
       
   120     void reportScanResult(int status);
       
   121     
       
   122     void updateConnectionStatus(bool isOpened);
       
   123     
       
   124     void addActiveConnection(uint connectionId);
       
   125     
       
   126     void removeActiveConnection(uint connectionId);
       
   127     
       
   128     void updateActiveConnection(
       
   129         uint connectionId,
       
   130         WlanQtUtils::ConnStatus connectionStatus);
       
   131 
       
   132     void updateIctResult(int ictsResult);
       
   133     
       
   134     void updateIctHotspotCase();
       
   135 
       
   136 private: // data
       
   137 
       
   138     //! Current scan mode
       
   139     enum ScanMode {
       
   140         ScanModeNone = 0,               //!< No scan active
       
   141         ScanModeAvailableWlans,         //!< Available AP's & IAPS
       
   142         ScanModeAvailableWlanAps,       //!< Available AP's
       
   143         ScanModeDirect                  //!< Direct SSID scan
       
   144     };
       
   145     
       
   146     // Not owned data
       
   147 
       
   148     //! Pointer to public implementation.
       
   149     WlanQtUtils *q_ptr;
       
   150 
       
   151     // Owned data
       
   152 
       
   153     //! Iap settings handler.
       
   154     WlanQtUtilsIapSettings *mSettings;
       
   155     
       
   156     //! Wrapper object for Connection Monitor and other parts of connmon library.
       
   157     WlanQtUtilsConMonWrapper *mConMonWrapper;
       
   158 
       
   159     //! Wrapper object for WLAN scanning.
       
   160     WlanQtUtilsScan *mScanWrapper;
       
   161     
       
   162     //! Wrapper object for esock library.
       
   163     WlanQtUtilsEsockWrapper *mEsockWrapper;
       
   164 
       
   165     //! Instance of Icts Wlan Login Interface.
       
   166     QSharedPointer<IctsWlanLoginInterface> mIctService;
       
   167 
       
   168     //! Current WLAN scan mode.
       
   169     ScanMode mScanMode;
       
   170 
       
   171     //! List of available WLAN IAPs according to the latest scan.
       
   172     QList< QSharedPointer<WlanQtUtilsIap> > mIapScanList;
       
   173     
       
   174     //! List of available WLAN APs according to the latest scan.
       
   175     QList< QSharedPointer<WlanQtUtilsAp> > mWlanScanList;
       
   176 
       
   177     //! ID of IAP requiring ICT running, IapIdNone if not valid.
       
   178     int mToBeTestedIapId;
       
   179     
       
   180     //! ID of IAP being connected by us (requested by UI), IapIdNone if not valid.
       
   181     int mConnectingIapId;
       
   182     
       
   183     //! Information of possible active connection.
       
   184     QSharedPointer<WlanQtUtilsConnection> mConnection;
       
   185 
       
   186     // Friend classes
       
   187     
       
   188     // This is defined as a friend class in order to be able to
       
   189     // call event handlers of wrappers from test code.
       
   190     friend class TestWlanQtUtils;
       
   191 };
       
   192 
       
   193 #endif // WLANQTUTILS_P_H