/**
* Constructor
*/
- InputMethodContext() = default;
+ InputMethodContext();
/**
* Destructor
InputMethodContext& operator=( InputMethodContext& ) = delete;
protected:
+ /**
+ * @brief Struct for providing Operation enumeration
+ */
+ struct Operation
+ {
+ enum Type
+ {
+ ALLOW_TEXT_PREDICTION = 0,
+ AUTO_ENABLE_INPUT_PANEL,
+ NOTIFY_TEXT_INPUT_MULTILINE,
+ SET_CONTENT_MIME_TYPES,
+ SET_INPUT_PANEL_DATA,
+ SET_INPUT_PANEL_LANGUAGE,
+ SET_INPUT_PANEL_POSITION,
+ SET_RETURN_KEY_STATE,
+ MAX_COUNT
+ };
+ };
+
+ using OperationList = std::vector< std::function<void()> >;
+
+ /**
+ * @brief Apply backup operations to the InputMethodContext
+ */
+ void ApplyBackupOperations();
+
+protected:
ActivatedSignalType mActivatedSignal;
KeyboardEventSignalType mEventSignal;
LanguageChangedSignalType mKeyboardLanguageChangedSignal;
KeyboardTypeSignalType mKeyboardTypeChangedSignal;
ContentReceivedSignalType mContentReceivedSignal;
+ OperationList mBackupOperations;
public:
{
CreateContext();
ConnectCallbacks();
+ ApplyBackupOperations();
}
void InputMethodContextEcoreWl::CreateContext()
(currentHint | ECORE_IMF_INPUT_HINT_MULTILINE) :
(currentHint & ~ECORE_IMF_INPUT_HINT_MULTILINE)));
}
+
+ mBackupOperations[Operation::NOTIFY_TEXT_INPUT_MULTILINE] = std::bind( &InputMethodContextEcoreWl::NotifyTextInputMultiLine, this, multiLine );
}
Dali::InputMethodContext::TextDirection InputMethodContextEcoreWl::GetTextDirection()
int length = data.length();
ecore_imf_context_input_panel_imdata_set( mIMFContext, data.c_str(), length );
}
+
+ mBackupOperations[Operation::SET_INPUT_PANEL_DATA] = std::bind( &InputMethodContextEcoreWl::SetInputPanelData, this, data );
}
void InputMethodContextEcoreWl::GetInputPanelData( std::string& data )
{
ecore_imf_context_input_panel_return_key_disabled_set( mIMFContext, !visible );
}
+
+ mBackupOperations[Operation::SET_RETURN_KEY_STATE] = std::bind( &InputMethodContextEcoreWl::SetReturnKeyState, this, visible );
}
void InputMethodContextEcoreWl::AutoEnableInputPanel( bool enabled )
{
ecore_imf_context_input_panel_enabled_set( mIMFContext, enabled );
}
+
+ mBackupOperations[Operation::AUTO_ENABLE_INPUT_PANEL] = std::bind( &InputMethodContextEcoreWl::AutoEnableInputPanel, this, enabled );
}
void InputMethodContextEcoreWl::ShowInputPanel()
{
ecore_imf_context_mime_type_accept_set( mIMFContext, mimeTypes.c_str() );
}
+
+ mBackupOperations[Operation::SET_CONTENT_MIME_TYPES] = std::bind( &InputMethodContextEcoreWl::SetContentMIMETypes, this, mimeTypes );
}
bool InputMethodContextEcoreWl::FilterEventKey( const Dali::KeyEvent& keyEvent )
{
ecore_imf_context_prediction_allow_set( mIMFContext, prediction );
}
+
+ mBackupOperations[Operation::ALLOW_TEXT_PREDICTION] = std::bind( &InputMethodContextEcoreWl::AllowTextPrediction, this, prediction );
}
bool InputMethodContextEcoreWl::IsTextPredictionAllowed() const
}
}
}
+
+ mBackupOperations[Operation::SET_INPUT_PANEL_LANGUAGE] = std::bind( &InputMethodContextEcoreWl::SetInputPanelLanguage, this, language );
}
Dali::InputMethodContext::InputPanelLanguage InputMethodContextEcoreWl::GetInputPanelLanguage() const
{
ecore_imf_context_input_panel_position_set( mIMFContext, x, y );
}
+
+ mBackupOperations[Operation::SET_INPUT_PANEL_POSITION] = std::bind( &InputMethodContextEcoreWl::SetInputPanelPosition, this, x, y );
}
Dali::InputMethodContext::PreeditStyle InputMethodContextEcoreWl::GetPreeditStyle() const