+void ImfManager::NotifyTextInputMultiLine( bool multiLine )
+{
+ Ecore_IMF_Input_Hints currentHint = ecore_imf_context_input_hint_get(mIMFContext);
+ ecore_imf_context_input_hint_set(mIMFContext, (Ecore_IMF_Input_Hints)(multiLine ?
+ (currentHint | ECORE_IMF_INPUT_HINT_MULTILINE) :
+ (currentHint & ~ECORE_IMF_INPUT_HINT_MULTILINE)));
+}
+
+Dali::ImfManager::TextDirection ImfManager::GetTextDirection()
+{
+ Dali::ImfManager::TextDirection direction ( Dali::ImfManager::LeftToRight );
+
+ if ( ImfManager::IsAvailable() /* We do not want to create an instance of ImfManager */ )
+ {
+ if ( mIMFContext )
+ {
+ char* locale( NULL );
+ ecore_imf_context_input_panel_language_locale_get( mIMFContext, &locale );
+
+ if ( locale )
+ {
+ direction = Locale::GetTextDirection( std::string( locale ) );
+ free( locale );
+ }
+ }
+ }
+ return direction;
+}
+
+Rect<int> ImfManager::GetInputMethodArea()
+{
+ int xPos, yPos, width, height;
+
+ width = height = xPos = yPos = 0;
+
+ if( mIMFContext )
+ {
+ ecore_imf_context_input_panel_geometry_get( mIMFContext, &xPos, &yPos, &width, &height );
+ }
+ else
+ {
+ DALI_LOG_WARNING("VKB Unable to get IMF Context so GetSize unavailable\n");
+ // return 0 as real size unknown.
+ }
+
+ return Rect<int>(xPos,yPos,width,height);
+}
+
+void ImfManager::ApplyOptions( const InputMethodOptions& options )
+{
+ using namespace Dali::InputMethod::Category;
+
+ int index;
+
+ if (mIMFContext == NULL)
+ {
+ DALI_LOG_WARNING("VKB Unable to excute ApplyOptions with Null ImfContext\n");
+ return;
+ }
+
+ if ( mOptions.CompareAndSet(PANEL_LAYOUT, options, index) )
+ {
+ ecore_imf_context_input_panel_layout_set( mIMFContext, panelLayoutMap[index] );
+ }
+ if ( mOptions.CompareAndSet(AUTO_CAPITALISE, options, index) )
+ {
+ ecore_imf_context_autocapital_type_set( mIMFContext, autoCapitalMap[index] );
+ }
+ if ( mOptions.CompareAndSet(ACTION_BUTTON_TITLE, options, index) )
+ {
+ ecore_imf_context_input_panel_return_key_type_set( mIMFContext, returnKeyTypeMap[index] );
+ }
+ if ( mOptions.CompareAndSet(VARIATION, options, index) )
+ {
+ ecore_imf_context_input_panel_layout_variation_set( mIMFContext, index );
+ }
+}
+
+void ImfManager::SetInputPanelUserData( const std::string& data )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetInputPanelUserData\n" );
+
+ if( mIMFContext )
+ {
+ int length = data.length();
+ ecore_imf_context_input_panel_imdata_set( mIMFContext, &data, length );
+ }
+}
+
+void ImfManager::GetInputPanelUserData( std::string& data )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelUserData\n" );
+
+ if( mIMFContext )
+ {
+ int* length = NULL;
+ ecore_imf_context_input_panel_imdata_get( mIMFContext, &data, length );
+ }
+}
+
+Dali::ImfManager::State ImfManager::GetInputPanelState()
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelState\n" );
+
+ if( mIMFContext )
+ {
+ int value;
+ value = ecore_imf_context_input_panel_state_get( mIMFContext );
+
+ switch (value)
+ {
+ case ECORE_IMF_INPUT_PANEL_STATE_SHOW:
+ {
+ return Dali::ImfManager::SHOW;
+ break;
+ }
+
+ case ECORE_IMF_INPUT_PANEL_STATE_HIDE:
+ {
+ return Dali::ImfManager::HIDE;
+ break;
+ }
+
+ case ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW:
+ {
+ return Dali::ImfManager::WILL_SHOW;
+ break;
+ }
+
+ default:
+ {
+ return Dali::ImfManager::DEFAULT;
+ }
+ }
+ }
+ return Dali::ImfManager::DEFAULT;
+}
+
+void ImfManager::SetReturnKeyState( bool visible )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetReturnKeyState\n" );
+
+ if( mIMFContext )
+ {
+ ecore_imf_context_input_panel_return_key_disabled_set( mIMFContext, !visible );
+ }
+}
+
+void ImfManager::AutoEnableInputPanel( bool enabled )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::AutoEnableInputPanel\n" );
+
+ if( mIMFContext )
+ {
+ ecore_imf_context_input_panel_enabled_set( mIMFContext, enabled );
+ }
+}
+
+void ImfManager::ShowInputPanel()
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::ShowInputPanel\n" );
+
+ if( mIMFContext )
+ {
+ ecore_imf_context_input_panel_show( mIMFContext );
+ }
+}
+
+void ImfManager::HideInputPanel()
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::HideInputPanel\n" );
+
+ if( mIMFContext )
+ {
+ ecore_imf_context_focus_out( mIMFContext );
+ ecore_imf_context_input_panel_hide( mIMFContext );
+ }
+}
+