55
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2008 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: Class header for CWsfDetailsViewModel
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef C_WSFDETAILSVIEWMODEL_H
|
|
19 |
#define C_WSFDETAILSVIEWMODEL_H
|
|
20 |
|
|
21 |
//EXTERNAL INCLUDES
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <rconnmon.h>
|
|
24 |
|
|
25 |
|
|
26 |
//INTERNAL INCLUDES
|
|
27 |
#include "wsfwlaninfo.h"
|
|
28 |
|
|
29 |
|
|
30 |
//FORWARD DECLARATIONS
|
|
31 |
class CCoeEnv;
|
|
32 |
class CWsfWlanInfoArray;
|
|
33 |
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Details view Model
|
|
37 |
*
|
|
38 |
* Holds & formats TWlanInfo for list box showable format
|
|
39 |
*
|
|
40 |
* @lib Sniffer.app
|
|
41 |
* @since S60 v5.0
|
|
42 |
*/
|
|
43 |
NONSHARABLE_CLASS( CWsfDetailsViewModel ): public CBase
|
|
44 |
{
|
|
45 |
|
|
46 |
public:
|
|
47 |
|
|
48 |
// Constructors and the C++ destructor
|
|
49 |
/**
|
|
50 |
* Two-phased constructor
|
|
51 |
* @since S60 5.0
|
|
52 |
* @return instance of CWsfDetailsViewModel class
|
|
53 |
*/
|
|
54 |
IMPORT_C static CWsfDetailsViewModel* NewL();
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Two-phased constructor. Leaves the object on CleanupStack
|
|
58 |
* @since S60 5.0
|
|
59 |
* @return instance of CWsfDetailsViewModel class
|
|
60 |
*/
|
|
61 |
IMPORT_C static CWsfDetailsViewModel* NewLC();
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Destructor of CWsfDetailsViewModel class
|
|
65 |
* @since S60 5.0
|
|
66 |
*/
|
|
67 |
~CWsfDetailsViewModel();
|
|
68 |
|
|
69 |
|
|
70 |
// New methods
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Formats Wlan info for showing
|
|
74 |
*
|
|
75 |
* @since S60 v5.0
|
|
76 |
* @param iWlanInfo - selected Wlan info
|
|
77 |
* @param aWlanArray - Wlan info array
|
|
78 |
* @return formated text array
|
|
79 |
*/
|
|
80 |
CDesCArrayFlat* FormatWlanInfoL( TWsfWlanInfo* aWlanInfo,
|
|
81 |
CWsfWlanInfoArray* aWlanArray );
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Formats next Wlan info from array
|
|
85 |
*
|
|
86 |
* @since S60 v5.0
|
|
87 |
* @return formated text array
|
|
88 |
*/
|
|
89 |
CDesCArrayFlat* FormatNextWlanInfoL();
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Formats previous Wlan info from array
|
|
93 |
*
|
|
94 |
* @since S60 v5.0
|
|
95 |
* @return formated text array
|
|
96 |
*/
|
|
97 |
CDesCArrayFlat* FormatPreviousWlanInfoL();
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Formats text for pane to show
|
|
101 |
*
|
|
102 |
* @since S60 v5.0
|
|
103 |
* @return formated text array
|
|
104 |
*/
|
|
105 |
HBufC* FormatPaneTextLC();
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Formats Left Scroll Button for pane to show
|
|
109 |
*
|
|
110 |
* @return boolen (EFalse show the arrow, ETrue hide it)
|
|
111 |
*/
|
|
112 |
TBool FormatLeftScrollButton();
|
|
113 |
|
|
114 |
/**
|
|
115 |
* Formats Right Scroll Button for pane to show
|
|
116 |
*
|
|
117 |
* @return boolen (EFalse show the arrow, ETrue hide it)
|
|
118 |
*/
|
|
119 |
TBool FormatRightScrollButton();
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Returns WLAN details that has already formatted
|
|
123 |
* @since S60 v5.0
|
|
124 |
* @return Formatted WLAN details
|
|
125 |
*/
|
|
126 |
CDesCArrayFlat* GetWlanDetails();
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Returns current Wlan Ssid
|
|
130 |
* @since S60 v5.0
|
|
131 |
* @return Ssid
|
|
132 |
*/
|
|
133 |
const TDesC8& WlanSsid() const;
|
|
134 |
|
|
135 |
private:
|
|
136 |
|
|
137 |
// Constructors and the C++ destructor
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Default C++ constructor
|
|
141 |
* @since S60 5.0
|
|
142 |
*/
|
|
143 |
CWsfDetailsViewModel();
|
|
144 |
|
|
145 |
/**
|
|
146 |
* 2nd phase constructor
|
|
147 |
* @since S60 5.0
|
|
148 |
*/
|
|
149 |
void ConstructL();
|
|
150 |
|
|
151 |
// New methods
|
|
152 |
|
|
153 |
/**
|
|
154 |
* Creates listbox items from header and value (formatter %S\t%S)
|
|
155 |
* @since S60 v5.0
|
|
156 |
* @param aResourceId - id of loaded header string
|
|
157 |
* @param aValueText - string containing value data
|
|
158 |
* @return formated string
|
|
159 |
*/
|
|
160 |
HBufC* FormatListBoxItemLC( const TUint aResourceId,
|
|
161 |
const TDesC& aValueText ) const;
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Appends Wlan IAP Name to iFormattedWlanInfo
|
|
165 |
* @since S60 v5.0
|
|
166 |
*/
|
|
167 |
void FormatAndAppenWlanIapNameL();
|
|
168 |
|
|
169 |
/**
|
|
170 |
* Appends Wlan Ssid to iFormattedWlanInfo
|
|
171 |
* @since S60 v5.0
|
|
172 |
*/
|
|
173 |
void FormatAndAppenWlanSsidL();
|
|
174 |
|
|
175 |
/**
|
|
176 |
* Appends singnal strength to iFormattedWlanInfo
|
|
177 |
* @since S60 v5.0
|
|
178 |
*/
|
|
179 |
void FormatAndAppenSingnalL();
|
|
180 |
|
|
181 |
/**
|
|
182 |
* Appends wlan mode to iFormattedWlanInfo
|
|
183 |
* @since S60 v5.0
|
|
184 |
*/
|
|
185 |
void FormatAndAppenModeL();
|
|
186 |
|
|
187 |
/**
|
|
188 |
* Appends wlan security to iFormattedWlanInfo
|
|
189 |
* @since S60 v5.0
|
|
190 |
*/
|
|
191 |
void FormatAndAppenSecurityL();
|
|
192 |
|
|
193 |
/**
|
|
194 |
* Appends wlan coverage to iFormattedWlanInfo
|
|
195 |
* @since S60 v5.0
|
|
196 |
*/
|
|
197 |
void FormatAndAppenCoverageL();
|
|
198 |
|
|
199 |
/**
|
|
200 |
* Appends wlan speed to iFormattedWlanInfo
|
|
201 |
* @since S60 v5.0
|
|
202 |
*/
|
|
203 |
void FormatAndAppenSpeedL();
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Formats signal strenth to string
|
|
207 |
* @since S60 v5.0
|
|
208 |
* @return formated string
|
|
209 |
*/
|
|
210 |
HBufC* FormatSingnalStrenghtLC();
|
|
211 |
|
|
212 |
/**
|
|
213 |
* Formats wlan mode to string
|
|
214 |
* @since S60 v5.0
|
|
215 |
* @return formated string
|
|
216 |
*/
|
|
217 |
HBufC* FormatModeLC();
|
|
218 |
|
|
219 |
/**
|
|
220 |
* Formats wlan security to string
|
|
221 |
* @since S60 v5.0
|
|
222 |
* @return formated string
|
|
223 |
*/
|
|
224 |
HBufC* FormatSecurityLC();
|
|
225 |
|
|
226 |
/**
|
|
227 |
* Formats wlan coverage to string
|
|
228 |
* @since S60 v5.0
|
|
229 |
* @return formated string
|
|
230 |
*/
|
|
231 |
HBufC* FormatCoverageLC();
|
|
232 |
|
|
233 |
/**
|
|
234 |
* Formats wlan technology to string
|
|
235 |
* @since S60 v5.2
|
|
236 |
* @return formated string
|
|
237 |
*/
|
|
238 |
HBufC* FormatTechnologyLC();
|
|
239 |
|
|
240 |
/**
|
|
241 |
* Calculate number of visible (Not hidden) WLANs
|
|
242 |
* @since S60 v.3.0
|
|
243 |
* @param aArray Array of WLAN passed as reference
|
|
244 |
* @return Number of visible WLANs
|
|
245 |
*/
|
|
246 |
TInt VisibleWlans( CWsfWlanInfoArray& aArray );
|
|
247 |
|
|
248 |
private: // data
|
|
249 |
|
|
250 |
/**
|
|
251 |
* Copy of showed Wlan info
|
|
252 |
* Own.
|
|
253 |
*/
|
|
254 |
TWsfWlanInfo iWlanInfo;
|
|
255 |
|
|
256 |
/**
|
|
257 |
* Formater Wlan info
|
|
258 |
* Own.
|
|
259 |
*/
|
|
260 |
CDesCArrayFlat* iFormattedWlanInfo;
|
|
261 |
|
|
262 |
/**
|
|
263 |
* Current List index;
|
|
264 |
* Own.
|
|
265 |
*/
|
|
266 |
TInt iIndex;
|
|
267 |
|
|
268 |
/**
|
|
269 |
* Coe env for loading string from resource
|
|
270 |
* Ref.
|
|
271 |
*/
|
|
272 |
CCoeEnv* iCoeEnv;
|
|
273 |
|
|
274 |
/**
|
|
275 |
* Reference to Wlan array
|
|
276 |
* ref.
|
|
277 |
*/
|
|
278 |
CWsfWlanInfoArray* iWlanArray;
|
|
279 |
|
|
280 |
};
|
|
281 |
|
|
282 |
#endif // C_WSFDETAILSVIEWMODEL_H
|