wlanutilities/wlansniffer/wlansnifferapplication/inc/wlansnifferengine.h
branchRCL_3
changeset 25 f28ada11abbf
parent 24 63be7eb3fc78
equal deleted inserted replaced
24:63be7eb3fc78 25:f28ada11abbf
     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 Sniffer application engine. 
       
    16 */
       
    17 
       
    18 #ifndef WLANSNIFFERENGINE_H
       
    19 #define WLANSNIFFERENGINE_H
       
    20 
       
    21 // System includes
       
    22 
       
    23 #include <QObject>
       
    24 #include <QVariant>
       
    25 #include <QString>
       
    26 #include <xqsettingskey.h>
       
    27 
       
    28 // User includes
       
    29 
       
    30 #include "wlanqtutils.h"
       
    31 
       
    32 // Forward declarations
       
    33 
       
    34 class WlanSnifferService;
       
    35 class XQSettingsManager;
       
    36 
       
    37 // External data types
       
    38 
       
    39 // Constants
       
    40 
       
    41 // Class declaration
       
    42 
       
    43 class WlanSnifferEngine : public QObject
       
    44 {
       
    45     Q_OBJECT
       
    46     
       
    47 public:
       
    48 
       
    49     // Data types
       
    50 
       
    51     explicit WlanSnifferEngine(QObject *parent = 0);
       
    52     
       
    53     ~WlanSnifferEngine();
       
    54 
       
    55     WlanQtUtils *wlanQtUtils() const;
       
    56 
       
    57     bool isEmbedded() const;
       
    58 
       
    59     void startWlanScanning();
       
    60 
       
    61     void stopWlanScanning();
       
    62 
       
    63     bool masterWlan() const;
       
    64 
       
    65     void setMasterWlan(bool enabled);
       
    66     
       
    67     bool forceDisableWlan() const;
       
    68 
       
    69     bool offlineMode() const;
       
    70 
       
    71 signals:
       
    72 
       
    73     /*!
       
    74         Signal indicating that WLAN scan results are available. 
       
    75     */
       
    76     void wlanScanReady();
       
    77 
       
    78     /*!
       
    79         Signal to inform that List View is requested.
       
    80         
       
    81         @param [in] title Window title.
       
    82     */
       
    83     void toListView(const QString &title);
       
    84     
       
    85     /*!
       
    86         Signal to inform that application exit was requested.
       
    87     */
       
    88     void exitTriggered();
       
    89 
       
    90     /*!
       
    91         Signal indicating that the WLAN master status has changed.
       
    92         
       
    93         @param [in] enabled Master WLAN status: true if enabled.
       
    94     */
       
    95     void masterWlanStatus(bool enabled);
       
    96     
       
    97     /*!
       
    98         Signal indicating that the force disable WLAN status has changed.
       
    99         
       
   100         @param [in] disabled Force disable WLAN status: true if disabled.
       
   101     */
       
   102     void forceDisableWlanStatus(bool disabled);
       
   103 
       
   104 public slots:
       
   105 
       
   106     void completeService();
       
   107 
       
   108 protected:
       
   109 
       
   110     void timerEvent(QTimerEvent *event);
       
   111 
       
   112 protected slots:
       
   113 
       
   114 private:
       
   115 
       
   116     Q_DISABLE_COPY(WlanSnifferEngine)
       
   117 
       
   118 private slots:
       
   119 
       
   120     void updateSetting(const XQSettingsKey &key, const QVariant &value);
       
   121     
       
   122     void handleWlanScanReady(int status);
       
   123 
       
   124 private: // data
       
   125 
       
   126     // Not owned data
       
   127 
       
   128     //! WLAN Sniffer service
       
   129     WlanSnifferService *mService;               
       
   130     
       
   131     //! Settings manager for platform settings reading, writing & status changes.
       
   132     XQSettingsManager *mSettingsManager;
       
   133 
       
   134     // Owned data
       
   135 
       
   136     //! Scan interval is 10 seconds
       
   137     static const int scanTimerInterval = 10000;
       
   138 
       
   139     //! WLAN scan timer ID
       
   140     int mScanTimerId;                           
       
   141     
       
   142     //! TRUE if scanning has been enabled
       
   143     bool mScanEnabled;
       
   144     
       
   145     //! TRUE if embedded
       
   146     bool mEmbedded;                             
       
   147     
       
   148     //! WLAN Qt Utils instance
       
   149     QSharedPointer<WlanQtUtils> mWlanQtUtils;
       
   150 
       
   151     // Friend classes
       
   152 };
       
   153 
       
   154 #endif // WLANSNIFFERENGINE_H