From c38ef089812a54c956c8ae5857c6fe369e1da005 Mon Sep 17 00:00:00 2001 From: suhyung Eom Date: Tue, 9 Aug 2016 09:29:12 +0900 Subject: [PATCH] Notify multiline hint to IMF context Signed-off-by: suhyung Eom Change-Id: If7b51387d37b3c3b652ac75cf74911904a2ed002 --- .../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp | 4 ++++ .../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h | 5 +++++ dali-toolkit/internal/text/text-controller-impl.cpp | 9 +++++++++ dali-toolkit/internal/text/text-controller-impl.h | 5 +++++ dali-toolkit/internal/text/text-controller.cpp | 2 +- 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp index e35ce05..11dfca9 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp @@ -267,6 +267,10 @@ const std::string& ImfManager::GetSurroundingText() const return Internal::Adaptor::ImfManager::GetImplementation(*this).GetSurroundingText(); } +void ImfManager::NotifyTextInputMultiLine( bool multiLine ) +{ +} + ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal() { return Internal::Adaptor::ImfManager::GetImplementation(*this).ActivatedSignal(); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h index d90e9d4..7049354 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h @@ -212,6 +212,11 @@ public: */ const std::string& GetSurroundingText() const; + /** + * @brief Notifies IMF context that text input is set to multi line or not + */ + void NotifyTextInputMultiLine( bool multiLine ); + public: // Signals diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 95115da..0fb2171 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -307,6 +307,15 @@ void Controller::Impl::NotifyImfManager() } } +void Controller::Impl::NotifyImfMultiLineStatus() +{ + if ( mEventData ) + { + LayoutEngine::Layout layout = mLayoutEngine.GetLayout(); + mEventData->mImfManager.NotifyTextInputMultiLine( layout == LayoutEngine::MULTI_LINE_BOX ); + } +} + CharacterIndex Controller::Impl::GetLogicalCursorPosition() const { CharacterIndex cursorPosition = 0u; diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 8e9ab39..b97a419 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -441,6 +441,11 @@ struct Controller::Impl void NotifyImfManager(); /** + * @brief Helper to notify IMF manager with multi line status. + */ + void NotifyImfMultiLineStatus(); + + /** * @brief Retrieve the current cursor position. * * @return The cursor position. diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 4c0316f..c0f6d68 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -1980,7 +1980,7 @@ void Controller::KeyboardFocusGainEvent() mImpl->ChangeState( EventData::EDITING ); mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered. } - + mImpl->NotifyImfMultiLineStatus(); if( mImpl->IsShowingPlaceholderText() ) { // Show alternative placeholder-text when editing -- 2.7.4