Add SelectionStarted signal 16/269516/7
authorabdullah <abdullahhasan10@gmail.com>
Mon, 17 Jan 2022 15:24:25 +0000 (17:24 +0200)
committerabdulleh ghujeh <abdullahhasan10@gmail.com>
Tue, 25 Jan 2022 13:18:05 +0000 (13:18 +0000)
added signal which will be called when selection started

void OnSelectionStarted(TextEditor textEditor)

Change-Id: I1ec070f5ebba419d8da2a75693c9c94d8f7f16bb

automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h
dali-toolkit/devel-api/controls/text-controls/text-field-devel.cpp
dali-toolkit/devel-api/controls/text-controls/text-field-devel.h
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h

index e38ca010fd8de818587de3c26623a64363d99fd4..0247a3b2865e490e96100662aea2a93856feef20 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -140,6 +140,7 @@ static bool                                        gSelectionChangedCallbackCall
 static uint32_t                                    oldSelectionStart;
 static uint32_t                                    oldSelectionEnd;
 static bool                                        gSelectionClearedCallbackCalled;
+static bool                                        gSelectionStartedCallbackCalled;
 static bool                                        gAnchorClickedCallBackCalled;
 static bool                                        gAnchorClickedCallBackNotCalled;
 static bool                                        gTextChangedCallBackCalled;
@@ -165,6 +166,13 @@ struct CallbackFunctor
   bool* mCallbackFlag;
 };
 
+static void TestSelectionStartedCallback(TextEditor control)
+{
+  tet_infoline(" TestSelectionStartedCallback");
+
+  gSelectionStartedCallbackCalled = true;
+}
+
 static void TestSelectionClearedCallback(TextEditor control)
 {
   tet_infoline(" TestSelectionClearedCallback");
@@ -5022,6 +5030,72 @@ int utcDaliTextEditorSelectionClearedSignal(void)
   END_TEST;
 }
 
+int utcDaliTextEditorSelectionStartedSignal(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorSelectionStartedSignal");
+
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK(editor);
+
+  application.GetScene().Add(editor);
+
+  // connect to the selection changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  DevelTextEditor::SelectionStartedSignal(editor).Connect(&TestSelectionStartedCallback);
+  bool selectionStartedSignal = false;
+  editor.ConnectSignal(testTracker, "selectionStarted", CallbackFunctor(&selectionStartedSignal));
+
+  editor.SetProperty(TextEditor::Property::TEXT, "Hello\nworld\nHello world");
+  editor.SetProperty(TextEditor::Property::POINT_SIZE, 10.f);
+  editor.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+  editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Tap on the text editor
+  TestGenerateTap(application, 3.0f, 25.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Move to second line of the text & Select some text in the right of the current cursor position
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gSelectionStartedCallbackCalled);
+
+  // remove selection
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::UP, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  gSelectionStartedCallbackCalled = false;
+
+  DevelTextEditor::SelectText(editor, 1, 3);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gSelectionStartedCallbackCalled);
+
+  END_TEST;
+}
+
 int utcDaliTextEditorSelectionWithSecondaryCursor(void)
 {
   ToolkitTestApplication application;
index aca00548d74091b013b6715428acd436cde13e8b..18200b892031e971f2c4cb9f0031b6e94e89da99 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -131,6 +131,7 @@ static bool                                       gSelectionChangedCallbackCalle
 static uint32_t                                   oldSelectionStart;
 static uint32_t                                   oldSelectionEnd;
 static bool                                       gSelectionClearedCallbackCalled;
+static bool                                       gSelectionStartedCallbackCalled;
 static bool                                       gAnchorClickedCallBackCalled;
 static bool                                       gAnchorClickedCallBackNotCalled;
 static bool                                       gTextChangedCallBackCalled;
@@ -229,6 +230,13 @@ static void TestSelectionClearedCallback(TextField control)
   gSelectionClearedCallbackCalled = true;
 }
 
+static void TestSelectionStartedCallback(TextField control)
+{
+  tet_infoline(" TestSelectionStartedCallback");
+
+  gSelectionStartedCallbackCalled = true;
+}
+
 static void TestSelectionChangedCallback(TextField control, uint32_t oldStart, uint32_t oldEnd)
 {
   tet_infoline(" TestSelectionChangedCallback");
@@ -4782,6 +4790,72 @@ int utcDaliTextFieldSelectionClearedSignal(void)
   END_TEST;
 }
 
+int utcDaliTextFieldSelectionStartedSignal(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldSelectionStartedSignal");
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK(field);
+
+  application.GetScene().Add(field);
+
+  // connect to the selection changed signal.
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  DevelTextField::SelectionStartedSignal(field).Connect(&TestSelectionStartedCallback);
+  bool selectionStartedSignal = false;
+  field.ConnectSignal(testTracker, "selectionStarted", CallbackFunctor(&selectionStartedSignal));
+
+  field.SetProperty(TextField::Property::TEXT, "Hello\nworld\nHello world");
+  field.SetProperty(TextField::Property::POINT_SIZE, 10.f);
+  field.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+  field.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  field.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Tap on the text field
+  TestGenerateTap(application, 3.0f, 25.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Move to second line of the text & Select some text in the right of the current cursor position
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gSelectionStartedCallbackCalled);
+
+  // remove selection
+  application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::UP, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  gSelectionStartedCallbackCalled = false;
+
+  DevelTextField::SelectText(field, 1, 3);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(gSelectionStartedCallbackCalled);
+
+  END_TEST;
+}
+
 int utcDaliTextFieldSelectionChangedSignal(void)
 {
   ToolkitTestApplication application;
index a7b4ae4e33caf9a8856af1f181d85bcbe749d8f7..41d0c345cbad1fb8bbb9ba5923371a68c400ea37 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,6 +60,11 @@ SelectionClearedSignalType& SelectionClearedSignal(TextEditor textEditor)
   return GetImpl(textEditor).SelectionClearedSignal();
 }
 
+SelectionStartedSignalType& SelectionStartedSignal(TextEditor textEditor)
+{
+  return GetImpl(textEditor).SelectionStartedSignal();
+}
+
 void SelectWholeText(TextEditor textEditor)
 {
   GetImpl(textEditor).SelectWholeText();
index 5a35e2d57f869d3acce899f16ebf2684bcdae52c..196cc3b1a056dde824913a788f5a9e453faea272 100644 (file)
@@ -433,6 +433,23 @@ using SelectionClearedSignalType = Signal<void(TextEditor)>;
  */
 DALI_TOOLKIT_API SelectionClearedSignalType& SelectionClearedSignal(TextEditor textEditor);
 
+/**
+ * @brief selection start signal type.
+ */
+using SelectionStartedSignalType = Signal<void(TextEditor)>;
+
+/**
+ * @brief This signal is emitted when the selection start.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName( TextEditor textEditor);
+ * @endcode
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The signal to connect to
+ */
+DALI_TOOLKIT_API SelectionStartedSignalType& SelectionStartedSignal(TextEditor textEditor);
+
 /**
  * @brief Select the whole text of TextEditor.
  *
index fce781906201fbd0fcaee6baad222cf0dc448577..345bb1288724a2136ed94c74a4f58f7e5b5ee1a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,6 +55,11 @@ SelectionClearedSignalType& SelectionClearedSignal(TextField textField)
   return GetImpl(textField).SelectionClearedSignal();
 }
 
+SelectionStartedSignalType& SelectionStartedSignal(TextField textField)
+{
+  return GetImpl(textField).SelectionStartedSignal();
+}
+
 void SelectWholeText(TextField textField)
 {
   GetImpl(textField).SelectWholeText();
index 9bc6fc117958a7f663b302dd56d52b7ea75b8601..165cd3faf5c11ccf2e0fda3eebe918c9c856a37c 100644 (file)
@@ -355,6 +355,23 @@ using SelectionClearedSignalType = Signal<void(TextField)>;
  */
 DALI_TOOLKIT_API SelectionClearedSignalType& SelectionClearedSignal(TextField textField);
 
+/**
+ * @brief selection start signal type.
+ */
+using SelectionStartedSignalType = Signal<void(TextField)>;
+
+/**
+ * @brief This signal is emitted when the selection start.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName( TextField textField);
+ * @endcode
+ * @param[in] textField The instance of TextField.
+ * @return The signal to connect to
+ */
+DALI_TOOLKIT_API SelectionStartedSignalType& SelectionStartedSignal(TextField textField);
+
 /**
  * @brief Get the rendered size of a specific text range.
  * if the requested text is at multilines, multiple sizes will be returned for each text located in a separate line.
index a75e21c015d9ef83f686adbcc0d816e3c8e781fd..cc8804d39f372cfd5ec79877db3e83e0f2f59972 100644 (file)
@@ -166,6 +166,7 @@ DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputFiltered",         SIGNAL_IN
 DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "cursorPositionChanged", SIGNAL_CURSOR_POSITION_CHANGED)
 DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "selectionChanged",      SIGNAL_SELECTION_CHANGED      )
 DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "selectionCleared",      SIGNAL_SELECTION_CLEARED      )
+DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "selectionStarted",      SIGNAL_SELECTION_STARTED      )
 
 DALI_TYPE_REGISTRATION_END()
 // clang-format on
@@ -404,6 +405,11 @@ DevelTextEditor::SelectionClearedSignalType& TextEditor::SelectionClearedSignal(
   return mSelectionClearedSignal;
 }
 
+DevelTextEditor::SelectionStartedSignalType& TextEditor::SelectionStartedSignal()
+{
+  return mSelectionStartedSignal;
+}
+
 Text::ControllerPtr TextEditor::GetTextController()
 {
   return mController;
@@ -472,6 +478,14 @@ bool TextEditor::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface*
       editorImpl.SelectionClearedSignal().Connect(tracker, functor);
     }
   }
+  else if(0 == strcmp(signalName.c_str(), SIGNAL_SELECTION_STARTED))
+  {
+    if(editor)
+    {
+      Internal::TextEditor& editorImpl(GetImpl(editor));
+      editorImpl.SelectionStartedSignal().Connect(tracker, functor);
+    }
+  }
   else
   {
     // signalName does not match any signal
@@ -718,6 +732,11 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
     EmitCursorPositionChangedSignal();
   }
 
+  if(mSelectionStarted)
+  {
+    EmitSelectionStartedSignal();
+  }
+
   if(mSelectionChanged)
   {
     EmitSelectionChangedSignal();
@@ -975,6 +994,13 @@ void TextEditor::EmitSelectionClearedSignal()
   mSelectionCleared = false;
 }
 
+void TextEditor::EmitSelectionStartedSignal()
+{
+  Dali::Toolkit::TextEditor handle(GetOwner());
+  mSelectionStartedSignal.Emit(handle);
+  mSelectionStarted = false;
+}
+
 void TextEditor::SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t newStart, uint32_t newEnd)
 {
   if(((oldStart != newStart) || (oldEnd != newEnd)) && !mSelectionChanged)
@@ -983,6 +1009,13 @@ void TextEditor::SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t n
     {
       mSelectionCleared = true;
     }
+    else
+    {
+      if(oldStart == oldEnd)
+      {
+        mSelectionStarted = true;
+      }
+    }
 
     mSelectionChanged  = true;
     mOldSelectionStart = oldStart;
@@ -1282,7 +1315,8 @@ TextEditor::TextEditor()
   mSelectionCleared(false),
   mOldPosition(0u),
   mOldSelectionStart(0u),
-  mOldSelectionEnd(0u)
+  mOldSelectionEnd(0u),
+  mSelectionStarted(false)
 {
 }
 
index 6ea1cc86f5244e2f510c0e056b29daee9529e480..8118a1c90001088c6a978942a899e919d3c426cb 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -115,6 +115,11 @@ public:
    */
   DevelTextEditor::SelectionClearedSignalType& SelectionClearedSignal();
 
+  /**
+   * @copydoc Dali::Toollkit::TextEditor::SelectionStartedSignal()
+   */
+  DevelTextEditor::SelectionStartedSignalType& SelectionStartedSignal();
+
   /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
@@ -447,6 +452,11 @@ private: // Implementation
    */
   void EmitSelectionClearedSignal();
 
+  /**
+   * @brief Emits SelectionStarted signal.
+   */
+  void EmitSelectionStartedSignal();
+
   /**
    * @brief set RenderActor's position with new scrollPosition
    *
@@ -512,6 +522,7 @@ private: // Data
   Toolkit::DevelTextEditor::CursorPositionChangedSignalType mCursorPositionChangedSignal;
   Toolkit::DevelTextEditor::SelectionChangedSignalType      mSelectionChangedSignal;
   Toolkit::DevelTextEditor::SelectionClearedSignalType      mSelectionClearedSignal;
+  Toolkit::DevelTextEditor::SelectionStartedSignalType      mSelectionStartedSignal;
 
   InputMethodContext               mInputMethodContext;
   Text::ControllerPtr              mController;
@@ -551,6 +562,8 @@ private: // Data
   uint32_t mOldSelectionStart;
   uint32_t mOldSelectionEnd;
 
+  bool mSelectionStarted : 1; ///< If true, emits SelectionStartedSignal at the end of OnRelayout().
+
   struct PropertyHandler;
 
   /**
index 3475b364ffed50d19d0e3abbfb97ed412fb5f743..2b813da8f61098a5087a28d5d9e25df86f5c8747 100644 (file)
@@ -153,6 +153,7 @@ DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "inputFiltered",         SIGNAL_INP
 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "cursorPositionChanged", SIGNAL_CURSOR_POSITION_CHANGED)
 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "selectionChanged",      SIGNAL_SELECTION_CHANGED      )
 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "selectionCleared",      SIGNAL_SELECTION_CLEARED      )
+DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "selectionStarted",      SIGNAL_SELECTION_STARTED      )
 
 DALI_TYPE_REGISTRATION_END()
 // clang-format on
@@ -417,6 +418,14 @@ bool TextField::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface*
       fieldImpl.SelectionClearedSignal().Connect(tracker, functor);
     }
   }
+  else if(0 == strcmp(signalName.c_str(), SIGNAL_SELECTION_STARTED))
+  {
+    if(field)
+    {
+      Internal::TextField& fieldImpl(GetImpl(field));
+      fieldImpl.SelectionStartedSignal().Connect(tracker, functor);
+    }
+  }
   else
   {
     // signalName does not match any signal
@@ -466,6 +475,11 @@ DevelTextField::SelectionClearedSignalType& TextField::SelectionClearedSignal()
   return mSelectionClearedSignal;
 }
 
+DevelTextField::SelectionStartedSignalType& TextField::SelectionStartedSignal()
+{
+  return mSelectionStartedSignal;
+}
+
 void TextField::OnAccessibilityStatusChanged()
 {
   CommonTextUtils::SynchronizeTextAnchorsInParent(Self(), mController, mAnchorActors);
@@ -676,6 +690,11 @@ void TextField::OnRelayout(const Vector2& size, RelayoutContainer& container)
     EmitCursorPositionChangedSignal();
   }
 
+  if(mSelectionStarted)
+  {
+    EmitSelectionStartedSignal();
+  }
+
   if(mSelectionChanged)
   {
     EmitSelectionChangedSignal();
@@ -951,6 +970,13 @@ void TextField::EmitSelectionClearedSignal()
   mSelectionCleared = false;
 }
 
+void TextField::EmitSelectionStartedSignal()
+{
+  Dali::Toolkit::TextField handle(GetOwner());
+  mSelectionStartedSignal.Emit(handle);
+  mSelectionStarted = false;
+}
+
 void TextField::SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t newStart, uint32_t newEnd)
 {
   if(((oldStart != newStart) || (oldEnd != newEnd)) && !mSelectionChanged)
@@ -959,6 +985,13 @@ void TextField::SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t ne
     {
       mSelectionCleared = true;
     }
+    else
+    {
+      if(oldStart == oldEnd)
+      {
+        mSelectionStarted = true;
+      }
+    }
 
     mSelectionChanged  = true;
     mOldSelectionStart = oldStart;
@@ -1117,7 +1150,8 @@ TextField::TextField()
   mSelectionCleared(false),
   mOldPosition(0u),
   mOldSelectionStart(0u),
-  mOldSelectionEnd(0u)
+  mOldSelectionEnd(0u),
+  mSelectionStarted(false)
 {
 }
 
index e53189eabec241239a607d722c351e9a411ddcb0..51a97c7c553c9661deb82975f729b1e945591e0d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -139,6 +139,11 @@ public:
    */
   DevelTextField::SelectionClearedSignalType& SelectionClearedSignal();
 
+  /**
+   * @copydoc TextField::SelectionStartedSignal()
+   */
+  DevelTextField::SelectionStartedSignalType& SelectionStartedSignal();
+
 private: // From Control
   /**
    * @copydoc Control::OnInitialize()
@@ -417,6 +422,11 @@ private: // Implementation
    */
   void EmitSelectionClearedSignal();
 
+  /**
+   * @brief Emits SelectionStarted signal.
+   */
+  void EmitSelectionStartedSignal();
+
   /**
    * @brief Callback function for when the layout is changed.
    * @param[in] actor The actor whose layoutDirection is changed.
@@ -467,6 +477,7 @@ private: // Data
   Toolkit::DevelTextField::CursorPositionChangedSignalType mCursorPositionChangedSignal;
   Toolkit::DevelTextField::SelectionChangedSignalType      mSelectionChangedSignal;
   Toolkit::DevelTextField::SelectionClearedSignalType      mSelectionClearedSignal;
+  Toolkit::DevelTextField::SelectionStartedSignalType      mSelectionStartedSignal;
 
   InputMethodContext               mInputMethodContext;
   Text::ControllerPtr              mController;
@@ -498,6 +509,8 @@ private: // Data
   uint32_t mOldSelectionStart;
   uint32_t mOldSelectionEnd;
 
+  bool mSelectionStarted : 1; ///< If true, emits SelectionStartedSignal at the end of OnRelayout().
+
 protected:
   struct PropertyHandler;