#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>
+#include <dali-toolkit/internal/text/text-model-interface.h>
namespace Dali
{
class ControlInterface;
class EditableControlInterface;
class View;
-struct ScrollerData;
+class RenderingController;
typedef IntrusivePtr<Controller> ControllerPtr;
*
* The text selection popup button callbacks are as well handled via the TextSelectionPopupCallbackInterface interface.
*/
-class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface, public Text::ScrollerInterface
+class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface
{
public: // Enumerated types.
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.
/**
bool IsAutoScrollEnabled() const;
/**
- * @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.
+ * @brief Get direction of the text from the first line of text,
+ * @return bool rtl (right to left) is true
*/
- float GetAutoScrollWrapGap() const;
+ CharacterDirection GetAutoScrollDirection() const;
/**
- * @brief Retrieves the text's autoscroll data.
+ * @brief Get the alignment offset of the first line of text.
*
- * @return The text's autoscroll data.
+ * @return The alignment offset.
*/
- const ScrollerData* const GetAutoScrollData();
+ float GetAutoScrollLineAlignment() const;
/**
* @brief Enables the horizontal scrolling.
bool IsMultiLineEnabled() const;
/**
- * @copydoc Dali::Toolkit::Text::LayoutEngine::SetHorizontalAlignment()
+ * @brief Sets the text's horizontal alignment.
+ *
+ * @param[in] alignment The horizontal alignment.
*/
- void SetHorizontalAlignment( LayoutEngine::HorizontalAlignment alignment );
+ void SetHorizontalAlignment( Layout::HorizontalAlignment alignment );
/**
- * @copydoc Dali::Toolkit::Text::LayoutEngine::GetHorizontalAlignment()
+ * @copydoc ModelInterface::GetHorizontalAlignment()
*/
- LayoutEngine::HorizontalAlignment GetHorizontalAlignment() const;
+ Layout::HorizontalAlignment GetHorizontalAlignment() const;
/**
- * @copydoc Dali::Toolkit::Text::LayoutEngine::SetVerticalAlignment()
+ * @brief Sets the text's vertical alignment.
+ *
+ * @param[in] alignment The vertical alignment.
*/
- void SetVerticalAlignment( LayoutEngine::VerticalAlignment alignment );
+ void SetVerticalAlignment( Layout::VerticalAlignment alignment );
/**
- * @copydoc Dali::Toolkit::Text::LayoutEngine::GetVerticalAlignment()
+ * @copydoc ModelInterface::GetVerticalAlignment()
*/
- LayoutEngine::VerticalAlignment GetVerticalAlignment() const;
+ Layout::VerticalAlignment GetVerticalAlignment() const;
+
+ /**
+ * @brief Enable or disable the text elide.
+ *
+ * @param[in] enabled Whether to enable the text elide.
+ */
+ void SetTextElideEnabled( bool enabled );
+
+ /**
+ * @copydoc ModelInterface::IsTextElideEnabled()
+ */
+ bool IsTextElideEnabled() const;
public: // Update.
float GetDefaultPointSize() const;
/**
- * @brief Set the text color
+ * @brief Sets the text's default color.
*
- * @param textColor The text color
+ * @param color The default color.
*/
- void SetTextColor( const Vector4& textColor );
+ void SetDefaultColor( const Vector4& color );
/**
- * @brief Retrieve the text color
+ * @brief Retrieves the text's default color.
*
- * @return The text color
+ * @return The default color.
*/
- const Vector4& GetTextColor() const;
+ const Vector4& GetDefaultColor() const;
/**
* @brief Set the text color
*
* @return A reference to the layout engine.
*/
- LayoutEngine& GetLayoutEngine();
+ Layout::Engine& GetLayoutEngine();
/**
* @brief Return a view of the text.
View& GetView();
/**
- * @brief Query the current scroll position; the UI control is responsible for moving actors to this position.
- *
- * @return The scroll position.
- */
- const Vector2& GetScrollPosition() const;
-
- /**
* @copydoc Control::GetNaturalSize()
*/
Vector3 GetNaturalSize();
*/
float GetHeightForWidth( float width );
+ /**
+ * @brief Retrieves the text's model.
+ *
+ * @return A pointer to the text's model.
+ */
+ const ModelInterface* const GetTextModel() const;
+
public: // Relayout.
/**
*/
virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button );
-private: // Inherit from TextScroller
-
- /**
- * @copydoc Text::ScrollerInterface::ScrollingFinished()
- */
- virtual void ScrollingFinished();
-
private: // Update.
/**