46 #include <bautils.h> |
46 #include <bautils.h> |
47 |
47 |
48 _LIT(KContentType,"text/html"); |
48 _LIT(KContentType,"text/html"); |
49 _LIT(KCsstextToRemovePathinfo,"<style>\n #APP_LAUNCH_LINK{display:none}\n</style>"); |
49 _LIT(KCsstextToRemovePathinfo,"<style>\n #APP_LAUNCH_LINK{display:none}\n</style>"); |
50 |
50 |
|
51 |
|
52 CBlankContainer::CBlankContainer() |
|
53 { |
|
54 } |
|
55 |
|
56 CBlankContainer::~CBlankContainer() |
|
57 { |
|
58 } |
|
59 |
|
60 |
|
61 void CBlankContainer::Draw( const TRect& aRect ) const |
|
62 { |
|
63 CWindowGc& gc = SystemGc(); |
|
64 TRect rect = Rect(); |
|
65 gc.Clear(rect); |
|
66 } |
|
67 |
|
68 |
51 // Standard construction sequence |
69 // Standard construction sequence |
52 CCSXHHtmlTopicContainer* CCSXHHtmlTopicContainer::NewL(const TRect& aRect,CCSXHDocument |
70 CCSXHHtmlTopicContainer* CCSXHHtmlTopicContainer::NewL(const TRect& aRect,CCSXHDocument |
53 &aDocument,CCSXHHtmlTopicView *aView) |
71 &aDocument,CCSXHHtmlTopicView *aView) |
54 { |
72 { |
55 CCSXHHtmlTopicContainer* self = CCSXHHtmlTopicContainer::NewLC(aRect,aDocument,aView); |
73 CCSXHHtmlTopicContainer* self = CCSXHHtmlTopicContainer::NewLC(aRect,aDocument,aView); |
82 iBrCtrl->SetFocus(EFalse); |
100 iBrCtrl->SetFocus(EFalse); |
83 iBrCtrl->RemoveLoadEventObserver(this); |
101 iBrCtrl->RemoveLoadEventObserver(this); |
84 delete iBrCtrl; |
102 delete iBrCtrl; |
85 iBrLibrary.Close(); |
103 iBrLibrary.Close(); |
86 } |
104 } |
87 if(iAppLauncher) |
105 |
88 { |
106 delete iAppLauncher; |
89 delete iAppLauncher; |
107 |
90 } |
108 delete iBlankContainer; |
91 } |
109 |
92 |
110 } |
93 void CCSXHHtmlTopicContainer::ConstructL(const TRect& aRect) |
111 |
|
112 void CCSXHHtmlTopicContainer::ConstructL( const TRect& aRect ) |
94 { |
113 { |
95 // Create a window for this application view |
114 // Create a window for this application view |
96 CreateWindowL(); |
115 CreateWindowL(); |
97 |
116 |
98 // Set the windows size |
117 // Set the windows size |
99 SetRect(aRect); |
118 SetRect(aRect); |
100 if(KErrNone != iBrLibrary.Load(_L("BrowserEngine.dll"))) |
119 if( KErrNone != iBrLibrary.Load( _L( "BrowserEngine.dll" ) ) ) |
101 { |
120 { |
102 HBufC* ErrorMessage = CCSXHAppUi::GetCoeEnv()->AllocReadResourceLC( |
121 HBufC* ErrorMessage = CCSXHAppUi::GetCoeEnv()->AllocReadResourceLC( |
103 R_CSHELP_RETRIEVE_NO_MEMORY_TEXT); |
122 R_CSHELP_RETRIEVE_NO_MEMORY_TEXT ); |
104 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
123 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
105 note->ShowNoteL(EAknGlobalInformationNote, *ErrorMessage); |
124 note->ShowNoteL( EAknGlobalInformationNote, *ErrorMessage ); |
106 CleanupStack::PopAndDestroy(note); |
125 CleanupStack::PopAndDestroy( note ); |
107 CleanupStack::PopAndDestroy(ErrorMessage); |
126 CleanupStack::PopAndDestroy( ErrorMessage ); |
108 iDocument.SetDisplayTopic(iDocument.GetPrevTopic()); |
127 iDocument.SetDisplayTopic( iDocument.GetPrevTopic() ); |
109 CCSXHAppUi::GetInstance()->HandleCommandL(ECSXHOpenItem); |
128 CCSXHAppUi::GetInstance()->HandleCommandL( ECSXHOpenItem ); |
110 User::Leave(KErrNoMemory); |
129 User::Leave( KErrNoMemory ); |
111 } |
130 } |
112 |
131 |
113 #ifdef __WINS__ |
132 #ifdef __WINS__ |
114 TLibraryFunction result = iBrLibrary.Lookup(10); |
133 TLibraryFunction result = iBrLibrary.Lookup( 10 ); |
115 #else |
134 #else |
116 TLibraryFunction result = iBrLibrary.Lookup(1); |
135 TLibraryFunction result = iBrLibrary.Lookup( 1 ); |
117 #endif |
136 #endif |
118 |
137 |
119 FuncPtr_CreateBrowserControlL fptr = (FuncPtr_CreateBrowserControlL)result; |
138 FuncPtr_CreateBrowserControlL fptr = ( FuncPtr_CreateBrowserControlL )result; |
120 |
139 |
121 iBrCtrl = (*fptr)( |
140 iBrCtrl = ( *fptr )( |
122 this,aRect, |
141 this,aRect, |
123 TBrCtlDefs::ECapabilityDisplayScrollBar| |
142 TBrCtlDefs::ECapabilityDisplayScrollBar| |
124 TBrCtlDefs::ECapabilityClientResolveEmbeddedURL| |
143 TBrCtlDefs::ECapabilityClientResolveEmbeddedURL| |
125 #ifndef __SERIES60_30__ |
144 #ifndef __SERIES60_30__ |
126 TBrCtlDefs::ECapabilityCursorNavigation| |
145 TBrCtlDefs::ECapabilityCursorNavigation| |
127 TBrCtlDefs::ECapabilityWebKitLite| |
146 TBrCtlDefs::ECapabilityWebKitLite| |
128 #endif |
147 #endif |
129 TBrCtlDefs::ECapabilityClientNotifyURL, |
148 TBrCtlDefs::ECapabilityClientNotifyURL, |
130 TBrCtlDefs::ECommandIdBase,this,this,NULL,this |
149 TBrCtlDefs::ECommandIdBase, this, this, NULL, this |
131 ); |
150 ); |
132 iBrCtrl->SetBrowserSettingL(TBrCtlDefs::ESettingsCSSFetchEnabled,1); |
151 iBrCtrl->SetBrowserSettingL( TBrCtlDefs::ESettingsCSSFetchEnabled, 1 ); |
133 iBrCtrl->AddLoadEventObserverL(this); |
152 iBrCtrl->AddLoadEventObserverL( this ); |
134 |
153 |
135 |
154 |
136 SetSelectedFontSizeL(iView->GetCurrentFontSize()); |
155 SetSelectedFontSizeL( iView->GetCurrentFontSize() ); |
137 iBrCtrl->MakeVisible(ETrue); |
156 iBrCtrl->MakeVisible( ETrue ); |
|
157 |
|
158 iBlankContainer = new ( ELeave ) CBlankContainer(); |
|
159 iBlankContainer->SetRect( Rect() ); |
|
160 |
|
161 ShowBrowser(); |
138 |
162 |
139 ActivateL(); |
163 ActivateL(); |
140 } |
164 } |
141 |
165 |
142 void CCSXHHtmlTopicContainer::Draw(const TRect& /*aRect*/) const |
166 void CCSXHHtmlTopicContainer::Draw(const TRect& /*aRect*/) const |
272 } |
298 } |
273 |
299 |
274 void CCSXHHtmlTopicContainer::SizeChanged() |
300 void CCSXHHtmlTopicContainer::SizeChanged() |
275 { |
301 { |
276 #ifndef __SERIES60_30__ |
302 #ifndef __SERIES60_30__ |
277 if(iBrCtrl) |
303 if( iBrCtrl ) |
278 { |
304 { |
279 if ( iContentLoading != EContentLoading ) |
305 if ( iContentLoading != EContentLoading ) |
280 { |
306 { |
281 iBrCtrl->SetRect(Rect()); |
307 iBlankContainer->SetRect( Rect() ); |
282 iBrCtrl->MakeVisible(ETrue); |
308 iBrCtrl->SetRect( Rect() ); |
|
309 iBrCtrl->MakeVisible( ETrue ); |
283 } |
310 } |
284 else |
311 else |
285 { |
312 { |
286 //Update the title bar |
313 //Update the title bar |
287 CEikStatusPane* sp = CCSXHAppUi::GetInstance()->StatusPane(); |
314 CEikStatusPane* sp = CCSXHAppUi::GetInstance()->StatusPane(); |
288 CAknTitlePane* titlePane = NULL; |
315 CAknTitlePane* titlePane = NULL; |
289 TRAPD( err, titlePane = STATIC_CAST(CAknTitlePane*, |
316 TRAPD( err, titlePane = STATIC_CAST(CAknTitlePane*, |
290 sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ) ); |
317 sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ) ); |
291 if ( KErrNone == err ) |
318 if ( KErrNone == err ) |
292 { |
319 { |
293 //If can't set Null text to title, no other good way to do further, |
320 //If can't set Null text to title, no other good way to do further, |
294 //so just ignore this leave |
321 //so just ignore this leave |
295 TRAP_IGNORE( titlePane->SetTextL( KNullDesC ) ); |
322 TRAP_IGNORE( titlePane->SetTextL( KNullDesC ) ); |
296 } |
323 } |
297 |
324 iBlankContainer->SetRect( Rect() ); |
298 iBrCtrl->SetRect(TRect(0,0,0,0)); |
325 iBrCtrl->SetRect( Rect() ); |
299 } |
326 } |
300 } |
327 } |
301 #endif |
328 #endif |
302 } |
329 } |
303 |
330 |