X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fx11%2Fimf-manager-impl-x.cpp;h=6d9d2a20f42c9ded9c838da93148868c2bf2c1a6;hb=fdeae0675b767547d5b017642cb256c514a35022;hp=1e598c223653c774d33d33b9848f428ac56e809f;hpb=6e329ecbaa0bc9ff01f2031434f4f266b4808752;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/x11/imf-manager-impl-x.cpp b/adaptors/x11/imf-manager-impl-x.cpp index 1e598c2..6d9d2a2 100644 --- a/adaptors/x11/imf-manager-impl-x.cpp +++ b/adaptors/x11/imf-manager-impl-x.cpp @@ -538,7 +538,7 @@ Dali::ImfManager::TextDirection ImfManager::GetTextDirection() if ( locale ) { - direction = Locale::GetTextDirection( std::string( locale ) ); + direction = static_cast< Dali::ImfManager::TextDirection >( Locale::GetDirection( std::string( locale ) ) ); free( locale ); } } @@ -590,25 +590,28 @@ void ImfManager::ApplyOptions( const InputMethodOptions& options ) } } -void ImfManager::SetInputPanelUserData( const std::string& data ) +void ImfManager::SetInputPanelData( const std::string& data ) { - DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetInputPanelUserData\n" ); + DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::SetInputPanelData\n" ); if( mIMFContext ) { int length = data.length(); - ecore_imf_context_input_panel_imdata_set( mIMFContext, &data, length ); + ecore_imf_context_input_panel_imdata_set( mIMFContext, data.c_str(), length ); } } -void ImfManager::GetInputPanelUserData( std::string& data ) +void ImfManager::GetInputPanelData( std::string& data ) { - DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelUserData\n" ); + DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelData\n" ); if( mIMFContext ) { - int* length = NULL; - ecore_imf_context_input_panel_imdata_get( mIMFContext, &data, length ); + int length = 4096; // The max length is 4096 bytes + Dali::Vector< char > buffer; + buffer.Resize( length ); + ecore_imf_context_input_panel_imdata_get( mIMFContext, &buffer[0], &length ); + data = std::string( buffer.Begin(), buffer.End() ); } } @@ -690,6 +693,34 @@ void ImfManager::HideInputPanel() } } +Dali::ImfManager::KeyboardType ImfManager::GetKeyboardType() +{ + return Dali::ImfManager::KeyboardType::SOFTWARE_KEYBOARD; +} + +std::string ImfManager::GetInputPanelLocale() +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "ImfManager::GetInputPanelLocale\n" ); + + std::string locale = ""; + + if( mIMFContext ) + { + char* value = NULL; + ecore_imf_context_input_panel_language_locale_get( mIMFContext, &value ); + + if( value ) + { + std::string valueCopy( value ); + locale = valueCopy; + + // The locale string retrieved must be freed with free(). + free( value ); + } + } + return locale; +} + } // Adaptor } // Internal