webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp
changeset 27 6297cdf66332
parent 26 cb62a4f66ebe
child 34 220a17280356
--- a/webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp	Thu Jan 07 13:31:38 2010 +0200
+++ b/webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp	Mon Jan 18 21:20:18 2010 +0200
@@ -75,7 +75,8 @@
 CWebFepTextEditor::CWebFepTextEditor(WebView* aView)
     : m_webView(aView),
       m_textFormatMask(NULL),
-      m_inlineEditText(NULL)
+      m_inlineEditText(NULL),
+      m_longKeyPress(EFalse)
 {
     // Set up the extended capabilities
     TRAP_IGNORE(
@@ -195,6 +196,8 @@
 
     delete m_inlineEditText;
     m_inlineEditText = NULL;
+    
+    m_longKeyPress = EFalse ;
 
     UpdateInputModeState(EAknEditorNullInputMode, EAknEditorAllInputModes,EAknEditorStandardNumberModeKeymap);
     UpdateFlagsState(EAknEditorFlagDefault);        
@@ -409,6 +412,9 @@
 	if ( m_textFormatMask && m_textFormatMask->getMultitude() > 0 )
         length = m_textFormatMask->getMultitude();
 
+    if (IsLongKeyPress() && 
+        (KMaxTInt != length))
+        length += 1 ;
     // TextArea node has no member function maxLength(), so return KMaxTInt
     return length;
 }
@@ -585,6 +591,8 @@
     //delete the m_inlineEditText since text is commited
     delete m_inlineEditText;
     m_inlineEditText = NULL;
+    
+    m_longKeyPress = EFalse;
 
     HandleUpdateCursor();
     UpdateEditingMode();
@@ -656,6 +664,7 @@
 {
     aSetToTrue=ETrue;
     SetCursorSelectionForFepL(aCursorSelection);
+    m_longKeyPress = ETrue ;
     StartFepInlineEditL(aInitialInlineText, aPositionOfInsertionPointInInlineText, aCursorVisibility, aCustomDraw, aInlineTextFormatRetriever, aPointerEventHandlerDuringInlineEdit);
 }
 
@@ -934,6 +943,10 @@
             style->setProperty(CSS_PROP_COLOR, "red", false, ec);
             return false;
         }
+        else if ( m_textFormatMask->acceptAll() )
+        {
+            return true;
+        }
         else
         {
             style->setProperty(CSS_PROP_COLOR, m_inputTextColor, false, ec);
@@ -1470,4 +1483,13 @@
     CancelEditingMode();    
     } 
 
+// -----------------------------------------------------------------------------
+// IsLongKeyPress
+//
+// Called to know the status of the key pressed 
+// -----------------------------------------------------------------------------
+TBool CWebFepTextEditor::IsLongKeyPress() const
+    {
+    return m_longKeyPress ;	
+    }