|
1 /* |
|
2 * Copyright (c) 2002-2007 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 * Implementation of CBrowserBookmarksGotoPane. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 |
|
23 #include <akninfrm.h> |
|
24 #include <eikedwin.h> |
|
25 #include <FavouritesLimits.h> |
|
26 |
|
27 #include <aknconsts.h> |
|
28 #include <akneditstateindicator.h> |
|
29 #include <AknsListBoxBackgroundControlContext.h> |
|
30 #include <AknsFrameBackgroundControlContext.h> |
|
31 |
|
32 #include <BrowserNG.rsg> |
|
33 #include <Avkon.mbg> |
|
34 #include <AknsUtils.h> |
|
35 #include <AppApacLayout.cdl.h> |
|
36 #include <AppLayout.cdl.h> |
|
37 #include <AknLayout.cdl.h> |
|
38 |
|
39 #include <centralrepository.h> |
|
40 #include <AknFepInternalCRKeys.h> |
|
41 #include <PtiDefs.h> |
|
42 |
|
43 #include "BrowserBookmarksGotoPane.h" |
|
44 #include "BrowserUtil.h" |
|
45 #include "commonconstants.h" |
|
46 #include "BrowserAdaptiveListPopup.h" |
|
47 #include "WmlBrowserBuild.h" //feature manager |
|
48 #include "browser.hrh" |
|
49 #include "BrowserAppUi.h" |
|
50 #include "BrowserFavouritesView.h" |
|
51 #include "Preferences.h" |
|
52 #include <Featmgr.h> |
|
53 |
|
54 #include <eikpriv.rsg> |
|
55 #include <BARSREAD.H> |
|
56 |
|
57 #include <skinlayout.cdl.h> |
|
58 using namespace SkinLayout; |
|
59 |
|
60 const TInt EUseSkinContext = 0x01; |
|
61 const TInt EParentAbsolute = 0x02; |
|
62 const TInt KRightSpace = 10; //space in pixels left at the end of text editor. |
|
63 // CONSTANTS |
|
64 |
|
65 _LIT(KAddressText,"http://www."); |
|
66 |
|
67 // ================= MEMBER FUNCTIONS ======================= |
|
68 |
|
69 // --------------------------------------------------------- |
|
70 // CBrowserBookmarksGotoPane::NewL |
|
71 // --------------------------------------------------------- |
|
72 // |
|
73 CBrowserBookmarksGotoPane* CBrowserBookmarksGotoPane::NewL |
|
74 ( const CCoeControl& aParent, CBrowserFavouritesView* aView ) |
|
75 { |
|
76 CBrowserBookmarksGotoPane* gotoPane = |
|
77 new(ELeave) CBrowserBookmarksGotoPane(aView); |
|
78 CleanupStack::PushL( gotoPane ); |
|
79 gotoPane->ConstructL( aParent ); |
|
80 CleanupStack::Pop(); // gotoPane |
|
81 return gotoPane; |
|
82 } |
|
83 |
|
84 // --------------------------------------------------------- |
|
85 // CBrowserBookmarksGotoPane::~CBrowserBookmarksGotoPane |
|
86 // --------------------------------------------------------- |
|
87 // |
|
88 CBrowserBookmarksGotoPane::~CBrowserBookmarksGotoPane() |
|
89 { |
|
90 delete iEditor; |
|
91 delete iInputFrame; |
|
92 delete iSkinContext; |
|
93 delete iInputContext; |
|
94 delete iBAdaptiveListPopup; |
|
95 } |
|
96 |
|
97 // --------------------------------------------------------- |
|
98 // CBrowserBookmarksGotoPane::BeginEditingL() |
|
99 // --------------------------------------------------------- |
|
100 // |
|
101 void CBrowserBookmarksGotoPane::BeginEditingL() |
|
102 { |
|
103 if ( !iFrozen ) |
|
104 { |
|
105 // set the default string, make visible, start editing |
|
106 SetTextL( KWWWString ); |
|
107 MakeVisible( ETrue ); |
|
108 SetEditingL( ETrue ); |
|
109 if (AknLayoutUtils::PenEnabled()) |
|
110 { |
|
111 ActivateVKB(); |
|
112 } |
|
113 } |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------- |
|
117 // CBrowserBookmarksGotoPane::CancelEditingL() |
|
118 // --------------------------------------------------------- |
|
119 // |
|
120 void CBrowserBookmarksGotoPane::CancelEditingL() |
|
121 { |
|
122 if ( !iFrozen ) |
|
123 { |
|
124 SetEditingL( EFalse ); |
|
125 |
|
126 // Cancel Adaptive List popup if its active |
|
127 if( NULL != iBAdaptiveListPopup) |
|
128 { |
|
129 iBAdaptiveListPopup->SetDirectoryModeL( ETrue ); |
|
130 iBAdaptiveListPopup->HidePopupL(); |
|
131 } |
|
132 } |
|
133 |
|
134 } |
|
135 |
|
136 // --------------------------------------------------------- |
|
137 // CBrowserBookmarksGotoPane::SetTextL |
|
138 // --------------------------------------------------------- |
|
139 // |
|
140 void CBrowserBookmarksGotoPane::SetTextL |
|
141 ( const TDesC& aText, TBool aClipToFit /*=ETrue*/, TBool aCancelEditing ) |
|
142 { |
|
143 |
|
144 CFbsFont * font = NULL; |
|
145 |
|
146 if ( !iFrozen ) |
|
147 { |
|
148 if ( aClipToFit && aText.Length() ) |
|
149 { |
|
150 // Allocate 3 chars more (make sure "..." fits). |
|
151 HBufC* buf = HBufC::NewLC( aText.Length() + 3 ); |
|
152 *buf = aText; |
|
153 TPtr ptr( buf->Des() ); |
|
154 CTextView* textView = iEditor->TextView(); |
|
155 if ( textView ) |
|
156 { |
|
157 //The Textview does not use the iConEnv->NormalFont() for drawing so we can not use it for measurement. |
|
158 //Textview uses the default char format font for drawing. See bug: EHCN-6U59SN |
|
159 TBuf<KMaxTypefaceNameLength> typeface; |
|
160 CEikonEnv::Static()->ReadResource(typeface,R_EIK_DEFAULT_CHAR_FORMAT_TYPEFACE); |
|
161 TResourceReader reader; |
|
162 CEikonEnv::Static()->CreateResourceReaderLC(reader,R_EIK_DEFAULT_CHAR_FORMAT_HEIGHT); |
|
163 TInt height = reader.ReadInt16(); |
|
164 CleanupStack::PopAndDestroy(); // reader |
|
165 |
|
166 TFontSpec fontSpec(typeface, height); |
|
167 CEikonEnv::Static()->ScreenDevice()->GetNearestFontInTwips((CFont*&)font, fontSpec); |
|
168 |
|
169 AknTextUtils::ClipToFit |
|
170 ( |
|
171 ptr, |
|
172 *font, |
|
173 textView->ViewRect().Width() - KRightSpace |
|
174 ); |
|
175 } |
|
176 iEditor->SetTextL( &ptr ); |
|
177 CleanupStack::PopAndDestroy(); // buf |
|
178 } |
|
179 else |
|
180 { |
|
181 if ( aText.Length() ) |
|
182 { |
|
183 iEditor->SetTextL( &aText ); |
|
184 } |
|
185 else |
|
186 { |
|
187 TBufC<16> buf(KAddressText); |
|
188 HBufC* tmpBuf = NULL; |
|
189 tmpBuf = buf.AllocLC(); |
|
190 iEditor->SetTextL( tmpBuf ); |
|
191 CleanupStack::PopAndDestroy(); // tmpBuf |
|
192 } |
|
193 } |
|
194 |
|
195 iEditor->SetCursorPosL( iEditor->TextLength(), EFalse ); |
|
196 if ( !iEverFocused ) |
|
197 { |
|
198 iEditor->SetFocus( ETrue ); |
|
199 } |
|
200 |
|
201 if ( !iEverFocused ) |
|
202 { |
|
203 iEditor->SetFocus( IsFocused() ); |
|
204 iEverFocused = ETrue; |
|
205 } |
|
206 SetEditingL( !aCancelEditing ); |
|
207 DrawDeferred(); |
|
208 } |
|
209 |
|
210 // release font if it was used |
|
211 if(font != NULL) |
|
212 { |
|
213 CEikonEnv::Static()->ScreenDevice()->ReleaseFont(font); |
|
214 } |
|
215 |
|
216 } |
|
217 |
|
218 // --------------------------------------------------------- |
|
219 // CBrowserBookmarksGotoPane::GetTextL |
|
220 // --------------------------------------------------------- |
|
221 // |
|
222 HBufC* CBrowserBookmarksGotoPane::GetTextL() |
|
223 { |
|
224 HBufC* text = HBufC::NewL( iEditor->TextLength() + 1 ); |
|
225 TPtr ptr = text->Des(); |
|
226 iEditor->GetText( ptr ); |
|
227 ptr.ZeroTerminate(); |
|
228 |
|
229 Util::EncodeSpaces(text); |
|
230 |
|
231 return text; |
|
232 } |
|
233 |
|
234 // --------------------------------------------------------- |
|
235 // CBrowserBookmarksGotoPane::SetObserver |
|
236 // --------------------------------------------------------- |
|
237 // |
|
238 void CBrowserBookmarksGotoPane::SetGPObserver |
|
239 ( MBookmarksGotoPaneObserver* aObserver ) |
|
240 { |
|
241 __ASSERT_DEBUG( !iGPObserver, \ |
|
242 Util::Panic( Util::EGotoPaneObserverAlreadySet ) ); |
|
243 iGPObserver = aObserver; |
|
244 } |
|
245 |
|
246 // --------------------------------------------------------- |
|
247 // CBrowserBookmarksGotoPane::SetLineState |
|
248 // --------------------------------------------------------- |
|
249 // |
|
250 void CBrowserBookmarksGotoPane::SetLineState( TBool aLineVisible ) |
|
251 { |
|
252 iInputFrame->SetLineState( aLineVisible ); |
|
253 } |
|
254 |
|
255 // --------------------------------------------------------- |
|
256 // CBrowserBookmarksGotoPane::OfferKeyEventL |
|
257 // --------------------------------------------------------- |
|
258 // |
|
259 TKeyResponse CBrowserBookmarksGotoPane::OfferKeyEventL |
|
260 ( const TKeyEvent& aKeyEvent, TEventCode aType ) |
|
261 { |
|
262 TKeyResponse response = EKeyWasNotConsumed; |
|
263 TChar iInputChar = TChar( aKeyEvent.iScanCode ); |
|
264 |
|
265 |
|
266 if ( iBAdaptiveListPopup ) |
|
267 { |
|
268 response = iBAdaptiveListPopup->OfferKeyEventL( aKeyEvent, aType ); |
|
269 } |
|
270 |
|
271 if ( iEditing && response != EKeyWasConsumed) |
|
272 { |
|
273 // Editing; most keys simply forwarded to the editor. |
|
274 switch ( aKeyEvent.iCode ) |
|
275 { |
|
276 case EKeyOK: |
|
277 { |
|
278 // MSK is now handled through HandleCommand in BrowserBookmarksView |
|
279 response = EKeyWasConsumed; |
|
280 break; |
|
281 } |
|
282 case EKeyEnter: |
|
283 // Handle EnterKey as "GOTO" for Touch, VKB's enter key |
|
284 if( AknLayoutUtils::PenEnabled() ) |
|
285 { |
|
286 CBrowserAppUi::Static()->ActiveView()->HandleCommandL(EWmlCmdGotoPaneGoTo); |
|
287 break; |
|
288 } |
|
289 // FALL through to default in case Pen is not enabled. |
|
290 default: |
|
291 { |
|
292 response = iEditor->OfferKeyEventL(aKeyEvent, aType ); |
|
293 break; |
|
294 } |
|
295 } |
|
296 |
|
297 // Force key event to be consumed if you're editing |
|
298 // regardless of what's happened to it. |
|
299 // |
|
300 // This forces user to press cancel to continue other tasks |
|
301 response = EKeyWasConsumed; |
|
302 } |
|
303 else if ( response != EKeyWasConsumed ) |
|
304 { |
|
305 |
|
306 if ( (aKeyEvent.iScanCode == EStdKeyHash) || |
|
307 ( aKeyEvent.iModifiers & |
|
308 ( EModifierShift | EModifierLeftShift | EModifierRightShift | |
|
309 EModifierCtrl | EModifierLeftCtrl | EModifierRightCtrl ) ) ) |
|
310 { |
|
311 |
|
312 // Hash key press will be used for Mark/UnMark functionality |
|
313 // Let Platform Listbox handle this. |
|
314 response = EKeyWasNotConsumed; |
|
315 } |
|
316 |
|
317 // |
|
318 // Not currently editing the GoTo pane. |
|
319 // Catch alpha and numeric to pop |
|
320 // up goto pane |
|
321 // |
|
322 // Only popup the GoTo Pane with a KeyDown event. |
|
323 // Otherwise, if browser is pushed to the backround (but still active) |
|
324 // in favor of the App Shell, A long "0" press will reactivate the browser and |
|
325 // leave a KeyUp to (wrongly) pop the pane up |
|
326 // |
|
327 // Note that we exclude Unicode 0xC4 and 0xC5 which |
|
328 // are defined by EStdkeyYes and EStdkeyNo. These |
|
329 // map to the Send and End keys respectively. Normally, |
|
330 // 0xC4 and 0xC5 can be considered alpha digits, but we exclude them so that |
|
331 // they will not pop the goto pane |
|
332 // |
|
333 // key event is generated again (to channel through FEP) |
|
334 // |
|
335 else if ( !iFrozen && |
|
336 aType == EEventKeyDown && |
|
337 iInputChar.IsAlphaDigit() && |
|
338 iInputChar != EStdKeyYes && |
|
339 iInputChar != EStdKeyNo) |
|
340 { |
|
341 // These keys activate the Goto Pane. |
|
342 response = EKeyWasConsumed; |
|
343 |
|
344 BeginEditingL(); |
|
345 |
|
346 iEditor->SetCursorPosL( iEditor->TextLength(), EFalse ); |
|
347 iCoeEnv->SyncNotifyFocusObserversOfChangeInFocus(); |
|
348 iCoeEnv->SimulateKeyEventL( aKeyEvent, aType ); |
|
349 |
|
350 } |
|
351 else |
|
352 { |
|
353 // Other keys do not activate the Goto Pane. |
|
354 response = EKeyWasNotConsumed; |
|
355 } |
|
356 } |
|
357 return response; |
|
358 } |
|
359 |
|
360 // --------------------------------------------------------- |
|
361 // CBrowserBookmarksGotoPane::CountComponentControls |
|
362 // --------------------------------------------------------- |
|
363 // |
|
364 TInt CBrowserBookmarksGotoPane::CountComponentControls() const |
|
365 { |
|
366 return 2; |
|
367 } |
|
368 |
|
369 // --------------------------------------------------------- |
|
370 // CBrowserBookmarksGotoPane::ComponentControl |
|
371 // --------------------------------------------------------- |
|
372 // |
|
373 CCoeControl* CBrowserBookmarksGotoPane::ComponentControl |
|
374 ( TInt aIndex ) const |
|
375 { |
|
376 switch ( aIndex ) |
|
377 { |
|
378 case 0: |
|
379 { |
|
380 return iInputFrame; |
|
381 } |
|
382 |
|
383 case 1: |
|
384 { |
|
385 return iEditor; |
|
386 } |
|
387 |
|
388 default: |
|
389 { |
|
390 return NULL; |
|
391 } |
|
392 } |
|
393 } |
|
394 |
|
395 // --------------------------------------------------------- |
|
396 // CBrowserBookmarksGotoPane::FocusChanged |
|
397 // --------------------------------------------------------- |
|
398 // |
|
399 void CBrowserBookmarksGotoPane::FocusChanged( TDrawNow aDrawNow ) |
|
400 { |
|
401 iEditor->SetFocus( IsFocused(), aDrawNow ); |
|
402 } |
|
403 |
|
404 // --------------------------------------------------------- |
|
405 // CBrowserBookmarksGotoPane::CBrowserBookmarksGotoPane |
|
406 // --------------------------------------------------------- |
|
407 // |
|
408 CBrowserBookmarksGotoPane::CBrowserBookmarksGotoPane(CBrowserFavouritesView* aView) |
|
409 : iView(aView), iEditing( EFalse ), iFrozen( EFalse ) |
|
410 { |
|
411 } |
|
412 |
|
413 // --------------------------------------------------------- |
|
414 // CBrowserBookmarksGotoPane::ConstructL |
|
415 // --------------------------------------------------------- |
|
416 // |
|
417 void CBrowserBookmarksGotoPane::ConstructL |
|
418 ( const CCoeControl& aParent ) |
|
419 { |
|
420 SetContainerWindowL( aParent ); // This is now non-window owning control |
|
421 SetMopParent(const_cast<CCoeControl*>(&aParent)); |
|
422 iEditor = new (ELeave) CEikEdwin; |
|
423 iInputFrame = CAknInputFrame::NewL( iEditor, EFalse, KAvkonBitmapFile, |
|
424 EMbmAvkonQgn_indi_find_goto, |
|
425 EMbmAvkonQgn_indi_find_goto_mask, |
|
426 0 ); |
|
427 iInputFrame->SetContainerWindowL( *this ); |
|
428 iEditor->SetContainerWindowL( *this ); |
|
429 AknEditUtils::ConstructEditingL(iEditor, KFavouritesMaxUrlGotoPaneDefine, 1, EAknEditorCharactersLowerCase, EAknEditorAlignRight, EFalse, ETrue, EFalse); |
|
430 iEditor->AddFlagToUserFlags( CEikEdwin::EAlwaysShowSelection ); |
|
431 iEditor->SetBorder( TGulBorder::ENone ); |
|
432 iEditor->SetAknEditorCase( EAknEditorLowerCase ); |
|
433 iEditor->SetAknEditorInputMode( EAknEditorTextInputMode ); |
|
434 iEditor->SetSkinBackgroundControlContextL(NULL); |
|
435 if (AVKONAPAC) |
|
436 { |
|
437 // Disallow chinese input. |
|
438 iEditor->SetAknEditorAllowedInputModes( EAknEditorTextInputMode | EAknEditorNumericInputMode ); |
|
439 } |
|
440 |
|
441 TInt editorFlags( EAknEditorFlagLatinInputModesOnly | EAknEditorFlagUseSCTNumericCharmap ); |
|
442 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
443 TInt physicalKeyboards = 0; |
|
444 CRepository* aknFepRepository = CRepository::NewL( KCRUidAknFep ); |
|
445 User::LeaveIfNull( aknFepRepository ); |
|
446 |
|
447 aknFepRepository->Get( KAknFepPhysicalKeyboards, physicalKeyboards ); |
|
448 delete aknFepRepository; |
|
449 |
|
450 if ( physicalKeyboards && EPtiKeyboardQwerty3x11 ) { |
|
451 editorFlags = (editorFlags | EAknEditorFlagNoT9); |
|
452 } |
|
453 #endif |
|
454 iEditor->SetAknEditorFlags( editorFlags ); |
|
455 |
|
456 |
|
457 iEditor->SetAknEditorPermittedCaseModes( EAknEditorUpperCase | EAknEditorLowerCase ); |
|
458 |
|
459 iEditor->CreateTextViewL(); |
|
460 SetupSkinContextL(); |
|
461 iEditing = EFalse; |
|
462 //adaptive popuplist |
|
463 iBAdaptiveListPopup = NULL; |
|
464 if( AUTOCOMP ) //ask the feature manager |
|
465 { |
|
466 iBAdaptiveListPopup= new (ELeave) CBrowserAdaptiveListPopup( |
|
467 iEditor, this, EBookmarksGotoPane); |
|
468 iBAdaptiveListPopup->ConstructL(); |
|
469 iEditor->SetObserver( iBAdaptiveListPopup ); |
|
470 if (iView) |
|
471 { |
|
472 iBAdaptiveListPopup->SetUrlSuffixList(iView->ApiProvider().Preferences().URLSuffixList()); |
|
473 iBAdaptiveListPopup->SetMaxRecentUrls(iView->ApiProvider().Preferences().MaxRecentUrls()); |
|
474 } |
|
475 } |
|
476 |
|
477 ActivateL(); |
|
478 MakeVisible( EFalse ); |
|
479 } |
|
480 |
|
481 // --------------------------------------------------------- |
|
482 // CBrowserBookmarksGotoPane::SizeChanged |
|
483 // --------------------------------------------------------- |
|
484 // |
|
485 void CBrowserBookmarksGotoPane::SizeChanged() |
|
486 { |
|
487 TAknLayoutRect layoutRectTemp; |
|
488 TAknWindowLineLayout windowLayoutTmp, windowLayoutTmp2; |
|
489 |
|
490 windowLayoutTmp = AknLayout::Find_pane_elements_Line_4(); |
|
491 windowLayoutTmp2 = windowLayoutTmp; |
|
492 layoutRectTemp.LayoutRect( Rect(), windowLayoutTmp2 ); |
|
493 iEditor->SetRect( layoutRectTemp.Rect() ); |
|
494 iInputFrame->SetRect( Rect() ); |
|
495 TRAP_IGNORE(SetupSkinContextL()); |
|
496 } |
|
497 |
|
498 // --------------------------------------------------------- |
|
499 // CBrowserBookmarksGotoPane::SetEditingL |
|
500 // --------------------------------------------------------- |
|
501 // |
|
502 void CBrowserBookmarksGotoPane::SetEditingL( TBool aEditing ) |
|
503 { |
|
504 if ( aEditing != iEditing ) |
|
505 { |
|
506 iEditing = aEditing; |
|
507 SetFocus( iEditing ); |
|
508 if ( iGPObserver ) |
|
509 { |
|
510 iGPObserver->HandleBookmarksGotoPaneEventL |
|
511 ( |
|
512 this, |
|
513 MBookmarksGotoPaneObserver::EEventEditingModeChanged |
|
514 ); |
|
515 } |
|
516 } |
|
517 } |
|
518 |
|
519 // --------------------------------------------------------- |
|
520 // CBrowserBookmarksGotoPane::PopupList |
|
521 // --------------------------------------------------------- |
|
522 // |
|
523 CBrowserAdaptiveListPopup* CBrowserBookmarksGotoPane::PopupList() |
|
524 { |
|
525 return iBAdaptiveListPopup; |
|
526 } |
|
527 |
|
528 // --------------------------------------------------------- |
|
529 // CBrowserBookmarksGotoPane::HandleResourceChange |
|
530 // --------------------------------------------------------- |
|
531 // |
|
532 void CBrowserBookmarksGotoPane::HandleResourceChange( |
|
533 TInt aType |
|
534 ) |
|
535 { |
|
536 CCoeControl::HandleResourceChange( aType ); |
|
537 |
|
538 if( iBAdaptiveListPopup ) |
|
539 { |
|
540 iBAdaptiveListPopup->HandleResourceChange( aType ); |
|
541 } |
|
542 } |
|
543 |
|
544 // --------------------------------------------------------- |
|
545 // CBrowserBookmarksGotoPane::MopSupplyObject |
|
546 // --------------------------------------------------------- |
|
547 // |
|
548 TTypeUid::Ptr CBrowserBookmarksGotoPane::MopSupplyObject( TTypeUid aId ) |
|
549 { |
|
550 return MAknsControlContext::SupplyMopObject( aId, iSkinContext ); |
|
551 } |
|
552 |
|
553 // ---------------------------------------------------------------------------- |
|
554 // CBrowserBookmarksGotoPane::Editor |
|
555 // ---------------------------------------------------------------------------- |
|
556 CEikEdwin* CBrowserBookmarksGotoPane::Editor() const |
|
557 { |
|
558 return iEditor; |
|
559 } |
|
560 |
|
561 // ---------------------------------------------------------------------------- |
|
562 // CBrowserBookmarksGotoPane::HandlePointerEventL |
|
563 // ---------------------------------------------------------------------------- |
|
564 // |
|
565 void CBrowserBookmarksGotoPane::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
566 { |
|
567 if (AknLayoutUtils::PenEnabled()) |
|
568 { |
|
569 if(iEditor && Rect().Contains(aPointerEvent.iPosition)) |
|
570 { |
|
571 iEditor->HandlePointerEventL(aPointerEvent); |
|
572 if ( !iEditing ) |
|
573 { |
|
574 SetEditingL( ETrue ); |
|
575 iCoeEnv->SyncNotifyFocusObserversOfChangeInFocus(); |
|
576 CBrowserAppUi::Static()->UpdateCbaL(); |
|
577 } |
|
578 } |
|
579 else |
|
580 { |
|
581 // pointer outside of control |
|
582 CBrowserAppUi::Static()->ActiveView()->HandleCommandL(EWmlCmdGotoPaneCancel); |
|
583 } |
|
584 } |
|
585 } |
|
586 // ---------------------------------------------------------------------------- |
|
587 // CBrowserBookmarksGotoPane::SetupSkinContextL |
|
588 // ---------------------------------------------------------------------------- |
|
589 void CBrowserBookmarksGotoPane::SetupSkinContextL() |
|
590 { |
|
591 TAknsItemID tileIID = KAknsIIDQsnBgColumnA; |
|
592 |
|
593 TAknWindowLineLayout tile = |
|
594 Column_background_and_list_slice_skin_placing_Line_2(); |
|
595 |
|
596 TAknLayoutRect mainPane; |
|
597 mainPane.LayoutRect( |
|
598 iAvkonAppUi->ApplicationRect(), |
|
599 AKN_LAYOUT_WINDOW_main_pane( iAvkonAppUi->ApplicationRect(), |
|
600 0, 0, 1) ); |
|
601 TAknLayoutRect listRect; |
|
602 listRect.LayoutRect( mainPane.Rect(), AknLayout::list_gen_pane(0) ); |
|
603 |
|
604 TAknLayoutRect tileRect; |
|
605 tileRect.LayoutRect(mainPane.Rect(), tile); |
|
606 |
|
607 if ( !iSkinContext ) |
|
608 { |
|
609 iSkinContext = CAknsListBoxBackgroundControlContext::NewL( |
|
610 KAknsIIDQsnBgAreaMainListGene, |
|
611 listRect.Rect(), |
|
612 EUseSkinContext & EParentAbsolute, |
|
613 tileIID, |
|
614 tileRect.Rect() ); |
|
615 } |
|
616 else |
|
617 { |
|
618 iSkinContext->SetRect( listRect.Rect() ); |
|
619 } |
|
620 |
|
621 |
|
622 if ( !iInputContext ) |
|
623 { |
|
624 iInputContext = CAknsFrameBackgroundControlContext::NewL( |
|
625 KAknsIIDQsnFrInput, TRect(0,0,0,0),TRect(0,0,0,0),EFalse ); |
|
626 } |
|
627 |
|
628 iInputFrame->SetInputContext(iInputContext); |
|
629 iEditor->SetSkinBackgroundControlContextL(iInputContext); |
|
630 |
|
631 } |
|
632 |
|
633 // ---------------------------------------------------------------------------- |
|
634 // CBrowserBookmarksGotoPane::ActivateVKB |
|
635 // ---------------------------------------------------------------------------- |
|
636 void CBrowserBookmarksGotoPane::ActivateVKB() |
|
637 { |
|
638 if (iEditor && iEditor->TextView()) |
|
639 { |
|
640 // make sure observer is set |
|
641 iCoeEnv->SyncNotifyFocusObserversOfChangeInFocus(); |
|
642 |
|
643 // simulate pointer event to force VKB |
|
644 |
|
645 // first get point at cursor location |
|
646 TInt pos = iEditor->CursorPos(); |
|
647 CTextView* textView = iEditor->TextView(); |
|
648 TPoint curPos; |
|
649 textView->DocPosToXyPosL(pos, curPos); |
|
650 |
|
651 TPointerEvent pe; |
|
652 pe.iPosition = curPos; |
|
653 |
|
654 pe.iType = TPointerEvent::EButton1Down; |
|
655 iEditor->HandlePointerEventL(pe); |
|
656 |
|
657 // VKB will only activate is nothing selected |
|
658 iEditor->SetSelectionL(pos,pos); |
|
659 |
|
660 pe.iType = TPointerEvent::EButton1Up; |
|
661 iEditor->HandlePointerEventL(pe); |
|
662 } |
|
663 } |
|
664 |
|
665 // End of File |