From 0a6a19712b8a06300fa739ed95ce4e4412c4f950 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Tue, 15 Jan 2019 19:56:07 +0900 Subject: [PATCH] Set the input hint when IME layout is password Change-Id: I773b408bbcee8e2e27c099271a66526f37f405eb Signed-off-by: Seoyeon Kim --- .../adaptor-framework/input-method-options.cpp | 2 +- .../adaptor-framework/input-method-options.h | 2 +- .../input-method-context-impl-ecore-wl.cpp | 20 +++++++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/dali/devel-api/adaptor-framework/input-method-options.cpp b/dali/devel-api/adaptor-framework/input-method-options.cpp index a035763..4e0d8fa 100644 --- a/dali/devel-api/adaptor-framework/input-method-options.cpp +++ b/dali/devel-api/adaptor-framework/input-method-options.cpp @@ -53,7 +53,7 @@ InputMethodOptions::~InputMethodOptions() // for unique_ptr to work with forward declaration } -bool InputMethodOptions::IsPassword() +bool InputMethodOptions::IsPassword() const { return (mImpl->mPanelLayout == Dali::InputMethod::PanelLayout::PASSWORD); } diff --git a/dali/devel-api/adaptor-framework/input-method-options.h b/dali/devel-api/adaptor-framework/input-method-options.h index 27f93e8..b2109a4 100644 --- a/dali/devel-api/adaptor-framework/input-method-options.h +++ b/dali/devel-api/adaptor-framework/input-method-options.h @@ -50,7 +50,7 @@ public: * @brief Returns whether panel layout type is password or not * @return true if panel layout type is password, false otherwise. */ - bool IsPassword(); + bool IsPassword() const; /** * @brief Apply property map to attribute class, this class will keep the virtualKeyboard settings. diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp index 13f8c0a..19adce8 100755 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp @@ -718,25 +718,35 @@ void InputMethodContextEcoreWl::ApplyOptions( const InputMethodOptions& options int index; - if (mIMFContext == NULL) + if( mIMFContext == NULL ) { DALI_LOG_WARNING("VKB Unable to excute ApplyOptions with Null ImfContext\n"); return; } - if ( mOptions.CompareAndSet(PANEL_LAYOUT, options, index) ) + if( mOptions.CompareAndSet(PANEL_LAYOUT, options, index) ) { ecore_imf_context_input_panel_layout_set( mIMFContext, panelLayoutMap[index] ); + + // Sets the input hint which allows input methods to fine-tune their behavior. + if( panelLayoutMap[index] == ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD ) + { + ecore_imf_context_input_hint_set( mIMFContext, static_cast< Ecore_IMF_Input_Hints >( ecore_imf_context_input_hint_get( mIMFContext ) | ECORE_IMF_INPUT_HINT_SENSITIVE_DATA ) ); + } + else + { + ecore_imf_context_input_hint_set( mIMFContext, static_cast< Ecore_IMF_Input_Hints >( ecore_imf_context_input_hint_get( mIMFContext ) & ~ECORE_IMF_INPUT_HINT_SENSITIVE_DATA ) ); + } } - if ( mOptions.CompareAndSet(BUTTON_ACTION, options, index) ) + if( mOptions.CompareAndSet(BUTTON_ACTION, options, index) ) { ecore_imf_context_input_panel_return_key_type_set( mIMFContext, returnKeyTypeMap[index] ); } - if ( mOptions.CompareAndSet(AUTO_CAPITALIZE, options, index) ) + if( mOptions.CompareAndSet(AUTO_CAPITALIZE, options, index) ) { ecore_imf_context_autocapital_type_set( mIMFContext, autoCapitalMap[index] ); } - if ( mOptions.CompareAndSet(VARIATION, options, index) ) + if( mOptions.CompareAndSet(VARIATION, options, index) ) { ecore_imf_context_input_panel_layout_variation_set( mIMFContext, index ); } -- 2.7.4