wlanutilities/wlansniffer/wlansnifferapplication/inc/wlansnifferlistview.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 List View. 
       
    16 */
       
    17 
       
    18 #ifndef WLANSNIFFERLISTVIEW_H
       
    19 #define WLANSNIFFERLISTVIEW_H
       
    20 
       
    21 // System includes
       
    22 
       
    23 #include <QSharedPointer>
       
    24 #include <QScopedPointer>
       
    25 
       
    26 #include <HbView>
       
    27 #include <HbMenu>
       
    28 #include <HbMessageBox>
       
    29 
       
    30 // User includes
       
    31 
       
    32 // Forward declarations
       
    33 
       
    34 class HbDocumentLoader;
       
    35 class HbListWidget;
       
    36 class HbListWidgetItem;
       
    37 class HbLabel;
       
    38 class HbPushButton;
       
    39 class WlanSnifferMainWindow;
       
    40 class WlanSnifferListWidget;
       
    41 class WlanSnifferEngine;
       
    42 class WlanQtUtilsAp;
       
    43 
       
    44 // External data types
       
    45 
       
    46 // Constants
       
    47 
       
    48 // Class declaration
       
    49 
       
    50 class WlanSnifferListView : public HbView
       
    51 {
       
    52     Q_OBJECT
       
    53 
       
    54 public:
       
    55 
       
    56     // Data types
       
    57 
       
    58     WlanSnifferListView(
       
    59         WlanSnifferEngine *engine,
       
    60         WlanSnifferMainWindow *mainWindow);
       
    61     
       
    62     ~WlanSnifferListView();
       
    63 
       
    64 signals:
       
    65 
       
    66     /*!
       
    67         Signal for triggering WLAN Wizard start. 
       
    68         
       
    69         @param [in] ap WLAN access point.
       
    70      */
       
    71 
       
    72     void wizardTriggered(const WlanQtUtilsAp *ap);
       
    73     
       
    74 public slots:
       
    75 
       
    76 protected:
       
    77 
       
    78 protected slots:
       
    79 
       
    80 private:
       
    81 
       
    82     Q_DISABLE_COPY(WlanSnifferListView)
       
    83 
       
    84     void loadDocml(bool isEmbedded);
       
    85     
       
    86     void updateWlanStatusLabel(bool enabled);
       
    87     
       
    88     void handleConnect(QVariant data);
       
    89 
       
    90 private slots:
       
    91 
       
    92     void updateListContent();
       
    93     
       
    94     void updateWlanEnabled();
       
    95     
       
    96     void updateConnectionOpened(int iapId);
       
    97     
       
    98     void updateConnectionClosed(int iapId);
       
    99     
       
   100     void handleContextMenuClosed();
       
   101 
       
   102     void handleListItemActivated(HbListWidgetItem *item);
       
   103     
       
   104     void handleListItemLongPressed(
       
   105         HbListWidgetItem *item,
       
   106         const QPointF &coords);
       
   107     
       
   108     void handleListItemConnect();
       
   109     
       
   110     void handleListItemDisconnect();
       
   111     
       
   112     void handleWlanToggled();
       
   113     
       
   114     void startWlanWizard();
       
   115     
       
   116     void handleWlanEnableDialogClosed(HbAction *action);
       
   117 
       
   118 private: // data
       
   119 
       
   120     // Owned data
       
   121     
       
   122     //! Document loader for list view
       
   123     QScopedPointer<HbDocumentLoader> mDocLoader;
       
   124     //! WLAN Sniffer list view custom widget
       
   125     QSharedPointer<WlanSnifferListWidget> mWlanListWidget;
       
   126     //! Context menu reference, if one is open
       
   127     QSharedPointer<HbMenu> mContextMenu;
       
   128     /*!
       
   129        Data identifying the network for which the context menu has been
       
   130        opened: WlanQtUtilsAp class, or int IAP ID.
       
   131      */
       
   132     QVariant mContextMenuData;
       
   133     //! WLAN enabling in airplane mode dialog
       
   134     QSharedPointer<HbMessageBox> mWlanEnableDialog;
       
   135     //! Flag for handling WLAN scan result update ignoring
       
   136     bool mIgnoreWlanScanResults;
       
   137     //! ID of the IAP we are currently connecting
       
   138     int mConnectingIapId;
       
   139 
       
   140     // Not owned data
       
   141     
       
   142     //! WLAN Sniffer engine
       
   143     WlanSnifferEngine *mEngine;
       
   144     //! WLAN ON/OFF switch action
       
   145     HbAction *mSwitchWlanAction;
       
   146     //! Add WLAN manually action
       
   147     HbAction *mAddWlanAction;
       
   148     //! WLAN Sniffer list view widget
       
   149     HbListWidget *mWlanList;
       
   150     //! WLAN Status label
       
   151     HbLabel *mStatusLabel;
       
   152     //! WLAN ON/OFF button
       
   153     HbPushButton *mWlanButton;
       
   154 
       
   155     // Friend classes
       
   156 };
       
   157 
       
   158 #endif // WLANSNIFFERLISTVIEW_H