📄 _web_client_container_8cpp-source.html
字号:
<a name="l00280"></a>00280 iStatusWindow->SetFocus( ETrue );<a name="l00281"></a>00281 iHeaderWindow->SetFocus( EFalse );<a name="l00282"></a>00282 iSourceWindow->SetFocus( EFalse );<a name="l00283"></a>00283 iStatusWindow->MoveCursorL( TCursorPosition::EFNoMovement, EFalse );<a name="l00284"></a>00284 }<a name="l00285"></a>00285 <span class="keywordflow">break</span>;<a name="l00286"></a>00286 <span class="keywordflow">default</span>:<a name="l00287"></a>00287 <span class="keywordflow">break</span>;<a name="l00288"></a>00288 }<a name="l00289"></a>00289 }<a name="l00290"></a>00290 <a name="l00291"></a>00291 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00292"></a>00292 <span class="comment">// CWebClientContainer::OfferKeyEventL()</span><a name="l00293"></a>00293 <span class="comment">// Handles key events.</span><a name="l00294"></a>00294 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00295"></a>00295 <span class="comment">//</span><a name="l00296"></a><a class="code" href="class_c_web_client_container.html#6775621e6d3ce05d6685555c939c7706">00296</a> TKeyResponse <a class="code" href="class_c_web_client_container.html#6775621e6d3ce05d6685555c939c7706">CWebClientContainer::OfferKeyEventL</a>( <span class="keyword">const</span> TKeyEvent& aKeyEvent, <a name="l00297"></a>00297 TEventCode aType )<a name="l00298"></a>00298 {<a name="l00299"></a>00299 <span class="comment">// Redirect keyevents to controls</span><a name="l00300"></a>00300 <span class="keywordflow">if</span> ( <a class="code" href="class_c_web_client_container.html#ef4ea4ea92b98ddbacf568487ecb9f91">iHeaderWindow</a> ) <a name="l00301"></a>00301 {<a name="l00302"></a>00302 <span class="keywordflow">if</span> ( <a class="code" href="class_c_web_client_container.html#ef4ea4ea92b98ddbacf568487ecb9f91">iHeaderWindow</a>->IsFocused() )<a name="l00303"></a>00303 <span class="keywordflow">return</span> <a class="code" href="class_c_web_client_container.html#ef4ea4ea92b98ddbacf568487ecb9f91">iHeaderWindow</a>->OfferKeyEventL( aKeyEvent, aType );<a name="l00304"></a>00304 }<a name="l00305"></a>00305 <a name="l00306"></a>00306 <span class="keywordflow">if</span> ( <a class="code" href="class_c_web_client_container.html#8bc3b8bb8475ad9a1a952be25bd57ea1">iSourceWindow</a> ) <a name="l00307"></a>00307 {<a name="l00308"></a>00308 <span class="keywordflow">if</span> ( <a class="code" href="class_c_web_client_container.html#8bc3b8bb8475ad9a1a952be25bd57ea1">iSourceWindow</a>->IsFocused() )<a name="l00309"></a>00309 <span class="keywordflow">return</span> <a class="code" href="class_c_web_client_container.html#8bc3b8bb8475ad9a1a952be25bd57ea1">iSourceWindow</a>->OfferKeyEventL( aKeyEvent, aType );<a name="l00310"></a>00310 }<a name="l00311"></a>00311 <a name="l00312"></a>00312 <span class="keywordflow">if</span> ( <a class="code" href="class_c_web_client_container.html#adbca40542e9a219b97bd69dd93cb9d8">iStatusWindow</a> ) <a name="l00313"></a>00313 {<a name="l00314"></a>00314 <span class="keywordflow">if</span> ( <a class="code" href="class_c_web_client_container.html#adbca40542e9a219b97bd69dd93cb9d8">iStatusWindow</a>->IsFocused() )<a name="l00315"></a>00315 <span class="keywordflow">return</span> <a class="code" href="class_c_web_client_container.html#adbca40542e9a219b97bd69dd93cb9d8">iStatusWindow</a>->OfferKeyEventL( aKeyEvent, aType );<a name="l00316"></a>00316 }<a name="l00317"></a>00317 <a name="l00318"></a>00318 <span class="keywordflow">return</span> EKeyWasNotConsumed;<a name="l00319"></a>00319 }<a name="l00320"></a>00320 <a name="l00321"></a>00321 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00322"></a>00322 <span class="comment">// CWebClientContainer::AddToHeaderWindowL()</span><a name="l00323"></a>00323 <span class="comment">// Add a single line of text to the header window.</span><a name="l00324"></a>00324 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00325"></a>00325 <span class="comment">//</span><a name="l00326"></a><a class="code" href="class_c_web_client_container.html#1fa60f7d49cb132d83edc6236672fdc2">00326</a> <span class="keywordtype">void</span> <a class="code" href="class_c_web_client_container.html#1fa60f7d49cb132d83edc6236672fdc2">CWebClientContainer::AddToHeaderWindowL</a>( <span class="keyword">const</span> TDesC& aText )<a name="l00327"></a>00327 {<a name="l00328"></a>00328 <span class="comment">// Append aText to header window with line break</span><a name="l00329"></a>00329 CRichText* text = <a class="code" href="class_c_web_client_container.html#ef4ea4ea92b98ddbacf568487ecb9f91">iHeaderWindow</a>->RichText();<a name="l00330"></a>00330 text->InsertL( text->DocumentLength(), aText );<a name="l00331"></a>00331 text->InsertL( text->DocumentLength(), CEditableText::ELineBreak );<a name="l00332"></a>00332 <a class="code" href="class_c_web_client_container.html#ef4ea4ea92b98ddbacf568487ecb9f91">iHeaderWindow</a>->HandleTextChangedL();<a name="l00333"></a>00333 }<a name="l00334"></a>00334 <a name="l00335"></a>00335 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00336"></a>00336 <span class="comment">// CWebClientContainer::AddToSourceWindowL()</span><a name="l00337"></a>00337 <span class="comment">// Add text to Sourcewindow. No formatting is provided.</span><a name="l00338"></a>00338 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00339"></a>00339 <span class="comment">//</span><a name="l00340"></a><a class="code" href="class_c_web_client_container.html#b802399592b063745de465c090ec8607">00340</a> <span class="keywordtype">void</span> <a class="code" href="class_c_web_client_container.html#b802399592b063745de465c090ec8607">CWebClientContainer::AddToSourceWindowL</a>( <span class="keyword">const</span> TDesC8& aText )<a name="l00341"></a>00341 {<a name="l00342"></a>00342 <span class="comment">// Convert 8-bit aText to 16-bit and append it to end of Source window</span><a name="l00343"></a>00343 HBufC* tempBuf = HBufC::NewL( aText.Length() );<a name="l00344"></a>00344 CleanupStack::PushL( tempBuf );<a name="l00345"></a>00345 tempBuf->Des().Copy( aText );<a name="l00346"></a>00346 CRichText* text = <a class="code" href="class_c_web_client_container.html#8bc3b8bb8475ad9a1a952be25bd57ea1">iSourceWindow</a>->RichText();<a name="l00347"></a>00347 text->InsertL( text->DocumentLength(), *tempBuf );<a name="l00348"></a>00348 <a class="code" href="class_c_web_client_container.html#8bc3b8bb8475ad9a1a952be25bd57ea1">iSourceWindow</a>->HandleTextChangedL();<a name="l00349"></a>00349 CleanupStack::PopAndDestroy( tempBuf );<a name="l00350"></a>00350 }<a name="l00351"></a>00351 <a name="l00352"></a>00352 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00353"></a>00353 <span class="comment">// CWebClientContainer::AddToStatusWindowL()</span><a name="l00354"></a>00354 <span class="comment">// Add a single line of text to the status window.</span><a name="l00355"></a>00355 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00356"></a>00356 <span class="comment">//</span><a name="l00357"></a><a class="code" href="class_c_web_client_container.html#69ab1b585a2487fa4c6b00d4fbac92fe">00357</a> <span class="keywordtype">void</span> <a class="code" href="class_c_web_client_container.html#69ab1b585a2487fa4c6b00d4fbac92fe">CWebClientContainer::AddToStatusWindowL</a>( <span class="keyword">const</span> TDesC& aText )<a name="l00358"></a>00358 {<a name="l00359"></a>00359 <span class="comment">// Append aText to status window with line break</span><a name="l00360"></a>00360 CRichText* text = <a class="code" href="class_c_web_client_container.html#adbca40542e9a219b97bd69dd93cb9d8">iStatusWindow</a>->RichText();<a name="l00361"></a>00361 text->InsertL( text->DocumentLength(), aText );<a name="l00362"></a>00362 text->InsertL( text->DocumentLength(), CEditableText::ELineBreak );<a name="l00363"></a>00363 <a class="code" href="class_c_web_client_container.html#adbca40542e9a219b97bd69dd93cb9d8">iStatusWindow</a>->HandleTextChangedL();<a name="l00364"></a>00364 <a class="code" href="class_c_web_client_container.html#adbca40542e9a219b97bd69dd93cb9d8">iStatusWindow</a>->MoveCursorL( TCursorPosition::EFLineDown, EFalse );<a name="l00365"></a>00365 }<a name="l00366"></a>00366 <a name="l00367"></a>00367 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00368"></a>00368 <span class="comment">// CWebClientContainer::ClientEvent()</span><a name="l00369"></a>00369 <span class="comment">// Called by CWebClientEngine to notify events to user</span><a name="l00370"></a>00370 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00371"></a>00371 <span class="comment">//</span><a name="l00372"></a><a class="code" href="class_c_web_client_container.html#bb15cfcc42cfccd15b6a500010ed0691">00372</a> <span class="keywordtype">void</span> <a class="code" href="class_c_web_client_container.html#bb15cfcc42cfccd15b6a500010ed0691">CWebClientContainer::ClientEvent</a>( <span class="keyword">const</span> TDesC& aEventDescription )<a name="l00373"></a>00373 {<a name="l00374"></a>00374 TRAPD( err, <a class="code" href="class_c_web_client_container.html#69ab1b585a2487fa4c6b00d4fbac92fe">AddToStatusWindowL</a>( aEventDescription ));<a name="l00375"></a>00375 <span class="keywordflow">if</span>( err )<a name="l00376"></a>00376 Panic( EClientView );<a name="l00377"></a>00377 }<a name="l00378"></a>00378 <a name="l00379"></a>00379 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00380"></a>00380 <span class="comment">// CWebClientContainer::ClientHeaderReceived()</span><a name="l00381"></a>00381 <span class="comment">// Called by CWebClientEngine when HTTP header received</span><a name="l00382"></a>00382 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00383"></a>00383 <span class="comment">//</span><a name="l00384"></a><a class="code" href="class_c_web_client_container.html#952f58b3b079847c51533ccdf2f7ddc1">00384</a> <span class="keywordtype">void</span> <a class="code" href="class_c_web_client_container.html#952f58b3b079847c51533ccdf2f7ddc1">CWebClientContainer::ClientHeaderReceived</a>( <span class="keyword">const</span> TDesC& aHeaderData ) <a name="l00385"></a>00385 {<a name="l00386"></a>00386 TRAPD( err, <a class="code" href="class_c_web_client_container.html#1fa60f7d49cb132d83edc6236672fdc2">AddToHeaderWindowL</a>( aHeaderData ));<a name="l00387"></a>00387 <span class="keywordflow">if</span>( err )<a name="l00388"></a>00388 Panic( EClientView );<a name="l00389"></a>00389 }<a name="l00390"></a>00390 <a name="l00391"></a>00391 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00392"></a>00392 <span class="comment">// CWebClientContainer::ClientBodyReceived()</span><a name="l00393"></a>00393 <span class="comment">// Called by CWebClientEngine when part of response body received</span><a name="l00394"></a>00394 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00395"></a>00395 <span class="comment">//</span><a name="l00396"></a><a class="code" href="class_c_web_client_container.html#0b7e6843d5fd6c0f212380e90dc47302">00396</a> <span class="keywordtype">void</span> <a class="code" href="class_c_web_client_container.html#0b7e6843d5fd6c0f212380e90dc47302">CWebClientContainer::ClientBodyReceived</a>( <span class="keyword">const</span> TDesC8& aBodyData ) <a name="l00397"></a>00397 {<a name="l00398"></a>00398 TRAPD( err, <a class="code" href="class_c_web_client_container.html#b802399592b063745de465c090ec8607">AddToSourceWindowL</a>( aBodyData ));<a name="l00399"></a>00399 <span class="keywordflow">if</span>( err )<a name="l00400"></a>00400 Panic( EClientView );<a name="l00401"></a>00401 }</pre></div><hr><table x-use-null-cells style="x-cell-content-align: top; width: 100%; border-spacing: 0px; border-spacing: 0px;" cellspacing=0 width=100%> <col style="width: 50%;"> <col style="width: 50%;"> <tr style="x-cell-content-align: top;" valign=top> <td style="width: 50%; padding-right: 10px; padding-left: 10px; border-right-style: None; border-left-style: None; border-top-style: None; border-bottom-style: None;" width=50%> <p style="font-family: Arial;"><small style="font-size: smaller;">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -