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 widget class. |
|
16 */ |
|
17 |
|
18 #ifndef WLANSNIFFERLISTWIDGET_H |
|
19 #define WLANSNIFFERLISTWIDGET_H |
|
20 |
|
21 // System includes |
|
22 |
|
23 #include <QSharedPointer> |
|
24 #include <QList> |
|
25 #include <QString> |
|
26 |
|
27 // User includes |
|
28 |
|
29 // Forward declarations |
|
30 |
|
31 class HbListWidget; |
|
32 class HbListWidgetItem; |
|
33 class WlanSnifferListItem; |
|
34 class WlanQtUtilsIap; |
|
35 class WlanQtUtilsAp; |
|
36 |
|
37 // External data types |
|
38 |
|
39 // Constants |
|
40 |
|
41 // Class declaration |
|
42 |
|
43 class WlanSnifferListWidget |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 // Data types |
|
49 |
|
50 /*! |
|
51 Signal strength category boundaries in dB (absolute value). |
|
52 Smaller value means better signal. |
|
53 */ |
|
54 enum |
|
55 { |
|
56 SignalStrengthHigh = 65, //!< High signal strength |
|
57 SignalStrengthMedium = 79 //!< Medium signal strength |
|
58 }; |
|
59 |
|
60 explicit WlanSnifferListWidget(HbListWidget *listWidget); |
|
61 |
|
62 virtual ~WlanSnifferListWidget(); |
|
63 |
|
64 void updateContent( |
|
65 QList< QSharedPointer<WlanQtUtilsIap> > &iaps, |
|
66 QList< QSharedPointer<WlanQtUtilsAp> > &aps, |
|
67 int connectedIapId); |
|
68 |
|
69 void scrollTo(int row); |
|
70 |
|
71 signals: |
|
72 |
|
73 public slots: |
|
74 |
|
75 protected: |
|
76 |
|
77 protected slots: |
|
78 |
|
79 private: |
|
80 |
|
81 Q_DISABLE_COPY(WlanSnifferListWidget) |
|
82 |
|
83 void sortIaps( |
|
84 QList< QSharedPointer<WlanQtUtilsIap> > &iaps, |
|
85 int connectedIapId); |
|
86 |
|
87 void sortAps( |
|
88 QList< QSharedPointer<WlanQtUtilsAp> > &aps); |
|
89 |
|
90 static bool iapLessThan( |
|
91 const QSharedPointer<WlanQtUtilsIap> iap1, |
|
92 const QSharedPointer<WlanQtUtilsIap> iap2); |
|
93 |
|
94 static bool apLessThan( |
|
95 const QSharedPointer<WlanQtUtilsAp> ap1, |
|
96 const QSharedPointer<WlanQtUtilsAp> ap2); |
|
97 |
|
98 WlanSnifferListItem *findFromOldList(QSharedPointer<WlanQtUtilsIap> iap); |
|
99 |
|
100 WlanSnifferListItem *findFromOldList(QSharedPointer<WlanQtUtilsAp> ap); |
|
101 |
|
102 HbListWidgetItem *listItemCreate( |
|
103 QSharedPointer<WlanQtUtilsIap> iap, |
|
104 int connectedIapId); |
|
105 |
|
106 HbListWidgetItem *listItemCreate(QSharedPointer<WlanQtUtilsAp> ap); |
|
107 |
|
108 QString signalStrengthIconChoose(int signalStrength); |
|
109 |
|
110 QString leftIconChoose(int iapId, int connectedIapId); |
|
111 |
|
112 void removeLostItems( |
|
113 const QList< QSharedPointer<WlanQtUtilsIap> > &iaps, |
|
114 const QList< QSharedPointer<WlanQtUtilsAp> > &aps); |
|
115 |
|
116 void addDiscoveredItemsAndUpdateRest( |
|
117 const QList< QSharedPointer<WlanQtUtilsIap> > &iaps, |
|
118 const QList< QSharedPointer<WlanQtUtilsAp> > &aps, |
|
119 int connectedIapId); |
|
120 |
|
121 void traceListContent() const; |
|
122 |
|
123 private slots: |
|
124 |
|
125 private: // data |
|
126 |
|
127 // Not owned data |
|
128 HbListWidget *mListWidget; //!< WLAN list view widget |
|
129 |
|
130 // Owned data |
|
131 |
|
132 // Friend classes |
|
133 }; |
|
134 |
|
135 #endif // WLANSNIFFERLISTWIDGET_H |
|