X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-editable-control-interface.h;h=12d4256e86f7abca5b0740c840957ba18943bd55;hp=abfbb5912c666b4a38768514aef558df659cc15b;hb=00758f1301dd0bfbf6dc87659a6db9d0ba2c6816;hpb=5359a575636e678baf178dab5209b587be1a7551 diff --git a/dali-toolkit/internal/text/text-editable-control-interface.h b/dali-toolkit/internal/text/text-editable-control-interface.h index abfbb59..12d4256 100644 --- a/dali-toolkit/internal/text/text-editable-control-interface.h +++ b/dali-toolkit/internal/text/text-editable-control-interface.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_EDITABLE_CONTROL_INTERFACE_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -20,35 +20,50 @@ // INTERNAL INCLUDES #include +#include namespace Dali { - class Actor; namespace Toolkit { - namespace Text { - /** * @brief An interface that the Text::Controller uses to notify about text changes and add decoration to the text control. */ class EditableControlInterface { public: - /** * @brief Virtual destructor. */ virtual ~EditableControlInterface() - {} + { + } + + /** + * @brief Called to signal that text has been inserted. + */ + virtual void TextInserted(unsigned int position, unsigned int length, const std::string& content) = 0; + + /** + * @brief Called to signal that text has been deleted. + */ + virtual void TextDeleted(unsigned int position, unsigned int length, const std::string& content) = 0; + + /** + * @brief Called to signal that caret (cursor position) has been moved. + */ + virtual void CursorPositionChanged(unsigned int oldPosition, unsigned int newPosition) = 0; /** * @brief Called to signal that text has been inserted or deleted. + * + * @param[in] immediate If true, it immediately emits the signal, if false, only emits once the signal when OnRelayout() is called next time. */ - virtual void TextChanged() = 0; + virtual void TextChanged(bool immediate) = 0; /** * @brief Called when the number of characters to be inserted exceeds the maximum limit @@ -60,7 +75,14 @@ public: * * @param[in] inputStyleMask Mask with the bits of the input style that has changed. */ - virtual void InputStyleChanged( InputStyle::Mask inputStyleMask ) = 0; + virtual void InputStyleChanged(InputStyle::Mask inputStyleMask) = 0; + + /** + * @brief Called when the character to be inserted is filtered by the input filter. + * + * @param[in] type The filter type is ACCEPTED or REJECTED. + */ + virtual void InputFiltered(Toolkit::InputFilter::Property::Type type) = 0; /** * @brief Add a decoration. @@ -68,7 +90,14 @@ public: * @param[in] decoration The actor displaying a decoration. * @param[in] needsClipping Whether the actor needs clipping. */ - virtual void AddDecoration( Actor& actor, bool needsClipping ) = 0; + virtual void AddDecoration(Actor& actor, bool needsClipping) = 0; + + /** + * @brief Gets the color of the control. + * + * @param[out] The color of the control. + */ + virtual void GetControlBackgroundColor(Vector4& color) const = 0; /** * @brief Editable status (on/off). @@ -82,7 +111,24 @@ public: * * @param[in] editable The editable status. */ - virtual void SetEditable( bool editable ) = 0; + virtual void SetEditable(bool editable) = 0; + + /** + * @brief Called to copy the selected text. + * @return The copied text. + */ + virtual string CopyText() = 0; + + /** + * @brief Called to cut the selected text. + * @return The cut text. + */ + virtual string CutText() = 0; + + /** + * @brief Called to paste the most recent clipboard text item into the control. + */ + virtual void PasteText() = 0; }; } // namespace Text