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