(Text Controller) Moved event handling, InputFont & Placeholder related methods into...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.h
index 4d40f41..54444b1 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_CONTROLLER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -31,6 +31,7 @@
 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
 #include <dali-toolkit/internal/text/hidden-text.h>
 #include <dali-toolkit/internal/text/text-model-interface.h>
+#include <dali-toolkit/internal/text/text-selectable-control-interface.h>
 
 namespace Dali
 {
@@ -187,11 +188,13 @@ public: // Constructor.
    *
    * @param[in] controlInterface The control's interface.
    * @param[in] editableControlInterface The editable control's interface.
+   * @param[in] selectableControlInterface The selectable control's interface.
    *
    * @return A pointer to a new Controller.
    */
   static ControllerPtr New( ControlInterface* controlInterface,
-                            EditableControlInterface* editableControlInterface );
+                            EditableControlInterface* editableControlInterface,
+                            SelectableControlInterface* selectableControlInterface );
 
 public: // Configure the text controller.
 
@@ -1493,6 +1496,41 @@ public: // Text-input Event Queuing.
   void SelectEvent( float x, float y, SelectionType selection );
 
   /**
+   * @copydoc Text::SelectableControlInterface::SetTextSelectionRange()
+   */
+  void SetTextSelectionRange(const uint32_t *start, const uint32_t *end);
+
+  /**
+   * @copydoc Text::SelectableControlInterface::GetTextSelectionRange()
+   */
+  Uint32Pair GetTextSelectionRange() const;
+
+  /**
+   * @copydoc Text::SelectableControlInterface::SelectWholeText()
+   */
+  void SelectWholeText();
+
+  /**
+   * @copydoc Text::SelectableControlInterface::SelectNone()
+   */
+  void SelectNone();
+
+  /**
+   * @copydoc Text::SelectableControlInterface::GetSelectedText()
+   */
+  string GetSelectedText() const;
+
+  /**
+   * @copydoc Text::EditableControlInterface::IsEditable()
+   */
+  virtual bool IsEditable() const;
+
+  /**
+   * @copydoc Text::EditableControlInterface::SetEditable()
+   */
+  virtual void SetEditable( bool editable );
+
+  /**
    * @brief Event received from input method context
    *
    * @param[in] inputMethodContext The input method context.
@@ -1520,13 +1558,6 @@ public: // Text-input Event Queuing.
    */
   Actor CreateBackgroundActor();
 
-  /**
-   * @brief Retrive Selected text.
-   *
-   * @return The seleced text.
-   */
-  std::string GetSelectedText();
-
 protected: // Inherit from Text::Decorator::ControllerInterface.
 
   /**
@@ -1698,7 +1729,8 @@ private: // Private contructors & copy operator.
    * @brief Private constructor.
    */
   Controller( ControlInterface* controlInterface,
-              EditableControlInterface* editableControlInterface );
+              EditableControlInterface* editableControlInterface,
+              SelectableControlInterface* selectableControlInterface );
 
   // Undefined
   Controller( const Controller& handle );
@@ -1719,6 +1751,10 @@ public:
 
 private:
 
+  struct EventHandler;
+  struct InputFontHandler;
+  struct PlaceholderHandler;
+
   Impl* mImpl;
 };