This property is provided in TextField.
TextEditor also needs a property that controls the options of the input method.
Change-Id: Idc0d8252180f547e84072981fb5ff9bd4bebf00b
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup";
+const char* const PROPERTY_NAME_INPUT_METHOD_SETTINGS = "inputMethodSettings";
const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MAX_LENGTH ) == DevelTextEditor::Property::MAX_LENGTH );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_GRAB_HANDLE_COLOR ) == DevelTextEditor::Property::GRAB_HANDLE_COLOR );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_METHOD_SETTINGS ) == DevelTextEditor::Property::INPUT_METHOD_SETTINGS );
END_TEST;
}
editor.SetProperty( DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP, false );
DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP ), false, TEST_LOCATION);
+ // Check the input method setting
+ Property::Map propertyMap;
+ InputMethod::PanelLayout::Type panelLayout = InputMethod::PanelLayout::NUMBER;
+ InputMethod::AutoCapital::Type autoCapital = InputMethod::AutoCapital::WORD;
+ InputMethod::ButtonAction::Type buttonAction = InputMethod::ButtonAction::GO;
+ int inputVariation = 1;
+ propertyMap["PANEL_LAYOUT"] = panelLayout;
+ propertyMap["AUTO_CAPITALIZE"] = autoCapital;
+ propertyMap["BUTTON_ACTION"] = buttonAction;
+ propertyMap["VARIATION"] = inputVariation;
+ editor.SetProperty( DevelTextEditor::Property::INPUT_METHOD_SETTINGS, propertyMap );
+
+ Property::Value value = editor.GetProperty( DevelTextEditor::Property::INPUT_METHOD_SETTINGS );
+ Property::Map map;
+ DALI_TEST_CHECK( value.Get( map ) );
+
+ int layout = 0;
+ DALI_TEST_CHECK( map[ "PANEL_LAYOUT" ].Get( layout ) );
+ DALI_TEST_EQUALS( static_cast<int>(panelLayout), layout, TEST_LOCATION );
+
+ int capital = 0;
+ DALI_TEST_CHECK( map[ "AUTO_CAPITALIZE" ].Get( capital ) );
+ DALI_TEST_EQUALS( static_cast<int>(autoCapital), capital, TEST_LOCATION );
+
+ int action = 0;
+ DALI_TEST_CHECK( map[ "BUTTON_ACTION" ].Get( action ) );
+ DALI_TEST_EQUALS( static_cast<int>(buttonAction), action, TEST_LOCATION );
+
+ int variation = 0;
+ DALI_TEST_CHECK( map[ "VARIATION" ].Get( variation ) );
+ DALI_TEST_EQUALS( inputVariation, variation, TEST_LOCATION );
+
application.SendNotification();
application.Render();
* @note The default value is true, which means the grab handle popup is enabled by default.
*/
ENABLE_GRAB_HANDLE_POPUP,
+
+ /**
+ * @brief The settings to relating to the System's Input Method, Key and Value.
+ * @details Name "inputMethodSettings", type Property::MAP.
+ *
+ * @note VARIATION key can be changed depending on PANEL_LAYOUT.
+ * For example, when PANEL_LAYOUT key is InputMethod::PanelLayout::NORMAL,
+ * then VARIATION would be among NORMAL, WITH_FILENAME, and WITH_PERSON_NAME in Dali::InputMethod::NormalLayout.
+ * For more information, see Dali::InputMethod::Category.
+ *
+ * Example Usage:
+ * @code
+ * Property::Map propertyMap;
+ * InputMethod::PanelLayout::Type panelLayout = InputMethod::PanelLayout::NUMBER;
+ * InputMethod::AutoCapital::Type autoCapital = InputMethod::AutoCapital::WORD;
+ * InputMethod::ButtonAction::Type buttonAction = InputMethod::ButtonAction::GO;
+ * int inputVariation = 1;
+ * propertyMap["PANEL_LAYOUT"] = panelLayout;
+ * propertyMap["AUTO_CAPITALIZE"] = autoCapital;
+ * propertyMap["BUTTON_ACTION"] = buttonAction;
+ * propertyMap["VARIATION"] = inputVariation;
+ *
+ * editor.SetProperty(DevelTextEditor::Property::INPUT_METHOD_SETTINGS, propertyMap);
+ * @endcode
+ */
+ INPUT_METHOD_SETTINGS,
};
} // namespace Property
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "inputMethodSettings", MAP, INPUT_METHOD_SETTINGS )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED)
impl.mController->SetGrabHandlePopupEnabled(grabHandlePopupEnabled);
break;
}
+ case Toolkit::DevelTextEditor::Property::INPUT_METHOD_SETTINGS:
+ {
+ const Property::Map* map = value.GetMap();
+ if(map)
+ {
+ impl.mInputMethodOptions.ApplyProperty(*map);
+ }
+ impl.mController->SetInputModePassword(impl.mInputMethodOptions.IsPassword());
+
+ Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
+ if(control == textEditor)
+ {
+ impl.mInputMethodContext.ApplyOptions(impl.mInputMethodOptions);
+ }
+ break;
+ }
} // switch
} // texteditor
}
value = impl.mController->IsGrabHandlePopupEnabled();
break;
}
+ case Toolkit::DevelTextEditor::Property::INPUT_METHOD_SETTINGS:
+ {
+ Property::Map map;
+ impl.mInputMethodOptions.RetrieveProperty(map);
+ value = map;
+ break;
+ }
} //switch
}
if(mInputMethodContext && IsEditable())
{
// All input panel properties, such as layout, return key type, and input hint, should be set before input panel activates (or shows).
+ mInputMethodContext.ApplyOptions(mInputMethodOptions);
mInputMethodContext.NotifyTextInputMultiLine(true);
mInputMethodContext.StatusChangedSignal().Connect(this, &TextEditor::KeyboardStatusChanged);
Dali::Animation mAnimation; ///< Scroll indicator Show/Hide Animation.
Dali::TimePeriod mAnimationPeriod;
std::vector<Actor> mClippingDecorationActors; ///< Decoration actors which need clipping.
+ Dali::InputMethodOptions mInputMethodOptions;
Actor mRenderableActor;
Actor mActiveLayer;