255 // CBrowserGotoPane::HandleFindSizeChanged |
298 // CBrowserGotoPane::HandleFindSizeChanged |
256 // --------------------------------------------------------------------------- |
299 // --------------------------------------------------------------------------- |
257 // |
300 // |
258 void CBrowserGotoPane::HandleFindSizeChanged() |
301 void CBrowserGotoPane::HandleFindSizeChanged() |
259 { |
302 { |
260 |
|
261 if ( !AknLayoutUtils::PenEnabled() ) |
303 if ( !AknLayoutUtils::PenEnabled() ) |
262 { |
304 { |
263 TRect parentrect = iAvkonAppUi->ApplicationRect(); |
305 if ( iSearchEditor && !iFindKeywordMode) |
264 |
306 { |
265 TAknLayoutRect lrect; |
307 TRect clientRect = CBrowserAppUi::Static()->ClientRect(); |
266 lrect.LayoutRect( parentrect, |
308 TAknWindowLineLayout findWindow = AknLayout::popup_find_window(); |
|
309 |
|
310 TRect findWindowRect = AknLayoutUtils::RectFromCoords( clientRect,findWindow.il, findWindow.it, |
|
311 findWindow.ir, findWindow.ib, findWindow.iW, findWindow.iH); |
|
312 |
|
313 // Now Increase the height of rect to make room for two editors (Goto + search)// |
|
314 findWindowRect.iTl.iY -= ( findWindow.iH ); |
|
315 SetRect( findWindowRect ); |
|
316 } |
|
317 else |
|
318 { |
|
319 TRect parentrect = iAvkonAppUi->ApplicationRect(); |
|
320 |
|
321 TAknLayoutRect lrect; |
|
322 lrect.LayoutRect( parentrect, |
267 AknLayout::main_pane( CBrowserAppUi::Static()->ApplicationRect(), 0, 1, 1 ) |
323 AknLayout::main_pane( CBrowserAppUi::Static()->ApplicationRect(), 0, 1, 1 ) |
268 ); |
324 ); |
269 AknLayoutUtils::LayoutControl ( this, |
325 AknLayoutUtils::LayoutControl ( this, |
270 lrect.Rect(), |
326 lrect.Rect(), |
271 AknLayout::popup_find_window() ); |
327 AknLayout::popup_find_window() ); |
|
328 } |
272 } |
329 } |
273 else |
330 else |
274 { |
331 { |
275 // The ClientRect() will be the application rectangle minus any |
332 // The ClientRect() will be the application rectangle minus any |
276 // toolbars/menu bars etc. |
333 // toolbars/menu bars etc. |
348 // ---------------------------------------------------------------------------- |
405 // ---------------------------------------------------------------------------- |
349 // |
406 // |
350 TKeyResponse CBrowserGotoPane::OfferKeyEventL |
407 TKeyResponse CBrowserGotoPane::OfferKeyEventL |
351 ( const TKeyEvent& aKeyEvent, TEventCode aType ) |
408 ( const TKeyEvent& aKeyEvent, TEventCode aType ) |
352 { |
409 { |
353 TKeyResponse resp; |
410 TKeyResponse resp = EKeyWasNotConsumed; |
354 |
411 |
355 if ( AknLayoutUtils::PenEnabled() && |
412 if ( AknLayoutUtils::PenEnabled() |
356 PopupList() && |
413 && PopupList() |
357 PopupList()->DrawableWindow()->OrdinalPosition() > 0) |
414 && PopupList()->DrawableWindow()->OrdinalPosition() > 0 ) |
358 { |
415 { |
359 PopupList()->SetOrdinalPosition(0); |
416 PopupList()->SetOrdinalPosition(0); |
360 } |
417 } |
361 |
418 |
362 // Escape key event handling |
419 if ( aType == EEventKey && aKeyEvent.iCode == EKeyEscape ) // Escape key event handling |
363 if ( aType == EEventKey && aKeyEvent.iCode == EKeyEscape ) |
|
364 { |
420 { |
365 CCoeEnv::Static()->AppUi()->RemoveFromStack( this ); |
421 CCoeEnv::Static()->AppUi()->RemoveFromStack( this ); |
366 if ( PopupList() ) |
422 if ( PopupList() ) |
367 { |
423 { |
368 PopupList()->SetDirectoryModeL( ETrue ); |
424 PopupList()->SetDirectoryModeL( ETrue ); |
369 PopupList()->HidePopupL(); |
425 PopupList()->HidePopupL(); |
370 } |
426 } |
371 |
427 MakeVisible( EFalse ); // Hide Goto pane |
372 // Hide Goto pane |
|
373 MakeVisible( EFalse ); |
|
374 SetFocus( EFalse ); |
428 SetFocus( EFalse ); |
375 // should set the focus of container to ETrue...how? |
429 resp = EKeyWasConsumed; // should set the focus of container to ETrue...how? |
376 resp = EKeyWasConsumed; |
|
377 } |
430 } |
378 |
431 |
379 if ( iFindKeywordMode ) |
432 if ( iFindKeywordMode ) |
380 { |
433 { |
381 if ( iContentView->MenuBar()->MenuPane()->IsVisible() ) |
434 if ( iContentView->MenuBar()->MenuPane()->IsVisible() ) |
382 { |
435 { |
383 return iContentView->MenuBar()->MenuPane()->OfferKeyEventL( aKeyEvent, aType ); |
436 return iContentView->MenuBar()->MenuPane()->OfferKeyEventL( aKeyEvent, aType ); |
384 } |
437 } |
385 else |
438 else |
386 { |
439 { |
387 // Handle up and down arow keys to search for |
440 if ( aType == EEventKey ) // Handle up and down arow keys to search for |
388 // next and previous keywords. |
441 { // next and previous keywords. |
389 if ( aType == EEventKey ) |
442 |
390 { |
|
391 if ( aKeyEvent.iCode == EKeyLeftUpArrow // Northwest |
443 if ( aKeyEvent.iCode == EKeyLeftUpArrow // Northwest |
392 || aKeyEvent.iCode == EStdKeyDevice10 // : Extra KeyEvent supports diagonal event simulator wedge |
444 || aKeyEvent.iCode == EStdKeyDevice10 // : Extra KeyEvent supports diagonal event simulator wedge |
393 || aKeyEvent.iCode == EKeyUpArrow // North |
445 || aKeyEvent.iCode == EKeyUpArrow // North |
394 || aKeyEvent.iCode == EKeyRightUpArrow // Northeast |
446 || aKeyEvent.iCode == EKeyRightUpArrow // Northeast |
395 || aKeyEvent.iCode == EStdKeyDevice11 ) // : Extra KeyEvent supports diagonal event simulator wedge |
447 || aKeyEvent.iCode == EStdKeyDevice11 ) // : Extra KeyEvent supports diagonal event simulator wedge |
396 { |
448 { // Any of those? If so, then... |
397 // Find previous keyword |
449 iContentView->FindKeywordL( NULL, EFalse ); // Find previous keyword |
398 iContentView->FindKeywordL( NULL, EFalse ); |
450 iHandleFEPFind = EFalse; // : |
399 iHandleFEPFind = EFalse; |
451 return EKeyWasConsumed; // And that consumes the key |
400 return EKeyWasConsumed; |
452 } |
401 } |
453 |
402 if ( aKeyEvent.iCode == EKeyLeftDownArrow // Southwest |
454 if ( aKeyEvent.iCode == EKeyLeftDownArrow // Southwest |
403 || aKeyEvent.iCode == EStdKeyDevice13 // : Extra KeyEvent supports diagonal event simulator wedge |
455 || aKeyEvent.iCode == EStdKeyDevice13 // : Extra KeyEvent supports diagonal event simulator wedge |
404 || aKeyEvent.iCode == EKeyDownArrow // South |
456 || aKeyEvent.iCode == EKeyDownArrow // South |
405 || aKeyEvent.iCode == EKeyRightDownArrow // Southeast |
457 || aKeyEvent.iCode == EKeyRightDownArrow // Southeast |
406 || aKeyEvent.iCode == EStdKeyDevice12 ) // : Extra KeyEvent supports diagonal event simulator wedge |
458 || aKeyEvent.iCode == EStdKeyDevice12 ) // : Extra KeyEvent supports diagonal event simulator wedge |
407 { |
459 { // Any of those? If so, then... |
408 // Find next keyword |
460 iContentView->FindKeywordL( NULL, ETrue ); // Find next keyword |
409 iContentView->FindKeywordL( NULL, ETrue ); |
461 iHandleFEPFind = EFalse; // : |
410 iHandleFEPFind = EFalse; |
462 return EKeyWasConsumed; // And that consumes the key |
411 return EKeyWasConsumed; |
463 } |
412 } |
464 |
413 if ( aKeyEvent.iCode == EKeyDevice3 ) |
465 if ( aKeyEvent.iCode == EKeyDevice3 ) // Select key? |
414 { |
466 { // If so, then... |
415 // ignore select key |
467 return EKeyWasConsumed; // Ignore select key |
416 return EKeyWasConsumed; |
468 } |
417 } |
469 |
418 } |
470 } |
419 return iEditor->OfferKeyEventL( aKeyEvent, aType ); |
471 return iEditor->OfferKeyEventL( aKeyEvent, aType ); // Otherwise, just pass the key on to the editor |
420 } |
472 } |
421 } |
473 } |
422 else |
474 |
423 { |
475 else // *NOT* iFindKeywordMode |
|
476 { |
|
477 |
|
478 if ( aKeyEvent.iCode == EKeyRightUpArrow // Northeast |
|
479 || aKeyEvent.iCode == EStdKeyDevice11 // : Extra KeyEvent supports diagonal event simulator wedge |
|
480 || aKeyEvent.iCode == EKeyRightDownArrow // Southeast |
|
481 || aKeyEvent.iCode == EStdKeyDevice12 // : Extra KeyEvent supports diagonal event simulator wedge |
|
482 || aKeyEvent.iCode == EKeyLeftDownArrow // Southwest |
|
483 || aKeyEvent.iCode == EStdKeyDevice13 // : Extra KeyEvent supports diagonal event simulator wedge |
|
484 || aKeyEvent.iCode == EKeyLeftUpArrow // Northwest |
|
485 || aKeyEvent.iCode == EStdKeyDevice10 ) // : Extra KeyEvent supports diagonal event simulator wedge |
|
486 { // Any of those? If so, then... |
|
487 return EKeyWasConsumed; // Ignore diagonal navigation events here |
|
488 } |
|
489 |
424 if ( (aKeyEvent.iCode == EKeyOK ) && iGPObserver && IsFocused() ) |
490 if ( (aKeyEvent.iCode == EKeyOK ) && iGPObserver && IsFocused() ) |
425 { |
491 { |
426 if ( CBrowserAppUi::Static()->ContentView()->MenuBar()->MenuPane()->IsVisible() ) |
492 if ( CBrowserAppUi::Static()->ContentView()->MenuBar()->MenuPane()->IsVisible() ) |
427 { |
493 { |
428 return CBrowserAppUi::Static()->ContentView()->MenuBar()->MenuPane()->OfferKeyEventL( aKeyEvent, aType ); |
494 return CBrowserAppUi::Static()->ContentView()->MenuBar()->MenuPane()->OfferKeyEventL( aKeyEvent, aType ); |
429 } |
495 } |
430 else |
496 else |
431 { |
497 { |
432 // If there is an observer and we have the focus, enter key is |
|
433 // consumed and observer is notified. |
|
434 iGPObserver->HandleGotoPaneEventL |
498 iGPObserver->HandleGotoPaneEventL |
435 ( this, MGotoPaneObserver::EEventEnterKeyPressed ); |
499 ( this, MGotoPaneObserver::EEventEnterKeyPressed ); |
436 return EKeyWasConsumed; |
500 return EKeyWasConsumed; // If there is an observer and we have the focus, |
437 } |
501 } // enter key is consumed and observer is notified. |
438 } |
502 } |
439 // For touch UI, handle enter key from VKB as a "GOTO" |
503 |
440 else if (AknLayoutUtils::PenEnabled() && aKeyEvent.iCode == EKeyEnter) |
504 else if (AknLayoutUtils::PenEnabled() && aKeyEvent.iCode == EKeyEnter) |
441 { |
505 { // For touch UI, handle enter key from VKB as a "GOTO" |
442 CBrowserAppUi::Static()->ActiveView()->HandleCommandL(EWmlCmdGotoPaneGoTo); |
506 CBrowserAppUi::Static()->ActiveView()->HandleCommandL(EWmlCmdGotoPaneGoTo); |
443 return EKeyWasConsumed; |
507 return EKeyWasConsumed; |
444 } |
508 } |
445 |
509 |
446 resp = iEditor->OfferKeyEventL( aKeyEvent, aType ); |
510 if ( iSearchEditor && iSearchPaneActive ) |
|
511 { |
|
512 resp = iSearchEditor->OfferKeyEventL( aKeyEvent, aType ); |
|
513 } |
|
514 else |
|
515 { |
|
516 resp = iEditor->OfferKeyEventL( aKeyEvent, aType ); |
|
517 } |
447 |
518 |
448 if ((iBAdaptiveListPopup ) && (resp != EKeyWasConsumed)) |
519 if ((iBAdaptiveListPopup ) && (resp != EKeyWasConsumed)) |
449 { |
520 { |
450 resp = iBAdaptiveListPopup->OfferKeyEventL( aKeyEvent, aType ); |
521 resp = iBAdaptiveListPopup->OfferKeyEventL( aKeyEvent, aType ); |
451 } |
522 } |
452 return resp; |
523 |
453 } |
524 |
|
525 if ( iSearchEditor ) |
|
526 { |
|
527 if ( ( iGotoPaneActive || iSearchPaneActive) |
|
528 && (resp != EKeyWasConsumed) ) |
|
529 { |
|
530 |
|
531 if ( aKeyEvent.iCode == EKeyUpArrow ) |
|
532 { |
|
533 resp = EKeyWasConsumed; |
|
534 if ( iSearchPaneActive ) |
|
535 { |
|
536 SetGotoPaneActiveL(); |
|
537 iEditor->RemoveFlagFromUserFlags( CEikEdwin::EAvkonDisableVKB ); |
|
538 } |
|
539 } |
|
540 if ( aKeyEvent.iCode == EKeyDownArrow ) |
|
541 { |
|
542 resp = EKeyWasConsumed; |
|
543 if ( iGotoPaneActive ) |
|
544 { |
|
545 SetSearchPaneActiveL(); |
|
546 iSearchEditor->RemoveFlagFromUserFlags( CEikEdwin::EAvkonDisableVKB ); |
|
547 } |
|
548 } |
|
549 } |
|
550 } |
|
551 } |
|
552 |
|
553 return resp; |
|
554 |
454 } |
555 } |
455 |
556 |
456 // ---------------------------------------------------------------------------- |
557 // ---------------------------------------------------------------------------- |
457 // CBrowserGotoPane::HandlePointerEventL |
558 // CBrowserGotoPane::HandlePointerEventL |
458 // ---------------------------------------------------------------------------- |
559 // ---------------------------------------------------------------------------- |
797 // ---------------------------------------------------------------------------- |
1029 // ---------------------------------------------------------------------------- |
798 // CBrowserGotoPane::ActivateVKB |
1030 // CBrowserGotoPane::ActivateVKB |
799 // ---------------------------------------------------------------------------- |
1031 // ---------------------------------------------------------------------------- |
800 void CBrowserGotoPane::ActivateVKB() |
1032 void CBrowserGotoPane::ActivateVKB() |
801 { |
1033 { |
802 if (iEditor && iEditor->TextView()) |
1034 if ( ( iEditor && iEditor->TextView() ) |
|
1035 || ( iSearchEditor && iSearchEditor->TextView()) ) |
803 { |
1036 { |
804 // make sure observer is set |
1037 // make sure observer is set |
805 iCoeEnv->SyncNotifyFocusObserversOfChangeInFocus(); |
1038 iCoeEnv->SyncNotifyFocusObserversOfChangeInFocus(); |
806 |
1039 |
807 // simulate pointer event to force VKB |
1040 // simulate pointer event to force VKB |
808 |
1041 |
809 // first get point at cursor location |
1042 // first get point at cursor location |
810 TInt pos = iEditor->CursorPos(); |
1043 TInt pos = 0; |
811 CTextView* textView = iEditor->TextView(); |
1044 CTextView* textView = NULL; |
|
1045 if ( iSearchEditor && iSearchPaneActive ) |
|
1046 { |
|
1047 pos = iSearchEditor->CursorPos(); |
|
1048 textView = iSearchEditor->TextView(); |
|
1049 } |
|
1050 else |
|
1051 { |
|
1052 pos = iEditor->CursorPos(); |
|
1053 textView = iEditor->TextView(); |
|
1054 } |
|
1055 |
812 TPoint curPos; |
1056 TPoint curPos; |
813 textView->DocPosToXyPosL(pos, curPos); |
1057 textView->DocPosToXyPosL(pos, curPos); |
814 |
1058 |
815 TPointerEvent pe; |
1059 TPointerEvent pe; |
816 pe.iPosition = curPos; |
1060 pe.iPosition = curPos; |
817 |
1061 |
818 pe.iType = TPointerEvent::EButton1Down; |
1062 pe.iType = TPointerEvent::EButton1Down; |
|
1063 |
819 TInt err(KErrNone); |
1064 TInt err(KErrNone); |
820 TRAP(err, iEditor->HandlePointerEventL(pe)); |
1065 if ( iSearchEditor && iSearchPaneActive ) |
|
1066 { |
|
1067 TRAP(err, iSearchEditor->HandlePointerEventL(pe)); |
|
1068 } |
|
1069 else |
|
1070 { |
|
1071 TRAP(err, iEditor->HandlePointerEventL(pe)); |
|
1072 } |
|
1073 |
821 if (err != KErrNone) |
1074 if (err != KErrNone) |
822 { |
1075 { |
823 return; |
1076 return; |
824 } |
1077 } |
825 |
1078 |
|
1079 pe.iType = TPointerEvent::EButton1Up; |
|
1080 |
826 // VKB will only activate is nothing selected |
1081 // VKB will only activate is nothing selected |
827 iEditor->SetSelectionL(pos,pos); |
1082 if ( iSearchEditor && iSearchPaneActive ) |
828 |
1083 { |
829 pe.iType = TPointerEvent::EButton1Up; |
1084 iSearchEditor->SetSelectionL(pos,pos); |
830 if (KErrNone == err) |
1085 TRAP_IGNORE(iSearchEditor->HandlePointerEventL(pe)); |
|
1086 } |
|
1087 else |
|
1088 { |
|
1089 iEditor->SetSelectionL(pos,pos); |
|
1090 TRAP_IGNORE(iEditor->HandlePointerEventL(pe)); |
|
1091 } |
|
1092 } |
|
1093 } |
|
1094 |
|
1095 // ---------------------------------------------------------------------------- |
|
1096 // CBrowserGotoPane::ConstructSearchPaneL |
|
1097 // ---------------------------------------------------------------------------- |
|
1098 void CBrowserGotoPane::ConstructSearchPaneL() |
|
1099 { |
|
1100 |
|
1101 TFileName iconFile; |
|
1102 TInt iconId = iContentView->ApiProvider().Preferences().GetIntValue( KBrowserSearchIconId ); |
|
1103 iContentView->ApiProvider().Preferences().GetStringValueL( KBrowserSearchIconPath, KMaxFileName, iconFile ); |
|
1104 |
|
1105 // If Icon File Path Changed or Icon Id Changed, Refresh the Icon for Search Pane. |
|
1106 // Comparing Icon File path as well, because it may be possible that two different |
|
1107 // Icon files have same icon id. |
|
1108 if ( iconId != iSearchIconId |
|
1109 || iSearchIconFilePath.Compare( iconFile ) != 0 ) |
|
1110 { |
|
1111 |
|
1112 TInt iconMaskId = iContentView->ApiProvider().Preferences().GetIntValue( KBrowserSearchIconMaskId ); |
|
1113 // Save IconId |
|
1114 iSearchIconId = iconId; |
|
1115 // Save Icon File |
|
1116 iSearchIconFilePath = iconFile; |
|
1117 |
|
1118 // No Icon file or IconId or IconMaskId set , then it means no search provider is still |
|
1119 // selected and set by search application, in that case we use the default icon for Search. |
|
1120 if ( ! iconFile.Length() |
|
1121 || iconId == -1 |
|
1122 || iconMaskId == -1 ) |
|
1123 { |
|
1124 iconId = EMbmAvkonQgn_indi_find_glass; |
|
1125 iconMaskId = EMbmAvkonQgn_indi_find_glass_mask; |
|
1126 iconFile = KAvkonBitmapFile; |
|
1127 } |
|
1128 |
|
1129 |
|
1130 if ( iSearchEditor ) |
831 { |
1131 { |
832 TRAP_IGNORE(iEditor->HandlePointerEventL(pe)); |
1132 delete iSearchEditor; |
|
1133 iSearchEditor = NULL; |
833 } |
1134 } |
834 } |
1135 |
835 } |
1136 if ( iSearchInputFrame ) |
|
1137 { |
|
1138 delete iSearchInputFrame; |
|
1139 iSearchInputFrame = NULL; |
|
1140 } |
|
1141 |
|
1142 |
|
1143 // iSearchEditor != NULL, implies presence of Search Feature, which can be |
|
1144 // used to validate search feature exsistence, avoiding unecessary feature |
|
1145 // check calls and need of separate variable. |
|
1146 iSearchEditor = new (ELeave) CEikGlobalTextEditor; |
|
1147 iSearchInputFrame = CAknInputFrame::NewL( |
|
1148 iSearchEditor, |
|
1149 EFalse, |
|
1150 iconFile, |
|
1151 iconId, |
|
1152 iconMaskId, |
|
1153 CAknInputFrame::EPopupLayout ); |
|
1154 |
|
1155 iSearchInputFrame->SetContainerWindowL( *this); |
|
1156 AknEditUtils::ConstructEditingL ( iSearchEditor, |
|
1157 KFavouritesMaxUrlGotoPaneDefine, |
|
1158 1, |
|
1159 EAknEditorCharactersLowerCase, |
|
1160 EAknEditorAlignRight, |
|
1161 EFalse, |
|
1162 ETrue, |
|
1163 EFalse ); |
|
1164 |
|
1165 iSearchEditor->SetContainerWindowL( *this ); |
|
1166 iSearchEditor->SetObserver( this ); |
|
1167 iSearchEditor->SetBorder( TGulBorder::ENone ); |
|
1168 iSearchEditor->SetAknEditorCase( EAknEditorLowerCase ); |
|
1169 iSearchEditor->SetAknEditorInputMode( EAknEditorTextInputMode ); |
|
1170 |
|
1171 if (AVKONAPAC) |
|
1172 { |
|
1173 // Disallow chinese input. |
|
1174 iSearchEditor->SetAknEditorAllowedInputModes( EAknEditorTextInputMode | |
|
1175 EAknEditorNumericInputMode ); |
|
1176 } |
|
1177 |
|
1178 //Search should use EAknEditorFlagDefault as search allows all types of input |
|
1179 iSearchEditor->SetAknEditorFlags |
|
1180 ( EAknEditorFlagDefault | EAknEditorFlagUseSCTNumericCharmap ); |
|
1181 |
|
1182 iSearchEditor->SetAknEditorPermittedCaseModes ( EAknEditorUpperCase | |
|
1183 EAknEditorLowerCase ); |
|
1184 |
|
1185 iSearchEditor->SetEdwinObserver( iGotoKeyHandled ); |
|
1186 iSearchEditor->SetSkinBackgroundControlContextL(NULL); |
|
1187 iSearchEditor->MakeVisible( ETrue ); |
|
1188 iSearchInputFrame->MakeVisible( ETrue ); |
|
1189 // Set the default text if not active// |
|
1190 if ( ! iSearchPaneActive ) |
|
1191 { |
|
1192 SetSearchTextL( *iDefaultSearchText ); |
|
1193 } |
|
1194 iSearchInputFrame->ActivateL(); |
|
1195 } |
|
1196 |
|
1197 } |
|
1198 |
|
1199 // ---------------------------------------------------------------------------- |
|
1200 // CBrowserGotoPane::SetGotoPaneActive |
|
1201 // ---------------------------------------------------------------------------- |
|
1202 void CBrowserGotoPane::SetGotoPaneActiveL() |
|
1203 { |
|
1204 |
|
1205 iGotoPaneActive = ETrue; |
|
1206 iSearchPaneActive = EFalse; |
|
1207 |
|
1208 if ( iSearchEditor ) |
|
1209 { |
|
1210 iEditor->AddFlagToUserFlags( CEikEdwin::EAvkonDisableVKB ); |
|
1211 // if searchpane is empty add default text |
|
1212 if ( !SearchTextLength() ) |
|
1213 { |
|
1214 SetSearchTextL( *iDefaultSearchText ); |
|
1215 } |
|
1216 |
|
1217 // if gotopane is empty add default text |
|
1218 if ( !TextLength() ) |
|
1219 { |
|
1220 SetTextL( KWWWString ); |
|
1221 } |
|
1222 |
|
1223 iSearchEditor->SetFocus( EFalse); |
|
1224 } |
|
1225 |
|
1226 iEditor->SetFocus( ETrue ); |
|
1227 CBrowserAppUi::Static()->UpdateCbaL(); |
|
1228 SetTextModeItalicL(); |
|
1229 iEditor->SetCursorPosL(iEditor->TextLength(), EFalse); |
|
1230 DrawDeferred(); |
|
1231 } |
|
1232 |
|
1233 // ---------------------------------------------------------------------------- |
|
1234 // CBrowserGotoPane::SetSearchPaneActive |
|
1235 // ---------------------------------------------------------------------------- |
|
1236 void CBrowserGotoPane::SetSearchPaneActiveL() |
|
1237 { |
|
1238 |
|
1239 if ( iSearchEditor ) |
|
1240 { |
|
1241 iSearchEditor->AddFlagToUserFlags( CEikEdwin::EAvkonDisableVKB ); |
|
1242 // if gotopane is empty add default text |
|
1243 if ( !TextLength() ) |
|
1244 { |
|
1245 SetTextL( KWWWString ); |
|
1246 } |
|
1247 |
|
1248 // if searchpane has default text remove it |
|
1249 HBufC* text = iSearchEditor->GetTextInHBufL(); |
|
1250 if ( text ) |
|
1251 { |
|
1252 CleanupStack::PushL( text ); |
|
1253 if ( !text->Compare( iDefaultSearchText->Des() ) ) |
|
1254 { |
|
1255 SetSearchTextL( KNullDesC ); |
|
1256 } |
|
1257 |
|
1258 CleanupStack::PopAndDestroy( text ); |
|
1259 } |
|
1260 |
|
1261 iSearchPaneActive = ETrue; |
|
1262 iGotoPaneActive = EFalse; |
|
1263 iEditor->SetFocus( EFalse ); |
|
1264 if ( iBAdaptiveListPopup ) |
|
1265 iBAdaptiveListPopup->HidePopupL(); |
|
1266 iSearchEditor->SetFocus( ETrue ); |
|
1267 iSearchEditor->SetCursorPosL(iSearchEditor->TextLength(), EFalse); |
|
1268 CBrowserAppUi::Static()->UpdateCbaL(); |
|
1269 |
|
1270 SetTextModeItalicL(); |
|
1271 DrawDeferred(); |
|
1272 } |
|
1273 } |
|
1274 |
|
1275 |
|
1276 // ---------------------------------------------------------------------------- |
|
1277 // CBrowserBookmarksGotoPane::SetTextModeItalic |
|
1278 // ---------------------------------------------------------------------------- |
|
1279 void CBrowserGotoPane::SetTextModeItalicL() |
|
1280 { |
|
1281 |
|
1282 // Editor Control is laid in a scalable way, so we need to get the correct font |
|
1283 // specification for setting CharFormatLayer, We could have used GetNearestFontInTwips, |
|
1284 // as done above in SetTextL() but it does not provide correct fonts for editor. |
|
1285 // We do not need to set the FontPosture back to EPostureUpright ( Normal ), as it |
|
1286 // is automatically handled by AknLayoutUtils::LayoutEdwinScalable called by |
|
1287 // iInputFrame->SetRect(), which overwrites all the properties for Editor. |
|
1288 if ( iSearchEditor ) |
|
1289 { |
|
1290 TAknTextComponentLayout editorLayout; |
|
1291 TBool apac( AknLayoutUtils::Variant() == EApacVariant && ( CAknInputFrame::EShowIndicators ) ); |
|
1292 editorLayout = AknLayoutScalable_Avkon::input_popup_find_pane_t1( apac ? 2 : 0 ); |
|
1293 TAknTextLineLayout lineLayout = editorLayout.LayoutLine(); |
|
1294 TInt fontid = lineLayout.FontId(); |
|
1295 const CAknLayoutFont *font = AknLayoutUtils::LayoutFontFromId( fontid ); |
|
1296 |
|
1297 TCharFormat charFormat; |
|
1298 TCharFormatMask charFormatMask; |
|
1299 charFormat.iFontSpec = font->FontSpecInTwips(); |
|
1300 charFormat.iFontSpec.iFontStyle.SetPosture( EPostureItalic ); |
|
1301 charFormatMask.SetAttrib(EAttFontTypeface); |
|
1302 charFormatMask.SetAttrib(EAttFontHeight); |
|
1303 charFormatMask.SetAttrib(EAttFontStrokeWeight); |
|
1304 charFormatMask.SetAttrib(EAttFontPosture); |
|
1305 |
|
1306 // Owner ship of charFormatLayer is taken by Editor |
|
1307 CCharFormatLayer* charFormatLayerItalics = NULL; |
|
1308 CCharFormatLayer* charFormatLayerUpright = NULL; |
|
1309 charFormatLayerItalics = CCharFormatLayer::NewL(charFormat,charFormatMask); |
|
1310 charFormat.iFontSpec.iFontStyle.SetPosture( EPostureUpright ); |
|
1311 charFormatLayerUpright = CCharFormatLayer::NewL(charFormat,charFormatMask); |
|
1312 if ( iSearchPaneActive ) |
|
1313 { |
|
1314 iSearchEditor->SetCharFormatLayer(charFormatLayerUpright); |
|
1315 iEditor->SetCharFormatLayer(charFormatLayerItalics); |
|
1316 } |
|
1317 else |
|
1318 { |
|
1319 iSearchEditor->SetCharFormatLayer(charFormatLayerItalics); |
|
1320 iEditor->SetCharFormatLayer(charFormatLayerUpright); |
|
1321 } |
|
1322 } |
|
1323 } |
|
1324 |
836 |
1325 |
837 // END OF FILE |
1326 // END OF FILE |