Add SelectionCleared signal
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / text-controls / text-field-devel.h
index e1c18f0..2471cc4 100644 (file)
@@ -100,7 +100,7 @@ enum
   /**
    * @brief Modifies the default text alignment to match the direction of the system language.
    * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write
-   * @note The default value is false
+   * @note The default value is true
    */
   MATCH_SYSTEM_LANGUAGE_DIRECTION = ELLIPSIS + 3,
 
@@ -205,6 +205,14 @@ enum
    * @endcode
    */
   INPUT_FILTER,
+
+  /**
+  * @brief The enumerations used to specify whether to position the ellipsis at the END, START or MIDDLE of the text.
+  * @details Name "EllipsisPosition", type [Type](@ref Dali::Toolkit::DevelText::EllipsisPosition::Type) (Property::INTEGER), or Property::STRING. Read/Write
+  * @note Default is EllipsisPosition::END.
+  * @see DevelText::EllipsisPosition
+  */
+  ELLIPSIS_POSITION,
 };
 
 } // namespace Property
@@ -239,6 +247,26 @@ using AnchorClickedSignalType = Signal<void(TextField, const char*, uint32_t)>;
 DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextField textField);
 
 /**
+ * @brief cursor position changed signal type.
+ *
+ * @note Signal
+ *  - uint32_t    : old position.
+ */
+using CursorPositionChangedSignalType = Signal<void(TextField, uint32_t)>;
+
+/**
+ * @brief This signal is emitted when the cursor position has been changed.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName(TextField textField, uint32_t oldPosition);
+ * @endcode
+ * @param[in] textField The instance of TextField.
+ * @return The signal to connect to.
+ */
+DALI_TOOLKIT_API CursorPositionChangedSignalType& CursorPositionChangedSignal(TextField textField);
+
+/**
  * @brief Input filtered signal type.
  */
 using InputFilteredSignalType = Signal<void(TextField, Toolkit::InputFilter::Property::Type)>;
@@ -270,6 +298,44 @@ using InputFilteredSignalType = Signal<void(TextField, Toolkit::InputFilter::Pro
 DALI_TOOLKIT_API InputFilteredSignalType& InputFilteredSignal(TextField textField);
 
 /**
+ * @brief selection changed signal type.
+ *
+ * @note Signal
+ *  - uint32_t  : selection start before the change.
+ *  - uint32_t  : selection end before the change.
+ */
+using SelectionChangedSignalType = Signal<void(TextField, uint32_t, uint32_t)>;
+
+/**
+ * @brief This signal is emitted when the selection has been changed.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName( TextField textField, uint32_t oldStart, uint32_t oldEnd);
+ * @endcode
+ * @param[in] textField The instance of TextField.
+ * @return The signal to connect to
+ */
+DALI_TOOLKIT_API SelectionChangedSignalType& SelectionChangedSignal(TextField textField);
+
+/**
+ * @brief selection cleared signal type.
+ */
+using SelectionClearedSignalType = Signal<void(TextField)>;
+
+/**
+ * @brief This signal is emitted when the selection has been cleared.
+ *
+ * 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 SelectionClearedSignalType& SelectionClearedSignal(TextField textField);
+
+/**
  * @brief Select the whole text of TextField.
  *
  * @param[in] textField The instance of TextField.
@@ -283,6 +349,21 @@ DALI_TOOLKIT_API void SelectWholeText(TextField textField);
  */
 DALI_TOOLKIT_API void SelectNone(TextField textField);
 
+/**
+ * @brief Select the text from start index to end index of TextField.
+ * @note
+ * The selection index is based on the cursor index.
+ *
+ * text   H e l l o
+ * index 0 1 2 3 4 5
+ * if textField.SelectText(1, 4); is executed, "ell" is selected.
+ *
+ * @param[in] textField The instance of TextField.
+ * @param[in] start The start index of the text to select. (The starting point of start index is 0.)
+ * @param[in] end The end index of the text to select. (If end index > text's length, the end index is set to the length of the text.)
+ */
+DALI_TOOLKIT_API void SelectText(TextField textField, const uint32_t start, const uint32_t end);
+
 } // namespace DevelTextField
 
 } // namespace Toolkit