Merge "Updated visuals to use VisualRenderer" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-editor-impl.h
index 6ea1cc8..8a96a13 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.
@@ -116,6 +116,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.
    * @param[in] tracker Used to disconnect the signal.
@@ -261,7 +266,7 @@ private: // From Control
   /**
    * @copydoc Text::EditableControlInterface::AddDecoration()
    */
-  void AddDecoration(Actor& actor, bool needsClipping) override;
+  void AddDecoration(Actor& actor, Toolkit::Text::DecorationType type, bool needsClipping) override;
 
   /**
    * @copydoc Text::EditableControlInterface::InputFiltered()
@@ -448,6 +453,11 @@ private: // Implementation
   void EmitSelectionClearedSignal();
 
   /**
+   * @brief Emits SelectionStarted signal.
+   */
+  void EmitSelectionStartedSignal();
+
+  /**
    * @brief set RenderActor's position with new scrollPosition
    *
    * Apply updated scroll position or start scroll animation if VerticalScrollAnimation is enabled
@@ -469,6 +479,13 @@ private: // Implementation
   void OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type);
 
   /**
+  * @brief Add a layer for active or cursor.
+  * @param[in] layer The actor in which to store the layer.
+  * @param[in] actor The new layer to add.
+  */
+  void AddLayer(Actor& layer, Actor& actor);
+
+  /**
    * Construct a new TextEditor.
    */
   TextEditor();
@@ -512,6 +529,7 @@ private: // Data
   Toolkit::DevelTextEditor::CursorPositionChangedSignalType mCursorPositionChangedSignal;
   Toolkit::DevelTextEditor::SelectionChangedSignalType      mSelectionChangedSignal;
   Toolkit::DevelTextEditor::SelectionClearedSignalType      mSelectionClearedSignal;
+  Toolkit::DevelTextEditor::SelectionStartedSignalType      mSelectionStartedSignal;
 
   InputMethodContext               mInputMethodContext;
   Text::ControllerPtr              mController;
@@ -528,6 +546,7 @@ private: // Data
 
   Actor         mRenderableActor;
   Actor         mActiveLayer;
+  Actor         mCursorLayer;
   Actor         mBackgroundActor;
   CallbackBase* mIdleCallback;
 
@@ -551,6 +570,8 @@ private: // Data
   uint32_t mOldSelectionStart;
   uint32_t mOldSelectionEnd;
 
+  bool mSelectionStarted : 1; ///< If true, emits SelectionStartedSignal at the end of OnRelayout().
+
   struct PropertyHandler;
 
   /**
@@ -608,6 +629,11 @@ private: // Data
     bool SetRangeOfSelection(size_t selectionIndex, size_t startOffset, size_t endOffset) override;
 
     /**
+     * @copydoc Dali::Accessibility::Text::GetRangeExtents()
+     */
+    Rect<> GetRangeExtents(size_t startOffset, size_t endOffset, Accessibility::CoordinateType type) override;
+
+    /**
      * @copydoc Dali::Accessibility::EditableText::CopyText()
      */
     bool CopyText(size_t startPosition, size_t endPosition) override;