#define DALI_TOOLKIT_TEXT_CONTROLLER_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali-toolkit/devel-api/text/spanned.h>
#include <dali/devel-api/adaptor-framework/clipboard.h>
#include <dali/devel-api/adaptor-framework/input-method-context.h>
+#include <dali/integration-api/processor-interface.h>
#include <dali/public-api/events/gesture.h>
// INTERNAL INCLUDES
*
* The text selection popup button callbacks are as well handled via the TextSelectionPopupCallbackInterface interface.
*/
-class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface, public HiddenText::Observer, public ConnectionTracker
+class Controller : public RefObject,
+ public Decorator::ControllerInterface,
+ public TextSelectionPopupCallbackInterface,
+ public HiddenText::Observer,
+ public ConnectionTracker,
+ public Integration::Processor
{
public: // Enumerated types.
/**
const Vector4& GetDefaultColor() const;
/**
+ * @brief Sets the anchor's default color.
+ *
+ * @param color The anchor color.
+ */
+ void SetAnchorColor(const Vector4& color);
+
+ /**
+ * @brief Retrieves the anchor's default color.
+ *
+ * @return The anchor color.
+ */
+ const Vector4& GetAnchorColor() const;
+
+ /**
+ * @brief Sets the anchor's clicked color.
+ *
+ * @param color The anchor color.
+ */
+ void SetAnchorClickedColor(const Vector4& color);
+
+ /**
+ * @brief Retrieves the anchor's clicked color.
+ *
+ * @return The anchor color.
+ */
+ const Vector4& GetAnchorClickedColor() const;
+
+ /**
* @brief Sets the user interaction enabled.
*
* @param enabled whether to enable the user interaction.
float GetDashedUnderlineGap() const;
/**
+ * @brief Set the outline offset.
+ *
+ * @param[in] outlineOffset The outline offset.
+ */
+ void SetOutlineOffset(const Vector2& outlineOffset);
+
+ /**
+ * @brief Retrieve the outline offset.
+ *
+ * @return The outline offset.
+ */
+ const Vector2& GetOutlineOffset() const;
+
+ /**
* @brief Set the outline color.
*
* @param[in] color color of outline.
uint16_t GetOutlineWidth() const;
/**
+ * @brief Set the outline blur radius.
+ *
+ * @param[in] outlineBlurRadius The outline blur radius, 0,0 indicates no blur.
+ */
+ void SetOutlineBlurRadius(const float& outlineBlurRadius);
+
+ /**
+ * @brief Retrieve the outline blur radius.
+ *
+ * @return The outline blur radius.
+ */
+ const float& GetOutlineBlurRadius() const;
+
+ /**
* @brief Set the background color.
*
* @param[in] color color of background.
* @brief Sets the input font's point size.
*
* @param[in] size The input font's point size.
+ * @param[in] defaultFontSizeUpdated True If the default font size is updated and sets the input point size, false otherwise.
*/
- void SetInputFontPointSize(float size);
+ void SetInputFontPointSize(float size, bool defaultFontSizeUpdated = false);
/**
* @brief Retrieves the input font's point size.
*/
const float GetCharacterSpacing() const;
+ /**
+ * @brief Sets the visual transform offset.
+ *
+ * @param[in] offset The offset.
+ */
+ void SetVisualTransformOffset(Vector2 offset);
+
+ /**
+ * @brief Sets whether background color with cutout is enabled.
+ *
+ * @param[in] enable True if enabled.
+ */
+ void SetBackgroundWithCutoutEnabled(bool enable);
+
+ /**
+ * @brief Whether background color with cutout is enabled.
+ *
+ * @return True if enabled.
+ */
+ bool IsBackgroundWithCutoutEnabled() const;
+
+ /**
+ * @brief Sets whether background color with cutout.
+ *
+ * @param[in] color The color to set.
+ */
+ void SetBackgroundColorWithCutout(const Vector4& color);
+
+ /**
+ * @brief Retrieves background color with cutout.
+ *
+ * @return The color.
+ */
+ const Vector4 GetBackgroundColorWithCutout() const;
+
public: // Queries & retrieves.
/**
* @brief Return the layout engine.
void SetIgnoreSpacesAfterText(bool ignore);
/**
+ * @brief Retrieves removeFrontInset value from model
+ * @return The value of removeFrontInset
+ */
+ bool IsRemoveFrontInset() const;
+
+ /**
+ * @brief Sets removeFrontInset value to model
+ * @param[in] remove The value of removeFrontInset for the text
+ */
+ void SetRemoveFrontInset(bool remove);
+
+ /**
+ * @brief Retrieves removeBackInset value from model
+ * @return The value of removeBackInset
+ */
+ bool IsRemoveBackInset() const;
+
+ /**
+ * @brief Sets removeBackInset value to model
+ * @param[in] remove The value of removeBackInset for the text
+ */
+ void SetRemoveBackInset(bool remove);
+
+ /**
+ * @brief Retrieves cutout value to model
+ * @return The value of cutout for the text
+ */
+ bool IsTextCutout() const;
+
+ /**
+ * @brief Sets cutout value to model
+ * @param[in] cutout The value of cutout for the text
+ */
+ void SetTextCutout(bool cutout);
+
+ /**
* @brief Sets SetMatchLayoutDirection value to model
* @param[in] match The value of matchLayoutDirection for the text
*/
void ChangedLayoutDirection();
/**
+ * @brief Clear font and style data.
+ */
+ void ResetFontAndStyleData();
+
+ /**
* @brief Retrieves if showing real text or not.
* @return The value of showing real text.
*/
bool IsInputStyleChangedSignalsQueueEmpty();
/**
- * @brief Process all pending input style changed signals.
+ * @brief Request process all pending input style changed signals.
*
- * Calls the Text::ControlInterface::InputStyleChanged() method which is overriden by the
+ * Request to calls the Text::ControlInterface::InputStyleChanged() method which is overriden by the
* text controls. Text controls may send signals to state the input style has changed.
+ *
+ * The signal will be execute next idle time, or skip if we fail to add idler.
*/
- void ProcessInputStyleChangedSignals();
+ void RequestProcessInputStyleChangedSignals();
+
+private:
+ /**
+ * @brief Callbacks called on idle.
+ *
+ * If there are notifications of change of input style on the queue, Toolkit::TextField::InputStyleChangedSignal() are emitted.
+ */
+ void OnIdleSignal();
public: // Text-input Event Queuing.
/**
*/
void DisplayTimeExpired() override;
+protected: // Inherit from Integration::Processor
+ /**
+ * @copydoc Dali::Integration::Processor::Process()
+ */
+ void Process(bool postProcess) override;
+
+ /**
+ * @copydoc Dali::Integration::Processor::GetProcessorName()
+ */
+ std::string_view GetProcessorName() const override
+ {
+ return "Text::Controller";
+ }
+
private: // Private contructors & copy operator.
/**
* @brief Private constructor.