- Be able to set IME Language as English using SetInputPanelLanguage().
The default is automatic depending on the system display.
Change-Id: I57b56c5aa6e48955ba4b0c67aa7f14aedb56a566
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).IsTextPredictionAllowed();
}
+void InputMethodContext::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelLanguage( language );
+}
+
+Dali::InputMethodContext::InputPanelLanguage InputMethodContext::GetInputPanelLanguage() const
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLanguage();
+}
+
+// Signals
InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
{
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
#define __DALI_INPUT_METHOD_CONTEXT_H__
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
HARDWARE_KEYBOARD ///< Hardware keyboard
};
+ enum class InputPanelLanguage
+ {
+ AUTOMATIC, ///< IME Language automatically set depending on the system display
+ ALPHABET ///< Latin alphabet at all times
+ };
+
/**
* @brief This structure is used to pass on data from the InputMethodContext regarding predictive text.
*/
* @return Whether the IM allow text prediction or not.
*/
bool IsTextPredictionAllowed() const;
+
+ /**
+ * @brief Sets the language of the input panel.
+ *
+ * This method can be used when you want to show the English keyboard.
+ * @param[in] language The language to be set to the input panel
+ */
+ void SetInputPanelLanguage( InputPanelLanguage language );
+
+ /**
+ * @brief Gets the language of the input panel.
+ *
+ * @return The language of the input panel
+ */
+ InputPanelLanguage GetInputPanelLanguage() const;
+
public:
// Signals
* @copydoc Dali::InputMethodContext::IsTextPredictionAllowed()
*/
virtual bool IsTextPredictionAllowed() const { return false; }
+
+ /**
+ * @copydoc Dali::InputMethodContext::SetInputPanelLanguage()
+ */
+ virtual void SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language ) {}
+
+ /**
+ * @copydoc Dali::InputMethodContext::GetInputPanelLanguage()
+ */
+ virtual Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const { return Dali::InputMethodContext::InputPanelLanguage(); }
+
public: // Signals
/**
return prediction;
}
+void InputMethodContextEcoreWl::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::SetInputPanelLanguage\n" );
+ if( mIMFContext )
+ {
+ switch (language)
+ {
+ case Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC:
+ {
+ ecore_imf_context_input_panel_language_set( mIMFContext, ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC );
+ break;
+ }
+ case Dali::InputMethodContext::InputPanelLanguage::ALPHABET:
+ {
+ ecore_imf_context_input_panel_language_set( mIMFContext, ECORE_IMF_INPUT_PANEL_LANG_ALPHABET );
+ break;
+ }
+ }
+ }
+}
+
+Dali::InputMethodContext::InputPanelLanguage InputMethodContextEcoreWl::GetInputPanelLanguage() const
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::GetInputPanelLanguage\n" );
+ if( mIMFContext )
+ {
+ int value;
+ value = ecore_imf_context_input_panel_language_get( mIMFContext );
+
+ switch (value)
+ {
+ case ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC:
+ {
+ return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
+ break;
+ }
+ case ECORE_IMF_INPUT_PANEL_LANG_ALPHABET:
+ {
+ return Dali::InputMethodContext::InputPanelLanguage::ALPHABET;
+ break;
+ }
+ }
+ }
+ return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
+}
+
bool InputMethodContextEcoreWl::ProcessEventKeyDown( const KeyEvent& keyEvent )
{
bool eventHandled( false );
* @copydoc Dali::InputMethodContext::IsTextPredictionAllowed()
*/
bool IsTextPredictionAllowed() const override;
+
+ /**
+ * @copydoc Dali::InputMethodContext::SetInputPanelLanguage()
+ */
+ void SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language ) override;
+
+ /**
+ * @copydoc Dali::InputMethodContext::GetInputPanelLanguage()
+ */
+ Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const override;
+
private:
/**
* Context created the first time and kept until deleted.
return prediction;
}
+void InputMethodContextX::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::SetInputPanelLanguage\n" );
+ if( mIMFContext )
+ {
+ switch (language)
+ {
+ case Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC:
+ {
+ ecore_imf_context_input_panel_language_set( mIMFContext, ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC );
+ break;
+ }
+ case Dali::InputMethodContext::InputPanelLanguage::ALPHABET:
+ {
+ ecore_imf_context_input_panel_language_set( mIMFContext, ECORE_IMF_INPUT_PANEL_LANG_ALPHABET );
+ break;
+ }
+ }
+ }
+}
+
+Dali::InputMethodContext::InputPanelLanguage InputMethodContextX::GetInputPanelLanguage() const
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::GetInputPanelLanguage\n" );
+ if( mIMFContext )
+ {
+ int value;
+ value = ecore_imf_context_input_panel_language_get( mIMFContext );
+
+ switch (value)
+ {
+ case ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC:
+ {
+ return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
+ break;
+ }
+ case ECORE_IMF_INPUT_PANEL_LANG_ALPHABET:
+ {
+ return Dali::InputMethodContext::InputPanelLanguage::ALPHABET;
+ break;
+ }
+ }
+ }
+ return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
+}
+
bool InputMethodContextX::ProcessEventKeyDown( const KeyEvent& keyEvent )
{
bool eventHandled( false );
* @copydoc Dali::InputMethodContext::IsTextPredictionAllowed()
*/
bool IsTextPredictionAllowed() const override;
+
+ /**
+ * @copydoc Dali::InputMethodContext::SetInputPanelLanguage()
+ */
+ void SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language ) override;
+
+ /**
+ * @copydoc Dali::InputMethodContext::GetInputPanelLanguage()
+ */
+ Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const override;
+
private:
/**
* Context created the first time and kept until deleted.
return eventHandled;\r
}\r
\r
+void InputMethodContextWin::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )\r
+{\r
+ DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::SetInputPanelLanguage\n" );\r
+}\r
+\r
+Dali::InputMethodContext::InputPanelLanguage InputMethodContextWin::GetInputPanelLanguage() const\r
+{\r
+ DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetInputPanelLanguage\n" );\r
+ return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;\r
+}\r
+\r
bool InputMethodContextWin::ProcessEventKeyDown( const KeyEvent& keyEvent )\r
{\r
bool eventHandled( false );\r
*/\r
bool FilterEventKey( const Dali::KeyEvent& keyEvent ) override;\r
\r
+ /**\r
+ * @copydoc Dali::InputMethodContext::SetInputPanelLanguage()\r
+ */\r
+ void SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language ) override;\r
+\r
+ /**\r
+ * @copydoc Dali::InputMethodContext::GetInputPanelLanguage()\r
+ */\r
+ Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const override;\r
+\r
private:\r
/**\r
* Context created the first time and kept until deleted.\r