55 enum TSplitInputState |
55 enum TSplitInputState |
56 { |
56 { |
57 ESplitInputEnabled = 1, |
57 ESplitInputEnabled = 1, |
58 ESplitInputOpen = 2, |
58 ESplitInputOpen = 2, |
59 ESplitInputEditorInStack = 4, |
59 ESplitInputEditorInStack = 4, |
|
60 EScreenDeviceChanged = 8 |
60 }; |
61 }; |
61 |
62 |
62 _LIT8( KCpsPublishing, "cpspublishing" ); |
63 _LIT8( KCpsPublishing, "cpspublishing" ); |
63 _LIT8( KMaxLineAmount, "max-line-amount" ); |
64 _LIT8( KMaxLineAmount, "max-line-amount" ); |
64 _LIT8( KMaxCharAmount, "max-char-amount" ); |
65 _LIT8( KMaxCharAmount, "max-char-amount" ); |
65 _LIT8( KEnablePartialInput, "splitinputenabled" ); |
66 _LIT8( KEnablePartialInput, "splitinputenabled" ); |
|
67 _LIT8( KSplitScreenEnabledTrigger , "splitscreenenabled" ); |
|
68 _LIT8( KSplitScreenDisabledTrigger, "splitscreendisabled" ); |
66 |
69 |
67 _LIT( KEnterChar, "\x2029" ); |
70 _LIT( KEnterChar, "\x2029" ); |
68 |
71 |
69 // Local macros |
72 // Local macros |
70 #define IS_ARROW_KEY( k ) \ |
73 #define IS_ARROW_KEY( k ) \ |
419 if( IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) && |
422 if( IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) && |
420 !IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) |
423 !IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) |
421 { |
424 { |
422 iUiEngine->EnablePartialTouchInput( iNode, ETrue ); |
425 iUiEngine->EnablePartialTouchInput( iNode, ETrue ); |
423 SetFlag( iSplitInputFlags, ESplitInputOpen ); |
426 SetFlag( iSplitInputFlags, ESplitInputOpen ); |
|
427 if ( !IsFlagSet( iSplitInputFlags, EScreenDeviceChanged ) ) |
|
428 { |
|
429 TRAP_IGNORE( iNode.ReportTriggerEventL( KSplitScreenEnabledTrigger, |
|
430 KNullDesC8, KNullDesC8) ); |
|
431 } |
|
432 else |
|
433 { |
|
434 ClearFlag( iSplitInputFlags, EScreenDeviceChanged ); |
|
435 } |
424 } |
436 } |
425 } |
437 } |
426 |
438 |
427 if ( aType == KAknSplitInputDisabled ) |
439 if ( aType == KAknSplitInputDisabled ) |
428 { |
440 { |
429 if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) |
441 if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) |
430 { |
442 { |
431 iUiEngine->EnablePartialTouchInput( iNode, EFalse ); |
443 iUiEngine->EnablePartialTouchInput( iNode, EFalse ); |
432 ClearFlag( iSplitInputFlags, ESplitInputOpen ); |
444 ClearFlag( iSplitInputFlags, ESplitInputOpen ); |
433 |
445 |
434 // If editor is not focused anymore, remove if from stack |
446 // Note that after orientation switch, split screen is first closed and |
435 CXnNodePluginIf* focusedNode( NULL ); |
447 // then opened again. Therefore these must be discarded |
436 TRAP_IGNORE( focusedNode = iUiEngine->FocusedNodeL() ); |
448 if ( !IsFlagSet( iSplitInputFlags, EScreenDeviceChanged ) ) |
437 if( focusedNode != &iNode && |
|
438 IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) ) |
|
439 { |
449 { |
440 iAppui->RemoveFromStack( iEditor ); |
450 TRAP_IGNORE( iNode.ReportTriggerEventL( KSplitScreenDisabledTrigger, |
441 iEditor->SetFocus( EFalse ); |
451 KNullDesC8, KNullDesC8) ); |
442 ClearFlag( iSplitInputFlags, ESplitInputEditorInStack ); |
452 |
443 |
453 // If editor is not focused anymore, remove if from stack |
444 // Forward keys to phone again |
454 CXnNodePluginIf* focusedNode( NULL ); |
445 RProperty::Set( KPSUidAiInformation, |
455 TRAP_IGNORE( focusedNode = iUiEngine->FocusedNodeL() ); |
446 KActiveIdleForwardNumericKeysToPhone, |
456 if( focusedNode != &iNode && |
447 EPSAiForwardNumericKeysToPhone ); |
457 IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) ) |
|
458 { |
|
459 iAppui->RemoveFromStack( iEditor ); |
|
460 iEditor->SetFocus( EFalse ); |
|
461 ClearFlag( iSplitInputFlags, ESplitInputEditorInStack ); |
|
462 |
|
463 // Forward keys to phone again |
|
464 RProperty::Set( KPSUidAiInformation, |
|
465 KActiveIdleForwardNumericKeysToPhone, |
|
466 EPSAiForwardNumericKeysToPhone ); |
|
467 } |
448 } |
468 } |
449 } |
469 } |
450 } |
470 } |
451 CCoeControl::HandleResourceChange( aType ); |
471 CCoeControl::HandleResourceChange( aType ); |
452 } |
472 } |
453 |
473 |
454 // ----------------------------------------------------------------------------- |
474 // ----------------------------------------------------------------------------- |
455 // CXnTextEditorAdapter::HandleControlEventL |
475 // CXnTextEditorAdapter::HandleScreenDeviceChangedL |
456 // |
476 // |
457 // ----------------------------------------------------------------------------- |
477 // ----------------------------------------------------------------------------- |
458 // |
478 // |
459 void CXnTextEditorAdapter::HandleControlEventL( CCoeControl* aControl, |
479 void CXnTextEditorAdapter::HandleScreenDeviceChangedL() |
460 TCoeEvent aEventType ) |
480 { |
461 { |
481 if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) ) |
462 if ( aControl == iEditor ) |
482 { |
463 { |
483 SetFlag( iSplitInputFlags, EScreenDeviceChanged ); |
464 // If background drawing is suppressed, then we need to call draw here |
484 } |
465 if ( aEventType == EEventStateChanged ) |
485 } |
466 { |
486 |
467 DrawNow(); |
487 // ----------------------------------------------------------------------------- |
468 } |
488 // From MCoeControlBackground |
|
489 // CXnTextEditorAdapter::Draw |
|
490 // ----------------------------------------------------------------------------- |
|
491 // |
|
492 void CXnTextEditorAdapter::Draw( CWindowGc& aGc, const CCoeControl& aControl, |
|
493 const TRect& aRect) const |
|
494 { |
|
495 if( &aControl == iEditor ) |
|
496 { |
|
497 CXnControlAdapter::Draw( aRect, aGc ); |
469 } |
498 } |
470 } |
499 } |
471 |
500 |
472 // ----------------------------------------------------------------------------- |
501 // ----------------------------------------------------------------------------- |
473 // CXnTextEditorAdapter::SetTextL |
502 // CXnTextEditorAdapter::SetTextL |