applied new IMF_LAYOUT (ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD)
authorChulheon <ch.jeong47@samsung.com>
Mon, 22 Apr 2013 07:12:27 +0000 (16:12 +0900)
committerChulheon <ch.jeong47@samsung.com>
Mon, 22 Apr 2013 07:14:05 +0000 (16:14 +0900)
Change-Id: I33fddd9ef93afb67e816aed4167c5565fe535c52

src/ui/FUi_InputConnectionImpl.cpp
src/ui/FUi_InputConnectionImpl.h
src/ui/controls/FUiCtrl_Edit.cpp
src/ui/controls/FUiCtrl_EditFieldImpl.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp

index 021470a..50bd06e 100644 (file)
@@ -360,6 +360,7 @@ _InputConnectionImpl::_InputConnectionImpl(InputConnection* pInputConnection)
        , __inputPanelStyle(INPUT_PANEL_STYLE_NORMAL)
        , __pUSBEventHandler(null)
        , __IsKeyEventSkipped(false)
+       , __passwordMode(false)
 {
 
 }
@@ -542,6 +543,10 @@ _InputConnectionImpl::SetInputPanelStyle(InputPanelStyle style)
        {
        case INPUT_PANEL_STYLE_NORMAL:
                ecorePanelLayout = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL;
+               if (__passwordMode == true)
+               {
+                       ecorePanelLayout = ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD;
+               }
                break;
        case INPUT_PANEL_STYLE_NUMBER:
                ecorePanelLayout = ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER;
@@ -1020,6 +1025,25 @@ _InputConnectionImpl::IsCapsLockEnabled(void) const
 }
 
 result
+_InputConnectionImpl::SetPasswordMode(bool enable)
+{
+       result r = E_SUCCESS;
+
+       SysAssertf(__pContext != null, "Not yet constructed. Construct() should be called before use.");
+
+       __passwordMode = true;
+       ecore_imf_context_input_panel_layout_set(__pContext, ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD);
+
+       return r;
+}
+
+bool
+_InputConnectionImpl::IsPasswordMode(void) const
+{
+       return __passwordMode;
+}
+
+result
 _InputConnectionImpl::SetInputPanelLanguage(LanguageCode languageCode)
 {
        result r = E_SUCCESS;
index 0f8542d..ccae000 100644 (file)
@@ -78,6 +78,8 @@ public:
        bool IsTextPredictionEnabled(void) const;
        result SetCapsLockEnabled(bool enable);
        bool IsCapsLockEnabled(void) const;
+       result SetPasswordMode(bool enable);
+       bool IsPasswordMode(void) const;
 
        result SetInputPanelLanguage(Tizen::Locales::LanguageCode languageCode);
        Tizen::Locales::LanguageCode GetInputPanelLanguage(void) const;
@@ -125,6 +127,7 @@ private:
        InputPanelStyle __inputPanelStyle;
        Ecore_Event_Handler* __pUSBEventHandler;
        bool __IsKeyEventSkipped;
+       bool __passwordMode;
 
 }; // _InputConnectionImpl
 
index 43103e3..7b5eb21 100644 (file)
@@ -3020,7 +3020,10 @@ _Edit::GetPropertyKeypadEnabled(void) const
 result
 _Edit::SetPropertyKeypadStyle(const Variant& style)
 {
-       SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != (KeypadStyle)style.ToInt()), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
+       if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+       {
+               SysTryReturn(NID_UI_CTRL, (KEYPAD_STYLE_PASSWORD != (KeypadStyle)style.ToInt()), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given.");
+       }
 
        return _pEditPresenter->SetKeypadStyle((KeypadStyle)style.ToInt());
 }
index 1c23be3..63048d6 100644 (file)
@@ -416,6 +416,10 @@ _EditFieldImpl::Initialize(EditFieldStyle style, InputStyle inputStyle,
                keypadStyle = KEYPAD_STYLE_IP_V4;
                break;
 
+       case EDIT_FIELD_STYLE_PASSWORD :
+               keypadStyle = KEYPAD_STYLE_PASSWORD;
+               break;
+
        default:
                break;
        }
index 94a718f..18fc658 100644 (file)
@@ -703,6 +703,10 @@ _EditPresenter::OnComposingTextChanged(const String& composingText, int cursorPo
        ScrollPanelToCursorPosition();
 
        DrawText();
+       if (__composingTextLength > 0)
+       {
+               ChangePasswordToEchoCharacter((GetCursorPosition() - __composingTextLength), __composingTextLength);
+       }
 
        __pEdit->SendTextEvent(CORE_TEXT_EVENT_CHANGED);
 
@@ -5225,6 +5229,10 @@ _EditPresenter::SetKeypadStyle(KeypadStyle keypadStyle)
                break;
        case KEYPAD_STYLE_PASSWORD:
                inputPanelStyle = INPUT_PANEL_STYLE_NORMAL;
+               if (__pInputConnection)
+               {
+                       __pInputConnection->SetPasswordMode(true);
+               }
                break;
        case KEYPAD_STYLE_EMAIL:
                inputPanelStyle = INPUT_PANEL_STYLE_EMAIL;
@@ -8440,6 +8448,16 @@ _EditPresenter::OnPasswordTimerExpired(void)
        }
 
        ReplaceTextIntoPasswordHyphenString();
+       if (__composingTextLength > 0)
+       {
+               _FontImpl* fontImpl = _FontImpl::GetInstance(*__pFont);
+               SysTryReturnResult(NID_UI_CTRL, fontImpl != null, E_SYSTEM, "[E_SYSTEM] fontImpl is null.");
+               fontImpl->SetUnderline(false);
+               int composingStartPosition =  GetCursorPosition()-__composingTextLength;
+               __pTextObject->SetFont(__pFont, composingStartPosition, composingStartPosition+__composingTextLength);
+       }
+
+       __isCursorChanged = true;
 
        __pEdit->Invalidate();