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 CWsfConnectedDetailsDialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <avkon.hrh> |
|
21 #include <aknlists.h> |
|
22 #include <StringLoader.h> |
|
23 #include <wlansniffer.rsg> |
|
24 #include "wsfconnecteddetailsdialog.h" |
|
25 #include "wsfconnecteddetailsmodel.h" |
|
26 #include "wsfconnecteddetailscontroller.h" |
|
27 #include "wsfactivetimeupdater.h" |
|
28 |
|
29 #include "wsflogger.h" |
|
30 |
|
31 // CONSTANTS |
|
32 LOCAL_D const TInt KUpdateInterval = 1000000; // in micro seconds (1 sec) |
|
33 |
|
34 |
|
35 // ================= MEMBER FUNCTIONS ======================= |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // CWsfConnectedDetailsDialog::ConstructL |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 void CWsfConnectedDetailsDialog::ConstructL() |
|
42 { |
|
43 LOG_ENTERFN( "CWsfConnectedDetailsDialog::ConstructL" ); |
|
44 iController.SetDialog( this ); |
|
45 // Create and start Active Object 'Active Updater' |
|
46 iActiveUpdater = CWsfActiveTimeUpdater::NewL( &iController ); |
|
47 iActiveUpdater->Start( KUpdateInterval ); |
|
48 } |
|
49 |
|
50 |
|
51 // --------------------------------------------------------------------------- |
|
52 // CWsfConnectedDetailsDialog::NewL |
|
53 // --------------------------------------------------------------------------- |
|
54 // |
|
55 CWsfConnectedDetailsDialog* CWsfConnectedDetailsDialog::NewL() |
|
56 { |
|
57 LOG_ENTERFN( "CWsfConnectedDetailsDialog::NewL" ); |
|
58 CWsfConnectedDetailsDialog* self = CWsfConnectedDetailsDialog::NewLC(); |
|
59 CleanupStack::Pop( self ); |
|
60 return self; |
|
61 } |
|
62 |
|
63 |
|
64 // --------------------------------------------------------------------------- |
|
65 // CWsfConnectedDetailsDialog::NewLC |
|
66 // --------------------------------------------------------------------------- |
|
67 // |
|
68 CWsfConnectedDetailsDialog* CWsfConnectedDetailsDialog::NewLC() |
|
69 { |
|
70 LOG_ENTERFN( "CWsfConnectedDetailsDialog::NewLC" ); |
|
71 CWsfConnectedDetailsDialog* self = |
|
72 new( ELeave ) CWsfConnectedDetailsDialog( NULL ); |
|
73 CleanupStack::PushL( self ); |
|
74 self->ConstructL(); |
|
75 return self; |
|
76 } |
|
77 |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // CWsfConnectedDetailsDialog::CWsfConnectedDetailsDialog |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 CWsfConnectedDetailsDialog::CWsfConnectedDetailsDialog( |
|
84 CListBoxView::CSelectionIndexArray* aSelectionIndexArray ) |
|
85 : CAknListQueryDialog( aSelectionIndexArray ), |
|
86 iList( NULL ), |
|
87 iModel( NULL ) |
|
88 { |
|
89 } |
|
90 |
|
91 |
|
92 // --------------------------------------------------------------------------- |
|
93 // CWsfConnectedDetailsDialog::~CWsfConnectedDetailsDialog |
|
94 // --------------------------------------------------------------------------- |
|
95 // |
|
96 CWsfConnectedDetailsDialog::~CWsfConnectedDetailsDialog() |
|
97 { |
|
98 LOG_ENTERFN( "CWsfConnectedDetailsDialog::~CWsfConnectedDetailsDialog" ); |
|
99 iController.SetModel(NULL); |
|
100 iController.SetDialog(NULL); |
|
101 if( iActiveUpdater ) |
|
102 { |
|
103 iActiveUpdater->Stop(); |
|
104 } |
|
105 delete iActiveUpdater; |
|
106 // iListModel is deleted in WSFAppui::StartConnectedDetailsL |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------------------------- |
|
110 // CWsfConnectedDetailsDialog::SetListModel |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 void CWsfConnectedDetailsDialog::SetListModel( CWsfConnectedDetailsModel* aModel) |
|
114 { |
|
115 LOG_ENTERFN( "CWsfConnectedDetailsDialog::SetListModel" ); |
|
116 iListModel = aModel; |
|
117 iController.SetModel(iListModel); |
|
118 } |
|
119 |
|
120 |
|
121 // --------------------------------------------------------- |
|
122 // CWsfConnectedDetailsDialog::PreLayoutDynInitL |
|
123 // called by framework before dialog is shown |
|
124 // --------------------------------------------------------- |
|
125 // |
|
126 void CWsfConnectedDetailsDialog::PreLayoutDynInitL() |
|
127 { |
|
128 LOG_ENTERFN( "CWsfConnectedDetailsDialog::PreLayoutDynInitL" ); |
|
129 // parent creates the private listbox |
|
130 CAknListQueryDialog::PreLayoutDynInitL(); |
|
131 // and now we get access to it... |
|
132 CAknListQueryControl *control = |
|
133 ( CAknListQueryControl* )Control( EListQueryControl ); |
|
134 iList = control->Listbox(); |
|
135 iModel = ( CTextListBoxModel* )iList->Model(); |
|
136 |
|
137 // 1st Refresh of the listbox |
|
138 iController.RefreshL(); |
|
139 ActivateL(); |
|
140 } |
|
141 |
|
142 // --------------------------------------------------------- |
|
143 // CWsfConnectedDetailsContainer::UpdateListBox |
|
144 // --------------------------------------------------------- |
|
145 // |
|
146 void CWsfConnectedDetailsDialog::UpdateListBox( MDesCArray* aItemTextArray ) |
|
147 { |
|
148 LOG_ENTERFN( "CWsfConnectedDetailsDialog::UpdateListBox" ); |
|
149 for( TInt i = 0; i < aItemTextArray->MdcaCount(); i++) |
|
150 { |
|
151 TPtrC temp = aItemTextArray->MdcaPoint( i ); |
|
152 TBuf<100> tempElement = temp; |
|
153 LOG_WRITEF( "aItemTextArray[0]: %S", &tempElement ); |
|
154 } |
|
155 |
|
156 if ( iList && aItemTextArray->MdcaCount() ) |
|
157 { |
|
158 iModel->SetItemTextArray( aItemTextArray ); |
|
159 iModel->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
160 DrawNow(); |
|
161 } |
|
162 } |
|
163 |
|
164 // --------------------------------------------------------- |
|
165 // CWsfConnectedDetailsContainer::Controller |
|
166 // --------------------------------------------------------- |
|
167 // |
|
168 MWsfDetailsViewControllerIf& CWsfConnectedDetailsDialog::Controller() |
|
169 { |
|
170 return iController; |
|
171 } |
|
172 |
|
173 // --------------------------------------------------------- |
|
174 // CWsfConnectedDetailsDialog::HandleListBoxEventL |
|
175 // --------------------------------------------------------- |
|
176 // |
|
177 void CWsfConnectedDetailsDialog::HandleListBoxEventL( CEikListBox* /*aListBox*/, |
|
178 TListBoxEvent /*aEventType*/ ) |
|
179 { |
|
180 } |
|
181 |
|
182 // End of File |
|