Set the input hint when IME layout is password 93/197693/5
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 15 Jan 2019 10:56:07 +0000 (19:56 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 13 May 2019 05:39:17 +0000 (14:39 +0900)
Change-Id: I773b408bbcee8e2e27c099271a66526f37f405eb
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali/devel-api/adaptor-framework/input-method-options.cpp
dali/devel-api/adaptor-framework/input-method-options.h
dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp

index a035763..4e0d8fa 100644 (file)
@@ -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);
 }
index 27f93e8..b2109a4 100644 (file)
@@ -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.
index 13f8c0a..19adce8 100755 (executable)
@@ -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 );
   }