Refactored text field/editor property getters/setters
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-field-impl.h
index dfd12a2..b65e953 100644 (file)
@@ -126,6 +126,16 @@ public:
    */
   DevelTextField::InputFilteredSignalType& InputFilteredSignal();
 
+  /**
+   * @copydoc TextField::SelectionChangedSignal()
+   */
+  DevelTextField::SelectionChangedSignalType& SelectionChangedSignal();
+
+  /**
+   * @copydoc TextField::SelectionClearedSignal()
+   */
+  DevelTextField::SelectionClearedSignalType& SelectionClearedSignal();
+
 private: // From Control
   /**
    * @copydoc Control::OnInitialize()
@@ -232,6 +242,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;
@@ -288,6 +303,21 @@ public:
    */
   void SetEditable(bool editable) override;
 
+  /**
+   * @copydoc Dali::EditableControlInterface::CopyText()
+   */
+  string CopyText() override;
+
+  /**
+   * @copydoc Dali::EditableControlInterface::CutText()
+   */
+  string CutText() override;
+
+  /**
+   * @copydoc Text::EditableControlInterface::PasteText()
+   */
+  void PasteText() override;
+
   // From AnchorControlInterface
 
   /**
@@ -353,6 +383,16 @@ private: // Implementation
   void EmitCursorPositionChangedSignal();
 
   /**
+   * @brief Emits SelectionChanged signal.
+   */
+  void EmitSelectionChangedSignal();
+
+  /**
+   * @brief Emits SelectionCleared signal.
+   */
+  void EmitSelectionClearedSignal();
+
+  /**
    * @brief Callback function for when the layout is changed.
    * @param[in] actor The actor whose layoutDirection is changed.
    * @param[in] type  The layoutDirection.
@@ -397,6 +437,8 @@ private: // Data
   Toolkit::DevelTextField::AnchorClickedSignalType         mAnchorClickedSignal;
   Toolkit::DevelTextField::InputFilteredSignalType         mInputFilteredSignal;
   Toolkit::DevelTextField::CursorPositionChangedSignalType mCursorPositionChangedSignal;
+  Toolkit::DevelTextField::SelectionChangedSignalType      mSelectionChangedSignal;
+  Toolkit::DevelTextField::SelectionClearedSignalType      mSelectionClearedSignal;
 
   InputMethodContext       mInputMethodContext;
   Text::ControllerPtr      mController;
@@ -417,11 +459,19 @@ private: // Data
   bool  mHasBeenStaged : 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 position changed event
   unsigned int mOldPosition;
 
+  //args for selection changed event
+  uint32_t mOldSelectionStart;
+  uint32_t mOldSelectionEnd;
+
 protected:
+  struct PropertyHandler;
+
   /**
    * @brief This structure is to connect TextField with Accessible functions.
    */