Move Clipboard to TextClipboard
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-field-impl.h
index 7b5d2f6..36fe57f 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
+#include <dali/devel-api/adaptor-framework/text-clipboard-event-notifier.h>
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
 #include <dali/devel-api/atspi-interfaces/editable-text.h>
 #include <dali/devel-api/atspi-interfaces/hypertext.h>
@@ -54,8 +54,9 @@ class TextField : public Control, public Text::ControlInterface, public Text::Ed
 public:
   /**
    * @copydoc Dali::Toollkit::TextField::New()
+   * @param[in] additionalBehaviour custom behavior flags for this TextField. Default is CONTROL_BEHAVIOUR_DEFAULT
    */
-  static Toolkit::TextField New();
+  static Toolkit::TextField New(ControlBehaviour additionalBehaviour = ControlBehaviour::CONTROL_BEHAVIOUR_DEFAULT);
 
   // Properties
 
@@ -385,6 +386,25 @@ public:
   Rect<float> GetCharacterBoundingRectangle(const uint32_t charIndex) const;
 
   /**
+   * @brief Get the character index.
+   * If the text is not yet rendered or the text is empty, -1 is returned.
+   *
+   * @param[in] visualX visual x position.
+   * @param[in] visualY visual y position.
+   * @return character index.
+   */
+  int GetCharacterIndexAtPosition(float visualX, float visualY) const;
+
+  /**
+   * @brief Gets the bounding box of a specific text range.
+   *
+   * @param[in] startIndex start index of the text requested to get bounding box to.
+   * @param[in] endIndex end index(included) of the text requested to get bounding box to.
+   * @return bounding box of the requested text.
+   */
+  Rect<> GetTextBoundingRectangle(uint32_t startIndex, uint32_t endIndex) const;
+
+  /**
    * @brief Set the @p spannedText into current textField
    * the spanned text contains content (text) and  format (spans with ranges)
    * the text is copied into text-controller and the spans are applied on ranges
@@ -401,9 +421,9 @@ private: // Implementation
 
   /**
    * @brief Callback when Clipboard signals an item should be pasted
-   * @param[in] clipboard handle to Clipboard Event Notifier
+   * @param[in] clipboard handle to TextClipboard Event Notifier
    */
-  void OnClipboardTextSelected(ClipboardEventNotifier& clipboard);
+  void OnClipboardTextSelected(TextClipboardEventNotifier& clipboard);
 
   /**
    * @brief Get a Property Map for the image used for the required Handle Image
@@ -481,8 +501,10 @@ private: // Implementation
 
   /**
    * Construct a new TextField.
+   *
+   * @param[in] additionalBehaviour additional behaviour flags for this TextField
    */
-  TextField();
+  TextField(ControlBehaviour additionalBehaviour);
 
   /**
    * A reference counted object may only be deleted by calling Unreference()