1 /* |
|
2 * Copyright (c) 2002 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 * Browser content view |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 |
|
23 #include <brctldefs.h> |
|
24 #include <brctlinterface.h> |
|
25 |
|
26 #include "BrowserWindow.h" |
|
27 #include "BrowserContentView.h" |
|
28 #include "BrowserContentViewContainer.h" |
|
29 #include <browserdialogsprovider.h> |
|
30 #include "BrowserDialogsProviderProxy.h" |
|
31 #include "BrowserSoftkeysObserver.h" |
|
32 #include "BrowserSpecialLoadObserver.h" |
|
33 #include "BrowserWindowManager.h" |
|
34 |
|
35 #include "ApiProvider.h" |
|
36 #include "BrowserAppUi.h" |
|
37 #include "BrowserUIVariant.hrh" |
|
38 #include "Logger.h" |
|
39 #include "BrowserDisplay.h" |
|
40 #include "BrowserPopupEngine.h" |
|
41 #include <cdownloadmgruidownloadslist.h> |
|
42 #include <downloadmgrclient.h> |
|
43 |
|
44 // for instantiating BrCtlInterface |
|
45 #include "CommonConstants.h" |
|
46 #include "BrowserApplication.h" |
|
47 #include "BrowserAppDocument.h" |
|
48 |
|
49 #include "Preferences.h" |
|
50 |
|
51 // for dialog notes |
|
52 #include <StringLoader.h> |
|
53 #include <BrowserNG.rsg> |
|
54 #include "BrowserDialogs.h" |
|
55 |
|
56 |
|
57 #define CALL_ORIG iWindowManager->ApiProvider()-> |
|
58 |
|
59 TBool CBrowserWindow::iIsPageOverviewSupportQueried = EFalse; |
|
60 TBool CBrowserWindow::iIsPageOverviewSupported = EFalse; |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CBrowserWindow::NewLC() |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 TBool CBrowserWindow::CompleteDelayedInit() |
|
67 { |
|
68 return EFalse; |
|
69 } |
|
70 |
|
71 CBrowserWindow* CBrowserWindow::NewLC( |
|
72 TInt aWindowId, |
|
73 const TDesC* aTargetName, |
|
74 CBrowserWindowManager* aWindowMgr ) |
|
75 { |
|
76 CBrowserWindow* self = new (ELeave) |
|
77 CBrowserWindow( aWindowId, aTargetName, aWindowMgr ); |
|
78 CleanupStack::PushL( self ); |
|
79 self->ConstructL(); |
|
80 return self; |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CBrowserWindow::NewL() |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 CBrowserWindow* CBrowserWindow::NewL( |
|
88 TInt aWindowId, |
|
89 const TDesC* aTargetName, |
|
90 CBrowserWindowManager* aWindowMgr ) |
|
91 { |
|
92 CBrowserWindow* self = |
|
93 CBrowserWindow::NewLC( aWindowId, aTargetName, aWindowMgr ); |
|
94 CleanupStack::Pop( self ); |
|
95 return self; |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CBrowserWindow::~CBrowserWindow() |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 CBrowserWindow::~CBrowserWindow() |
|
103 { |
|
104 iClosing = ETrue; |
|
105 |
|
106 LOG_ENTERFN("CBrowserWindow::~CBrowserWindow"); |
|
107 BROWSER_LOG( ( _L( "window id: %d" ), WindowId() ) ); |
|
108 |
|
109 if( iBrCtlInterface ) |
|
110 { |
|
111 iBrCtlInterface->RemoveLoadEventObserver( iLoadObserver ); |
|
112 BROWSER_LOG( ( _L( " RemoveLoadEventObserver" ) ) ); |
|
113 |
|
114 CBrowserContentView* cv = iWindowManager->ContentView(); |
|
115 iBrCtlInterface->RemoveStateChangeObserver( cv ); |
|
116 BROWSER_LOG( ( _L( " RemoveStateChangeObserver" ) ) ); |
|
117 iBrCtlInterface->RemoveCommandObserver( cv ); |
|
118 BROWSER_LOG( ( _L( " RemoveCommandObserver" ) ) ); |
|
119 |
|
120 |
|
121 // TRAP_IGNORE( iBrCtlInterface->HandleCommandL( |
|
122 // (TInt)TBrCtlDefs::ECommandCancelFetch + (TInt)TBrCtlDefs::ECommandIdBase ) ); |
|
123 BROWSER_LOG( ( _L( " HandleCommandL" ) ) ); |
|
124 } |
|
125 |
|
126 // security indicator must be set off. |
|
127 if( iDisplay && !iWindowManager->ApiProvider()-> |
|
128 Preferences().HttpSecurityWarningsStatSupressed() ) |
|
129 { |
|
130 BROWSER_LOG( ( _L( " UpdateSecureIndicatorL 1" ) ) ); |
|
131 TRAP_IGNORE( iDisplay->UpdateSecureIndicatorL( EAknIndicatorStateOff ) ); |
|
132 BROWSER_LOG( ( _L( " UpdateSecureIndicatorL 2" ) ) ); |
|
133 // we cannot do much here if error occurs... application is closing anyway |
|
134 } |
|
135 delete iDisplay; |
|
136 BROWSER_LOG( ( _L( " Display deleted.") ) ); |
|
137 |
|
138 //Delete iBrCtlInterface before observers. If this is not |
|
139 //done then browser crashes on exit when page is being loaded. |
|
140 delete iBrCtlInterface; |
|
141 BROWSER_LOG( ( _L( " BrCtlInterface deleted.") ) ); |
|
142 |
|
143 delete iLoadObserver; |
|
144 BROWSER_LOG( ( _L( " LoadObserver deleted.") ) ); |
|
145 |
|
146 delete iDialogsProviderProxy; |
|
147 BROWSER_LOG( ( _L( " DialogsProviderProxy deleted.") ) ); |
|
148 |
|
149 delete iSpecialLoadObserver; |
|
150 BROWSER_LOG( ( _L( " SpecialLoadObserver deleted.") ) ); |
|
151 |
|
152 delete iSoftkeysObserver; |
|
153 BROWSER_LOG( ( _L( " SoftkeysObserver deleted.") ) ); |
|
154 // |
|
155 delete iTargetName; |
|
156 } |
|
157 |
|
158 // ----------------------------------------------------------------------------- |
|
159 // CBrowserWindow::CBrowserWindow() |
|
160 // ----------------------------------------------------------------------------- |
|
161 // |
|
162 CBrowserWindow::CBrowserWindow( |
|
163 TInt aWindowId, |
|
164 const TDesC* aTargetName, |
|
165 CBrowserWindowManager* aWindowMgr ) : |
|
166 iWindowId( aWindowId ), |
|
167 iActive( EFalse ), |
|
168 iFirstPage(ETrue), |
|
169 iBrCtlInterface( NULL ), |
|
170 iDialogsProviderProxy( NULL ), |
|
171 iDisplay( NULL ), |
|
172 iLoadObserver( NULL ), |
|
173 iSoftkeysObserver( NULL ), |
|
174 iSpecialLoadObserver( NULL ), |
|
175 iWindowManager( aWindowMgr ) |
|
176 { |
|
177 __ASSERT_DEBUG( (aTargetName != NULL), Util::Panic( Util::EUninitializedData )); |
|
178 iTargetName = aTargetName->Alloc(); |
|
179 } |
|
180 |
|
181 // ----------------------------------------------------------------------------- |
|
182 // CBrowserWindow::ConstructL() |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 void CBrowserWindow::ConstructL() |
|
186 { |
|
187 PERFLOG_LOCAL_INIT |
|
188 LOG_ENTERFN("CBrowserWindow::ConstructL"); |
|
189 MApiProvider* api = iWindowManager->ApiProvider(); |
|
190 CleanupStack::PushL( api ); |
|
191 PERFLOG_STOPWATCH_START |
|
192 iDisplay = CBrowserDisplay::NewL( *this, *this ); |
|
193 PERFLOG_STOP_WRITE("*BrowserDisplay*") |
|
194 BROWSER_LOG( ( _L( " Multiple Display up" ) ) ); |
|
195 |
|
196 CBrowserContentView* cv = iWindowManager->ContentView(); |
|
197 TRect rect = cv->Container()->Rect(); |
|
198 |
|
199 PERFLOG_STOPWATCH_START |
|
200 iLoadObserver = CBrowserLoadObserver::NewL( *this, *cv, *this ); |
|
201 BROWSER_LOG( ( _L( " Multiple LoadObserver up" ) ) ); |
|
202 PERFLOG_STOP_WRITE("*LoadObs*") |
|
203 PERFLOG_STOPWATCH_START |
|
204 iDialogsProviderProxy = CBrowserDialogsProviderProxy::NewL( |
|
205 api->DialogsProvider(), iLoadObserver, *this ); |
|
206 PERFLOG_STOP_WRITE("*DlgProxy*") |
|
207 BROWSER_LOG( ( _L( " Multiple CBrowserDialogsProviderProxy UP" ) ) ); |
|
208 PERFLOG_STOPWATCH_START |
|
209 iSoftkeysObserver = CBrowserSoftkeysObserver::NewL( *this ); |
|
210 BROWSER_LOG( ( _L( " Multiple SoftkeyObserver up" ) ) ); |
|
211 PERFLOG_STOP_WRITE("*SoftKeyObs*") |
|
212 PERFLOG_STOPWATCH_START |
|
213 iSpecialLoadObserver = CBrowserSpecialLoadObserver::NewL( |
|
214 *this, this, CBrowserAppUi::Static()->Document(), cv ); |
|
215 PERFLOG_STOP_WRITE("*SoftKeyObs*") |
|
216 BROWSER_LOG( ( _L( " Multiple SpecialLoadObserver up" ) ) ); |
|
217 |
|
218 TInt autoLaunch( TBrCtlDefs::ECapabilityLaunchViewer ); |
|
219 CBrowserAppDocument* doc = STATIC_CAST( CBrowserAppDocument*, |
|
220 CBrowserAppUi::Static()->Document() ); |
|
221 |
|
222 if( doc->IsContentHandlerRegistered() ) |
|
223 { |
|
224 autoLaunch = 0; |
|
225 } |
|
226 |
|
227 PERFLOG_STOPWATCH_START |
|
228 TUint capabilityFlags = ( TBrCtlDefs::ECapabilityLoadHttpFw | |
|
229 TBrCtlDefs::ECapabilityDisplayScrollBar | |
|
230 TBrCtlDefs::ECapabilityConfirmDownloads | |
|
231 TBrCtlDefs::ECapabilitySavedPage | |
|
232 TBrCtlDefs::ECapabilityUseDlMgr | |
|
233 TBrCtlDefs::ECapabilityCursorNavigation | |
|
234 TBrCtlDefs::ECapabilityFavicon | |
|
235 TBrCtlDefs::ECapabilityToolBar | |
|
236 TBrCtlDefs::ECapabilityFitToScreen | |
|
237 TBrCtlDefs::ECapabilityPinchZoom | |
|
238 autoLaunch ); |
|
239 |
|
240 if ( Preferences().UiLocalFeatureSupported( KBrowserGraphicalPage )) |
|
241 { |
|
242 capabilityFlags = capabilityFlags | TBrCtlDefs::ECapabilityGraphicalPage; |
|
243 } |
|
244 #ifdef BRDO_MULTITOUCH_ENABLED_FF |
|
245 if (Preferences().UiLocalFeatureSupported( KBrowserGraphicalHistory )) |
|
246 #else |
|
247 if ( Preferences().UiLocalFeatureSupported( KBrowserGraphicalPage ) && |
|
248 Preferences().UiLocalFeatureSupported( KBrowserGraphicalHistory )) |
|
249 #endif |
|
250 { |
|
251 capabilityFlags = capabilityFlags | TBrCtlDefs::ECapabilityGraphicalHistory; |
|
252 } |
|
253 if ( Preferences().UiLocalFeatureSupported( KBrowserAutoFormFill ) ) |
|
254 { |
|
255 capabilityFlags = capabilityFlags | TBrCtlDefs::ECapabilityAutoFormFill; |
|
256 } |
|
257 if (Preferences().AccessKeys()) |
|
258 { |
|
259 capabilityFlags = capabilityFlags | TBrCtlDefs::ECapabilityAccessKeys; |
|
260 } |
|
261 |
|
262 iBrCtlInterface = CreateBrowserControlL( |
|
263 (CCoeControl*)cv->Container(), // parent control |
|
264 rect, // client rect |
|
265 capabilityFlags, // capabilities |
|
266 (TUint)TBrCtlDefs::ECommandIdBase, // command base |
|
267 iSoftkeysObserver, |
|
268 (MBrCtlLinkResolver*)NULL, // LinkResolver |
|
269 iSpecialLoadObserver, |
|
270 (MBrCtlLayoutObserver*)NULL, // Layout Observer |
|
271 iDialogsProviderProxy, |
|
272 this // Window Observer |
|
273 ); |
|
274 BROWSER_LOG( ( _L( " Multiple Plugin Br Control up, Kimono." ) ) ); |
|
275 |
|
276 iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsLaunchAppUid, KUidBrowserApplication.iUid); |
|
277 iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsLaunchViewId, KUidBrowserBookmarksViewId.iUid); |
|
278 iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsLaunchCustomMessageId, KUidCustomMsgDownloadsList.iUid ); |
|
279 BROWSER_LOG( ( _L( " LaunchSettings are passed." ) ) ); |
|
280 |
|
281 #if defined( __RSS_FEEDS ) |
|
282 TPtrC rssMimeTypes = api->FeedsClientUtilities().SupportedMimeTypesL(); |
|
283 BROWSER_LOG( ( _L( " rss SupportedMimeTypes OK" ) ) ); |
|
284 TPtrC selfDownloadContentTypes = api->Preferences().SelfDownloadContentTypesL(); |
|
285 BROWSER_LOG( ( _L( " SelfDownloadContentTypesL OK" ) ) ); |
|
286 |
|
287 HBufC* buf = HBufC::NewLC( |
|
288 rssMimeTypes.Length() + selfDownloadContentTypes.Length() + 2 ); |
|
289 TPtr ptr( buf->Des() ); |
|
290 ptr.Append( rssMimeTypes ); |
|
291 ptr.Append( TChar(';') ); |
|
292 ptr.Append( selfDownloadContentTypes ); |
|
293 ptr.ZeroTerminate(); |
|
294 |
|
295 iBrCtlInterface->SetSelfDownloadContentTypesL( ptr ); |
|
296 CleanupStack::PopAndDestroy(); // buf |
|
297 #else // __RSS_FEEDS |
|
298 TPtrC selfDownloadContentTypes = api->Preferences().SelfDownloadContentTypesL(); |
|
299 BROWSER_LOG( ( _L( " SelfDownloadContentTypesL OK" ) ) ); |
|
300 iBrCtlInterface->SetSelfDownloadContentTypesL( selfDownloadContentTypes ); |
|
301 #endif // __RSS_FEEDS |
|
302 BROWSER_LOG( ( _L( " SetSelfDownloadContentTypesL") ) ); |
|
303 |
|
304 iBrCtlInterface->AddLoadEventObserverL( iLoadObserver ); |
|
305 BROWSER_LOG( ( _L( " AddLoadEventObserverL") ) ); |
|
306 iBrCtlInterface->AddStateChangeObserverL( cv ); |
|
307 BROWSER_LOG( ( _L( " AddStateChangeObserverL") ) ); |
|
308 iBrCtlInterface->AddCommandObserverL( cv ); |
|
309 BROWSER_LOG( ( _L( " AddCommandObserverL") ) ); |
|
310 |
|
311 // Window is not added as PreferencesObserver, |
|
312 // this message flow is controlled by the WindowManager. |
|
313 |
|
314 // Each window needs to notify its Browser Control of the settings |
|
315 PERFLOG_STOP_WRITE("***BctlItem creation***") |
|
316 PERFLOG_STOPWATCH_START |
|
317 InitialiseLocalPreferencesL(); |
|
318 UpdateBrCtlSettingsL(); |
|
319 PERFLOG_STOP_WRITE("***BrowserCtl Settings update***") |
|
320 CleanupStack::Pop( api ); |
|
321 |
|
322 iIsPageOverviewOn = iWindowManager->ApiProvider()->Preferences().PageOverview(); |
|
323 |
|
324 } |
|
325 |
|
326 // ----------------------------------------------------------------------------- |
|
327 // CBrowserWindow::OpenWindowL() |
|
328 // ----------------------------------------------------------------------------- |
|
329 // |
|
330 CBrCtlInterface* CBrowserWindow::OpenWindowL( |
|
331 TDesC& /* aUrl */, TDesC* aTargetName, |
|
332 TBool aUserInitiated, TAny* /* aReserved */ ) |
|
333 { |
|
334 // do not create new window when the browser is being closed |
|
335 if( iClosing ) |
|
336 { |
|
337 return NULL; |
|
338 } |
|
339 LOG_ENTERFN("CBrowserWindow::OpenWindowL, OSS"); |
|
340 // Do not exceed the maximum number of windows allowed |
|
341 if ( iWindowManager->WindowCount() == |
|
342 iWindowManager->MaxWindowCount() ) |
|
343 { |
|
344 |
|
345 // Show warning to user |
|
346 TBrowserDialogs::ErrorNoteL( R_BROWSER_NOTE_MAX_WINDOWS ); |
|
347 |
|
348 return NULL; |
|
349 } |
|
350 |
|
351 CBrCtlInterface* retVal( NULL ); |
|
352 TBool loadUrl( EFalse ); // allow fetching of url |
|
353 |
|
354 CBrowserPopupEngine* popup = &( iWindowManager->ApiProvider()->PopupEngine() ); |
|
355 // embedded mode doesn't allow multiple windows feature, hence popup object is NULL |
|
356 if (!popup) { |
|
357 return retVal; |
|
358 } |
|
359 |
|
360 HBufC* url = BrCtlInterface().PageInfoLC( TBrCtlDefs::EPageInfoUrl ); |
|
361 if(!url) |
|
362 { |
|
363 //The url is already pushed on to the cleanup stack and we have the ownership of it. Pop it. |
|
364 CleanupStack::Pop(url); |
|
365 return NULL; |
|
366 } |
|
367 |
|
368 TPtrC ptr( url->Des() ); |
|
369 |
|
370 // Check if on the whitelist, if not a user initiated open |
|
371 // or if pop-up blocking has been disabled |
|
372 if ( !( iWindowManager->ApiProvider()->Preferences().PopupBlocking() ) || |
|
373 popup->IsUrlOnWhiteListL( ptr ) || |
|
374 aUserInitiated ) |
|
375 { |
|
376 loadUrl = ETrue; // OK to fetch the URL |
|
377 } |
|
378 else |
|
379 { |
|
380 // Notify user that popup was blocked |
|
381 HBufC* popupBlocked = StringLoader::LoadLC( |
|
382 R_BROWSER_NOTE_POPUP_BLOCKED ); |
|
383 iWindowManager->ApiProvider()-> |
|
384 DialogsProvider().ShowTooltipL( *popupBlocked ); |
|
385 |
|
386 CleanupStack::PopAndDestroy( popupBlocked ); |
|
387 } |
|
388 |
|
389 CleanupStack::PopAndDestroy( url ); |
|
390 |
|
391 if ( loadUrl ) |
|
392 { |
|
393 // Open a new popup window |
|
394 CBrowserWindow* window = iWindowManager->CreateWindowL( |
|
395 WindowId(), aTargetName ); |
|
396 if (window == NULL) |
|
397 { |
|
398 return retVal; |
|
399 } |
|
400 |
|
401 retVal = & ( window->BrCtlInterface() ); |
|
402 |
|
403 // do not initiate load, it does by the engine automatically |
|
404 // aUrl is empty / NULL |
|
405 |
|
406 |
|
407 // Indicate to the user that a new window is being opened |
|
408 HBufC* newWindow = StringLoader::LoadLC( R_BROWSER_NEW_WINDOW_OPENED ); |
|
409 iWindowManager->ApiProvider()->DialogsProvider(). |
|
410 ShowTooltipL( *newWindow ); |
|
411 CleanupStack::PopAndDestroy( newWindow ); |
|
412 } |
|
413 |
|
414 return retVal; |
|
415 } |
|
416 |
|
417 // ----------------------------------------------------------------------------- |
|
418 // CBrowserWindow::FindWindowL() |
|
419 // ----------------------------------------------------------------------------- |
|
420 // |
|
421 CBrCtlInterface* CBrowserWindow::FindWindowL( const TDesC& aTargetName ) const |
|
422 { |
|
423 CBrowserWindow* window = iWindowManager->FindWindowL( aTargetName ); |
|
424 if( window ) |
|
425 return & ( window->BrCtlInterface() ); |
|
426 else |
|
427 return NULL; |
|
428 } |
|
429 |
|
430 // ----------------------------------------------------------------------------- |
|
431 // CBrowserWindow::HandleWindowCommandL() |
|
432 // ----------------------------------------------------------------------------- |
|
433 // |
|
434 void CBrowserWindow::HandleWindowCommandL( |
|
435 const TDesC& aTargetName, |
|
436 TBrCtlWindowCommand aCommand ) |
|
437 { |
|
438 LOG_ENTERFN("CBrowserWindow::HandleWindowCommandL"); |
|
439 BROWSER_LOG( ( _L( "window Id: %d, aCommand: %d" ), WindowId(), aCommand ) ); |
|
440 |
|
441 // KNullDesC() refers to the current window |
|
442 |
|
443 // I am NOT that targetwindow |
|
444 if( aTargetName != KNullDesC() && iTargetName->Compare( aTargetName ) != 0 ) |
|
445 { |
|
446 // try to find that window |
|
447 CBrowserWindow* window = iWindowManager->FindWindowL( aTargetName ); |
|
448 if( window ) |
|
449 { |
|
450 window->HandleWindowCommandL( aTargetName, aCommand ); |
|
451 } |
|
452 else |
|
453 { |
|
454 // no window with that name |
|
455 } |
|
456 } |
|
457 else // I am that targetwindow |
|
458 { |
|
459 switch( aCommand ) |
|
460 { |
|
461 case EShowWindow: // to activate a window after creating it |
|
462 case EFocusWindow: // window.focus or reload |
|
463 // focusing this window |
|
464 { |
|
465 // Changes were made to ClearHistory that cause it to keep one (current) page |
|
466 // In order to reuse a window we need to clear the history again after the first new page |
|
467 // is loaded |
|
468 if (iFirstPage) |
|
469 { |
|
470 BrCtlInterface().HandleCommandL((TInt)TBrCtlDefs::ECommandClearHistory + (TInt)TBrCtlDefs::ECommandIdBase); |
|
471 iFirstPage = EFalse; |
|
472 } |
|
473 iWindowManager->SwitchWindowL( WindowId() ); |
|
474 break; |
|
475 } |
|
476 case EUnfocusWindow: // focusing the last active window |
|
477 { |
|
478 // iWindowManager->SwitchWindowL( ); |
|
479 break; |
|
480 } |
|
481 case ECloseWindow: |
|
482 { |
|
483 CBrowserAppUi::Static()->CloseWindowL( WindowId() ); |
|
484 break; |
|
485 } |
|
486 // case EDisableScriptLog: |
|
487 // iWindowManager->ApiProvider()->Preferences().SetScriptLogL( TBrCtlDefs::EScriptLogDisable ); |
|
488 // break; |
|
489 default: |
|
490 { |
|
491 break; |
|
492 } |
|
493 } |
|
494 } |
|
495 } |
|
496 |
|
497 // --------------------------------------------------------- |
|
498 // CBrowserWindow::IsPageOverviewSupported |
|
499 // --------------------------------------------------------- |
|
500 // |
|
501 TBool CBrowserWindow::IsPageOverviewSupportedL() |
|
502 { |
|
503 if(!iIsPageOverviewSupportQueried) |
|
504 { |
|
505 iIsPageOverviewSupported = iBrCtlInterface->BrowserSettingL( |
|
506 TBrCtlDefs::ESettingsPageOverview ); |
|
507 iIsPageOverviewSupportQueried = ETrue; |
|
508 } |
|
509 |
|
510 return iIsPageOverviewSupported; |
|
511 } |
|
512 |
|
513 // ----------------------------------------------------------------------------- |
|
514 // CBrowserWindow::ResetPageOverviewLocalSettingL() |
|
515 // ----------------------------------------------------------------------------- |
|
516 // |
|
517 void CBrowserWindow::ResetPageOverviewLocalSettingL() |
|
518 { |
|
519 iIsPageOverviewOn = |
|
520 iWindowManager->ApiProvider()->Preferences().PageOverview(); |
|
521 BrCtlInterface().SetBrowserSettingL(TBrCtlDefs::ESettingsPageOverview, |
|
522 iIsPageOverviewOn ); |
|
523 } |
|
524 |
|
525 // ----------------------------------------------------------------------------- |
|
526 // CBrowserWindow::ChangeTitlePaneTextUntilL() |
|
527 // ----------------------------------------------------------------------------- |
|
528 // |
|
529 void CBrowserWindow::ChangeTitlePaneTextUntilL( |
|
530 const TDesC& aTitle, TInt /* aInterval */ ) |
|
531 { |
|
532 iWindowManager->ApiProvider()->DialogsProvider().ShowTooltipL( aTitle ); |
|
533 } |
|
534 |
|
535 // ----------------------------------------------------------------------------- |
|
536 // CBrowserWindow::FlipPageOverviewLocalSettingL() |
|
537 // ----------------------------------------------------------------------------- |
|
538 // |
|
539 void CBrowserWindow::FlipPageOverviewLocalSettingL() |
|
540 { |
|
541 iIsPageOverviewOn = !iIsPageOverviewOn; |
|
542 BrCtlInterface().SetBrowserSettingL( TBrCtlDefs::ESettingsPageOverview, |
|
543 iIsPageOverviewOn ); |
|
544 TInt tooltipResource = iIsPageOverviewOn ? |
|
545 R_BROWSER_TOOLTIP_PAGE_OVERVIEW_ON : R_BROWSER_TOOLTIP_PAGE_OVERVIEW_OFF; |
|
546 HBufC* overviewTooltip = StringLoader::LoadLC( tooltipResource ); |
|
547 |
|
548 iWindowManager->ApiProvider()->DialogsProvider().ShowTooltipL( *overviewTooltip ); |
|
549 CleanupStack::PopAndDestroy( overviewTooltip ); |
|
550 } |
|
551 |
|
552 // ----------------------------------------------------------------------------- |
|
553 // CBrowserWindow::BrCtlInterface() |
|
554 // ----------------------------------------------------------------------------- |
|
555 // |
|
556 CBrCtlInterface& CBrowserWindow::BrCtlInterface() const |
|
557 { |
|
558 return *iBrCtlInterface; |
|
559 } |
|
560 |
|
561 // ----------------------------------------------------------------------------- |
|
562 // CBrowserWindow::Display() |
|
563 // ----------------------------------------------------------------------------- |
|
564 // |
|
565 MDisplay& CBrowserWindow::Display() const |
|
566 { |
|
567 return *iDisplay; |
|
568 } |
|
569 |
|
570 // ----------------------------------------------------------------------------- |
|
571 // CBrowserWindow::LoadObserver() |
|
572 // ----------------------------------------------------------------------------- |
|
573 // |
|
574 CBrowserLoadObserver& CBrowserWindow::LoadObserver() const |
|
575 { |
|
576 return *iLoadObserver; |
|
577 } |
|
578 |
|
579 // ----------------------------------------------------------------------------- |
|
580 // CBrowserWindow::SoftkeysObserver() |
|
581 // ----------------------------------------------------------------------------- |
|
582 // |
|
583 CBrowserSoftkeysObserver& CBrowserWindow::SoftkeysObserver() const |
|
584 { |
|
585 return *iSoftkeysObserver; |
|
586 } |
|
587 |
|
588 // ----------------------------------------------------------------------------- |
|
589 // CBrowserWindow::SpecialLoadObserver() |
|
590 // ----------------------------------------------------------------------------- |
|
591 // |
|
592 CBrowserSpecialLoadObserver& CBrowserWindow::SpecialLoadObserver() const |
|
593 { |
|
594 return *iSpecialLoadObserver; |
|
595 } |
|
596 |
|
597 // ---------------------------------------------------------------------------- |
|
598 // CBrowserWindow::HandlePreferencesChangeL() |
|
599 // ---------------------------------------------------------------------------- |
|
600 // |
|
601 void CBrowserWindow::HandlePreferencesChangeL( |
|
602 TPreferencesEvent aEvent, |
|
603 TPreferencesValues& aValues, |
|
604 TBrCtlDefs::TBrCtlSettings aSettingType ) |
|
605 { |
|
606 switch ( aEvent ) |
|
607 { |
|
608 case EPreferencesActivate: |
|
609 { |
|
610 // Provide local settings |
|
611 aValues.iFontSize = iFontSize; |
|
612 aValues.iTextWrap = iTextWrap; |
|
613 aValues.iEncoding = iEncoding; |
|
614 break; |
|
615 } |
|
616 case EPreferencesDeactivate: |
|
617 { |
|
618 // Save local preferences and notify Browser Control |
|
619 if ( iActive ) // Topmost window only |
|
620 { |
|
621 UpdateLocalPreferencesL( aValues ); |
|
622 } |
|
623 break; |
|
624 } |
|
625 case EPreferencesItemChange: |
|
626 { |
|
627 // All preferences changes should notify the |
|
628 // Browser Control |
|
629 UpdateGlobalPreferencesL( aSettingType ); |
|
630 |
|
631 if ( iActive ) // Topmost window only |
|
632 { |
|
633 UpdateLocalPreferencesL( aValues ); |
|
634 // Change the local setting to the changed setting. |
|
635 iIsPageOverviewOn = iWindowManager->ApiProvider()->Preferences().PageOverview(); |
|
636 } |
|
637 break; |
|
638 } |
|
639 default: |
|
640 // Do nothing |
|
641 break; |
|
642 } |
|
643 } |
|
644 |
|
645 // ----------------------------------------------------------------------------- |
|
646 // CBrowserWindow::UpdateGlobalPreferencesL() |
|
647 // ----------------------------------------------------------------------------- |
|
648 // |
|
649 void CBrowserWindow::UpdateGlobalPreferencesL( |
|
650 TBrCtlDefs::TBrCtlSettings aSettingType ) |
|
651 { |
|
652 // Local Settings should be ignored |
|
653 switch ( aSettingType ) |
|
654 { |
|
655 case TBrCtlDefs::ESettingsAutoLoadImages: |
|
656 { |
|
657 // WebEngine has two different settings for Content Autoload enable/disable: |
|
658 // AutoLoad Images - True/False and Disable flash - True/False |
|
659 // Here is how the Load Content setting in UI maps to the Image and |
|
660 // Flash settings in Webengine in case flash Plugin is present |
|
661 // Load Content = 0, AutoLoadImages = 0, DisableFlash = 1 |
|
662 // Load Content = 1, AutoLoadImages = 1, DisableFlash = 1 |
|
663 // Load Content = 2, AutoLoadImages = 1, DisableFlash = 0 |
|
664 // In case flash plugin is not present |
|
665 // Load Content = 0, AutoLoadImages = 0, DisableFlash = 1 |
|
666 // Load Content = 1, AutoLoadImages = 1, DisableFlash = 1 |
|
667 |
|
668 iBrCtlInterface->SetBrowserSettingL( |
|
669 TBrCtlDefs::ESettingsAutoLoadImages, |
|
670 ((Preferences().AutoLoadContent() == EWmlSettingsAutoloadText) |
|
671 ?EFalse:ETrue)); |
|
672 |
|
673 iBrCtlInterface->SetBrowserSettingL( |
|
674 TBrCtlDefs::ESettingsDisableFlash, |
|
675 ((Preferences().AutoLoadContent() == EWmlSettingsAutoloadAll) |
|
676 ?EFalse:ETrue)); |
|
677 break; |
|
678 } |
|
679 case TBrCtlDefs::ESettingsEmbedded: |
|
680 { |
|
681 iBrCtlInterface->SetBrowserSettingL( |
|
682 TBrCtlDefs::ESettingsEmbedded, |
|
683 Preferences().EmbeddedMode() ); |
|
684 break; |
|
685 } |
|
686 case TBrCtlDefs::ESettingsCookiesEnabled: |
|
687 { |
|
688 iBrCtlInterface->SetBrowserSettingL( |
|
689 TBrCtlDefs::ESettingsCookiesEnabled, |
|
690 Preferences().Cookies() ); |
|
691 break; |
|
692 } |
|
693 case TBrCtlDefs::ESettingsECMAScriptEnabled: |
|
694 { |
|
695 iBrCtlInterface->SetBrowserSettingL( |
|
696 TBrCtlDefs::ESettingsECMAScriptEnabled, |
|
697 Preferences().Ecma() ); |
|
698 break; |
|
699 } |
|
700 case TBrCtlDefs::ESettingsScriptLog: |
|
701 { |
|
702 iBrCtlInterface->SetBrowserSettingL( |
|
703 TBrCtlDefs::ESettingsScriptLog, |
|
704 Preferences().ScriptLog() ); |
|
705 break; |
|
706 } |
|
707 case TBrCtlDefs::ESettingsIMEINotifyEnabled: |
|
708 { |
|
709 iBrCtlInterface->SetBrowserSettingL( |
|
710 TBrCtlDefs::ESettingsIMEINotifyEnabled, |
|
711 Preferences().IMEINotification() ); |
|
712 break; |
|
713 } |
|
714 case TBrCtlDefs::ESettingsSendRefererHeader: |
|
715 { |
|
716 iBrCtlInterface->SetBrowserSettingL( |
|
717 TBrCtlDefs::ESettingsSendRefererHeader, |
|
718 Preferences().SendReferrer() ); |
|
719 break; |
|
720 } |
|
721 case TBrCtlDefs::ESettingsSecurityWarnings: |
|
722 { |
|
723 iBrCtlInterface->SetBrowserSettingL( |
|
724 TBrCtlDefs::ESettingsSecurityWarnings, |
|
725 Preferences().HttpSecurityWarnings() ); |
|
726 break; |
|
727 } |
|
728 |
|
729 case TBrCtlDefs::ESettingsAutoOpenDownloads: |
|
730 { |
|
731 iBrCtlInterface->SetBrowserSettingL( |
|
732 TBrCtlDefs::ESettingsAutoOpenDownloads, |
|
733 Preferences().DownloadsOpen() ); |
|
734 break; |
|
735 } |
|
736 |
|
737 case TBrCtlDefs::ESettingsPageOverview: |
|
738 { |
|
739 if( IsPageOverviewSupportedL() ) |
|
740 { |
|
741 iBrCtlInterface->SetBrowserSettingL( |
|
742 TBrCtlDefs::ESettingsPageOverview, |
|
743 Preferences().PageOverview() ); |
|
744 } |
|
745 break; |
|
746 } |
|
747 case TBrCtlDefs::ESettingsBackList: |
|
748 { |
|
749 iBrCtlInterface->SetBrowserSettingL( |
|
750 TBrCtlDefs::ESettingsBackList, |
|
751 Preferences().BackList() ); |
|
752 break; |
|
753 } |
|
754 case TBrCtlDefs::ESettingsAutoRefresh: |
|
755 { |
|
756 iBrCtlInterface->SetBrowserSettingL( |
|
757 TBrCtlDefs::ESettingsAutoRefresh, |
|
758 Preferences().AutoRefresh() ); |
|
759 break; |
|
760 } |
|
761 case TBrCtlDefs::ESettingsAutoFormFillEnabled: |
|
762 { |
|
763 iBrCtlInterface->SetBrowserSettingL( |
|
764 TBrCtlDefs::ESettingsAutoFormFillEnabled, |
|
765 Preferences().FormDataSaving() ); |
|
766 break; |
|
767 } |
|
768 case TBrCtlDefs::ESettingsToolbarOnOff: |
|
769 { |
|
770 iBrCtlInterface->SetBrowserSettingL( |
|
771 TBrCtlDefs::ESettingsToolbarOnOff, |
|
772 Preferences().ShowToolbarOnOff() ); |
|
773 break; |
|
774 } |
|
775 case TBrCtlDefs::ESettingsToolbarButton1Cmd: |
|
776 { |
|
777 iBrCtlInterface->SetBrowserSettingL( |
|
778 TBrCtlDefs::ESettingsToolbarButton1Cmd, |
|
779 Preferences().ShowToolbarButton1Cmd() ); |
|
780 break; |
|
781 } |
|
782 case TBrCtlDefs::ESettingsToolbarButton2Cmd: |
|
783 { |
|
784 iBrCtlInterface->SetBrowserSettingL( |
|
785 TBrCtlDefs::ESettingsToolbarButton2Cmd, |
|
786 Preferences().ShowToolbarButton2Cmd() ); |
|
787 break; |
|
788 } |
|
789 case TBrCtlDefs::ESettingsToolbarButton3Cmd: |
|
790 { |
|
791 iBrCtlInterface->SetBrowserSettingL( |
|
792 TBrCtlDefs::ESettingsToolbarButton3Cmd, |
|
793 Preferences().ShowToolbarButton3Cmd() ); |
|
794 break; |
|
795 } |
|
796 case TBrCtlDefs::ESettingsToolbarButton4Cmd: |
|
797 { |
|
798 iBrCtlInterface->SetBrowserSettingL( |
|
799 TBrCtlDefs::ESettingsToolbarButton4Cmd, |
|
800 Preferences().ShowToolbarButton4Cmd() ); |
|
801 break; |
|
802 } |
|
803 case TBrCtlDefs::ESettingsToolbarButton5Cmd: |
|
804 { |
|
805 iBrCtlInterface->SetBrowserSettingL( |
|
806 TBrCtlDefs::ESettingsToolbarButton5Cmd, |
|
807 Preferences().ShowToolbarButton5Cmd() ); |
|
808 break; |
|
809 } |
|
810 case TBrCtlDefs::ESettingsToolbarButton6Cmd: |
|
811 { |
|
812 iBrCtlInterface->SetBrowserSettingL( |
|
813 TBrCtlDefs::ESettingsToolbarButton6Cmd, |
|
814 Preferences().ShowToolbarButton6Cmd() ); |
|
815 break; |
|
816 } |
|
817 case TBrCtlDefs::ESettingsToolbarButton7Cmd: |
|
818 { |
|
819 iBrCtlInterface->SetBrowserSettingL( |
|
820 TBrCtlDefs::ESettingsToolbarButton7Cmd, |
|
821 Preferences().ShowToolbarButton7Cmd() ); |
|
822 break; |
|
823 } |
|
824 case TBrCtlDefs::ESettingsZoomLevelMin: |
|
825 { |
|
826 iBrCtlInterface->SetBrowserSettingL( |
|
827 TBrCtlDefs::ESettingsZoomLevelMin, |
|
828 Preferences().ZoomLevelMinimum() ); |
|
829 break; |
|
830 } |
|
831 case TBrCtlDefs::ESettingsZoomLevelMax: |
|
832 { |
|
833 iBrCtlInterface->SetBrowserSettingL( |
|
834 TBrCtlDefs::ESettingsZoomLevelMax, |
|
835 Preferences().ZoomLevelMaximum() ); |
|
836 break; |
|
837 } |
|
838 case TBrCtlDefs::ESettingsZoomLevelDefault: |
|
839 { |
|
840 iBrCtlInterface->SetBrowserSettingL( |
|
841 TBrCtlDefs::ESettingsZoomLevelDefault, |
|
842 Preferences().ZoomLevelDefault() ); |
|
843 break; |
|
844 } |
|
845 case TBrCtlDefs::ESettingsCursorShowMode: |
|
846 { |
|
847 iBrCtlInterface->SetBrowserSettingL( |
|
848 TBrCtlDefs::ESettingsCursorShowMode, |
|
849 Preferences().CursorShowMode() ); |
|
850 break; |
|
851 } |
|
852 |
|
853 case TBrCtlDefs::ESettingsEnterKeyMode: |
|
854 { |
|
855 iBrCtlInterface->SetBrowserSettingL( |
|
856 TBrCtlDefs::ESettingsEnterKeyMode, |
|
857 Preferences().EnterKeyMode() ); |
|
858 break; |
|
859 } |
|
860 |
|
861 // LOCAL SETTINGS should be ignored |
|
862 case TBrCtlDefs::ESettingsTextWrapEnabled: |
|
863 case TBrCtlDefs::ESettingsFontSize: |
|
864 case TBrCtlDefs::ESettingsCharacterset: |
|
865 { |
|
866 break; |
|
867 } |
|
868 case TBrCtlDefs::ESettingsUnknown: // ignore |
|
869 default: |
|
870 break; |
|
871 } |
|
872 } |
|
873 |
|
874 // ----------------------------------------------------------------------------- |
|
875 // CBrowserWindow::UpdateLocalPreferencesL() |
|
876 // ----------------------------------------------------------------------------- |
|
877 // |
|
878 void CBrowserWindow::UpdateLocalPreferencesL( TPreferencesValues& aValues ) |
|
879 { |
|
880 if ( iFontSize != aValues.iFontSize ) |
|
881 { |
|
882 iFontSize = aValues.iFontSize; |
|
883 iBrCtlInterface->SetBrowserSettingL( |
|
884 ( TUint ) TBrCtlDefs::ESettingsFontSize, iFontSize ); |
|
885 } |
|
886 |
|
887 if ( iTextWrap != aValues.iTextWrap ) |
|
888 { |
|
889 iTextWrap = aValues.iTextWrap; |
|
890 iBrCtlInterface->SetBrowserSettingL( |
|
891 ( TUint ) TBrCtlDefs::ESettingsTextWrapEnabled, iTextWrap ); |
|
892 } |
|
893 if ( iEncoding != aValues.iEncoding ) |
|
894 { |
|
895 iEncoding = aValues.iEncoding; |
|
896 iBrCtlInterface->SetBrowserSettingL( |
|
897 ( TUint ) TBrCtlDefs::ESettingsCharacterset, iEncoding ); |
|
898 } |
|
899 } |
|
900 |
|
901 // ----------------------------------------------------------------------------- |
|
902 // CBrowserWindow::InitialiseLocalPreferencesL() |
|
903 // ----------------------------------------------------------------------------- |
|
904 // |
|
905 void CBrowserWindow::InitialiseLocalPreferencesL() |
|
906 { |
|
907 // Initialise local settings from Central Repository |
|
908 const TPreferencesValues& pref = Preferences().AllPreferencesL(); |
|
909 iFontSize = pref.iFontSize; |
|
910 iTextWrap = pref.iTextWrap; |
|
911 iEncoding = pref.iEncoding; |
|
912 } |
|
913 |
|
914 // ---------------------------------------------------------------------------- |
|
915 // CBrowserWindow::UpdateBrCtlSettingsL() |
|
916 // ---------------------------------------------------------------------------- |
|
917 // |
|
918 void CBrowserWindow::UpdateBrCtlSettingsL() |
|
919 { |
|
920 LOG_ENTERFN("CBrowserPreferences::UpdateBrCtlSettingsL"); |
|
921 |
|
922 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsSmallScreen ); |
|
923 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsAutoLoadImages ); |
|
924 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsEmbedded ); |
|
925 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsCookiesEnabled ); |
|
926 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsCSSFetchEnabled ); |
|
927 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsECMAScriptEnabled ); |
|
928 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsScriptLog ); |
|
929 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsIMEINotifyEnabled ); |
|
930 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsSendRefererHeader ); |
|
931 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsSecurityWarnings ); |
|
932 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsAutoOpenDownloads ); |
|
933 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsPageOverview ); |
|
934 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsBackList ); |
|
935 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsAutoRefresh ); |
|
936 |
|
937 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsAutoFormFillEnabled ); |
|
938 |
|
939 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarOnOff ); |
|
940 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton1Cmd ); |
|
941 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton2Cmd ); |
|
942 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton3Cmd ); |
|
943 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton4Cmd ); |
|
944 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton5Cmd ); |
|
945 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton6Cmd ); |
|
946 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton7Cmd ); |
|
947 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsZoomLevelMin ); |
|
948 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsZoomLevelMax ); |
|
949 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsZoomLevelDefault ); |
|
950 |
|
951 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsCursorShowMode ); |
|
952 UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsEnterKeyMode ); |
|
953 |
|
954 // Font Size - LOCAL Setting |
|
955 iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsFontSize, |
|
956 iWindowManager->ApiProvider()->Preferences().FontSize() ); |
|
957 |
|
958 // Text Wrap - LOCAL Setting |
|
959 iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsTextWrapEnabled, |
|
960 iWindowManager->ApiProvider()->Preferences().TextWrap() ); |
|
961 |
|
962 // Encoding - LOCAL Setting |
|
963 iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsCharacterset, |
|
964 iWindowManager->ApiProvider()->Preferences().Encoding() ); |
|
965 } |
|
966 |
|
967 // ----------------------------------------------------------------------------- |
|
968 // CBrowserWindow::ActivateL() |
|
969 // ----------------------------------------------------------------------------- |
|
970 // |
|
971 void CBrowserWindow::ActivateL( TBool aDraw ) |
|
972 { |
|
973 LOG_ENTERFN("CBrowserWindow::ActivateL"); |
|
974 BROWSER_LOG( ( _L( "Activating window no. %d" ), WindowId() ) ); |
|
975 iDialogsProviderProxy->WindowActivated(); |
|
976 iBrCtlInterface->MakeVisible( ETrue ); // notify the engine |
|
977 iActive = ETrue; |
|
978 if( aDraw ) |
|
979 { |
|
980 iBrCtlInterface->DrawNow(); |
|
981 CBrowserContentView* cv = iWindowManager->ContentView(); |
|
982 cv->UpdateFullScreenL(); |
|
983 TRAP_IGNORE(Display().StopProgressAnimationL());//also updates title |
|
984 } |
|
985 WindowMgr().NotifyObserversL( EWindowActivate, WindowId() ); |
|
986 } |
|
987 |
|
988 // ----------------------------------------------------------------------------- |
|
989 // CBrowserWindow::DeactivateL() |
|
990 // ----------------------------------------------------------------------------- |
|
991 // |
|
992 void CBrowserWindow::DeactivateL() |
|
993 { |
|
994 LOG_ENTERFN("CBrowserWindow::DeactivateL"); |
|
995 BROWSER_LOG( ( _L( "Deactivating window no. %d" ), WindowId() ) ); |
|
996 iActive = EFalse; |
|
997 iBrCtlInterface->MakeVisible( EFalse ); // notify the engine |
|
998 } |
|
999 |
|
1000 // ----------------------------------------------------------------------------- |
|
1001 // CBrowserWindow::Connection |
|
1002 // ----------------------------------------------------------------------------- |
|
1003 // |
|
1004 MConnection& CBrowserWindow::Connection() const |
|
1005 { |
|
1006 return CALL_ORIG Connection(); |
|
1007 } |
|
1008 |
|
1009 // ----------------------------------------------------------------------------- |
|
1010 // CBrowserWindow::Preferences() |
|
1011 // ----------------------------------------------------------------------------- |
|
1012 // |
|
1013 MPreferences& CBrowserWindow::Preferences() const |
|
1014 { |
|
1015 return CALL_ORIG Preferences(); |
|
1016 } |
|
1017 |
|
1018 // ----------------------------------------------------------------------------- |
|
1019 // CBrowserWindow::CommsModel |
|
1020 // ----------------------------------------------------------------------------- |
|
1021 // |
|
1022 MCommsModel& CBrowserWindow::CommsModel() const |
|
1023 { |
|
1024 return CALL_ORIG CommsModel(); |
|
1025 } |
|
1026 |
|
1027 // ----------------------------------------------------------------------------- |
|
1028 // CBrowserWindow::DialogsProvider() |
|
1029 // ----------------------------------------------------------------------------- |
|
1030 // |
|
1031 CBrowserDialogsProvider& CBrowserWindow::DialogsProvider() const |
|
1032 { |
|
1033 __ASSERT_DEBUG( (iDialogsProviderProxy != NULL), Util::Panic( Util::EUninitializedData )); |
|
1034 return *( (CBrowserDialogsProvider*)iDialogsProviderProxy ); |
|
1035 } |
|
1036 |
|
1037 // ----------------------------------------------------------------------------- |
|
1038 // CBrowserWindow::BmOTABinSender |
|
1039 // ----------------------------------------------------------------------------- |
|
1040 // |
|
1041 MBmOTABinSender& CBrowserWindow::BmOTABinSenderL() |
|
1042 { |
|
1043 return CALL_ORIG BmOTABinSenderL(); |
|
1044 } |
|
1045 |
|
1046 // ----------------------------------------------------------------------------- |
|
1047 // CBrowserWindow::PopupEngine |
|
1048 // ----------------------------------------------------------------------------- |
|
1049 // |
|
1050 CBrowserPopupEngine& CBrowserWindow::PopupEngine() const |
|
1051 { |
|
1052 return CALL_ORIG PopupEngine(); |
|
1053 } |
|
1054 |
|
1055 // ----------------------------------------------------------------------------- |
|
1056 // CBrowserWindow::SetViewToBeActivatedIfNeededL |
|
1057 // ----------------------------------------------------------------------------- |
|
1058 // |
|
1059 void CBrowserWindow::SetViewToBeActivatedIfNeededL( |
|
1060 TUid aUid, |
|
1061 TInt aMessageId ) |
|
1062 { |
|
1063 CALL_ORIG SetViewToBeActivatedIfNeededL( aUid, aMessageId ); |
|
1064 } |
|
1065 |
|
1066 // ----------------------------------------------------------------------------- |
|
1067 // CBrowserWindow::IsCancelFetchAllowed |
|
1068 // ----------------------------------------------------------------------------- |
|
1069 // |
|
1070 TBool CBrowserWindow::IsCancelFetchAllowed() const |
|
1071 { |
|
1072 return CALL_ORIG IsCancelFetchAllowed(); |
|
1073 } |
|
1074 |
|
1075 // ----------------------------------------------------------------------------- |
|
1076 // CBrowserWindow::LastActiveViewId |
|
1077 // ----------------------------------------------------------------------------- |
|
1078 // |
|
1079 TUid CBrowserWindow::LastActiveViewId() const |
|
1080 { |
|
1081 return CALL_ORIG LastActiveViewId(); |
|
1082 } |
|
1083 |
|
1084 // ----------------------------------------------------------------------------- |
|
1085 // CBrowserWindow::SetLastActiveViewId |
|
1086 // ----------------------------------------------------------------------------- |
|
1087 // |
|
1088 void CBrowserWindow::SetLastActiveViewId( TUid aUid ) |
|
1089 { |
|
1090 CALL_ORIG SetLastActiveViewId( aUid ); |
|
1091 } |
|
1092 |
|
1093 // ----------------------------------------------------------------------------- |
|
1094 // CBrowserWindow::ExitInProgress |
|
1095 // ----------------------------------------------------------------------------- |
|
1096 // |
|
1097 TBool CBrowserWindow::ExitInProgress() const |
|
1098 { |
|
1099 return CALL_ORIG ExitInProgress(); |
|
1100 } |
|
1101 |
|
1102 // ----------------------------------------------------------------------------- |
|
1103 // CBrowserWindow::SetExitInProgress |
|
1104 // ----------------------------------------------------------------------------- |
|
1105 // |
|
1106 void CBrowserWindow::SetExitInProgress( TBool aValue ) |
|
1107 { |
|
1108 CALL_ORIG SetExitInProgress( aValue ); |
|
1109 } |
|
1110 |
|
1111 // ----------------------------------------------------------------------------- |
|
1112 // CBrowserWindow::IsConnecting |
|
1113 // ----------------------------------------------------------------------------- |
|
1114 // |
|
1115 TBool CBrowserWindow::IsConnecting() const |
|
1116 { |
|
1117 return CALL_ORIG IsConnecting(); |
|
1118 } |
|
1119 |
|
1120 // ----------------------------------------------------------------------------- |
|
1121 // CBrowserWindow::UpdateNaviPaneL |
|
1122 // ----------------------------------------------------------------------------- |
|
1123 // |
|
1124 void CBrowserWindow::UpdateNaviPaneL( TDesC& aStatusMsg ) |
|
1125 { |
|
1126 CALL_ORIG UpdateNaviPaneL( aStatusMsg ); |
|
1127 } |
|
1128 |
|
1129 // ----------------------------------------------------------------------------- |
|
1130 // CBrowserWindow::SetViewToReturnOnClose |
|
1131 // ----------------------------------------------------------------------------- |
|
1132 // |
|
1133 void CBrowserWindow::SetViewToReturnOnClose( TUid const &aUid ) |
|
1134 { |
|
1135 CALL_ORIG SetViewToReturnOnClose( aUid ); |
|
1136 } |
|
1137 |
|
1138 // ----------------------------------------------------------------------------- |
|
1139 // CBrowserWindow::CloseContentViewL |
|
1140 // ----------------------------------------------------------------------------- |
|
1141 // |
|
1142 void CBrowserWindow::CloseContentViewL() |
|
1143 { |
|
1144 CALL_ORIG CloseContentViewL(); |
|
1145 } |
|
1146 |
|
1147 // ----------------------------------------------------------------------------- |
|
1148 // CBrowserWindow::IsEmbeddedModeOn |
|
1149 // ----------------------------------------------------------------------------- |
|
1150 // |
|
1151 TBool CBrowserWindow::IsEmbeddedModeOn() const |
|
1152 { |
|
1153 return CALL_ORIG IsEmbeddedModeOn(); |
|
1154 } |
|
1155 |
|
1156 // ----------------------------------------------------------------------------- |
|
1157 // CBrowserWindow::IsShutdownRequested |
|
1158 // ----------------------------------------------------------------------------- |
|
1159 // |
|
1160 TBool CBrowserWindow::IsShutdownRequested() const |
|
1161 { |
|
1162 return CALL_ORIG IsShutdownRequested(); |
|
1163 } |
|
1164 |
|
1165 // ----------------------------------------------------------------------------- |
|
1166 // CBrowserWindow::ExitBrowser |
|
1167 // ----------------------------------------------------------------------------- |
|
1168 // |
|
1169 void CBrowserWindow::ExitBrowser( TBool aUserShutdown ) |
|
1170 { |
|
1171 CALL_ORIG ExitBrowser( aUserShutdown ); |
|
1172 } |
|
1173 |
|
1174 // ----------------------------------------------------------------------------- |
|
1175 // CBrowserWindow::IsAppShutterActive |
|
1176 // ----------------------------------------------------------------------------- |
|
1177 // |
|
1178 TBool CBrowserWindow::IsAppShutterActive() const |
|
1179 { |
|
1180 return CALL_ORIG IsAppShutterActive(); |
|
1181 } |
|
1182 |
|
1183 // ----------------------------------------------------------------------------- |
|
1184 // CBrowserWindow::StartPreferencesViewL |
|
1185 // ----------------------------------------------------------------------------- |
|
1186 // |
|
1187 TBool CBrowserWindow::StartPreferencesViewL( TUint aListItems ) |
|
1188 { |
|
1189 return CALL_ORIG StartPreferencesViewL( aListItems ); |
|
1190 } |
|
1191 |
|
1192 // ----------------------------------------------------------------------------- |
|
1193 // CBrowserWindow::IsPageLoaded |
|
1194 // ----------------------------------------------------------------------------- |
|
1195 // |
|
1196 TBool CBrowserWindow::IsPageLoaded() |
|
1197 { |
|
1198 return CALL_ORIG IsPageLoaded(); |
|
1199 } |
|
1200 |
|
1201 // ----------------------------------------------------------------------------- |
|
1202 // CBrowserWindow::IsForeGround |
|
1203 // ----------------------------------------------------------------------------- |
|
1204 // |
|
1205 TBool CBrowserWindow::IsForeGround() const |
|
1206 { |
|
1207 return CALL_ORIG IsForeGround(); |
|
1208 } |
|
1209 |
|
1210 // ----------------------------------------------------------------------------- |
|
1211 // CBrowserWindow::Fetching |
|
1212 // ----------------------------------------------------------------------------- |
|
1213 // |
|
1214 TBool CBrowserWindow::Fetching() const |
|
1215 { |
|
1216 return CALL_ORIG Fetching(); |
|
1217 } |
|
1218 // ----------------------------------------------------------------------------- |
|
1219 // CBrowserWindow::ContentDisplayed |
|
1220 // ----------------------------------------------------------------------------- |
|
1221 // |
|
1222 TBool CBrowserWindow::ContentDisplayed() const |
|
1223 { |
|
1224 return CALL_ORIG ContentDisplayed(); |
|
1225 } |
|
1226 // ----------------------------------------------------------------------------- |
|
1227 // CBrowserWindow::SetContentDisplayed |
|
1228 // ----------------------------------------------------------------------------- |
|
1229 // |
|
1230 void CBrowserWindow::SetContentDisplayed(TBool aValue) |
|
1231 { |
|
1232 return CALL_ORIG SetContentDisplayed( aValue ); |
|
1233 } |
|
1234 |
|
1235 // ----------------------------------------------------------------------------- |
|
1236 // CBrowserWindow::FetchBookmarkL |
|
1237 // ----------------------------------------------------------------------------- |
|
1238 // |
|
1239 void CBrowserWindow::FetchBookmarkL( TInt aBookmarkUid ) |
|
1240 { |
|
1241 CALL_ORIG FetchBookmarkL( aBookmarkUid ); |
|
1242 } |
|
1243 |
|
1244 // ----------------------------------------------------------------------------- |
|
1245 // CBrowserWindow::FetchBookmarkL |
|
1246 // ----------------------------------------------------------------------------- |
|
1247 // |
|
1248 void CBrowserWindow::FetchBookmarkL( const CFavouritesItem& aBookmarkItem ) |
|
1249 { |
|
1250 CALL_ORIG FetchBookmarkL( aBookmarkItem ); |
|
1251 } |
|
1252 |
|
1253 // ----------------------------------------------------------------------------- |
|
1254 // CBrowserWindow::FetchL |
|
1255 // ----------------------------------------------------------------------------- |
|
1256 // |
|
1257 void CBrowserWindow::FetchL( |
|
1258 const TDesC& aUrl, |
|
1259 const TDesC& aUserName, |
|
1260 const TDesC& aPassword, |
|
1261 const TFavouritesWapAp& aAccessPoint, |
|
1262 CBrowserLoadObserver::TBrowserLoadUrlType aUrlType ) |
|
1263 { |
|
1264 CALL_ORIG FetchL( aUrl, aUserName, aPassword, aAccessPoint, aUrlType ); |
|
1265 } |
|
1266 |
|
1267 // ----------------------------------------------------------------------------- |
|
1268 // CBrowserWindow::FetchL |
|
1269 // ----------------------------------------------------------------------------- |
|
1270 // |
|
1271 void CBrowserWindow::FetchL( |
|
1272 const TDesC& aUrl, |
|
1273 CBrowserLoadObserver::TBrowserLoadUrlType aUrlType ) |
|
1274 { |
|
1275 CALL_ORIG FetchL( aUrl, aUrlType ); |
|
1276 } |
|
1277 |
|
1278 // ----------------------------------------------------------------------------- |
|
1279 // CBrowserWindow::CancelFetch |
|
1280 // ----------------------------------------------------------------------------- |
|
1281 // |
|
1282 void CBrowserWindow::CancelFetch( TBool aIsUserInitiated ) |
|
1283 { |
|
1284 CALL_ORIG CancelFetch( aIsUserInitiated ); |
|
1285 } |
|
1286 |
|
1287 // ----------------------------------------------------------------------------- |
|
1288 // CBrowserWindow::SetRequestedAP |
|
1289 // ----------------------------------------------------------------------------- |
|
1290 // |
|
1291 void CBrowserWindow::SetRequestedAP( TInt aAp ) |
|
1292 { |
|
1293 CALL_ORIG SetRequestedAP( aAp ); |
|
1294 } |
|
1295 |
|
1296 // ----------------------------------------------------------------------------- |
|
1297 // CBrowserWindow::SetExitFromEmbeddedMode |
|
1298 // ----------------------------------------------------------------------------- |
|
1299 // |
|
1300 void CBrowserWindow::SetExitFromEmbeddedMode( TBool aFlag ) |
|
1301 { |
|
1302 CALL_ORIG SetExitFromEmbeddedMode( aFlag ); |
|
1303 } |
|
1304 |
|
1305 // ----------------------------------------------------------------------------- |
|
1306 // CBrowserWindow::IsProgressShown |
|
1307 // ----------------------------------------------------------------------------- |
|
1308 // |
|
1309 TBool CBrowserWindow::IsProgressShown() const |
|
1310 { |
|
1311 return CALL_ORIG IsProgressShown(); |
|
1312 } |
|
1313 |
|
1314 // ----------------------------------------------------------------------------- |
|
1315 // CBrowserWindow::SetProgressShown |
|
1316 // ----------------------------------------------------------------------------- |
|
1317 // |
|
1318 void CBrowserWindow::SetProgressShown( TBool aProgressShown ) |
|
1319 { |
|
1320 CALL_ORIG SetProgressShown( aProgressShown ); |
|
1321 } |
|
1322 |
|
1323 // ----------------------------------------------------------------------------- |
|
1324 // CBrowserWindow::StartedUp |
|
1325 // ----------------------------------------------------------------------------- |
|
1326 // |
|
1327 TBool CBrowserWindow::StartedUp() const |
|
1328 { |
|
1329 return CALL_ORIG StartedUp(); |
|
1330 } |
|
1331 |
|
1332 // ----------------------------------------------------------------------------- |
|
1333 // CBrowserWindow::RequestedAp |
|
1334 // ----------------------------------------------------------------------------- |
|
1335 // |
|
1336 TUint32 CBrowserWindow::RequestedAp() const |
|
1337 { |
|
1338 return CALL_ORIG RequestedAp(); |
|
1339 } |
|
1340 // ----------------------------------------------------------------------------- |
|
1341 // CBrowserWindow::LogAccessToRecentUrlL |
|
1342 // ----------------------------------------------------------------------------- |
|
1343 // |
|
1344 void CBrowserWindow::LogAccessToRecentUrlL( CBrCtlInterface& aBrCtlInterface) |
|
1345 { |
|
1346 CALL_ORIG LogAccessToRecentUrlL( aBrCtlInterface ); |
|
1347 } |
|
1348 |
|
1349 // ----------------------------------------------------------------------------- |
|
1350 // CBrowserWindow::LogRequestedPageToRecentUrlL |
|
1351 // ----------------------------------------------------------------------------- |
|
1352 // |
|
1353 void CBrowserWindow::LogRequestedPageToRecentUrlL( const TDesC& aUrl) |
|
1354 { |
|
1355 CALL_ORIG LogRequestedPageToRecentUrlL( aUrl ); |
|
1356 } |
|
1357 |
|
1358 // --------------------------------------------------------- |
|
1359 // CBrowserWindow::StartProgressAnimationL |
|
1360 // --------------------------------------------------------- |
|
1361 // |
|
1362 void CBrowserWindow::StartProgressAnimationL() |
|
1363 { |
|
1364 CALL_ORIG StartProgressAnimationL(); |
|
1365 } |
|
1366 |
|
1367 // --------------------------------------------------------- |
|
1368 // CBrowserWindow::StopProgressAnimationL |
|
1369 // --------------------------------------------------------- |
|
1370 // |
|
1371 void CBrowserWindow::StopProgressAnimationL() |
|
1372 { |
|
1373 CALL_ORIG StopProgressAnimationL(); |
|
1374 } |
|
1375 |
|
1376 #ifdef __RSS_FEEDS |
|
1377 // --------------------------------------------------------- |
|
1378 // CBrowserWindow::FeedsClientUtilities |
|
1379 // --------------------------------------------------------- |
|
1380 // |
|
1381 CFeedsClientUtilities& CBrowserWindow::FeedsClientUtilities() const |
|
1382 { |
|
1383 return CALL_ORIG FeedsClientUtilities(); |
|
1384 } |
|
1385 #endif // __RSS_FEEDS |
|
1386 |
|
1387 // --------------------------------------------------------- |
|
1388 // CBrowserWindow::BrowserWasLaunchedIntoFeeds |
|
1389 // --------------------------------------------------------- |
|
1390 // |
|
1391 TBool CBrowserWindow::BrowserWasLaunchedIntoFeeds() |
|
1392 { |
|
1393 return CALL_ORIG BrowserWasLaunchedIntoFeeds(); |
|
1394 } |
|
1395 |
|
1396 // --------------------------------------------------------- |
|
1397 // CBrowserWindow::SetHasWMLContent |
|
1398 // --------------------------------------------------------- |
|
1399 // |
|
1400 void CBrowserWindow::SetHasWMLContent(TBool aHasWMLContent) |
|
1401 { |
|
1402 iHasWMLContent = aHasWMLContent; |
|
1403 } |
|
1404 |
|
1405 // --------------------------------------------------------- |
|
1406 // CBrowserWindow::SetCurrWinHasWMLContent |
|
1407 // --------------------------------------------------------- |
|
1408 // |
|
1409 void CBrowserWindow::SetCurrWinHasWMLContent(TBool aCurrWinHasWMLContent) |
|
1410 { |
|
1411 iCurrWinHasWMLContent = aCurrWinHasWMLContent; |
|
1412 } |
|
1413 |
|
1414 // --------------------------------------------------------- |
|
1415 // CBrowserWindow::HasWMLContent |
|
1416 // --------------------------------------------------------- |
|
1417 // |
|
1418 TBool CBrowserWindow::HasWMLContent (TBool aCurrWinOnly) |
|
1419 { |
|
1420 if (aCurrWinOnly) |
|
1421 { |
|
1422 return iCurrWinHasWMLContent; |
|
1423 } |
|
1424 else |
|
1425 { |
|
1426 return iHasWMLContent; |
|
1427 } |
|
1428 } |
|
1429 |
|
1430 |
|
1431 // --------------------------------------------------------- |
|
1432 // CBrowserWindow::SetWMLMode |
|
1433 // --------------------------------------------------------- |
|
1434 // |
|
1435 void CBrowserWindow::SetWMLMode(TBool aWMLMode) |
|
1436 { |
|
1437 iWMLMode = aWMLMode; |
|
1438 } |
|
1439 |
|
1440 // --------------------------------------------------------- |
|
1441 // CBrowserWindow::SetFirstPage |
|
1442 // --------------------------------------------------------- |
|
1443 // |
|
1444 void CBrowserWindow::SetFirstPage(TBool aFirstPage) |
|
1445 { |
|
1446 iFirstPage = aFirstPage; |
|
1447 } |
|
1448 |
|
1449 // --------------------------------------------------------- |
|
1450 // CBrowserWindow::SetHasFeedsContent |
|
1451 // --------------------------------------------------------- |
|
1452 // |
|
1453 void CBrowserWindow::SetHasFeedsContent(TBool aHasFeedsContent) |
|
1454 { |
|
1455 iHasFeedsContent = aHasFeedsContent; |
|
1456 } |
|
1457 |
|
1458 // ----------------------------------------------------------------------------- |
|
1459 // CBrowserWindow::SetLastCBAUpdateView |
|
1460 // ----------------------------------------------------------------------------- |
|
1461 // |
|
1462 void CBrowserWindow::SetLastCBAUpdateView( TUid aView ) |
|
1463 { |
|
1464 CALL_ORIG SetLastCBAUpdateView( aView ); |
|
1465 } |
|
1466 |
|
1467 // ----------------------------------------------------------------------------- |
|
1468 // CBrowserWindow::GetLastCBAUpdateView |
|
1469 // ----------------------------------------------------------------------------- |
|
1470 // |
|
1471 TUid CBrowserWindow::GetLastCBAUpdateView() |
|
1472 { |
|
1473 return CALL_ORIG GetLastCBAUpdateView(); |
|
1474 } |
|
1475 |
|
1476 // ----------------------------------------------------------------------------- |
|
1477 // CBrowserWindow::GetPreviousViewFromViewHistory |
|
1478 // ----------------------------------------------------------------------------- |
|
1479 // |
|
1480 TUid CBrowserWindow::GetPreviousViewFromViewHistory() |
|
1481 { |
|
1482 return CALL_ORIG GetPreviousViewFromViewHistory(); |
|
1483 } |
|
1484 |
|
1485 // ----------------------------------------------------------------------------- |
|
1486 // CBrowserWindow::CalledFromAnotherApp |
|
1487 // ----------------------------------------------------------------------------- |
|
1488 // |
|
1489 TBool CBrowserWindow::CalledFromAnotherApp() |
|
1490 { |
|
1491 return CALL_ORIG CalledFromAnotherApp(); |
|
1492 } |
|
1493 |
|
1494 // ----------------------------------------------------------------------------- |
|
1495 // CBrowserWindow::SetCalledFromAnotherApp |
|
1496 // ----------------------------------------------------------------------------- |
|
1497 // |
|
1498 void CBrowserWindow::SetCalledFromAnotherApp( TBool aValue ) |
|
1499 { |
|
1500 return CALL_ORIG SetCalledFromAnotherApp( aValue ); |
|
1501 } |
|
1502 |
|
1503 // ----------------------------------------------------------------------------- |
|
1504 // CBrowserWindow::FlashPresent |
|
1505 // ----------------------------------------------------------------------------- |
|
1506 // |
|
1507 TBool CBrowserWindow::FlashPresent() |
|
1508 { |
|
1509 return CALL_ORIG FlashPresent(); |
|
1510 } |
|
1511 |
|
1512 |
|
1513 // ----------------------------------------------------------------------------- |
|
1514 // CBrowserWindow::IsLaunchHomePageDimmedL |
|
1515 // ----------------------------------------------------------------------------- |
|
1516 // |
|
1517 TBool CBrowserWindow::IsLaunchHomePageDimmedL() |
|
1518 { |
|
1519 return CALL_ORIG IsLaunchHomePageDimmedL(); |
|
1520 } |
|
1521 // ----------------------------------------------------------------------------- |
|
1522 // CBrowserWindow::IsDisplayingMenuOrDialog |
|
1523 // ----------------------------------------------------------------------------- |
|
1524 // |
|
1525 TBool CBrowserWindow::IsDisplayingMenuOrDialog() |
|
1526 { |
|
1527 return CALL_ORIG IsDisplayingMenuOrDialog(); |
|
1528 } |
|
1529 |
|
1530 #undef CALL_ORIG |
|
1531 |
|
1532 // End of file |
|