Text selection refactoring
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller-impl.h
index 064d644..bb03be4 100755 (executable)
@@ -48,6 +48,8 @@ const float DEFAULT_TEXTFIT_STEP = 1.f;
 struct CursorInfo;
 struct FontDefaults;
 
+class SelectableControlInterface;
+
 struct Event
 {
   // Used to queue input events until DoRelayout()
@@ -61,7 +63,8 @@ struct Event
     LEFT_SELECTION_HANDLE_EVENT,
     RIGHT_SELECTION_HANDLE_EVENT,
     SELECT,
-    SELECT_ALL
+    SELECT_ALL,
+    SELECT_NONE,
   };
 
   union Param
@@ -307,9 +310,11 @@ struct OutlineDefaults
 struct Controller::Impl
 {
   Impl( ControlInterface* controlInterface,
-        EditableControlInterface* editableControlInterface )
+        EditableControlInterface* editableControlInterface,
+        SelectableControlInterface* selectableControlInterface )
   : mControlInterface( controlInterface ),
     mEditableControlInterface( editableControlInterface ),
+    mSelectableControlInterface( selectableControlInterface ),
     mModel(),
     mFontDefaults( NULL ),
     mUnderlineDefaults( NULL ),
@@ -619,6 +624,18 @@ struct Controller::Impl
 
   void OnSelectAllEvent();
 
+  void OnSelectNoneEvent();
+
+  /**
+   * @copydoc Text::SelectableControlInterface::SetTextSelectionRange()
+   */
+  void SetTextSelectionRange(const uint32_t *pStart, const uint32_t *pEndf);
+
+  /**
+   * @copydoc Text::SelectableControlInterface::GetTextSelectionRange()
+   */
+  Uint32Pair GetTextSelectionRange() const;
+
   /**
    * @brief Retrieves the selected text. It removes the text if the @p deleteAfterRetrieval parameter is @e true.
    *
@@ -754,6 +771,7 @@ public:
 
   ControlInterface* mControlInterface;     ///< Reference to the text controller.
   EditableControlInterface* mEditableControlInterface; ///< Reference to the editable text controller.
+  SelectableControlInterface* mSelectableControlInterface; ///< Reference to the selectable text controller.
   ModelPtr mModel;                         ///< Pointer to the text's model.
   FontDefaults* mFontDefaults;             ///< Avoid allocating this when the user does not specify a font.
   UnderlineDefaults* mUnderlineDefaults;   ///< Avoid allocating this when the user does not specify underline parameters.