Merge "Destroy removal visuals after idler" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-editor-impl.cpp
index ea5f43c..3fc19f2 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <cstring>
 #include <limits>
@@ -379,6 +380,11 @@ int TextEditor::GetCharacterIndexAtPosition(float visualX, float visualY) const
   return mController->GetCharacterIndexAtPosition(visualX, visualY);
 }
 
+Rect<> TextEditor::GetTextBoundingRectangle(uint32_t startIndex, uint32_t endIndex) const
+{
+  return mController->GetTextBoundingRectangle(startIndex, endIndex);
+}
+
 void TextEditor::SetSpannedText(const Text::Spanned& spannedText)
 {
   mController->SetSpannedText(spannedText);
@@ -611,6 +617,7 @@ void TextEditor::OnInitialize()
   mStencil = Control::New();
   mStencil.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
   mStencil.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  mStencil.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN, true);
 
   // Creates a background visual. Even if the color is transparent it updates the stencil.
   mStencil.SetProperty(Toolkit::Control::Property::BACKGROUND,
@@ -851,12 +858,6 @@ void TextEditor::OnKeyInputFocusGained()
     // When window gain lost focus, the InputMethodContext is deactivated. Thus when window gain focus again, the InputMethodContext must be activated.
     mInputMethodContext.SetRestoreAfterFocusLost(true);
   }
-  ClipboardEventNotifier notifier(ClipboardEventNotifier::Get());
-
-  if(notifier)
-  {
-    notifier.ContentSelectedSignal().Connect(this, &TextEditor::OnClipboardTextSelected);
-  }
 
   if(IsEditable() && mController->IsUserInteractionEnabled())
   {
@@ -881,12 +882,6 @@ void TextEditor::OnKeyInputFocusLost()
 
     mInputMethodContext.EventReceivedSignal().Disconnect(this, &TextEditor::OnInputMethodContextEvent);
   }
-  ClipboardEventNotifier notifier(ClipboardEventNotifier::Get());
-
-  if(notifier)
-  {
-    notifier.ContentSelectedSignal().Disconnect(this, &TextEditor::OnClipboardTextSelected);
-  }
 
   mController->KeyboardFocusLostEvent();
 
@@ -1242,7 +1237,7 @@ void TextEditor::UpdateScrollBar()
 void TextEditor::OnScrollIndicatorAnimationFinished(Animation& animation)
 {
   // If animation is successfully ended, then emit ScrollStateChangedSignal
-  if(animation.GetCurrentProgress() == 0.0f)
+  if(Dali::EqualsZero(animation.GetCurrentProgress()))
   {
     mScrollStarted = false;
     Dali::Toolkit::TextEditor handle(GetOwner());
@@ -1279,11 +1274,6 @@ void TextEditor::GetHandleImagePropertyValue(Property::Value& value, Text::Handl
   }
 }
 
-void TextEditor::OnClipboardTextSelected(ClipboardEventNotifier& clipboard)
-{
-  mController->PasteClipboardItemEvent();
-}
-
 void TextEditor::KeyboardStatusChanged(bool keyboardShown)
 {
   DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor::KeyboardStatusChanged %p keyboardShown %d\n", mController.Get(), keyboardShown);