idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp
branchRCL_3
changeset 9 f966699dea19
parent 0 f72a12da539e
child 15 ff572dfe6d86
--- a/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp	Tue Feb 02 00:04:13 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp	Fri Feb 19 22:42:37 2010 +0200
@@ -46,12 +46,14 @@
 #include "xnnodepluginif.h"
 #include "xneditmode.h"
 #include "c_xnutils.h"
+#include "xntexteditor.h" 
 
 const TInt KMaxLength = 100;
 
 _LIT8( KCpsPublishing, "cpspublishing" );
 _LIT8( KMaxLineAmount, "max-line-amount" );
 _LIT8( KMaxCharAmount, "max-char-amount" );
+_LIT8( KEnablePartialInput, "splitinputenabled" );
 
 _LIT( KEnterChar, "\x2029" );
 
@@ -170,7 +172,19 @@
     iEditor->SetAknEditorNumericKeymap( EAknEditorPlainNumberModeKeymap );
     
     iEditor->SetSuppressBackgroundDrawing( ETrue );
-                      
+
+    // Enable partial Screen
+    CXnProperty* enablepartialinput( iNode.GetPropertyL( KEnablePartialInput ) );
+    iPartialInputEnabled = EFalse;
+    iPartialInputOpen = EFalse;
+     
+    if ( enablepartialinput && 
+         enablepartialinput->StringValue() == XnPropertyNames::KTrue )
+        {
+        iEditor->SetAknEditorFlags( EAknEditorFlagEnablePartialScreen );
+        iPartialInputEnabled = ETrue;
+        }
+    
     iEditor->SetObserver( this );
                                         
     // Default not focused                                  
@@ -295,20 +309,38 @@
     if ( isFocused )
         {      
         value = EPSAiDontForwardNumericKeysToPhone;
-                       
-        TRAP_IGNORE( appui->AddToStackL( appui->View(), iEditor ) );
-        
-        // AddToStackL calls iEditor->SetFocus( ETrue ); 
+
+        if( !iPartialInputEnabled )
+            {
+            TRAP_IGNORE( appui->AddToStackL( appui->View(), iEditor ) );            
+            // AddToStackL calls iEditor->SetFocus( ETrue ); 
+            }
+
         }
     else
         {
         value = EPSAiForwardNumericKeysToPhone;
                                       
-        appui->RemoveFromStack( iEditor );
-        
-        iEditor->SetFocus( EFalse, aDrawNow );
+        if( !iPartialInputEnabled )
+            {    
+            appui->RemoveFromStack( iEditor );            
+            iEditor->SetFocus( EFalse, aDrawNow );
+            }
+        else if(iPartialInputEnabled && iRemoveSplitInputFromStack )
+            {
+            appui->RemoveFromStack( iEditor );            
+            iEditor->SetFocus( EFalse, aDrawNow );
+            iPartialInputOpen = EFalse;
+            iRemoveSplitInputFromStack = EFalse;
+            }
+            
         }
-    
+
+    if(iPartialInputOpen)
+        {
+        value = EPSAiDontForwardNumericKeysToPhone;
+        }
+
     iRefusesFocusLoss = isFocused;
     
     RProperty::Set( KPSUidAiInformation,            
@@ -352,6 +384,7 @@
 void CXnTextEditorAdapter::SetTextL( const TDesC& aText )
     {
     iEditor->SetTextL( &aText );
+    iNode.SetDirtyL();
     }
     
 // -----------------------------------------------------------------------------
@@ -370,6 +403,53 @@
     }
 
 // -----------------------------------------------------------------------------
+// CXnTextEditorAdapter::HandleEditorEvent
+// -----------------------------------------------------------------------------
+//
+void CXnTextEditorAdapter::HandleEditorEvent( TInt aReason )
+    {
+    CXnAppUiAdapter* appui( 
+        static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) );
+
+    switch( aReason )
+            {           
+            case CXnTextEditor::KActivateTextEditor:
+                {
+                if( !iPartialInputOpen )
+                     {
+                     iUiEngine->EnablePartialTouchInput(iNode , ETrue);
+                     TRAP_IGNORE( appui->AddToStackL( appui->View(), iEditor ) ); 
+                     iPartialInputOpen = ETrue;
+                     }  
+                break;
+                }
+            case CXnTextEditor::KDeactivateTextEditor:
+                {
+                if( iPartialInputOpen )
+                     {
+                     iUiEngine->EnablePartialTouchInput(iNode, EFalse);
+                     iPartialInputOpen = EFalse;
+                     appui->RemoveFromStack( iEditor );
+                     iEditor->SetFocus( EFalse );
+                     }              
+                break;
+                }
+            case CXnTextEditor::KRemoveSplitInputFromStack:
+                {
+                iRemoveSplitInputFromStack = ETrue;
+                break;
+                }
+            case CXnTextEditor::KKeepSplitInputInStack:
+                {
+                iRemoveSplitInputFromStack = EFalse;
+                break;
+                }
+            default:                    
+                break;    
+            }
+    }
+
+// -----------------------------------------------------------------------------
 // CXnTextEditorAdapter::SetPropertiesL
 // Sets text properties
 // -----------------------------------------------------------------------------