|
1 /* |
|
2 * Copyright (c) 2002-2006 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 the License "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 * Access to display components |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 // System includes |
|
23 #include <aknappui.h> |
|
24 #include <aknnavi.h> |
|
25 #include <aknnavide.h> |
|
26 #include <akntabgrp.h> |
|
27 #include <akntitle.h> |
|
28 #include <eikenv.h> |
|
29 #include <eikspane.h> |
|
30 #include <ApEngineConsts.h> |
|
31 #include <avkon.hrh> |
|
32 #include <bldvariant.hrh> |
|
33 #include <FeatMgr.h> |
|
34 #include <akneditstateindicator.h> |
|
35 #include <aknindicatorcontainer.h> |
|
36 #include <AknStatuspaneUtils.h> |
|
37 #include <Browser_platform_variant.hrh> |
|
38 |
|
39 #include <wlaninternalpskeys.h> // For WLAN state checking |
|
40 |
|
41 #include <LayoutMetaData.cdl.h> // For Layout_Meta_Data landscape/portrait status |
|
42 |
|
43 // User includes |
|
44 #include "ApiProvider.h" |
|
45 #include "BrowserProgressIndicator.h" |
|
46 #include "BrowserDisplay.h" |
|
47 #include "BrowserUtil.h" |
|
48 #include "Preferences.h" |
|
49 #include "CommonConstants.h" |
|
50 #include "BrowserWindow.h" |
|
51 #include "BrowserWindowManager.h" |
|
52 #include "Logger.h" |
|
53 |
|
54 #include "WlanObserver.h" |
|
55 |
|
56 #include <BrowserNG.rsg> |
|
57 |
|
58 // TYPES |
|
59 |
|
60 struct TIndicatorContainer { |
|
61 TInt locName; // indicator's local name |
|
62 TInt aknName; // indicator's avkon name |
|
63 TInt indState; // indicator's value |
|
64 }; |
|
65 |
|
66 // cosmetic macros |
|
67 #define _AKN_IND( a ) EAknNaviPaneEditorIndicator ## a |
|
68 #define _LOC_IND( a ) ELocalIndicator ## a |
|
69 #define _IND_STATE( a ) KLocalIndicators[ _LOC_IND( a ) ].indState |
|
70 #define _SET_INDIC( a ) SetIndicatorState( \ |
|
71 TUid::Uid( _AKN_IND( a ) ), _IND_STATE( a ) ) |
|
72 #define _SET_INDIC2( a, b ) SetIndicatorState( \ |
|
73 TUid::Uid( _AKN_IND( a ) ), _IND_STATE( a ), b ) |
|
74 |
|
75 // indicators used in this module |
|
76 enum { |
|
77 _LOC_IND( SecuredConnection ), |
|
78 _LOC_IND( MessageInfo ), |
|
79 _LOC_IND( ProgressBar ), |
|
80 // _LOC_IND( WaitBar ), // |
|
81 // _LOC_IND( T9 ), // |
|
82 // _LOC_IND( UpperCase ), // |
|
83 // _LOC_IND( LowerCase ), // |
|
84 // _LOC_IND( AudioAttached ), // |
|
85 // _LOC_IND( Objects ), // |
|
86 // _LOC_IND( WmlWaitGlobe ), |
|
87 _LOC_IND( Gprs ), |
|
88 _LOC_IND( WlanAvailable ), |
|
89 _LOC_IND( WlanActive ), |
|
90 _LOC_IND( WlanActiveSecure ), |
|
91 _LOC_IND( FileSize ), |
|
92 // _LOC_IND( MessageLength ), // |
|
93 _LOC_IND( WmlWindows ), |
|
94 _LOC_IND( WmlWindowsText ), |
|
95 _LOC_IND( LastItem ) |
|
96 }; |
|
97 |
|
98 // CONSTANTS |
|
99 _LIT( KBrowserSpaceChar, " " ); |
|
100 |
|
101 // order of the indicators in this structure MUST match the enum definition above! |
|
102 LOCAL_D TIndicatorContainer KLocalIndicators[] = |
|
103 { |
|
104 { _LOC_IND( SecuredConnection ), _AKN_IND( SecuredConnection ), EAknIndicatorStateOff }, |
|
105 { _LOC_IND( MessageInfo ), _AKN_IND( MessageInfo ), EAknIndicatorStateOff }, |
|
106 { _LOC_IND( ProgressBar ), _AKN_IND( ProgressBar ), EAknIndicatorStateOff }, |
|
107 // { _LOC_IND( WaitBar ), _AKN_IND( WaitBar ), EAknIndicatorStateOff }, |
|
108 // { _LOC_IND( T9 ), _AKN_IND( T9 ), EAknIndicatorStateOff }, |
|
109 // { _LOC_IND( UpperCase ), _AKN_IND( UpperCase ), EAknIndicatorStateOff }, |
|
110 // { _LOC_IND( LowerCase ), _AKN_IND( LowerCase ), EAknIndicatorStateOff }, |
|
111 // { _LOC_IND( AudioAttached ), _AKN_IND( AudioAttached ), EAknIndicatorStateOff }, |
|
112 // { _LOC_IND( Objects ), _AKN_IND( Objects ), EAknIndicatorStateOff }, |
|
113 // { _LOC_IND( WmlWaitGlobe ), _AKN_IND( WmlWaitGlobe ), EAknIndicatorStateOff }, |
|
114 { _LOC_IND( Gprs ), _AKN_IND( Gprs ), EAknIndicatorStateOn }, |
|
115 { _LOC_IND( WlanAvailable ), _AKN_IND( WlanAvailable ), EAknIndicatorStateOff }, |
|
116 { _LOC_IND( WlanActive ), _AKN_IND( WlanActive ), EAknIndicatorStateOff }, |
|
117 { _LOC_IND( WlanActiveSecure ), _AKN_IND( WlanActiveSecure ), EAknIndicatorStateOff }, |
|
118 { _LOC_IND( FileSize ), _AKN_IND( FileSize ), EAknIndicatorStateOff }, |
|
119 // { _LOC_IND( MessageLength ), _AKN_IND( MessageLength ), EAknIndicatorStateOff }, |
|
120 { _LOC_IND( WmlWindows ), _AKN_IND( WmlWindows ), EAknIndicatorStateOff }, |
|
121 { _LOC_IND( WmlWindowsText ), _AKN_IND( WmlWindowsText ), EAknIndicatorStateOff }, |
|
122 { _LOC_IND( LastItem ), 0, 0 } |
|
123 }; |
|
124 |
|
125 // ================= MEMBER FUNCTIONS ======================= |
|
126 |
|
127 // C++ default constructor can NOT contain any code, that |
|
128 // might leave. |
|
129 // |
|
130 CBrowserDisplay::CBrowserDisplay( MApiProvider& aApiProvider, CBrowserWindow& aWindow ) |
|
131 : iApiProvider( aApiProvider ), iWindow( &aWindow ) |
|
132 { |
|
133 } |
|
134 |
|
135 // --------------------------------------------------------------------------- |
|
136 // CBrowserDisplay::ConstructL() |
|
137 // --------------------------------------------------------------------------- |
|
138 // |
|
139 void CBrowserDisplay::ConstructL() |
|
140 { |
|
141 PERFLOG_LOCAL_INIT |
|
142 PERFLOG_STOPWATCH_START |
|
143 iProgressIndicator = CBrowserProgressIndicator::NewL( iApiProvider ); |
|
144 iEditorIndicatorContainer = NULL; |
|
145 iTitle = NULL; |
|
146 PERFLOG_STOP_WRITE("BrProgressIndicator") |
|
147 InitIndicatorsL(); //for full screen |
|
148 |
|
149 #ifdef _DEBUG |
|
150 // check the indicator array's integrity |
|
151 TInt i = 0; |
|
152 while( KLocalIndicators[i].locName != _LOC_IND( LastItem ) ) |
|
153 { |
|
154 __ASSERT_DEBUG( KLocalIndicators[i].locName == i, |
|
155 Util::Panic( Util::EUnExpected ) ); |
|
156 ++i; |
|
157 } |
|
158 #endif // _DEBUG |
|
159 } |
|
160 |
|
161 // --------------------------------------------------------------------------- |
|
162 // CBrowserDisplay::NewL() |
|
163 // --------------------------------------------------------------------------- |
|
164 // |
|
165 CBrowserDisplay* CBrowserDisplay::NewL( MApiProvider& aApiProvider, CBrowserWindow& aWindow ) |
|
166 { |
|
167 CBrowserDisplay* self = new (ELeave) CBrowserDisplay( aApiProvider, aWindow ); |
|
168 |
|
169 CleanupStack::PushL( self ); |
|
170 self->ConstructL(); |
|
171 CleanupStack::Pop(); // self |
|
172 |
|
173 return self; |
|
174 } |
|
175 |
|
176 // --------------------------------------------------------------------------- |
|
177 // CBrowserDisplay::~CBrowserDisplay() |
|
178 // --------------------------------------------------------------------------- |
|
179 // |
|
180 CBrowserDisplay::~CBrowserDisplay() |
|
181 { |
|
182 delete iProgressIndicator; |
|
183 delete iEditorIndicatorContainer; |
|
184 delete iTitle; |
|
185 delete iWlanObserver; |
|
186 } |
|
187 |
|
188 // --------------------------------------------------------------------------- |
|
189 // CBrowserDisplay::StatusPane() |
|
190 // --------------------------------------------------------------------------- |
|
191 // |
|
192 CEikStatusPane* CBrowserDisplay::StatusPane() const |
|
193 { |
|
194 return STATIC_CAST( CAknAppUi*, CEikonEnv::Static()->EikAppUi() )-> |
|
195 StatusPane(); |
|
196 } |
|
197 |
|
198 // --------------------------------------------------------------------------- |
|
199 // CBrowserDisplay::NaviPaneL() |
|
200 // --------------------------------------------------------------------------- |
|
201 // |
|
202 CAknNavigationControlContainer* CBrowserDisplay::NaviPaneL() const |
|
203 { |
|
204 CEikStatusPane* sp = StatusPane(); |
|
205 User::LeaveIfNull( sp ); |
|
206 return STATIC_CAST( CAknNavigationControlContainer*, |
|
207 sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); |
|
208 } |
|
209 |
|
210 // --------------------------------------------------------- |
|
211 // CBrowserDisplay::SetTitleL() |
|
212 // --------------------------------------------------------- |
|
213 // |
|
214 void CBrowserDisplay::SetTitleL( const TDesC& aTitle ) |
|
215 { |
|
216 PERFLOG_LOCAL_INIT |
|
217 PERFLOG_STOPWATCH_START |
|
218 HBufC* temp = aTitle.AllocL(); |
|
219 delete iTitle; |
|
220 iTitle = temp; |
|
221 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
222 // Checking to see if we are in contentview so that title is updated for other views like |
|
223 // Bookmarks and Settings |
|
224 if((indicContainerEditing) && (ApiProvider().LastActiveViewId() == KUidBrowserContentViewId )) |
|
225 { |
|
226 //Under full screen mode, the progress bar is at the bottom and the title should be updated |
|
227 //all the time. |
|
228 if (indicContainerEditing->IndicatorState( |
|
229 TUid::Uid(EAknNaviPaneEditorIndicatorProgressBar) ) != EAknIndicatorStateOn) |
|
230 { |
|
231 RestoreTitleL(); |
|
232 } |
|
233 } |
|
234 else |
|
235 { |
|
236 RestoreTitleL(); |
|
237 } |
|
238 PERFLOG_STOP_WRITE("BrDsply:SetTitle") |
|
239 } |
|
240 |
|
241 // --------------------------------------------------------- |
|
242 // CBrowserDisplay::ClearMessageInfo() |
|
243 // --------------------------------------------------------- |
|
244 // |
|
245 void CBrowserDisplay::ClearMessageInfo() |
|
246 { |
|
247 |
|
248 if( iEditorIndicatorContainer != NULL ) |
|
249 { |
|
250 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
251 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
252 |
|
253 _IND_STATE( MessageInfo ) = EAknIndicatorStateOff; |
|
254 indicContainerEditing->_SET_INDIC( MessageInfo ); |
|
255 indicContainerOwn->_SET_INDIC( MessageInfo ); |
|
256 } |
|
257 } |
|
258 // --------------------------------------------------------- |
|
259 // CBrowserDisplay::RestoreTitleL() |
|
260 // --------------------------------------------------------- |
|
261 // |
|
262 void CBrowserDisplay::RestoreTitleL() |
|
263 { |
|
264 PERFLOG_LOCAL_INIT |
|
265 PERFLOG_STOPWATCH_START |
|
266 if ( (iTitle !=NULL) ) |
|
267 { |
|
268 |
|
269 if(( iApiProvider.LastActiveViewId() == KUidBrowserContentViewId ) |
|
270 && ( iEditorIndicatorContainer != NULL ) |
|
271 && (!(AknStatuspaneUtils::StaconPaneActive())) ) |
|
272 { |
|
273 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
274 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
275 |
|
276 _IND_STATE( FileSize ) = EAknIndicatorStateOff; |
|
277 indicContainerEditing->_SET_INDIC( FileSize ); |
|
278 indicContainerOwn->_SET_INDIC( FileSize ); |
|
279 indicContainerOwn->SetIndicatorValueL( |
|
280 TUid::Uid( _AKN_IND( FileSize ) ), KNullDesC() ); |
|
281 |
|
282 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
283 { |
|
284 // Lanscape mode - Title in title pane not navipane/messageinfo |
|
285 ClearMessageInfo(); |
|
286 } |
|
287 else |
|
288 { // Portrait mode - Title in navipane/messageinfo |
|
289 _IND_STATE( MessageInfo ) = EAknIndicatorStateOn; |
|
290 indicContainerEditing->_SET_INDIC( MessageInfo ); |
|
291 indicContainerOwn->_SET_INDIC( MessageInfo ); |
|
292 indicContainerEditing->SetIndicatorValueL( |
|
293 TUid::Uid( _AKN_IND( MessageInfo ) ), *iTitle); |
|
294 indicContainerOwn->SetIndicatorValueL( |
|
295 TUid::Uid( _AKN_IND( MessageInfo ) ), *iTitle); |
|
296 } |
|
297 |
|
298 CEikStatusPane* sp = STATIC_CAST( CAknAppUi*, |
|
299 CEikonEnv::Static()->EikAppUi() )->StatusPane(); |
|
300 CAknTitlePane* title = STATIC_CAST( CAknTitlePane*, |
|
301 sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
|
302 title->SetTextL( *iTitle ); |
|
303 } |
|
304 else |
|
305 { |
|
306 if( ( iEditorIndicatorContainer != NULL ) |
|
307 && ( AknStatuspaneUtils::StaconPaneActive() ) ) |
|
308 { |
|
309 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
310 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
311 //turn off other indicator, because both are visible in landscape mode |
|
312 _IND_STATE( MessageInfo ) = EAknIndicatorStateOff; |
|
313 indicContainerEditing->_SET_INDIC2( MessageInfo, ETrue ); |
|
314 indicContainerOwn->_SET_INDIC2( MessageInfo, ETrue ); |
|
315 } |
|
316 |
|
317 // Set title to be page title |
|
318 CEikStatusPane* sp = STATIC_CAST( CAknAppUi*, |
|
319 CEikonEnv::Static()->EikAppUi() )->StatusPane(); |
|
320 CAknTitlePane* title = STATIC_CAST( CAknTitlePane*, |
|
321 sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
|
322 title->SetTextL( *iTitle ); |
|
323 } |
|
324 |
|
325 #ifndef __WINSCW__ |
|
326 // Wireless Lan Indicator |
|
327 TInt wlanStateValue; |
|
328 StartWlanObserverL(); // if needed |
|
329 if ( iWlanObserver && iWlanObserver->GetCurrentState(wlanStateValue) ) |
|
330 { |
|
331 UpdateWlanIndicator(wlanStateValue); |
|
332 } |
|
333 #endif // __WINSCW__ |
|
334 |
|
335 // Multiple Windows Indicator |
|
336 TInt winCount = iApiProvider.WindowMgr().WindowCount(); |
|
337 TBool showMWIndic = (( winCount > 1 ) && |
|
338 (ApiProvider().LastActiveViewId() == KUidBrowserContentViewId )) ? |
|
339 ETrue : EFalse; |
|
340 UpdateMultipleWindowsIndicatorL( showMWIndic, winCount ); |
|
341 } |
|
342 PERFLOG_STOP_WRITE("BrDsply:RestoreTitle") |
|
343 } |
|
344 |
|
345 // --------------------------------------------------------- |
|
346 // CBrowserDisplay::SetTitleL() |
|
347 // --------------------------------------------------------- |
|
348 // |
|
349 void CBrowserDisplay::SetTitleL( TInt aResourceId ) |
|
350 { |
|
351 HBufC* title = CEikonEnv::Static()->AllocReadResourceLC( aResourceId ); |
|
352 SetTitleL( *title ); |
|
353 CleanupStack::PopAndDestroy(); // title |
|
354 } |
|
355 |
|
356 // --------------------------------------------------------- |
|
357 // CBrowserDisplay::StartProgressAnimationL() |
|
358 // --------------------------------------------------------- |
|
359 // |
|
360 void CBrowserDisplay::StartProgressAnimationL() |
|
361 { |
|
362 PERFLOG_LOCAL_INIT |
|
363 PERFLOG_STOPWATCH_START |
|
364 LOG_ENTERFN( "Display::StartProgressAnimationL" ); |
|
365 BROWSER_LOG( ( _L("myWindow: %d, active: %d"), |
|
366 iWindow->WindowId(), iWindow->IsWindowActive() ) ); |
|
367 if ( iApiProvider.IsProgressShown() ) |
|
368 { |
|
369 // ProgressIndicator doesn't have pointer to its Window or parent Display |
|
370 // so check validity here |
|
371 if( iWindow->IsWindowActive() ) |
|
372 { |
|
373 iProgressIndicator->StartL(); |
|
374 } |
|
375 // start globe animation |
|
376 iApiProvider.StartProgressAnimationL(); |
|
377 } |
|
378 PERFLOG_STOP_WRITE("BrDsply: StartPrgAnim") |
|
379 } |
|
380 |
|
381 // --------------------------------------------------------- |
|
382 // CBrowserDisplay::StopProgressAnimationL() |
|
383 // --------------------------------------------------------- |
|
384 // |
|
385 void CBrowserDisplay::StopProgressAnimationL() |
|
386 { |
|
387 PERFLOG_LOCAL_INIT |
|
388 PERFLOG_STOPWATCH_START |
|
389 LOG_ENTERFN( "Display::StopProgressAnimationL" ); |
|
390 BROWSER_LOG( ( _L("myWindow: %d"), iWindow->WindowId() ) ); |
|
391 if ( iApiProvider.IsProgressShown() ) |
|
392 { |
|
393 // always stop spinning globe in FavouritesView |
|
394 // most of the cases View::DoDeactivateL() does it |
|
395 // other: e.g. Cancel load in BookmarksView |
|
396 iApiProvider.StopProgressAnimationL(); |
|
397 |
|
398 if ( !ApiProvider().Fetching() ) |
|
399 { |
|
400 if ( iEditorIndicatorContainer != NULL ) |
|
401 { |
|
402 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
403 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
404 |
|
405 _IND_STATE( ProgressBar ) = EAknIndicatorStateOff; |
|
406 indicContainerEditing->_SET_INDIC( ProgressBar ); |
|
407 indicContainerOwn->_SET_INDIC( ProgressBar ); |
|
408 |
|
409 if( iTitle ) |
|
410 { |
|
411 RestoreTitleL(); |
|
412 } |
|
413 iApiProvider.SetProgressShown( EFalse ); |
|
414 } |
|
415 iProgressIndicator->StopL(); |
|
416 } |
|
417 } |
|
418 PERFLOG_STOP_WRITE("BrDsply: StopPrgAnim") |
|
419 } |
|
420 |
|
421 // --------------------------------------------------------- |
|
422 // CBrowserDisplay::SelectIndicContainerEditing() |
|
423 // --------------------------------------------------------- |
|
424 // |
|
425 CAknIndicatorContainer* CBrowserDisplay::SelectIndicContainerEditing() |
|
426 { |
|
427 CAknIndicatorContainer* indicContainer1 = CAknEnv::Static()-> |
|
428 EditingStateIndicator()->IndicatorContainer(); |
|
429 return indicContainer1; |
|
430 } |
|
431 |
|
432 // --------------------------------------------------------- |
|
433 // CBrowserDisplay::SelectIndicContainerOwn() |
|
434 // --------------------------------------------------------- |
|
435 // |
|
436 CAknIndicatorContainer* CBrowserDisplay::SelectIndicContainerOwn() |
|
437 { |
|
438 CAknIndicatorContainer* indicContainer2 = STATIC_CAST( |
|
439 CAknIndicatorContainer*, iEditorIndicatorContainer->DecoratedControl() ); |
|
440 return indicContainer2; |
|
441 } |
|
442 |
|
443 // --------------------------------------------------------- |
|
444 // CBrowserDisplay::InitIndicatorsL() |
|
445 // --------------------------------------------------------- |
|
446 // |
|
447 void CBrowserDisplay::InitIndicatorsL() |
|
448 { |
|
449 PERFLOG_LOCAL_INIT |
|
450 PERFLOG_STOPWATCH_START |
|
451 |
|
452 if (iEditorIndicatorContainer) |
|
453 { |
|
454 return; |
|
455 } |
|
456 |
|
457 if ((iEditorIndicatorContainer == NULL)) |
|
458 { |
|
459 PERFLOG_LOCAL_INIT |
|
460 PERFLOG_STOPWATCH_START |
|
461 iEditorIndicatorContainer = NaviPaneL()->CreateEditorIndicatorContainerL(); |
|
462 PERFLOG_STOP_WRITE(" -> BrDsply: EditorContainer") |
|
463 } |
|
464 |
|
465 PERFLOG_STOPWATCH_START |
|
466 CAknIndicatorContainer* indicContainer = SelectIndicContainerOwn(); |
|
467 |
|
468 _IND_STATE( SecuredConnection ) = EAknIndicatorStateOff; |
|
469 _IND_STATE( MessageInfo ) = EAknIndicatorStateOff; |
|
470 _IND_STATE( ProgressBar ) = EAknIndicatorStateOff; |
|
471 // _IND_STATE( WaitBar ) = EAknIndicatorStateOff; |
|
472 // _IND_STATE( T9 ) = EAknIndicatorStateOff; |
|
473 // _IND_STATE( UpperCase ) = EAknIndicatorStateOff; |
|
474 // _IND_STATE( LowerCase ) = EAknIndicatorStateOff; |
|
475 // _IND_STATE( AudioAttached ) = EAknIndicatorStateOff; |
|
476 // _IND_STATE( Objects ) = EAknIndicatorStateOff; |
|
477 // _IND_STATE( WmlWaitGlobe ) = EAknIndicatorStateOff; |
|
478 _IND_STATE( Gprs ) = EAknIndicatorStateOn; |
|
479 |
|
480 _IND_STATE( WlanAvailable ) = EAknIndicatorStateOff; |
|
481 _IND_STATE( WlanActive ) = EAknIndicatorStateOff; |
|
482 _IND_STATE( WlanActiveSecure ) = EAknIndicatorStateOff; |
|
483 |
|
484 _IND_STATE( FileSize ) = EAknIndicatorStateOff; |
|
485 // _IND_STATE( MessageLength ) = EAknIndicatorStateOff; |
|
486 _IND_STATE( WmlWindows ) = EAknIndicatorStateOff; |
|
487 _IND_STATE( WmlWindowsText ) = EAknIndicatorStateOff; |
|
488 |
|
489 indicContainer->_SET_INDIC( SecuredConnection ); |
|
490 indicContainer->_SET_INDIC( MessageInfo ); |
|
491 indicContainer->_SET_INDIC( ProgressBar ); |
|
492 // indicContainer->_SET_INDIC( WaitBar ); |
|
493 // indicContainer->_SET_INDIC( T9 ); |
|
494 // indicContainer->_SET_INDIC( UpperCase ); |
|
495 // indicContainer->_SET_INDIC( LowerCase ); |
|
496 // indicContainer->_SET_INDIC( AudioAttached ); |
|
497 // indicContainer->_SET_INDIC( Objects ); |
|
498 // indicContainer->_SET_INDIC( WmlWaitGlobe ); |
|
499 indicContainer->_SET_INDIC( Gprs ); |
|
500 |
|
501 indicContainer->_SET_INDIC( WlanAvailable ); |
|
502 indicContainer->_SET_INDIC( WlanActive ); |
|
503 indicContainer->_SET_INDIC( WlanActiveSecure ); |
|
504 |
|
505 indicContainer->_SET_INDIC( FileSize ); |
|
506 // indicContainer->_SET_INDIC( MessageLength ); |
|
507 indicContainer->_SET_INDIC( WmlWindows ); |
|
508 indicContainer->_SET_INDIC( WmlWindowsText ); |
|
509 PERFLOG_STOP_WRITE( "Display:InitIndicators") |
|
510 } |
|
511 |
|
512 // --------------------------------------------------------- |
|
513 // CBrowserDisplay::UpdateSecureIndicatorL() |
|
514 // --------------------------------------------------------- |
|
515 // |
|
516 void CBrowserDisplay::UpdateSecureIndicatorL( const TInt aState ) |
|
517 { |
|
518 PERFLOG_LOCAL_INIT |
|
519 PERFLOG_STOPWATCH_START |
|
520 if( !iApiProvider.ExitInProgress() ) |
|
521 { |
|
522 SetFullScreenSecureIndicatorL(aState); |
|
523 NaviPaneL()->DrawDeferred(); |
|
524 } |
|
525 PERFLOG_STOP_WRITE( "Display:UpdateSecureIndicator") |
|
526 } |
|
527 |
|
528 // --------------------------------------------------------- |
|
529 // CBrowserDisplay::UpdateFSDownloadInitialIndicator() |
|
530 // --------------------------------------------------------- |
|
531 // |
|
532 void CBrowserDisplay::UpdateFSDownloadInitialIndicator( const TBool aState ) |
|
533 { |
|
534 PERFLOG_LOCAL_INIT |
|
535 PERFLOG_STOPWATCH_START |
|
536 if( !iEditorIndicatorContainer ) |
|
537 { |
|
538 InitIndicatorsL(); |
|
539 } |
|
540 |
|
541 if ( iApiProvider.IsProgressShown() && ( iEditorIndicatorContainer != NULL ) ) |
|
542 { |
|
543 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
544 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
545 if (aState) |
|
546 { |
|
547 ClearMessageInfo(); |
|
548 |
|
549 _IND_STATE( FileSize ) = EAknIndicatorStateOff; |
|
550 indicContainerEditing->_SET_INDIC( FileSize ); |
|
551 indicContainerOwn->_SET_INDIC( FileSize ); |
|
552 } |
|
553 } |
|
554 PERFLOG_STOP_WRITE("BrDsply: GlobeAnimation init") |
|
555 } |
|
556 |
|
557 // --------------------------------------------------------- |
|
558 // CBrowserDisplay::SetGPRSIndicatorOnL() |
|
559 // --------------------------------------------------------- |
|
560 // |
|
561 void CBrowserDisplay::SetGPRSIndicatorOnL() |
|
562 { |
|
563 PERFLOG_LOCAL_INIT |
|
564 PERFLOG_STOPWATCH_START |
|
565 if ( iEditorIndicatorContainer != NULL ) |
|
566 { |
|
567 // Set GPRS indicator on, it will update itself |
|
568 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
569 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
570 _IND_STATE( Gprs ) = EAknIndicatorStateOn; |
|
571 indicContainerEditing->_SET_INDIC( Gprs ); |
|
572 indicContainerOwn->_SET_INDIC( Gprs ); |
|
573 } |
|
574 PERFLOG_STOP_WRITE("BrDsply: Gprsidic on") |
|
575 } |
|
576 |
|
577 // --------------------------------------------------------- |
|
578 // CBrowserDisplay::UpdateWlanIndicator() |
|
579 // --------------------------------------------------------- |
|
580 // |
|
581 void CBrowserDisplay::UpdateWlanIndicator( const TInt aWlanValue ) |
|
582 { |
|
583 PERFLOG_LOCAL_INIT |
|
584 PERFLOG_STOPWATCH_START |
|
585 |
|
586 if ( iEditorIndicatorContainer != NULL ) |
|
587 { |
|
588 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
589 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
590 |
|
591 _IND_STATE( WlanAvailable ) = EAknIndicatorStateOff; |
|
592 indicContainerEditing->_SET_INDIC( WlanAvailable ); |
|
593 indicContainerOwn->_SET_INDIC( WlanAvailable ); |
|
594 |
|
595 _IND_STATE( WlanActive ) = EAknIndicatorStateOff; |
|
596 indicContainerEditing->_SET_INDIC( WlanActive ); |
|
597 indicContainerOwn->_SET_INDIC( WlanActive ); |
|
598 |
|
599 _IND_STATE( WlanActiveSecure ) = EAknIndicatorStateOff; |
|
600 indicContainerEditing->_SET_INDIC( WlanActiveSecure ); |
|
601 indicContainerOwn->_SET_INDIC( WlanActiveSecure ); |
|
602 |
|
603 switch (aWlanValue) |
|
604 { |
|
605 case EPSWlanIndicatorNone: |
|
606 { |
|
607 // do nothing. |
|
608 break; |
|
609 } |
|
610 |
|
611 case EPSWlanIndicatorAvailable: |
|
612 { |
|
613 _IND_STATE( WlanAvailable ) = EAknIndicatorStateOn; |
|
614 indicContainerEditing->_SET_INDIC( WlanAvailable ); |
|
615 indicContainerOwn->_SET_INDIC( WlanAvailable ); |
|
616 break; |
|
617 } |
|
618 |
|
619 case EPSWlanIndicatorActive: |
|
620 { |
|
621 _IND_STATE( WlanActive ) = EAknIndicatorStateOn; |
|
622 indicContainerEditing->_SET_INDIC( WlanActive ); |
|
623 indicContainerOwn->_SET_INDIC( WlanActive ); |
|
624 break; |
|
625 } |
|
626 |
|
627 case EPSWlanIndicatorActiveSecure: |
|
628 { |
|
629 |
|
630 _IND_STATE( WlanActiveSecure ) = EAknIndicatorStateOn; |
|
631 indicContainerEditing->_SET_INDIC( WlanActiveSecure ); |
|
632 indicContainerOwn->_SET_INDIC( WlanActiveSecure ); |
|
633 break; |
|
634 } |
|
635 |
|
636 default: |
|
637 { |
|
638 // do nothing. |
|
639 break; |
|
640 } |
|
641 } |
|
642 } |
|
643 PERFLOG_STOP_WRITE("BrDsply: UpdateWlanIndicator") |
|
644 } |
|
645 |
|
646 // --------------------------------------------------------- |
|
647 // CBrowserDisplay::StartWlanObserverL() |
|
648 // --------------------------------------------------------- |
|
649 // |
|
650 void CBrowserDisplay::StartWlanObserverL() |
|
651 { |
|
652 PERFLOG_LOCAL_INIT |
|
653 PERFLOG_STOPWATCH_START |
|
654 |
|
655 if (iWlanObserver == NULL) |
|
656 { |
|
657 iWlanObserver = new ( ELeave ) CWlanObserver( iApiProvider ); |
|
658 } |
|
659 |
|
660 PERFLOG_STOP_WRITE("BrDsply: Wlan Observer Started") |
|
661 } |
|
662 |
|
663 // --------------------------------------------------------- |
|
664 // CBrowserDisplay::SetFullScreenSecureIndicatorL() |
|
665 // --------------------------------------------------------- |
|
666 // |
|
667 void CBrowserDisplay::SetFullScreenSecureIndicatorL(const TBool aState) |
|
668 { |
|
669 PERFLOG_LOCAL_INIT |
|
670 PERFLOG_STOPWATCH_START |
|
671 _IND_STATE( SecuredConnection ) = aState; |
|
672 if ( iEditorIndicatorContainer != NULL && iWindow->IsWindowActive() ) |
|
673 { |
|
674 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
675 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
676 _IND_STATE( SecuredConnection ) = aState ? |
|
677 EAknIndicatorStateOn : EAknIndicatorStateOff; |
|
678 indicContainerEditing->_SET_INDIC( SecuredConnection ); |
|
679 indicContainerOwn->_SET_INDIC( SecuredConnection ); |
|
680 } |
|
681 PERFLOG_STOP_WRITE("BrDsply: Secure indic upd") |
|
682 } |
|
683 |
|
684 // --------------------------------------------------------- |
|
685 // CBrowserDisplay::AddTransActIdL() |
|
686 // --------------------------------------------------------- |
|
687 // |
|
688 void CBrowserDisplay::AddTransActIdL( TUint16 aId ) const |
|
689 { |
|
690 iProgressIndicator->AddTransActIdL( aId ); |
|
691 } |
|
692 |
|
693 // --------------------------------------------------------- |
|
694 // CBrowserDisplay::AddProgressDataL() |
|
695 // --------------------------------------------------------- |
|
696 // |
|
697 void CBrowserDisplay::AddProgressDataL( |
|
698 TUint16 aId, TUint32 aRecvdData, TUint32 aMaxData ) const |
|
699 { |
|
700 iProgressIndicator->AddProgressDataL( aId, aRecvdData, aMaxData ); |
|
701 } |
|
702 |
|
703 // --------------------------------------------------------- |
|
704 // CBrowserDisplay::TransActIdComplete() |
|
705 // --------------------------------------------------------- |
|
706 // |
|
707 void CBrowserDisplay::TransActIdComplete( TUint16 aId ) const |
|
708 { |
|
709 TRAP_IGNORE( iProgressIndicator->TransActIdCompleteL( aId ) ); |
|
710 } |
|
711 |
|
712 // --------------------------------------------------------- |
|
713 // CBrowserDisplay::StartFSWaitIndicator() |
|
714 // --------------------------------------------------------- |
|
715 // |
|
716 void CBrowserDisplay::StartFSWaitIndicator() |
|
717 { |
|
718 if( iEditorIndicatorContainer != NULL && |
|
719 iWindow->IsWindowActive() ) |
|
720 { |
|
721 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
722 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
723 } |
|
724 } |
|
725 |
|
726 // --------------------------------------------------------- |
|
727 // CBrowserDisplay::UpdateFSProgressIndicator() |
|
728 // --------------------------------------------------------- |
|
729 // |
|
730 void CBrowserDisplay::UpdateFSProgressIndicator( const TInt aMaxData, |
|
731 const TInt aReceivedData ) |
|
732 { |
|
733 PERFLOG_LOCAL_INIT |
|
734 PERFLOG_STOPWATCH_START |
|
735 LOG_ENTERFN("UpdateFSProgressIndicator"); |
|
736 BROWSER_LOG( ( _L( "maxData: %d, recData: %d" ), aMaxData, aReceivedData ) ); |
|
737 if ( iApiProvider.IsProgressShown() && |
|
738 ( iEditorIndicatorContainer != NULL ) && |
|
739 iWindow->IsWindowActive() ) |
|
740 { |
|
741 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
742 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
743 |
|
744 if( indicContainerEditing->IndicatorState( |
|
745 TUid::Uid( EAknNaviPaneEditorIndicatorProgressBar ) ) |
|
746 != EAknIndicatorStateOn || |
|
747 indicContainerOwn->IndicatorState( |
|
748 TUid::Uid( EAknNaviPaneEditorIndicatorProgressBar ) ) |
|
749 != EAknIndicatorStateOn |
|
750 ) |
|
751 { |
|
752 _IND_STATE( ProgressBar ) = EAknIndicatorStateOn; |
|
753 indicContainerEditing->_SET_INDIC2( ProgressBar, ETrue ); |
|
754 indicContainerOwn->_SET_INDIC2( ProgressBar, ETrue ); |
|
755 } |
|
756 |
|
757 indicContainerEditing->SetIndicatorValue( |
|
758 TUid::Uid( EAknNaviPaneEditorIndicatorProgressBar ), |
|
759 aReceivedData, aMaxData ); |
|
760 indicContainerOwn->SetIndicatorValue( |
|
761 TUid::Uid( EAknNaviPaneEditorIndicatorProgressBar ), |
|
762 aReceivedData, aMaxData ); |
|
763 } |
|
764 PERFLOG_STOP_WRITE("BrDsply: Prg indic upd") |
|
765 } |
|
766 |
|
767 // --------------------------------------------------------- |
|
768 // CBrowserDisplay::UpdateFSProgressDataL() |
|
769 // --------------------------------------------------------- |
|
770 // |
|
771 void CBrowserDisplay::UpdateFSProgressDataL( const TDesC16& aReceivedDataText ) |
|
772 { |
|
773 PERFLOG_LOCAL_INIT |
|
774 PERFLOG_STOPWATCH_START |
|
775 if ( iApiProvider.IsProgressShown() &&( iEditorIndicatorContainer != NULL ) ) |
|
776 { |
|
777 CAknIndicatorContainer* indicContainerEditing = |
|
778 SelectIndicContainerEditing(); |
|
779 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
780 |
|
781 if( indicContainerEditing->IndicatorState( |
|
782 TUid::Uid( EAknNaviPaneEditorIndicatorMessageInfo ) ) |
|
783 != EAknIndicatorStateOff ) |
|
784 { |
|
785 ClearMessageInfo(); |
|
786 } |
|
787 |
|
788 if( indicContainerEditing->IndicatorState( |
|
789 TUid::Uid( EAknNaviPaneEditorIndicatorFileSize ) ) |
|
790 != EAknIndicatorStateOn || |
|
791 indicContainerOwn->IndicatorState( |
|
792 TUid::Uid( EAknNaviPaneEditorIndicatorFileSize ) ) |
|
793 != EAknIndicatorStateOn ) |
|
794 { |
|
795 _IND_STATE( FileSize ) = EAknIndicatorStateOn; |
|
796 indicContainerEditing->_SET_INDIC( FileSize ); |
|
797 indicContainerOwn->_SET_INDIC( FileSize ); |
|
798 } |
|
799 |
|
800 indicContainerEditing->SetIndicatorValueL( |
|
801 TUid::Uid( _AKN_IND( FileSize ) ), aReceivedDataText ); |
|
802 indicContainerOwn->SetIndicatorValueL( |
|
803 TUid::Uid( _AKN_IND( FileSize ) ), aReceivedDataText ); |
|
804 |
|
805 NaviPaneL()->PushL( *iEditorIndicatorContainer ); |
|
806 } |
|
807 PERFLOG_STOP_WRITE("BrDsply: Prg data upd") |
|
808 } |
|
809 |
|
810 |
|
811 // --------------------------------------------------------- |
|
812 // CBrowserDisplay::FSPaneOnL() |
|
813 // --------------------------------------------------------- |
|
814 // |
|
815 void CBrowserDisplay::FSPaneOnL() |
|
816 { |
|
817 InitIndicatorsL(); |
|
818 NaviPaneL()->PushL(*iEditorIndicatorContainer); |
|
819 } |
|
820 |
|
821 // --------------------------------------------------------- |
|
822 // CBrowserDisplay::NotifyProgress() |
|
823 // --------------------------------------------------------- |
|
824 // |
|
825 void CBrowserDisplay::NotifyProgress() |
|
826 { |
|
827 if ( iProgressIndicator != NULL && iWindow->IsWindowActive() ) |
|
828 { |
|
829 iProgressIndicator->NotifyProgress(); |
|
830 } |
|
831 } |
|
832 |
|
833 // ---------------------------------------------------------------------------- |
|
834 // CBrowserDisplay::UpdateMultipleWindowsIndicatorL() |
|
835 // ---------------------------------------------------------------------------- |
|
836 // |
|
837 void CBrowserDisplay::UpdateMultipleWindowsIndicatorL( |
|
838 TBool aState, TInt aWinCount ) |
|
839 { |
|
840 LOG_ENTERFN("CBrowserDisplay::UpdateMultipleWindowsIndicatorL"); |
|
841 |
|
842 if ( iEditorIndicatorContainer != NULL ) |
|
843 { |
|
844 CAknIndicatorContainer* indicContainerEditing = |
|
845 SelectIndicContainerEditing(); |
|
846 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
847 |
|
848 // Show or hide MW Icon |
|
849 _IND_STATE( WmlWindows ) = aState ? |
|
850 EAknIndicatorStateOn : EAknIndicatorStateOff; |
|
851 indicContainerEditing->_SET_INDIC( WmlWindows ); |
|
852 indicContainerOwn->_SET_INDIC( WmlWindows ); |
|
853 |
|
854 // Show or hide text indicator |
|
855 _IND_STATE( WmlWindowsText ) = aState ? |
|
856 EAknIndicatorStateOn : EAknIndicatorStateOff; |
|
857 indicContainerEditing->_SET_INDIC( WmlWindowsText ); |
|
858 indicContainerOwn->_SET_INDIC( WmlWindowsText ); |
|
859 |
|
860 if ( aState ) |
|
861 { |
|
862 // MW Indicator is made of an indicator icon and a number (num wins) |
|
863 |
|
864 // Display Number of windows open in text indicator |
|
865 HBufC* numWins = HBufC::NewLC( 3 ); |
|
866 numWins->Des().AppendNum( aWinCount ); |
|
867 numWins->Des().Append( KBrowserSpaceChar ); |
|
868 indicContainerEditing->SetIndicatorValueL( |
|
869 TUid::Uid( _AKN_IND( WmlWindowsText ) ), *numWins ); |
|
870 indicContainerOwn->SetIndicatorValueL( |
|
871 TUid::Uid( _AKN_IND( WmlWindowsText ) ), *numWins ); |
|
872 CleanupStack::PopAndDestroy( numWins ); |
|
873 } |
|
874 } |
|
875 } |
|
876 |
|
877 // End of File |