Refactored text field/editor property getters/setters
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-editor-impl.h
index 9b22782..8c5d7be 100644 (file)
@@ -103,6 +103,16 @@ public:
   DevelTextEditor::InputFilteredSignalType& InputFilteredSignal();
 
   /**
+   * @copydoc Dali::Toollkit::TextEditor::SelectionChangedSignal()
+   */
+  DevelTextEditor::SelectionChangedSignalType& SelectionChangedSignal();
+
+  /**
+   * @copydoc Dali::Toollkit::TextEditor::SelectionClearedSignal()
+   */
+  DevelTextEditor::SelectionClearedSignalType& SelectionClearedSignal();
+
+  /**
    * 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.
@@ -241,6 +251,11 @@ private: // From Control
   void InputStyleChanged(Text::InputStyle::Mask inputStyleMask) override;
 
   /**
+   * @copydoc Text::SelectableControlInterface::SelectionChanged()
+   */
+  void SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t newStart, uint32_t newEnd) override;
+
+  /**
    * @copydoc Text::EditableControlInterface::AddDecoration()
    */
   void AddDecoration(Actor& actor, bool needsClipping) override;
@@ -316,6 +331,21 @@ public:
    */
   void SetEditable(bool editable) override;
 
+  /**
+   * @copydoc Text::EditableControlInterface::CopyText()
+   */
+  string CopyText() override;
+
+  /**
+   * @copydoc Text::EditableControlInterface::CutText()
+   */
+  string CutText() override;
+
+  /**
+   * @copydoc Text::EditableControlInterface::PasteText()
+   */
+  void PasteText() override;
+
   // From AnchorControlInterface
 
   /**
@@ -383,6 +413,16 @@ private: // Implementation
   void EmitTextChangedSignal();
 
   /**
+   * @brief Emits SelectionChanged signal.
+   */
+  void EmitSelectionChangedSignal();
+
+  /**
+   * @brief Emits SelectionCleared signal.
+   */
+  void EmitSelectionClearedSignal();
+
+  /**
    * @brief set RenderActor's position with new scrollPosition
    *
    * Apply updated scroll position or start scroll animation if VerticalScrollAnimation is enabled
@@ -442,6 +482,8 @@ private: // Data
   Toolkit::DevelTextEditor::AnchorClickedSignalType         mAnchorClickedSignal;
   Toolkit::DevelTextEditor::InputFilteredSignalType         mInputFilteredSignal;
   Toolkit::DevelTextEditor::CursorPositionChangedSignalType mCursorPositionChangedSignal;
+  Toolkit::DevelTextEditor::SelectionChangedSignalType      mSelectionChangedSignal;
+  Toolkit::DevelTextEditor::SelectionClearedSignalType      mSelectionClearedSignal;
 
   InputMethodContext            mInputMethodContext;
   Text::ControllerPtr           mController;
@@ -470,10 +512,18 @@ private: // Data
   bool  mScrollStarted : 1;
   bool  mTextChanged : 1;           ///< If true, emits TextChangedSignal in next OnRelayout().
   bool  mCursorPositionChanged : 1; ///< If true, emits CursorPositionChangedSignal at the end of OnRelayout().
+  bool  mSelectionChanged : 1;      ///< If true, emits SelectionChangedSignal at the end of OnRelayout().
+  bool  mSelectionCleared : 1;      ///< If true, emits SelectionClearedSignal at the end of OnRelayout().
 
   //args for cursor PositionChanged event
   unsigned int mOldPosition;
 
+  //args for selection changed event
+  uint32_t mOldSelectionStart;
+  uint32_t mOldSelectionEnd;
+
+  struct PropertyHandler;
+
   /**
    * @brief This structure is to connect TextEditor with Accessible functions.
    */