Support line spacing & min line size in texteditor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.h
index 63a77a4..109be1a 100644 (file)
@@ -52,9 +52,10 @@ class RenderingController;
    */
 enum SelectionType
 {
-  INTERACTIVE = 0x0000,
-  ALL         = 0x0001,
-  NONE        = 0x0002
+  INTERACTIVE = 0x0000, ///< Select the word where the cursor is located.
+  ALL         = 0x0001, ///< Select the whole text.
+  NONE        = 0x0002, ///< Unselect the whole text.
+  RANGE       = 0x0003  ///< Select the range text.
 };
 
 typedef IntrusivePtr<Controller> ControllerPtr;
@@ -1588,9 +1589,10 @@ public: // Text-input Event Queuing.
    * @brief Used to set the Primary cursor position.
    *
    * @param[in] index for the Primary cursor position.
+   * @param[in] focused true if UI control has gained focus to receive key event, false otherwise.
    * @return[in] true if cursor position changed, false otherwise.
    */
-  bool SetPrimaryCursorPosition(CharacterIndex index);
+  bool SetPrimaryCursorPosition(CharacterIndex index, bool focused);
 
   /**
    * @brief Creates a selection event.
@@ -1604,6 +1606,18 @@ public: // Text-input Event Queuing.
   void SelectEvent(float x, float y, SelectionType selection);
 
   /**
+   * @brief Creates a selection event with a selection index.
+   *
+   * It could be called from the SelectText().
+   * The start and end parameters are passed through the event.
+   *
+   * @param[in] start The start selection position.
+   * @param[in] end The end selection position.
+   * @param[in] selection type like the range.
+   */
+  void SelectEvent(const uint32_t start, const uint32_t end, SelectionType selection);
+
+  /**
    * @copydoc Text::SelectableControlInterface::SetTextSelectionRange()
    */
   void SetTextSelectionRange(const uint32_t* start, const uint32_t* end);
@@ -1624,6 +1638,11 @@ public: // Text-input Event Queuing.
   void SelectNone();
 
   /**
+   * @copydoc Text::SelectableControlInterface::SelectText()
+   */
+  void SelectText(const uint32_t start, const uint32_t end);
+
+  /**
    * @copydoc Text::SelectableControlInterface::GetSelectedText()
    */
   string GetSelectedText() const;
@@ -1855,6 +1874,11 @@ private: // Helpers.
    */
   void ResetScrollPosition();
 
+  /**
+   * @brief fill needed relayout parameters when line size is changed & request relayout.
+   */
+  void RelayoutForNewLineSize();
+
 private: // Private contructors & copy operator.
   /**
    * @brief Private constructor.