TextVisual implementation.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.h
index 26a0ccb..ce5c51a 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
+#include <dali-toolkit/internal/text/text-scroller-interface.h>
 
 namespace Dali
 {
 
 namespace Dali
 {
@@ -40,6 +41,7 @@ class Controller;
 class ControlInterface;
 class EditableControlInterface;
 class View;
 class ControlInterface;
 class EditableControlInterface;
 class View;
+struct ScrollerData;
 
 typedef IntrusivePtr<Controller> ControllerPtr;
 
 
 typedef IntrusivePtr<Controller> ControllerPtr;
 
@@ -54,7 +56,7 @@ typedef IntrusivePtr<Controller> ControllerPtr;
  *
  * The text selection popup button callbacks are as well handled via the TextSelectionPopupCallbackInterface interface.
  */
  *
  * The text selection popup button callbacks are as well handled via the TextSelectionPopupCallbackInterface interface.
  */
-class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface
+class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface, public Text::ScrollerInterface
 {
 public: // Enumerated types.
 
 {
 public: // Enumerated types.
 
@@ -147,6 +149,13 @@ public: // Constructor.
   static ControllerPtr New( ControlInterface* controlInterface,
                             EditableControlInterface* editableControlInterface );
 
   static ControllerPtr New( ControlInterface* controlInterface,
                             EditableControlInterface* editableControlInterface );
 
+  /**
+   * @brief Sets the text-control interface.
+   *
+   * @param[in] controlInterface The text-control interface.
+   */
+  void SetTextControlInterface( ControlInterface* controlInterface );
+
 public: // Configure the text controller.
 
   /**
 public: // Configure the text controller.
 
   /**
@@ -201,17 +210,53 @@ public: // Configure the text controller.
   bool IsAutoScrollEnabled() const;
 
   /**
   bool IsAutoScrollEnabled() const;
 
   /**
-   * @brief Get direction of the text from the first line of text,
-   * @return bool rtl (right to left) is true
+   * @brief Sets the speed the text should automatically scroll at.
+   *
+   * @param[in] scrollSpeed The speed of scrolling in pixels per second.
+   */
+  void SetAutoscrollSpeed( int scrollSpeed );
+
+  /**
+   * @brief Retrieves the auto scroll speed.
+   *
+   * @return The auto scroll speed in pixels per second.
+   */
+  int GetAutoScrollSpeed() const;
+
+  /**
+   * @brief Sets the number of loops the text should scroll.
+   *
+   * @param[in] loopCount The number of loops.
+   */
+  void SetAutoScrollLoopCount( int loopCount );
+
+  /**
+   * @brief Retrieves the number of loops the text should scroll.
+   *
+   * @return The numebr of loops.
+   */
+  int GetAutoScrollLoopCount() const;
+
+  /**
+   * @brief Sets the gap before text wraps around when scrolling.
+   *
+   * @param[in] wrapGap The gap in pixels.
+   */
+  void SetAutoScrollWrapGap( float wrapGap );
+
+  /**
+   * @brief Retrieves the gap before text wraps around when scrolling.
+   *
+   * @return The gap in pixels.
    */
    */
-  CharacterDirection GetAutoScrollDirection() const;
+  float GetAutoScrollWrapGap() const;
 
   /**
 
   /**
-   * @brief Get the alignment offset of the first line of text.
+   * @brief Retrieves the text's autoscroll data.
    *
    *
-   * @return The alignment offset.
+   * @return The text's autoscroll data.
    */
    */
-  float GetAutoScrollLineAlignment() const;
+  const ScrollerData* const GetAutoScrollData();
 
   /**
    * @brief Enables the horizontal scrolling.
 
   /**
    * @brief Enables the horizontal scrolling.
@@ -808,6 +853,11 @@ public: // Relayout.
    */
   UpdateTextType Relayout( const Size& size );
 
    */
   UpdateTextType Relayout( const Size& size );
 
+  /**
+   * @brief Request a relayout using the ControlInterface.
+   */
+  void RequestRelayout();
+
 public: // Input style change signals.
 
   /**
 public: // Input style change signals.
 
   /**
@@ -906,6 +956,13 @@ protected: // Inherit from TextSelectionPopup::TextPopupButtonCallbackInterface.
    */
   virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button );
 
    */
   virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button );
 
+private: // Inherit from TextScroller
+
+  /**
+   * @copydoc Text::ScrollerInterface::ScrollingFinished()
+   */
+  virtual void ScrollingFinished();
+
 private: // Update.
 
   /**
 private: // Update.
 
   /**