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