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: Implementation of CWsfSearchWlansDialog |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // EXTERNAL INCLUDES |
|
21 #include <badesca.h> |
|
22 #include <coemain.h> |
|
23 #include <eiklbx.h> |
|
24 #include <eikclbd.h> |
|
25 #include <eikclb.h> |
|
26 #include <AknIconArray.h> |
|
27 #include <wsfaipluginrsc.rsg> |
|
28 |
|
29 // INTERNAL INCLUDES |
|
30 #include "wsfsearchwlansdialog.h" |
|
31 #include "wsflogger.h" |
|
32 |
|
33 // MACROS |
|
34 #ifdef _DEBUG |
|
35 _LIT( KSearchDialogPanic, "CWsfSearchWlansDialog" ); |
|
36 #define _ASS_D( cond ) __ASSERT_DEBUG( (cond), \ |
|
37 User::Panic( KSearchDialogPanic, __LINE__) ) |
|
38 #else |
|
39 #define _ASS_D( cond ) {} |
|
40 #endif // DEBUG |
|
41 |
|
42 |
|
43 // CONSTRUCTION AND DESTRUCTION |
|
44 // -------------------------------------------------------------------------- |
|
45 // CWsfSearchWlansDialog::NewL |
|
46 // -------------------------------------------------------------------------- |
|
47 // |
|
48 CWsfSearchWlansDialog* CWsfSearchWlansDialog::NewL( TInt &aSelectedItem ) |
|
49 { |
|
50 CWsfSearchWlansDialog* thisPtr = NewLC( aSelectedItem ); |
|
51 CleanupStack::Pop( thisPtr ); |
|
52 return thisPtr; |
|
53 } |
|
54 |
|
55 |
|
56 // -------------------------------------------------------------------------- |
|
57 // CWsfSearchWlansDialog::NewLC |
|
58 // -------------------------------------------------------------------------- |
|
59 // |
|
60 CWsfSearchWlansDialog* CWsfSearchWlansDialog::NewLC( TInt &aSelectedItem ) |
|
61 { |
|
62 CWsfSearchWlansDialog* thisPtr = |
|
63 new ( ELeave ) CWsfSearchWlansDialog( aSelectedItem ); |
|
64 CleanupStack::PushL( thisPtr ); |
|
65 thisPtr->ConstructL(); |
|
66 return thisPtr; |
|
67 } |
|
68 |
|
69 |
|
70 // -------------------------------------------------------------------------- |
|
71 // CWsfSearchWlansDialog::~CWsfSearchWlansDialog |
|
72 // -------------------------------------------------------------------------- |
|
73 // |
|
74 CWsfSearchWlansDialog::~CWsfSearchWlansDialog() |
|
75 { |
|
76 } |
|
77 |
|
78 |
|
79 // -------------------------------------------------------------------------- |
|
80 // CWsfSearchWlansDialog::CWsfSearchWlansDialog |
|
81 // -------------------------------------------------------------------------- |
|
82 // |
|
83 CWsfSearchWlansDialog::CWsfSearchWlansDialog( TInt &aSelectedItem ) : |
|
84 CAknListQueryDialog( &aSelectedItem ), |
|
85 iSelectedItem( &aSelectedItem ) |
|
86 { |
|
87 } |
|
88 |
|
89 |
|
90 // -------------------------------------------------------------------------- |
|
91 // CWsfSearchWlansDialog::ConstructL |
|
92 // -------------------------------------------------------------------------- |
|
93 // |
|
94 void CWsfSearchWlansDialog::ConstructL() |
|
95 { |
|
96 // nothing at the moment... |
|
97 } |
|
98 |
|
99 |
|
100 // -------------------------------------------------------------------------- |
|
101 // CWsfSearchWlansDialog::ProcessCommandL |
|
102 // -------------------------------------------------------------------------- |
|
103 // |
|
104 void CWsfSearchWlansDialog::ProcessCommandL( TInt aCommandId ) |
|
105 { |
|
106 LOG_ENTERFN( "CWsfSearchWlansDialog::ProcessCommandL" ); |
|
107 CAknListQueryDialog::ProcessCommandL( aCommandId ); |
|
108 } |
|
109 |
|
110 |
|
111 // -------------------------------------------------------------------------- |
|
112 // CWsfSearchWlansDialog::UpdateHotSpotsL |
|
113 // -------------------------------------------------------------------------- |
|
114 // |
|
115 void CWsfSearchWlansDialog::UpdateHotSpotsL( MDesCArray* aItemTextArray, |
|
116 TInt aCurrentItem ) |
|
117 { |
|
118 LOG_ENTERFN( "CWsfSearchWlansDialog::UpdateHotSpotsL" ); |
|
119 _ASS_D( ListBox() ); |
|
120 |
|
121 SetItemTextArray( aItemTextArray ); |
|
122 SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
123 ListBox()->HandleItemAdditionL(); |
|
124 if ( aCurrentItem < 0 || aCurrentItem >= aItemTextArray->MdcaCount() ) |
|
125 { |
|
126 ListBox()->ClearSelection(); |
|
127 } |
|
128 else |
|
129 { |
|
130 ListBox()->SetCurrentItemIndex( aCurrentItem ); |
|
131 } |
|
132 } |
|
133 |
|
134 |
|
135 // -------------------------------------------------------------------------- |
|
136 // CWsfSearchWlansDialog::SelectedItem |
|
137 // -------------------------------------------------------------------------- |
|
138 // |
|
139 TInt CWsfSearchWlansDialog::SelectedItem() |
|
140 { |
|
141 LOG_ENTERFN( "CWsfSearchWlansDialog::SelectedItem" ); |
|
142 _ASS_D( ListBox() ); |
|
143 |
|
144 return ListBox()->CurrentItemIndex(); |
|
145 } |
|
146 |
|
147 |
|
148 // -------------------------------------------------------------------------- |
|
149 // CWsfSearchWlansDialog::StartConnectingAnimationL |
|
150 // -------------------------------------------------------------------------- |
|
151 // |
|
152 void CWsfSearchWlansDialog::StartConnectingAnimationL() |
|
153 { |
|
154 LOG_ENTERFN( "CWsfSearchWlansDialog::StartConnectingAnimationL" ); |
|
155 } |
|
156 |
|
157 |
|
158 // -------------------------------------------------------------------------- |
|
159 // CWsfSearchWlansDialog::ForceRefreshingL |
|
160 // -------------------------------------------------------------------------- |
|
161 // |
|
162 void CWsfSearchWlansDialog::ForceRefreshingL() |
|
163 { |
|
164 LOG_ENTERFN( "CWsfSearchWlansDialog::ForceRefreshingL" ); |
|
165 } |
|
166 |
|
167 |
|
168 // -------------------------------------------------------------------------- |
|
169 // CWsfSearchWlansDialog::MultilineControl |
|
170 // -------------------------------------------------------------------------- |
|
171 // |
|
172 TBool CWsfSearchWlansDialog::MultilineControl() |
|
173 { |
|
174 LOG_ENTERFN( "CWsfSearchWlansDialog::MultilineControl" ); |
|
175 return ETrue; |
|
176 } |
|
177 |
|
178 |
|
179 // -------------------------------------------------------------------------- |
|
180 // CWsfSearchWlansDialog::UpdateViewL |
|
181 // -------------------------------------------------------------------------- |
|
182 // |
|
183 void CWsfSearchWlansDialog::UpdateViewL( MDesCArray* /*aItemTextArray*/ ) |
|
184 { |
|
185 LOG_ENTERFN( "CWsfSearchWlansDialog::UpdateViewL" ); |
|
186 } |
|
187 |
|
188 |
|
189 // -------------------------------------------------------------------------- |
|
190 // CWsfSearchWlansDialog::DisplayEngineOffL |
|
191 // -------------------------------------------------------------------------- |
|
192 // |
|
193 void CWsfSearchWlansDialog::DisplayEngineOffL() |
|
194 { |
|
195 LOG_ENTERFN( "CWsfSearchWlansDialog::DisplayEngineOffL" ); |
|
196 } |
|
197 |
|
198 |
|
199 // -------------------------------------------------------------------------- |
|
200 // CWsfSearchWlansDialog::PreLayoutDynInitL |
|
201 // -------------------------------------------------------------------------- |
|
202 // |
|
203 void CWsfSearchWlansDialog::PreLayoutDynInitL() |
|
204 { |
|
205 LOG_ENTERFN( "CWsfSearchWlansDialog::PreLayoutDynInitL" ); |
|
206 _ASS_D( ListBox() ); |
|
207 // add the empty text here.... |
|
208 HBufC* noWlansAvailable = iCoeEnv->AllocReadResourceLC( |
|
209 R_QTN_STATUS_NO_WLANS_AVAILABLE ); |
|
210 |
|
211 ListBox()->View()->SetListEmptyTextL( *noWlansAvailable ); |
|
212 |
|
213 CleanupStack::PopAndDestroy( noWlansAvailable ); |
|
214 CAknListQueryDialog::PreLayoutDynInitL(); |
|
215 } |
|
216 |
|
217 // End of file |
|
218 |
|