Notify multiline hint to IMF context 31/83031/8
authorsuhyung Eom <suhyung.eom@samsung.com>
Tue, 9 Aug 2016 00:29:12 +0000 (09:29 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Fri, 12 Aug 2016 06:34:52 +0000 (15:34 +0900)
Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: If7b51387d37b3c3b652ac75cf74911904a2ed002

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp

index e35ce05..11dfca9 100644 (file)
@@ -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();
index d90e9d4..7049354 100644 (file)
@@ -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
index 95115da..0fb2171 100644 (file)
@@ -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;
index 8e9ab39..b97a419 100644 (file)
@@ -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.
index 4c0316f..c0f6d68 100644 (file)
@@ -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