Merge "Revert the TextLabel to use the old renderer." into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / text / text-visual.h
index 9151ec7..dd1abf6 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/devel-api/object/weak-handle.h>
+#include <dali/public-api/common/intrusive-ptr.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
 #include <dali-toolkit/internal/text/text-controller.h>
-#include <dali-toolkit/internal/text/text-scroller.h>
 
 namespace Dali
 {
@@ -69,21 +72,12 @@ class TextVisual : public Visual::Base
 public:
 
   /**
-   * @brief Constructor.
-   *
-   * @param[in] factoryCache The VisualFactoryCache object
-   */
-  TextVisual( VisualFactoryCache& factoryCache );
-
-  /**
-   * @brief A reference counted object may only be deleted by calling Unreference().
-   */
-  ~TextVisual();
-
-  /**
+   * @brief Create a new text visual.
    *
+   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @return A smart-pointer to the newly allocated visual.
    */
-  void SetTextControlInterface( Text::ControlInterface* controlInterface );
+  static TextVisualPtr New( VisualFactoryCache& factoryCache );
 
 public: // from Visual::Base
 
@@ -100,18 +94,33 @@ public: // from Visual::Base
   /**
    * @copydoc Visual::Base::GetNaturalSize()
    */
-  virtual void GetNaturalSize( Vector2& naturalSize ) const;
+  virtual void GetNaturalSize( Vector2& naturalSize );
 
   /**
    * @copydoc Visual::Base::CreatePropertyMap()
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
-protected: // from Visual::Base
+protected:
+
   /**
-   * @copydoc Visual::Base::DoInitialize()
+   * @brief Constructor.
+   *
+   * @param[in] factoryCache The VisualFactoryCache object
    */
-  virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+  TextVisual( VisualFactoryCache& factoryCache );
+
+  /**
+   * @brief A reference counted object may only be deleted by calling Unreference().
+   */
+  virtual ~TextVisual();
+
+  // from Visual::Base
+
+  /**
+   * @copydoc Visual::Base::DoSetProperties()
+   */
+  virtual void DoSetProperties( const Property::Map& propertyMap );
 
   /**
    * @copydoc Visual::Base::DoSetOnStage()
@@ -141,22 +150,11 @@ private:
    */
   void RenderText();
 
-  /**
-   * @brief Stops the text auto scroll.
-   */
-  void StopTextAutoScrolling();
-
-  /**
-   * @brief Set up Autoscrolling.
-   */
-  void SetUpAutoScrolling();
-
 private:
   Text::ControllerPtr          mController;               ///< The text's controller.
-  Actor                        mSelf;
+  WeakHandle<Actor>            mSelf;
 
   Text::RendererPtr            mRenderer;
-  Text::TextScrollerPtr        mTextScroller;
   Actor                        mRenderableActor;
 
   int mRenderingBackend;