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. In landscape mode title could be updated all the time regardless of progress bar. |
|
224 if ( !Layout_Meta_Data::IsLandscapeOrientation() && |
|
225 (indicContainerEditing) && (ApiProvider().LastActiveViewId() == KUidBrowserContentViewId )) |
|
226 { |
|
227 //Under full screen mode, the progress bar is at the bottom and the title should be updated |
|
228 //all the time. |
|
229 if (indicContainerEditing->IndicatorState( |
|
230 TUid::Uid(EAknNaviPaneEditorIndicatorProgressBar) ) != EAknIndicatorStateOn) |
|
231 { |
|
232 RestoreTitleL(); |
|
233 } |
|
234 } |
|
235 else |
|
236 { |
|
237 RestoreTitleL(); |
|
238 } |
|
239 PERFLOG_STOP_WRITE("BrDsply:SetTitle") |
|
240 } |
|
241 |
|
242 // --------------------------------------------------------- |
|
243 // CBrowserDisplay::ClearMessageInfo() |
|
244 // --------------------------------------------------------- |
|
245 // |
|
246 void CBrowserDisplay::ClearMessageInfo() |
|
247 { |
|
248 |
|
249 if( iEditorIndicatorContainer != NULL ) |
|
250 { |
|
251 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
252 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
253 |
|
254 _IND_STATE( MessageInfo ) = EAknIndicatorStateOff; |
|
255 indicContainerEditing->_SET_INDIC( MessageInfo ); |
|
256 indicContainerOwn->_SET_INDIC( MessageInfo ); |
|
257 } |
|
258 } |
|
259 // --------------------------------------------------------- |
|
260 // CBrowserDisplay::RestoreTitleL() |
|
261 // --------------------------------------------------------- |
|
262 // |
|
263 void CBrowserDisplay::RestoreTitleL() |
|
264 { |
|
265 PERFLOG_LOCAL_INIT |
|
266 PERFLOG_STOPWATCH_START |
|
267 if ( (iTitle !=NULL) ) |
|
268 { |
|
269 |
|
270 if(( iApiProvider.LastActiveViewId() == KUidBrowserContentViewId ) |
|
271 && ( iEditorIndicatorContainer != NULL ) |
|
272 && (!(AknStatuspaneUtils::StaconPaneActive())) ) |
|
273 { |
|
274 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
275 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
276 |
|
277 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
278 { |
|
279 // Lanscape mode - Title in title pane not navipane/messageinfo |
|
280 ClearMessageInfo(); |
|
281 } |
|
282 else |
|
283 { // Portrait mode - Title in navipane/messageinfo |
|
284 _IND_STATE( MessageInfo ) = EAknIndicatorStateOn; |
|
285 indicContainerEditing->_SET_INDIC( MessageInfo ); |
|
286 indicContainerOwn->_SET_INDIC( MessageInfo ); |
|
287 indicContainerEditing->SetIndicatorValueL( |
|
288 TUid::Uid( _AKN_IND( MessageInfo ) ), *iTitle); |
|
289 indicContainerOwn->SetIndicatorValueL( |
|
290 TUid::Uid( _AKN_IND( MessageInfo ) ), *iTitle); |
|
291 } |
|
292 |
|
293 CEikStatusPane* sp = STATIC_CAST( CAknAppUi*, |
|
294 CEikonEnv::Static()->EikAppUi() )->StatusPane(); |
|
295 CAknTitlePane* title = STATIC_CAST( CAknTitlePane*, |
|
296 sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
|
297 title->SetTextL( *iTitle ); |
|
298 } |
|
299 else |
|
300 { |
|
301 if( ( iEditorIndicatorContainer != NULL ) |
|
302 && ( AknStatuspaneUtils::StaconPaneActive() ) ) |
|
303 { |
|
304 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
305 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
306 //turn off other indicator, because both are visible in landscape mode |
|
307 _IND_STATE( MessageInfo ) = EAknIndicatorStateOff; |
|
308 indicContainerEditing->_SET_INDIC2( MessageInfo, ETrue ); |
|
309 indicContainerOwn->_SET_INDIC2( MessageInfo, ETrue ); |
|
310 } |
|
311 |
|
312 // Set title to be page title |
|
313 CEikStatusPane* sp = STATIC_CAST( CAknAppUi*, |
|
314 CEikonEnv::Static()->EikAppUi() )->StatusPane(); |
|
315 CAknTitlePane* title = STATIC_CAST( CAknTitlePane*, |
|
316 sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
|
317 title->SetTextL( *iTitle ); |
|
318 } |
|
319 |
|
320 #ifndef __WINSCW__ |
|
321 // Wireless Lan Indicator |
|
322 TInt wlanStateValue; |
|
323 StartWlanObserverL(); // if needed |
|
324 if ( iWlanObserver && iWlanObserver->GetCurrentState(wlanStateValue) ) |
|
325 { |
|
326 UpdateWlanIndicator(wlanStateValue); |
|
327 } |
|
328 #endif // __WINSCW__ |
|
329 |
|
330 // Multiple Windows Indicator |
|
331 TInt winCount = iApiProvider.WindowMgr().WindowCount(); |
|
332 TBool showMWIndic = (( winCount > 1 ) && |
|
333 (ApiProvider().LastActiveViewId() == KUidBrowserContentViewId )) ? |
|
334 ETrue : EFalse; |
|
335 UpdateMultipleWindowsIndicatorL( showMWIndic, winCount ); |
|
336 } |
|
337 PERFLOG_STOP_WRITE("BrDsply:RestoreTitle") |
|
338 } |
|
339 |
|
340 // --------------------------------------------------------- |
|
341 // CBrowserDisplay::SetTitleL() |
|
342 // --------------------------------------------------------- |
|
343 // |
|
344 void CBrowserDisplay::SetTitleL( TInt aResourceId ) |
|
345 { |
|
346 HBufC* title = CEikonEnv::Static()->AllocReadResourceLC( aResourceId ); |
|
347 SetTitleL( *title ); |
|
348 CleanupStack::PopAndDestroy(); // title |
|
349 } |
|
350 |
|
351 // --------------------------------------------------------- |
|
352 // CBrowserDisplay::StartProgressAnimationL() |
|
353 // --------------------------------------------------------- |
|
354 // |
|
355 void CBrowserDisplay::StartProgressAnimationL() |
|
356 { |
|
357 PERFLOG_LOCAL_INIT |
|
358 PERFLOG_STOPWATCH_START |
|
359 LOG_ENTERFN( "Display::StartProgressAnimationL" ); |
|
360 BROWSER_LOG( ( _L("myWindow: %d, active: %d"), |
|
361 iWindow->WindowId(), iWindow->IsWindowActive() ) ); |
|
362 if ( iApiProvider.IsProgressShown() ) |
|
363 { |
|
364 // ProgressIndicator doesn't have pointer to its Window or parent Display |
|
365 // so check validity here |
|
366 if( iWindow->IsWindowActive() ) |
|
367 { |
|
368 iProgressIndicator->StartL(); |
|
369 } |
|
370 // start globe animation |
|
371 iApiProvider.StartProgressAnimationL(); |
|
372 } |
|
373 PERFLOG_STOP_WRITE("BrDsply: StartPrgAnim") |
|
374 } |
|
375 |
|
376 // --------------------------------------------------------- |
|
377 // CBrowserDisplay::StopProgressAnimationL() |
|
378 // --------------------------------------------------------- |
|
379 // |
|
380 void CBrowserDisplay::StopProgressAnimationL() |
|
381 { |
|
382 PERFLOG_LOCAL_INIT |
|
383 PERFLOG_STOPWATCH_START |
|
384 LOG_ENTERFN( "Display::StopProgressAnimationL" ); |
|
385 BROWSER_LOG( ( _L("myWindow: %d"), iWindow->WindowId() ) ); |
|
386 if ( iApiProvider.IsProgressShown() ) |
|
387 { |
|
388 // always stop spinning globe in FavouritesView |
|
389 // most of the cases View::DoDeactivateL() does it |
|
390 // other: e.g. Cancel load in BookmarksView |
|
391 iApiProvider.StopProgressAnimationL(); |
|
392 |
|
393 if ( !ApiProvider().Fetching() ) |
|
394 { |
|
395 if ( iEditorIndicatorContainer != NULL ) |
|
396 { |
|
397 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
398 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
399 |
|
400 _IND_STATE( FileSize ) = EAknIndicatorStateOff; |
|
401 indicContainerEditing->_SET_INDIC( FileSize ); |
|
402 indicContainerOwn->_SET_INDIC( FileSize ); |
|
403 |
|
404 indicContainerOwn->SetIndicatorValueL( |
|
405 TUid::Uid( _AKN_IND( FileSize ) ), KNullDesC() ); |
|
406 |
|
407 _IND_STATE( ProgressBar ) = EAknIndicatorStateOff; |
|
408 indicContainerEditing->_SET_INDIC( ProgressBar ); |
|
409 indicContainerOwn->_SET_INDIC( ProgressBar ); |
|
410 |
|
411 if( iTitle ) |
|
412 { |
|
413 RestoreTitleL(); |
|
414 } |
|
415 iApiProvider.SetProgressShown( EFalse ); |
|
416 } |
|
417 iProgressIndicator->StopL(); |
|
418 } |
|
419 } |
|
420 PERFLOG_STOP_WRITE("BrDsply: StopPrgAnim") |
|
421 } |
|
422 |
|
423 // --------------------------------------------------------- |
|
424 // CBrowserDisplay::SelectIndicContainerEditing() |
|
425 // --------------------------------------------------------- |
|
426 // |
|
427 CAknIndicatorContainer* CBrowserDisplay::SelectIndicContainerEditing() |
|
428 { |
|
429 CAknIndicatorContainer* indicContainer1 = CAknEnv::Static()-> |
|
430 EditingStateIndicator()->IndicatorContainer(); |
|
431 return indicContainer1; |
|
432 } |
|
433 |
|
434 // --------------------------------------------------------- |
|
435 // CBrowserDisplay::SelectIndicContainerOwn() |
|
436 // --------------------------------------------------------- |
|
437 // |
|
438 CAknIndicatorContainer* CBrowserDisplay::SelectIndicContainerOwn() |
|
439 { |
|
440 CAknIndicatorContainer* indicContainer2 = STATIC_CAST( |
|
441 CAknIndicatorContainer*, iEditorIndicatorContainer->DecoratedControl() ); |
|
442 return indicContainer2; |
|
443 } |
|
444 |
|
445 // --------------------------------------------------------- |
|
446 // CBrowserDisplay::InitIndicatorsL() |
|
447 // --------------------------------------------------------- |
|
448 // |
|
449 void CBrowserDisplay::InitIndicatorsL() |
|
450 { |
|
451 PERFLOG_LOCAL_INIT |
|
452 PERFLOG_STOPWATCH_START |
|
453 |
|
454 if (iEditorIndicatorContainer) |
|
455 { |
|
456 return; |
|
457 } |
|
458 |
|
459 if ((iEditorIndicatorContainer == NULL)) |
|
460 { |
|
461 PERFLOG_LOCAL_INIT |
|
462 PERFLOG_STOPWATCH_START |
|
463 iEditorIndicatorContainer = NaviPaneL()->CreateEditorIndicatorContainerL(); |
|
464 PERFLOG_STOP_WRITE(" -> BrDsply: EditorContainer") |
|
465 } |
|
466 |
|
467 PERFLOG_STOPWATCH_START |
|
468 CAknIndicatorContainer* indicContainer = SelectIndicContainerOwn(); |
|
469 |
|
470 _IND_STATE( SecuredConnection ) = EAknIndicatorStateOff; |
|
471 _IND_STATE( MessageInfo ) = EAknIndicatorStateOff; |
|
472 _IND_STATE( ProgressBar ) = EAknIndicatorStateOff; |
|
473 // _IND_STATE( WaitBar ) = EAknIndicatorStateOff; |
|
474 // _IND_STATE( T9 ) = EAknIndicatorStateOff; |
|
475 // _IND_STATE( UpperCase ) = EAknIndicatorStateOff; |
|
476 // _IND_STATE( LowerCase ) = EAknIndicatorStateOff; |
|
477 // _IND_STATE( AudioAttached ) = EAknIndicatorStateOff; |
|
478 // _IND_STATE( Objects ) = EAknIndicatorStateOff; |
|
479 // _IND_STATE( WmlWaitGlobe ) = EAknIndicatorStateOff; |
|
480 _IND_STATE( Gprs ) = EAknIndicatorStateOn; |
|
481 |
|
482 _IND_STATE( WlanAvailable ) = EAknIndicatorStateOff; |
|
483 _IND_STATE( WlanActive ) = EAknIndicatorStateOff; |
|
484 _IND_STATE( WlanActiveSecure ) = EAknIndicatorStateOff; |
|
485 |
|
486 _IND_STATE( FileSize ) = EAknIndicatorStateOff; |
|
487 // _IND_STATE( MessageLength ) = EAknIndicatorStateOff; |
|
488 _IND_STATE( WmlWindows ) = EAknIndicatorStateOff; |
|
489 _IND_STATE( WmlWindowsText ) = EAknIndicatorStateOff; |
|
490 |
|
491 indicContainer->_SET_INDIC( SecuredConnection ); |
|
492 indicContainer->_SET_INDIC( MessageInfo ); |
|
493 indicContainer->_SET_INDIC( ProgressBar ); |
|
494 // indicContainer->_SET_INDIC( WaitBar ); |
|
495 // indicContainer->_SET_INDIC( T9 ); |
|
496 // indicContainer->_SET_INDIC( UpperCase ); |
|
497 // indicContainer->_SET_INDIC( LowerCase ); |
|
498 // indicContainer->_SET_INDIC( AudioAttached ); |
|
499 // indicContainer->_SET_INDIC( Objects ); |
|
500 // indicContainer->_SET_INDIC( WmlWaitGlobe ); |
|
501 indicContainer->_SET_INDIC( Gprs ); |
|
502 |
|
503 indicContainer->_SET_INDIC( WlanAvailable ); |
|
504 indicContainer->_SET_INDIC( WlanActive ); |
|
505 indicContainer->_SET_INDIC( WlanActiveSecure ); |
|
506 |
|
507 indicContainer->_SET_INDIC( FileSize ); |
|
508 // indicContainer->_SET_INDIC( MessageLength ); |
|
509 indicContainer->_SET_INDIC( WmlWindows ); |
|
510 indicContainer->_SET_INDIC( WmlWindowsText ); |
|
511 PERFLOG_STOP_WRITE( "Display:InitIndicators") |
|
512 } |
|
513 |
|
514 // --------------------------------------------------------- |
|
515 // CBrowserDisplay::UpdateSecureIndicatorL() |
|
516 // --------------------------------------------------------- |
|
517 // |
|
518 void CBrowserDisplay::UpdateSecureIndicatorL( const TInt aState ) |
|
519 { |
|
520 PERFLOG_LOCAL_INIT |
|
521 PERFLOG_STOPWATCH_START |
|
522 if( !iApiProvider.ExitInProgress() ) |
|
523 { |
|
524 SetFullScreenSecureIndicatorL(aState); |
|
525 NaviPaneL()->DrawDeferred(); |
|
526 } |
|
527 PERFLOG_STOP_WRITE( "Display:UpdateSecureIndicator") |
|
528 } |
|
529 |
|
530 // --------------------------------------------------------- |
|
531 // CBrowserDisplay::UpdateFSDownloadInitialIndicator() |
|
532 // --------------------------------------------------------- |
|
533 // |
|
534 void CBrowserDisplay::UpdateFSDownloadInitialIndicator( const TBool aState ) |
|
535 { |
|
536 PERFLOG_LOCAL_INIT |
|
537 PERFLOG_STOPWATCH_START |
|
538 if( !iEditorIndicatorContainer ) |
|
539 { |
|
540 InitIndicatorsL(); |
|
541 } |
|
542 |
|
543 if ( iApiProvider.IsProgressShown() && ( iEditorIndicatorContainer != NULL ) ) |
|
544 { |
|
545 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
546 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
547 if (aState) |
|
548 { |
|
549 ClearMessageInfo(); |
|
550 |
|
551 _IND_STATE( FileSize ) = EAknIndicatorStateOff; |
|
552 indicContainerEditing->_SET_INDIC( FileSize ); |
|
553 indicContainerOwn->_SET_INDIC( FileSize ); |
|
554 } |
|
555 } |
|
556 PERFLOG_STOP_WRITE("BrDsply: GlobeAnimation init") |
|
557 } |
|
558 |
|
559 // --------------------------------------------------------- |
|
560 // CBrowserDisplay::SetGPRSIndicatorOnL() |
|
561 // --------------------------------------------------------- |
|
562 // |
|
563 void CBrowserDisplay::SetGPRSIndicatorOnL() |
|
564 { |
|
565 PERFLOG_LOCAL_INIT |
|
566 PERFLOG_STOPWATCH_START |
|
567 if ( iEditorIndicatorContainer != NULL ) |
|
568 { |
|
569 // Set GPRS indicator on, it will update itself |
|
570 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
571 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
572 _IND_STATE( Gprs ) = EAknIndicatorStateOn; |
|
573 indicContainerEditing->_SET_INDIC( Gprs ); |
|
574 indicContainerOwn->_SET_INDIC( Gprs ); |
|
575 } |
|
576 PERFLOG_STOP_WRITE("BrDsply: Gprsidic on") |
|
577 } |
|
578 |
|
579 // --------------------------------------------------------- |
|
580 // CBrowserDisplay::UpdateWlanIndicator() |
|
581 // --------------------------------------------------------- |
|
582 // |
|
583 void CBrowserDisplay::UpdateWlanIndicator( const TInt aWlanValue ) |
|
584 { |
|
585 PERFLOG_LOCAL_INIT |
|
586 PERFLOG_STOPWATCH_START |
|
587 |
|
588 if ( iEditorIndicatorContainer != NULL ) |
|
589 { |
|
590 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
591 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
592 |
|
593 _IND_STATE( WlanAvailable ) = EAknIndicatorStateOff; |
|
594 indicContainerEditing->_SET_INDIC( WlanAvailable ); |
|
595 indicContainerOwn->_SET_INDIC( WlanAvailable ); |
|
596 |
|
597 _IND_STATE( WlanActive ) = EAknIndicatorStateOff; |
|
598 indicContainerEditing->_SET_INDIC( WlanActive ); |
|
599 indicContainerOwn->_SET_INDIC( WlanActive ); |
|
600 |
|
601 _IND_STATE( WlanActiveSecure ) = EAknIndicatorStateOff; |
|
602 indicContainerEditing->_SET_INDIC( WlanActiveSecure ); |
|
603 indicContainerOwn->_SET_INDIC( WlanActiveSecure ); |
|
604 |
|
605 switch (aWlanValue) |
|
606 { |
|
607 case EPSWlanIndicatorNone: |
|
608 { |
|
609 // do nothing. |
|
610 break; |
|
611 } |
|
612 |
|
613 case EPSWlanIndicatorAvailable: |
|
614 { |
|
615 _IND_STATE( WlanAvailable ) = EAknIndicatorStateOn; |
|
616 indicContainerEditing->_SET_INDIC( WlanAvailable ); |
|
617 indicContainerOwn->_SET_INDIC( WlanAvailable ); |
|
618 break; |
|
619 } |
|
620 |
|
621 case EPSWlanIndicatorActive: |
|
622 { |
|
623 _IND_STATE( WlanActive ) = EAknIndicatorStateOn; |
|
624 indicContainerEditing->_SET_INDIC( WlanActive ); |
|
625 indicContainerOwn->_SET_INDIC( WlanActive ); |
|
626 break; |
|
627 } |
|
628 |
|
629 case EPSWlanIndicatorActiveSecure: |
|
630 { |
|
631 |
|
632 _IND_STATE( WlanActiveSecure ) = EAknIndicatorStateOn; |
|
633 indicContainerEditing->_SET_INDIC( WlanActiveSecure ); |
|
634 indicContainerOwn->_SET_INDIC( WlanActiveSecure ); |
|
635 break; |
|
636 } |
|
637 |
|
638 default: |
|
639 { |
|
640 // do nothing. |
|
641 break; |
|
642 } |
|
643 } |
|
644 } |
|
645 PERFLOG_STOP_WRITE("BrDsply: UpdateWlanIndicator") |
|
646 } |
|
647 |
|
648 // --------------------------------------------------------- |
|
649 // CBrowserDisplay::StartWlanObserverL() |
|
650 // --------------------------------------------------------- |
|
651 // |
|
652 void CBrowserDisplay::StartWlanObserverL() |
|
653 { |
|
654 PERFLOG_LOCAL_INIT |
|
655 PERFLOG_STOPWATCH_START |
|
656 |
|
657 if (iWlanObserver == NULL) |
|
658 { |
|
659 iWlanObserver = new ( ELeave ) CWlanObserver( iApiProvider ); |
|
660 } |
|
661 |
|
662 PERFLOG_STOP_WRITE("BrDsply: Wlan Observer Started") |
|
663 } |
|
664 |
|
665 // --------------------------------------------------------- |
|
666 // CBrowserDisplay::SetFullScreenSecureIndicatorL() |
|
667 // --------------------------------------------------------- |
|
668 // |
|
669 void CBrowserDisplay::SetFullScreenSecureIndicatorL(const TBool aState) |
|
670 { |
|
671 PERFLOG_LOCAL_INIT |
|
672 PERFLOG_STOPWATCH_START |
|
673 _IND_STATE( SecuredConnection ) = aState; |
|
674 if ( iEditorIndicatorContainer != NULL && iWindow->IsWindowActive() ) |
|
675 { |
|
676 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
677 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
678 _IND_STATE( SecuredConnection ) = aState ? |
|
679 EAknIndicatorStateOn : EAknIndicatorStateOff; |
|
680 indicContainerEditing->_SET_INDIC( SecuredConnection ); |
|
681 indicContainerOwn->_SET_INDIC( SecuredConnection ); |
|
682 } |
|
683 PERFLOG_STOP_WRITE("BrDsply: Secure indic upd") |
|
684 } |
|
685 |
|
686 // --------------------------------------------------------- |
|
687 // CBrowserDisplay::AddTransActIdL() |
|
688 // --------------------------------------------------------- |
|
689 // |
|
690 void CBrowserDisplay::AddTransActIdL( TUint16 aId ) const |
|
691 { |
|
692 iProgressIndicator->AddTransActIdL( aId ); |
|
693 } |
|
694 |
|
695 // --------------------------------------------------------- |
|
696 // CBrowserDisplay::AddProgressDataL() |
|
697 // --------------------------------------------------------- |
|
698 // |
|
699 void CBrowserDisplay::AddProgressDataL( |
|
700 TUint16 aId, TUint32 aRecvdData, TUint32 aMaxData ) const |
|
701 { |
|
702 iProgressIndicator->AddProgressDataL( aId, aRecvdData, aMaxData ); |
|
703 } |
|
704 |
|
705 // --------------------------------------------------------- |
|
706 // CBrowserDisplay::TransActIdComplete() |
|
707 // --------------------------------------------------------- |
|
708 // |
|
709 void CBrowserDisplay::TransActIdComplete( TUint16 aId ) const |
|
710 { |
|
711 TRAP_IGNORE( iProgressIndicator->TransActIdCompleteL( aId ) ); |
|
712 } |
|
713 |
|
714 // --------------------------------------------------------- |
|
715 // CBrowserDisplay::StartFSWaitIndicator() |
|
716 // --------------------------------------------------------- |
|
717 // |
|
718 void CBrowserDisplay::StartFSWaitIndicator() |
|
719 { |
|
720 if( iEditorIndicatorContainer != NULL && |
|
721 iWindow->IsWindowActive() ) |
|
722 { |
|
723 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
724 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
725 } |
|
726 } |
|
727 |
|
728 // --------------------------------------------------------- |
|
729 // CBrowserDisplay::UpdateFSProgressIndicator() |
|
730 // --------------------------------------------------------- |
|
731 // |
|
732 void CBrowserDisplay::UpdateFSProgressIndicator( const TInt aMaxData, |
|
733 const TInt aReceivedData ) |
|
734 { |
|
735 PERFLOG_LOCAL_INIT |
|
736 PERFLOG_STOPWATCH_START |
|
737 LOG_ENTERFN("UpdateFSProgressIndicator"); |
|
738 BROWSER_LOG( ( _L( "maxData: %d, recData: %d" ), aMaxData, aReceivedData ) ); |
|
739 if ( iApiProvider.IsProgressShown() && |
|
740 ( iEditorIndicatorContainer != NULL ) && |
|
741 iWindow->IsWindowActive() ) |
|
742 { |
|
743 CAknIndicatorContainer* indicContainerEditing = SelectIndicContainerEditing(); |
|
744 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
745 |
|
746 if( indicContainerEditing->IndicatorState( |
|
747 TUid::Uid( EAknNaviPaneEditorIndicatorProgressBar ) ) |
|
748 != EAknIndicatorStateOn || |
|
749 indicContainerOwn->IndicatorState( |
|
750 TUid::Uid( EAknNaviPaneEditorIndicatorProgressBar ) ) |
|
751 != EAknIndicatorStateOn |
|
752 ) |
|
753 { |
|
754 _IND_STATE( ProgressBar ) = EAknIndicatorStateOn; |
|
755 indicContainerEditing->_SET_INDIC2( ProgressBar, ETrue ); |
|
756 indicContainerOwn->_SET_INDIC2( ProgressBar, ETrue ); |
|
757 } |
|
758 |
|
759 indicContainerEditing->SetIndicatorValue( |
|
760 TUid::Uid( EAknNaviPaneEditorIndicatorProgressBar ), |
|
761 aReceivedData, aMaxData ); |
|
762 indicContainerOwn->SetIndicatorValue( |
|
763 TUid::Uid( EAknNaviPaneEditorIndicatorProgressBar ), |
|
764 aReceivedData, aMaxData ); |
|
765 } |
|
766 PERFLOG_STOP_WRITE("BrDsply: Prg indic upd") |
|
767 } |
|
768 |
|
769 // --------------------------------------------------------- |
|
770 // CBrowserDisplay::UpdateFSProgressDataL() |
|
771 // --------------------------------------------------------- |
|
772 // |
|
773 void CBrowserDisplay::UpdateFSProgressDataL( const TDesC16& aReceivedDataText ) |
|
774 { |
|
775 PERFLOG_LOCAL_INIT |
|
776 PERFLOG_STOPWATCH_START |
|
777 if ( iApiProvider.IsProgressShown() &&( iEditorIndicatorContainer != NULL ) ) |
|
778 { |
|
779 CAknIndicatorContainer* indicContainerEditing = |
|
780 SelectIndicContainerEditing(); |
|
781 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
782 |
|
783 if( indicContainerEditing->IndicatorState( |
|
784 TUid::Uid( EAknNaviPaneEditorIndicatorMessageInfo ) ) |
|
785 != EAknIndicatorStateOff ) |
|
786 { |
|
787 ClearMessageInfo(); |
|
788 } |
|
789 |
|
790 if( indicContainerEditing->IndicatorState( |
|
791 TUid::Uid( EAknNaviPaneEditorIndicatorFileSize ) ) |
|
792 != EAknIndicatorStateOn || |
|
793 indicContainerOwn->IndicatorState( |
|
794 TUid::Uid( EAknNaviPaneEditorIndicatorFileSize ) ) |
|
795 != EAknIndicatorStateOn ) |
|
796 { |
|
797 _IND_STATE( FileSize ) = EAknIndicatorStateOn; |
|
798 indicContainerEditing->_SET_INDIC( FileSize ); |
|
799 indicContainerOwn->_SET_INDIC( FileSize ); |
|
800 } |
|
801 |
|
802 indicContainerEditing->SetIndicatorValueL( |
|
803 TUid::Uid( _AKN_IND( FileSize ) ), aReceivedDataText ); |
|
804 indicContainerOwn->SetIndicatorValueL( |
|
805 TUid::Uid( _AKN_IND( FileSize ) ), aReceivedDataText ); |
|
806 |
|
807 NaviPaneL()->PushL( *iEditorIndicatorContainer ); |
|
808 } |
|
809 PERFLOG_STOP_WRITE("BrDsply: Prg data upd") |
|
810 } |
|
811 |
|
812 |
|
813 // --------------------------------------------------------- |
|
814 // CBrowserDisplay::FSPaneOnL() |
|
815 // --------------------------------------------------------- |
|
816 // |
|
817 void CBrowserDisplay::FSPaneOnL() |
|
818 { |
|
819 InitIndicatorsL(); |
|
820 NaviPaneL()->PushL(*iEditorIndicatorContainer); |
|
821 } |
|
822 |
|
823 // --------------------------------------------------------- |
|
824 // CBrowserDisplay::NotifyProgress() |
|
825 // --------------------------------------------------------- |
|
826 // |
|
827 void CBrowserDisplay::NotifyProgress() |
|
828 { |
|
829 if ( iProgressIndicator != NULL && iWindow->IsWindowActive() ) |
|
830 { |
|
831 iProgressIndicator->NotifyProgress(); |
|
832 } |
|
833 } |
|
834 |
|
835 // ---------------------------------------------------------------------------- |
|
836 // CBrowserDisplay::UpdateMultipleWindowsIndicatorL() |
|
837 // ---------------------------------------------------------------------------- |
|
838 // |
|
839 void CBrowserDisplay::UpdateMultipleWindowsIndicatorL( |
|
840 TBool aState, TInt aWinCount ) |
|
841 { |
|
842 LOG_ENTERFN("CBrowserDisplay::UpdateMultipleWindowsIndicatorL"); |
|
843 |
|
844 if ( iEditorIndicatorContainer != NULL ) |
|
845 { |
|
846 CAknIndicatorContainer* indicContainerEditing = |
|
847 SelectIndicContainerEditing(); |
|
848 CAknIndicatorContainer* indicContainerOwn = SelectIndicContainerOwn(); |
|
849 |
|
850 // Show or hide MW Icon |
|
851 _IND_STATE( WmlWindows ) = aState ? |
|
852 EAknIndicatorStateOn : EAknIndicatorStateOff; |
|
853 indicContainerEditing->_SET_INDIC( WmlWindows ); |
|
854 indicContainerOwn->_SET_INDIC( WmlWindows ); |
|
855 |
|
856 // Show or hide text indicator |
|
857 _IND_STATE( WmlWindowsText ) = aState ? |
|
858 EAknIndicatorStateOn : EAknIndicatorStateOff; |
|
859 indicContainerEditing->_SET_INDIC( WmlWindowsText ); |
|
860 indicContainerOwn->_SET_INDIC( WmlWindowsText ); |
|
861 |
|
862 if ( aState ) |
|
863 { |
|
864 // MW Indicator is made of an indicator icon and a number (num wins) |
|
865 |
|
866 // Display Number of windows open in text indicator |
|
867 HBufC* numWins = HBufC::NewLC( 3 ); |
|
868 numWins->Des().AppendNum( aWinCount ); |
|
869 numWins->Des().Append( KBrowserSpaceChar ); |
|
870 indicContainerEditing->SetIndicatorValueL( |
|
871 TUid::Uid( _AKN_IND( WmlWindowsText ) ), *numWins ); |
|
872 indicContainerOwn->SetIndicatorValueL( |
|
873 TUid::Uid( _AKN_IND( WmlWindowsText ) ), *numWins ); |
|
874 CleanupStack::PopAndDestroy( numWins ); |
|
875 } |
|
876 } |
|
877 } |
|
878 |
|
879 // End of File |
|