#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/hidden-text.h>
+#include <dali-toolkit/internal/text/input-filter.h>
#include <dali-toolkit/internal/text/layouts/layout-engine.h>
+#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
#include <dali-toolkit/internal/text/text-model-interface.h>
#include <dali-toolkit/internal/text/text-selectable-control-interface.h>
#include <dali-toolkit/public-api/text/text-enumerations.h>
* @param[in] controlInterface The control's interface.
* @param[in] editableControlInterface The editable control's interface.
* @param[in] selectableControlInterface The selectable control's interface.
+ * @param[in] anchorControlInterface The anchor control's interface.
*
* @return A pointer to a new Controller.
*/
static ControllerPtr New(ControlInterface* controlInterface,
EditableControlInterface* editableControlInterface,
- SelectableControlInterface* selectableControlInterface);
+ SelectableControlInterface* selectableControlInterface,
+ AnchorControlInterface* anchorControlInterface);
public: // Configure the text controller.
/**
bool IsMarkupProcessorEnabled() const;
/**
+ * @brief Retrieves whether the current text contains anchors.
+ *
+ * @return @e true if the current text contains anchors. @e false.
+ */
+ bool HasAnchors() const;
+
+ /**
* @brief Enables/disables the auto text scrolling
*
* By default is disabled.
*/
void SetControlInterface(ControlInterface* controlInterface);
+ /**
+ * @brief Set the anchor control's interface.
+ *
+ * @param[in] anchorControlInterface The control's interface.
+ */
+ void SetAnchorControlInterface(AnchorControlInterface* anchorControlInterface);
+
public: // Queries & retrieves.
/**
* @brief Return the layout engine.
void GetHiddenInputOption(Property::Map& options);
/**
+ * @brief Used to set the input filter option
+ */
+ void SetInputFilterOption(const Property::Map& options);
+
+ /**
+ * @brief Used to get the input filter option
+ */
+ void GetInputFilterOption(Property::Map& options);
+
+ /**
* @brief Sets the Placeholder Properties.
*
* @param[in] map The placeholder property map
void SetVerticalLineAlignment(Toolkit::DevelText::VerticalLineAlignment::Type alignment);
/**
+ * @brief Retrieves ellipsis position
+ * @return The ellipsis position
+ */
+ Toolkit::DevelText::EllipsisPosition::Type GetEllipsisPosition() const;
+
+ /**
+ * @brief Sets ellipsis position
+ * @param[in] ellipsisPosition The ellipsis position for the text
+ */
+ void SetEllipsisPosition(Toolkit::DevelText::EllipsisPosition::Type ellipsisPosition);
+
+ /**
* @brief Retrieves ignoreSpaceAfterText value from model
* @return The value of ignoreSpaceAfterText
*/
void SetIgnoreSpacesAfterText(bool ignore);
/**
- * @brief Retrieves matchSystemLanguageDirection value from model
- * @return The value of matchSystemLanguageDirection
+ * @brief Sets SetMatchLayoutDirection value to model
+ * @param[in] match The value of matchLayoutDirection for the text
*/
- bool IsMatchSystemLanguageDirection() const;
+ void SetMatchLayoutDirection(DevelText::MatchLayoutDirection type);
/**
- * @brief Sets matchSystemLanguageDirection value to model
- * @param[in] match The value of matchSystemLanguageDirection for the text
+ * @brief Retrieves matchLayoutDirection value from model
+ * @return The value of matchLayoutDirection
*/
- void SetMatchSystemLanguageDirection(bool match);
+ DevelText::MatchLayoutDirection GetMatchLayoutDirection() const;
/**
- * @brief Sets layoutDirection value
- * @param[in] layoutDirection The value of system language direction
+ * @brief Sets layoutDirection type value.
+ * @param[in] layoutDirection The value of the layout direction type.
*/
void SetLayoutDirection(Dali::LayoutDirection::Type layoutDirection);
/**
+ * @brief Gets layoutDirection type value.
+ * @param[in] actor The actor which will get the layout direction type.
+ * @return The value of the layout direction type.
+ */
+ Dali::LayoutDirection::Type GetLayoutDirection(Dali::Actor& actor) const;
+
+ /**
+ * @brief Sets the layout direction changed.
+ */
+ void ChangedLayoutDirection();
+
+ /**
* @brief Retrieves if showing real text or not.
* @return The value of showing real text.
*/
bool KeyEvent(const Dali::KeyEvent& event);
/**
+ * @brief Called by anchor when a tap gesture occurs.
+ * @param[in] x The x position relative to the top-left of the parent control.
+ * @param[in] y The y position relative to the top-left of the parent control.
+ */
+ void AnchorEvent(float x, float y);
+
+ /**
* @brief Called by editable UI controls when a tap gesture occurs.
* @param[in] tapCount The number of taps.
* @param[in] x The x position relative to the top-left of the parent control.
* @brief Used to set the Primary cursor position.
*
* @param[in] index for the Primary cursor position.
+ * @param[in] focused true if UI control has gained focus to receive key event, false otherwise.
* @return[in] true if cursor position changed, false otherwise.
*/
- bool SetPrimaryCursorPosition(CharacterIndex index);
+ bool SetPrimaryCursorPosition(CharacterIndex index, bool focused);
/**
* @brief Creates a selection event.
*/
bool RemoveSelectedText();
+ /**
+ * @brief Update anchor position from given number of inserted characters.
+ *
+ * @param[in] numberOfCharacters The number of inserted characters.
+ * @param[in] previousCursorIndex A cursor position before event occurs.
+ */
+ void InsertTextAnchor(int numberOfCharacters,
+ CharacterIndex previousCursorIndex);
+
+ /**
+ * @brief Update anchor position from given number of removed characters.
+ *
+ * @param[in] cursorOffset Start position from the current cursor position to start deleting characters.
+ * @param[in] numberOfCharacters The number of removed characters.
+ * @param[in] previousCursorIndex A cursor position before event occurs.
+ */
+ void RemoveTextAnchor(int cursorOffset,
+ int numberOfCharacters,
+ CharacterIndex previousCursorIndex);
+
private: // Relayout.
/**
* @brief Lays-out the text.
*/
Controller(ControlInterface* controlInterface,
EditableControlInterface* editableControlInterface,
- SelectableControlInterface* selectableControlInterface);
+ SelectableControlInterface* selectableControlInterface,
+ AnchorControlInterface* anchorControlInterface);
// Undefined
Controller(const Controller& handle);