From 13a1c132f185dd01e5d9bfbc1577179a382e08db Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Fri, 10 May 2019 16:55:10 +0900 Subject: [PATCH] Add to set MIME type to the input panel and add the callback - Added an API to set the allowed MIME type to deliver to the input panel. - Added a callback to receive the content of the input method URI. Change-Id: I6fb970d392fb66a438bd4590440c01503c572c45 Signed-off-by: Seoyeon Kim --- .../adaptor-framework/input-method-context.cpp | 10 +++ .../adaptor-framework/input-method-context.h | 23 +++++++ .../input/common/input-method-context-impl.h | 25 ++++++-- .../input-method-context-impl-ecore-wl.cpp | 73 +++++++++++++++++----- .../input-method-context-impl-ecore-wl.h | 18 ++++-- .../ubuntu-x11/input-method-context-impl-x.cpp | 28 +++++---- .../input/ubuntu-x11/input-method-context-impl-x.h | 19 ++++-- .../windows/input-method-context-impl-win.cpp | 13 ++-- .../input/windows/input-method-context-impl-win.h | 19 ++++-- 9 files changed, 182 insertions(+), 46 deletions(-) diff --git a/dali/devel-api/adaptor-framework/input-method-context.cpp b/dali/devel-api/adaptor-framework/input-method-context.cpp index a63c3e2..e5deaca 100755 --- a/dali/devel-api/adaptor-framework/input-method-context.cpp +++ b/dali/devel-api/adaptor-framework/input-method-context.cpp @@ -181,6 +181,11 @@ std::string InputMethodContext::GetInputPanelLocale() return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLocale(); } +void InputMethodContext::SetContentMIMETypes( const std::string& mimeTypes ) +{ + Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetContentMIMETypes( mimeTypes ); +} + bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent ) { return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent ); @@ -237,6 +242,11 @@ InputMethodContext::KeyboardTypeSignalType& InputMethodContext::KeyboardTypeChan return Internal::Adaptor::InputMethodContext::GetImplementation(*this).KeyboardTypeChangedSignal(); } +InputMethodContext::ContentReceivedSignalType& InputMethodContext::ContentReceivedSignal() +{ + return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ContentReceivedSignal(); +} + InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext *impl) : BaseHandle(impl) { diff --git a/dali/devel-api/adaptor-framework/input-method-context.h b/dali/devel-api/adaptor-framework/input-method-context.h index 5a3950c..e67f5fd 100755 --- a/dali/devel-api/adaptor-framework/input-method-context.h +++ b/dali/devel-api/adaptor-framework/input-method-context.h @@ -177,6 +177,7 @@ public: typedef Signal< void ( KeyboardType ) > KeyboardTypeSignalType; ///< keyboard type typedef Signal< void ( int ) > KeyboardResizedSignalType; ///< Keyboard resized signal typedef Signal< void ( int ) > LanguageChangedSignalType; ///< Language changed signal + typedef Signal< void ( const std::string&, const std::string&, const std::string& ) > ContentReceivedSignalType; ///< Content received signal public: @@ -397,6 +398,16 @@ public: std::string GetInputPanelLocale(); /** + * @brief Sets the allowed MIME Types to deliver to the input panel. + * + * ex) std::string mimeTypes = "text/plain,image/png,image/gif,application/pdf"; + * + * You can receive a media content URI and its MIME type from ContentReceivedSignal(). @see ContentReceivedSignal + * @param[in] mimeTypes The allowed MIME types + */ + void SetContentMIMETypes( const std::string& mimeTypes ); + + /** * @brief Process event key down or up, whether filter a key to isf. * * @param[in] keyEvent The event key to be handled. @@ -504,6 +515,18 @@ public: */ KeyboardTypeSignalType& KeyboardTypeChangedSignal(); + /** + * @brief Connect to this signal to be notified when the content, such as images, of input method is received. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( const std::string& contentUri, const std::string& description, const std::string& contentMIMEType ); + * @endcode + * + * @return The signal to connect to. + */ + ContentReceivedSignalType& ContentReceivedSignal(); + public: /** diff --git a/dali/internal/input/common/input-method-context-impl.h b/dali/internal/input/common/input-method-context-impl.h index 49387c1..33ab2a6 100755 --- a/dali/internal/input/common/input-method-context-impl.h +++ b/dali/internal/input/common/input-method-context-impl.h @@ -54,6 +54,7 @@ public: using KeyboardTypeSignalType = Dali::InputMethodContext::KeyboardTypeSignalType; using LanguageChangedSignalType = Dali::InputMethodContext::LanguageChangedSignalType; using KeyboardResizedSignalType = Dali::InputMethodContext::KeyboardResizedSignalType; + using ContentReceivedSignalType = Dali::InputMethodContext::ContentReceivedSignalType; public: @@ -117,12 +118,12 @@ public: /** * @copydoc Dali::InputMethodContext::PreEditChanged() */ - virtual void PreEditChanged( void *data, ImfContext* imfContext, void *event_info ) {} + virtual void PreEditChanged( void *data, ImfContext* imfContext, void *eventInfo ) {} /** * @copydoc Dali::InputMethodContext::CommitReceived() */ - virtual void CommitReceived( void *data, ImfContext* imfContext, void *event_info ) {} + virtual void CommitReceived( void *data, ImfContext* imfContext, void *eventInfo ) {} /** * @copydoc Dali::InputMethodContext::RetrieveSurrounding() @@ -133,12 +134,17 @@ public: /** * @copydoc Dali::InputMethodContext::DeleteSurrounding() */ - virtual void DeleteSurrounding( void *data, ImfContext* imfContext, void *event_info ) {} + virtual void DeleteSurrounding( void *data, ImfContext* imfContext, void *eventInfo ) {} /** * @copydoc Dali::InputMethodContext::SendPrivateCommand() */ - virtual void SendPrivateCommand( void* data, ImfContext* imfContext, void* event_info ) {} + virtual void SendPrivateCommand( void* data, ImfContext* imfContext, void* eventInfo ) {} + + /** + * @copydoc Dali::InputMethodContext::SendCommitContent() + */ + virtual void SendCommitContent( void* data, ImfContext* imfContext, void* eventInfo ) {} // Cursor related /** @@ -232,6 +238,11 @@ public: virtual std::string GetInputPanelLocale() { return std::string(); } /** + * @copydoc Dali::InputMethodContext::SetContentMIMETypes() + */ + virtual void SetContentMIMETypes( const std::string& mimeTypes ) {} + + /** * @copydoc Dali::InputMethodContext::FilterEventKey() */ virtual bool FilterEventKey( const Dali::KeyEvent& keyEvent ) { return false; } @@ -288,6 +299,11 @@ public: // Signals */ KeyboardTypeSignalType& KeyboardTypeChangedSignal() { return mKeyboardTypeChangedSignal; } + /** + * @copydoc Dali::InputMethodContext::ContentReceivedSignal() + */ + ContentReceivedSignalType& ContentReceivedSignal() { return mContentReceivedSignal; } + public: /** @@ -313,6 +329,7 @@ protected: KeyboardResizedSignalType mKeyboardResizeSignal; LanguageChangedSignalType mKeyboardLanguageChangedSignal; KeyboardTypeSignalType mKeyboardTypeChangedSignal; + ContentReceivedSignalType mContentReceivedSignal; public: diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp index accf6f2..fbff9ad 100755 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp @@ -123,21 +123,21 @@ size_t Utf8SequenceLength(const unsigned char leadByte) } // Static function calls used by ecore 'c' style callback registration -void Commit( void *data, Ecore_IMF_Context *imfContext, void *event_info ) +void Commit( void *data, Ecore_IMF_Context *imfContext, void *eventInfo ) { if ( data ) { InputMethodContextEcoreWl* inputMethodContext = reinterpret_cast< InputMethodContextEcoreWl* > ( data ); - inputMethodContext->CommitReceived( data, imfContext, event_info ); + inputMethodContext->CommitReceived( data, imfContext, eventInfo ); } } -void PreEdit( void *data, Ecore_IMF_Context *imfContext, void *event_info ) +void PreEdit( void *data, Ecore_IMF_Context *imfContext, void *eventInfo ) { if ( data ) { InputMethodContextEcoreWl* inputMethodContext = reinterpret_cast< InputMethodContextEcoreWl* > ( data ); - inputMethodContext->PreEditChanged( data, imfContext, event_info ); + inputMethodContext->PreEditChanged( data, imfContext, eventInfo ); } } @@ -235,24 +235,36 @@ void InputPanelKeyboardTypeChangedCallback( void *data, Ecore_IMF_Context *conte * Called when an IMF delete surrounding event is received. * Here we tell the application that it should delete a certain range. */ -void ImfDeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *event_info ) +void ImfDeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *eventInfo ) { if ( data ) { InputMethodContextEcoreWl* inputMethodContext = reinterpret_cast< InputMethodContextEcoreWl* > ( data ); - inputMethodContext->DeleteSurrounding( data, imfContext, event_info ); + inputMethodContext->DeleteSurrounding( data, imfContext, eventInfo ); } } /** * Called when the input method sends a private command. */ -void PrivateCommand( void *data, Ecore_IMF_Context *imfContext, void *event_info ) +void PrivateCommand( void *data, Ecore_IMF_Context *imfContext, void *eventInfo ) { if ( data ) { InputMethodContextEcoreWl* inputMethodContext = reinterpret_cast< InputMethodContextEcoreWl* > ( data ); - inputMethodContext->SendPrivateCommand( data, imfContext, event_info ); + inputMethodContext->SendPrivateCommand( data, imfContext, eventInfo ); + } +} + +/** + * Called when the input method commits content, such as an image. + */ +void CommitContent( void *data, Ecore_IMF_Context *imfContext, void *eventInfo ) +{ + if ( data ) + { + InputMethodContextEcoreWl* inputMethodContext = reinterpret_cast< InputMethodContextEcoreWl* > ( data ); + inputMethodContext->SendCommitContent( data, imfContext, eventInfo ); } } @@ -377,6 +389,7 @@ void InputMethodContextEcoreWl::ConnectCallbacks() ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_COMMIT, Commit, this ); ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, ImfDeleteSurrounding, this ); ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, PrivateCommand, this ); + ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_COMMIT_CONTENT, CommitContent, this ); ecore_imf_context_input_panel_event_callback_add( mIMFContext, ECORE_IMF_INPUT_PANEL_STATE_EVENT, InputPanelStateChangeCallback, this ); ecore_imf_context_input_panel_event_callback_add( mIMFContext, ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, InputPanelLanguageChangeCallback, this ); @@ -397,6 +410,7 @@ void InputMethodContextEcoreWl::DisconnectCallbacks() ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_COMMIT, Commit ); ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, ImfDeleteSurrounding ); ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, PrivateCommand ); + ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_COMMIT_CONTENT, CommitContent ); ecore_imf_context_input_panel_event_callback_del( mIMFContext, ECORE_IMF_INPUT_PANEL_STATE_EVENT, InputPanelStateChangeCallback ); ecore_imf_context_input_panel_event_callback_del( mIMFContext, ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, InputPanelLanguageChangeCallback ); @@ -470,7 +484,7 @@ void InputMethodContextEcoreWl::SetRestoreAfterFocusLost( bool toggle ) * We are still predicting what the user is typing. The latest string is what the InputMethodContext module thinks * the user wants to type. */ -void InputMethodContextEcoreWl::PreEditChanged( void*, ImfContext* imfContext, void* event_info ) +void InputMethodContextEcoreWl::PreEditChanged( void*, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::PreEditChanged\n" ); auto context = reinterpret_cast(imfContext); @@ -548,13 +562,13 @@ void InputMethodContextEcoreWl::PreEditChanged( void*, ImfContext* imfContext, v free( preEditString ); } -void InputMethodContextEcoreWl::CommitReceived( void*, ImfContext* imfContext, void* event_info ) +void InputMethodContextEcoreWl::CommitReceived( void*, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::CommitReceived\n" ); if ( Dali::Adaptor::IsAvailable() ) { - const std::string keyString( static_cast( event_info ) ); + const std::string keyString( static_cast( eventInfo ) ); Dali::InputMethodContext handle( this ); Dali::InputMethodContext::EventData eventData( Dali::InputMethodContext::COMMIT, keyString, 0, 0 ); @@ -605,13 +619,13 @@ bool InputMethodContextEcoreWl::RetrieveSurrounding( void* data, ImfContext* imf * Called when an InputMethodContext delete surrounding event is received. * Here we tell the application that it should delete a certain range. */ -void InputMethodContextEcoreWl::DeleteSurrounding( void* data, ImfContext* imfContext, void* event_info ) +void InputMethodContextEcoreWl::DeleteSurrounding( void* data, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::DeleteSurrounding\n" ); if( Dali::Adaptor::IsAvailable() ) { - Ecore_IMF_Event_Delete_Surrounding* deleteSurroundingEvent = static_cast( event_info ); + Ecore_IMF_Event_Delete_Surrounding* deleteSurroundingEvent = static_cast( eventInfo ); Dali::InputMethodContext::EventData imfData( Dali::InputMethodContext::DELETE_SURROUNDING, std::string(), deleteSurroundingEvent->offset, deleteSurroundingEvent->n_chars ); Dali::InputMethodContext handle( this ); @@ -622,13 +636,13 @@ void InputMethodContextEcoreWl::DeleteSurrounding( void* data, ImfContext* imfCo /** * Called when the input method sends a private command. */ -void InputMethodContextEcoreWl::SendPrivateCommand( void* data, ImfContext* imfContext, void* event_info ) +void InputMethodContextEcoreWl::SendPrivateCommand( void* data, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::SendPrivateCommand\n" ); if( Dali::Adaptor::IsAvailable() ) { - const char* privateCommandSendEvent = static_cast( event_info ); + const char* privateCommandSendEvent = static_cast( eventInfo ); Dali::InputMethodContext::EventData imfData( Dali::InputMethodContext::PRIVATE_COMMAND, privateCommandSendEvent, 0, 0 ); Dali::InputMethodContext handle( this ); @@ -636,6 +650,25 @@ void InputMethodContextEcoreWl::SendPrivateCommand( void* data, ImfContext* imfC } } +/** + * Called when the input method commits content, such as an image. + */ +void InputMethodContextEcoreWl::SendCommitContent( void* data, ImfContext* imfContext, void* eventInfo ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::SendCommitContent\n" ); + + if( Dali::Adaptor::IsAvailable() ) + { + Ecore_IMF_Event_Commit_Content* commitContent = static_cast( eventInfo ); + if( commitContent ) + { + DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::SendCommitContent commit content : %s, description : %s, mime type : %s\n", + commitContent->content_uri, commitContent->description, commitContent->mime_types ); + mContentReceivedSignal.Emit( commitContent->content_uri, commitContent->description, commitContent->mime_types ); + } + } +} + void InputMethodContextEcoreWl::NotifyCursorPosition() { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::NotifyCursorPosition\n" ); @@ -914,6 +947,16 @@ std::string InputMethodContextEcoreWl::GetInputPanelLocale() return locale; } +void InputMethodContextEcoreWl::SetContentMIMETypes( const std::string& mimeTypes ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::SetContentMIMETypes\n" ); + + if( mIMFContext ) + { + ecore_imf_context_mime_type_accept_set( mIMFContext, mimeTypes.c_str() ); + } +} + bool InputMethodContextEcoreWl::FilterEventKey( const Dali::KeyEvent& keyEvent ) { bool eventHandled( false ); diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h index ad7117c..3d2e170 100755 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h @@ -108,12 +108,12 @@ public: /** * @copydoc Dali::InputMethodContext::PreEditChanged() */ - void PreEditChanged( void *data, ImfContext *imfContext, void *event_info ) override; + void PreEditChanged( void *data, ImfContext *imfContext, void *eventInfo ) override; /** * @copydoc Dali::InputMethodContext::NotifyCursorPosition() */ - void CommitReceived( void *data, ImfContext *imfContext, void *event_info ) override; + void CommitReceived( void *data, ImfContext *imfContext, void *eventInfo ) override; /** * @copydoc Dali::InputMethodContext::NotifyCursorPosition() @@ -123,12 +123,17 @@ public: /** * @copydoc Dali::InputMethodContext::DeleteSurrounding() */ - void DeleteSurrounding( void *data, ImfContext *imfContext, void *event_info ) override; + void DeleteSurrounding( void *data, ImfContext *imfContext, void *eventInfo ) override; /** * @copydoc Dali::InputMethodContext::SendPrivateCommand() */ - void SendPrivateCommand( void* data, ImfContext* imfContext, void* event_info ) override; + void SendPrivateCommand( void* data, ImfContext* imfContext, void* eventInfo ) override; + + /** + * @copydoc Dali::InputMethodContext::SendCommitContent() + */ + void SendCommitContent( void* data, ImfContext* imfContext, void* eventInfo ) override; // Cursor related /** @@ -222,6 +227,11 @@ public: std::string GetInputPanelLocale() override; /** + * @copydoc Dali::InputMethodContext::SetContentMIMETypes() + */ + void SetContentMIMETypes( const std::string& mimeTypes ) override; + + /** * @copydoc Dali::InputMethodContext::FilterEventKey() */ bool FilterEventKey( const Dali::KeyEvent& keyEvent ) override; diff --git a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp index d398555..60cba35 100755 --- a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp +++ b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp @@ -76,21 +76,21 @@ size_t Utf8SequenceLength(const unsigned char leadByte) } // Static function calls used by ecore 'c' style callback registration -void Commit( void *data, Ecore_IMF_Context *imfContext, void *event_info ) +void Commit( void *data, Ecore_IMF_Context *imfContext, void *eventInfo ) { if ( data ) { InputMethodContextX* inputMethodContext = reinterpret_cast< InputMethodContextX* > ( data ); - inputMethodContext->CommitReceived( data, imfContext, event_info ); + inputMethodContext->CommitReceived( data, imfContext, eventInfo ); } } -void PreEdit( void *data, Ecore_IMF_Context *imfContext, void *event_info ) +void PreEdit( void *data, Ecore_IMF_Context *imfContext, void *eventInfo ) { if ( data ) { InputMethodContextX* inputMethodContext = reinterpret_cast< InputMethodContextX* > ( data ); - inputMethodContext->PreEditChanged( data, imfContext, event_info ); + inputMethodContext->PreEditChanged( data, imfContext, eventInfo ); } } @@ -111,12 +111,12 @@ Eina_Bool ImfRetrieveSurrounding(void *data, Ecore_IMF_Context *imfContext, char * Called when an InputMethodContext delete surrounding event is received. * Here we tell the application that it should delete a certain range. */ -void ImfDeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *event_info ) +void ImfDeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *eventInfo ) { if ( data ) { InputMethodContextX* inputMethodContext = reinterpret_cast< InputMethodContextX* > ( data ); - inputMethodContext->DeleteSurrounding( data, imfContext, event_info ); + inputMethodContext->DeleteSurrounding( data, imfContext, eventInfo ); } } @@ -314,7 +314,7 @@ void InputMethodContextX::SetRestoreAfterFocusLost( bool toggle ) * We are still predicting what the user is typing. The latest string is what the InputMethodContext module thinks * the user wants to type. */ -void InputMethodContextX::PreEditChanged( void*, ImfContext* imfContext, void* event_info ) +void InputMethodContextX::PreEditChanged( void*, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::PreEditChanged\n" ); auto context = reinterpret_cast(imfContext); @@ -391,13 +391,13 @@ void InputMethodContextX::PreEditChanged( void*, ImfContext* imfContext, void* e free( preEditString ); } -void InputMethodContextX::CommitReceived( void*, ImfContext* imfContext, void* event_info ) +void InputMethodContextX::CommitReceived( void*, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::CommitReceived\n" ); if ( Dali::Adaptor::IsAvailable() ) { - const std::string keyString( static_cast( event_info ) ); + const std::string keyString( static_cast( eventInfo ) ); Dali::InputMethodContext handle( this ); Dali::InputMethodContext::EventData eventData( Dali::InputMethodContext::COMMIT, keyString, 0, 0 ); @@ -446,13 +446,13 @@ bool InputMethodContextX::RetrieveSurrounding( void* data, ImfContext* imfContex * Called when an InputMethodContext delete surrounding event is received. * Here we tell the application that it should delete a certain range. */ -void InputMethodContextX::DeleteSurrounding( void* data, ImfContext* imfContext, void* event_info ) +void InputMethodContextX::DeleteSurrounding( void* data, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::DeleteSurrounding\n" ); if( Dali::Adaptor::IsAvailable() ) { - Ecore_IMF_Event_Delete_Surrounding* deleteSurroundingEvent = static_cast( event_info ); + Ecore_IMF_Event_Delete_Surrounding* deleteSurroundingEvent = static_cast( eventInfo ); Dali::InputMethodContext::EventData imfData( Dali::InputMethodContext::DELETE_SURROUNDING, std::string(), deleteSurroundingEvent->offset, deleteSurroundingEvent->n_chars ); Dali::InputMethodContext handle( this ); @@ -703,6 +703,12 @@ std::string InputMethodContextX::GetInputPanelLocale() return locale; } +void InputMethodContextX::SetContentMIMETypes( const std::string& mimeTypes ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::SetContentMIMETypes\n" ); + // ecore_imf_context_mime_type_accept_set() is supported from ecore-imf 1.20.0 version. +} + bool InputMethodContextX::FilterEventKey( const Dali::KeyEvent& keyEvent ) { bool eventHandled( false ); diff --git a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.h b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.h index 4c2b1b5..894d0f1 100755 --- a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.h +++ b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.h @@ -112,12 +112,12 @@ public: /** * @copydoc Dali::InputMethodContext::PreEditChanged() */ - void PreEditChanged( void* data, ImfContext* imfContext, void* event_info ) override; + void PreEditChanged( void* data, ImfContext* imfContext, void* eventInfo ) override; /** * @copydoc Dali::InputMethodContext::NotifyCursorPosition() */ - void CommitReceived( void* data, ImfContext* imfContext, void* event_info ) override; + void CommitReceived( void* data, ImfContext* imfContext, void* eventInfo ) override; /** * @copydoc Dali::InputMethodContext::NotifyCursorPosition() @@ -127,12 +127,18 @@ public: /** * @copydoc Dali::InputMethodContext::DeleteSurrounding() */ - void DeleteSurrounding( void* data, ImfContext* imfContext, void* event_info ) override; + void DeleteSurrounding( void* data, ImfContext* imfContext, void* eventInfo ) override; /** * @copydoc Dali::InputMethodContext::SendPrivateCommand() */ - void SendPrivateCommand( void* data, ImfContext* imfContext, void* event_info ) override + void SendPrivateCommand( void* data, ImfContext* imfContext, void* eventInfo ) override + {} + + /** + * @copydoc Dali::InputMethodContext::SendCommitContent() + */ + void SendCommitContent( void* data, ImfContext* imfContext, void* eventInfo ) override {} // Cursor related @@ -227,6 +233,11 @@ public: std::string GetInputPanelLocale() override; /** + * @copydoc Dali::InputMethodContext::SetContentMIMETypes() + */ + void SetContentMIMETypes( const std::string& mimeTypes ) override; + + /** * @copydoc Dali::InputMethodContext::FilterEventKey() */ bool FilterEventKey( const Dali::KeyEvent& keyEvent ) override; diff --git a/dali/internal/input/windows/input-method-context-impl-win.cpp b/dali/internal/input/windows/input-method-context-impl-win.cpp index 6bbfac1..ee3ff2b 100755 --- a/dali/internal/input/windows/input-method-context-impl-win.cpp +++ b/dali/internal/input/windows/input-method-context-impl-win.cpp @@ -148,18 +148,18 @@ void InputMethodContextWin::SetRestoreAfterFocusLost( bool toggle ) * We are still predicting what the user is typing. The latest string is what the InputMethodContext module thinks * the user wants to type. */ -void InputMethodContextWin::PreEditChanged( void*, ImfContext* imfContext, void* event_info ) +void InputMethodContextWin::PreEditChanged( void*, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::PreEditChanged\n" ); } -void InputMethodContextWin::CommitReceived( void*, ImfContext* imfContext, void* event_info ) +void InputMethodContextWin::CommitReceived( void*, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::CommitReceived\n" ); if ( Dali::Adaptor::IsAvailable() ) { - const std::string keyString( static_cast( event_info ) ); + const std::string keyString( static_cast( eventInfo ) ); Dali::InputMethodContext handle( this ); Dali::InputMethodContext::EventData eventData( Dali::InputMethodContext::COMMIT, keyString, 0, 0 ); @@ -208,7 +208,7 @@ bool InputMethodContextWin::RetrieveSurrounding( void* data, ImfContext* imfCont * Called when an InputMethodContext delete surrounding event is received. * Here we tell the application that it should delete a certain range. */ -void InputMethodContextWin::DeleteSurrounding( void* data, ImfContext* imfContext, void* event_info ) +void InputMethodContextWin::DeleteSurrounding( void* data, ImfContext* imfContext, void* eventInfo ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::DeleteSurrounding\n" ); } @@ -335,6 +335,11 @@ std::string InputMethodContextWin::GetInputPanelLocale() return locale; } +void InputMethodContextWin::SetContentMIMETypes( const std::string& mimeTypes ) +{ + DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::SetContentMIMETypes\n" ); +} + bool InputMethodContextWin::FilterEventKey( const Dali::KeyEvent& keyEvent ) { bool eventHandled( false ); diff --git a/dali/internal/input/windows/input-method-context-impl-win.h b/dali/internal/input/windows/input-method-context-impl-win.h index d2a03fc..e1c1e33 100755 --- a/dali/internal/input/windows/input-method-context-impl-win.h +++ b/dali/internal/input/windows/input-method-context-impl-win.h @@ -110,12 +110,12 @@ public: /** * @copydoc Dali::InputMethodContext::PreEditChanged() */ - void PreEditChanged( void* data, ImfContext* imfContext, void* event_info ) override; + void PreEditChanged( void* data, ImfContext* imfContext, void* eventInfo ) override; /** * @copydoc Dali::InputMethodContext::NotifyCursorPosition() */ - void CommitReceived( void* data, ImfContext* imfContext, void* event_info ) override; + void CommitReceived( void* data, ImfContext* imfContext, void* eventInfo ) override; /** * @copydoc Dali::InputMethodContext::NotifyCursorPosition() @@ -125,12 +125,18 @@ public: /** * @copydoc Dali::InputMethodContext::DeleteSurrounding() */ - void DeleteSurrounding( void* data, ImfContext* imfContext, void* event_info ) override; + void DeleteSurrounding( void* data, ImfContext* imfContext, void* eventInfo ) override; /** * @copydoc Dali::InputMethodContext::SendPrivateCommand() */ - void SendPrivateCommand( void* data, ImfContext* imfContext, void* event_info ) override + void SendPrivateCommand( void* data, ImfContext* imfContext, void* eventInfo ) override + {} + + /** + * @copydoc Dali::InputMethodContext::SendCommitContent() + */ + void SendCommitContent( void* data, ImfContext* imfContext, void* eventInfo ) override {} // Cursor related @@ -225,6 +231,11 @@ public: std::string GetInputPanelLocale() override; /** + * @copydoc Dali::InputMethodContext::SetContentMIMETypes() + */ + void SetContentMIMETypes( const std::string& mimeTypes ) override; + + /** * @copydoc Dali::InputMethodContext::FilterEventKey() */ bool FilterEventKey( const Dali::KeyEvent& keyEvent ) override; -- 2.7.4