-#ifndef __DALI_TOOLKIT_TEXT_CONTROLLER_H__
-#define __DALI_TOOLKIT_TEXT_CONTROLLER_H__
+#ifndef DALI_TOOLKIT_TEXT_CONTROLLER_H
+#define DALI_TOOLKIT_TEXT_CONTROLLER_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
#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-control-interface.h>
+#include <dali-toolkit/internal/text/text-model-interface.h>
namespace Dali
{
{
class Controller;
+class ControlInterface;
+class EditableControlInterface;
class View;
+class RenderingController;
typedef IntrusivePtr<Controller> ControllerPtr;
-typedef Dali::Toolkit::Text::ControlInterface ControlInterface;
/**
* @brief A Text Controller is used by UI Controls which display text.
/**
* @brief Create a new instance of a Controller.
*
- * @param[in] controlInterface An interface used to request a text relayout.
* @return A pointer to a new Controller.
*/
- static ControllerPtr New( ControlInterface& controlInterface );
+ static ControllerPtr New();
+
+ /**
+ * @brief Create a new instance of a Controller.
+ *
+ * @param[in] controlInterface The control's interface.
+ *
+ * @return A pointer to a new Controller.
+ */
+ static ControllerPtr New( ControlInterface* controlInterface );
+
+ /**
+ * @brief Create a new instance of a Controller.
+ *
+ * @param[in] controlInterface The control's interface.
+ * @param[in] editableControlInterface The editable control's interface.
+ *
+ * @return A pointer to a new Controller.
+ */
+ static ControllerPtr New( ControlInterface* controlInterface,
+ EditableControlInterface* editableControlInterface );
public: // Configure the text controller.
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
const Vector4& GetShadowColor() const;
/**
- * @brief Sets the shadow's properties string.
- *
- * @note The string is stored to be recovered.
- *
- * @param[in] shadowProperties The shadow's properties string.
- */
- void SetDefaultShadowProperties( const std::string& shadowProperties );
-
- /**
- * @brief Retrieves the shadow's properties string.
- *
- * @return The shadow's properties string.
- */
- const std::string& GetDefaultShadowProperties() const;
-
- /**
* @brief Set the underline color.
*
* @param[in] color color of underline.
float GetUnderlineHeight() const;
/**
- * @brief Sets the underline's properties string.
- *
- * @note The string is stored to be recovered.
- *
- * @param[in] underlineProperties The underline's properties string.
- */
- void SetDefaultUnderlineProperties( const std::string& underlineProperties );
-
- /**
- * @brief Retrieves the underline's properties string.
- *
- * @return The underline's properties string.
- */
- const std::string& GetDefaultUnderlineProperties() const;
-
- /**
* @brief Sets the emboss's properties string.
*
* @note The string is stored to be recovered.
*
* @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;
+
+ /**
+ * @brief Used to get scrolled distance by user input
+ *
+ * @return Distance from last scroll offset to new scroll offset
+ */
+ float GetScrollAmountByUserInput();
+
public: // Relayout.
/**
*/
UpdateTextType Relayout( const Size& size );
+ /**
+ * @brief Request a relayout using the ControlInterface.
+ */
+ void RequestRelayout();
+
public: // Input style change signals.
/**
/**
* @brief Private constructor.
*/
- Controller( ControlInterface& controlInterface );
+ Controller();
+
+ /**
+ * @brief Private constructor.
+ */
+ Controller( ControlInterface* controlInterface );
+
+ /**
+ * @brief Private constructor.
+ */
+ Controller( ControlInterface* controlInterface,
+ EditableControlInterface* editableControlInterface );
// Undefined
Controller( const Controller& handle );
} // namespace Dali
-#endif // __DALI_TOOLKIT_TEXT_CONTROLLER_H__
+#endif // DALI_TOOLKIT_TEXT_CONTROLLER_H