X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-selectable-control-interface.h;h=931cf6b38198fcdd00d780a71dd7403aae2d2034;hb=29a52105283ce8ced672ed92545daeacf882316a;hp=fe70abb2917f6fd86969ceba63053e6c43f564c3;hpb=f11be450471738b68f98fa4c552b3a22482ae4de;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-selectable-control-interface.h b/dali-toolkit/internal/text/text-selectable-control-interface.h index fe70abb..931cf6b 100644 --- a/dali-toolkit/internal/text/text-selectable-control-interface.h +++ b/dali-toolkit/internal/text/text-selectable-control-interface.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_SELECTABLE_CONTROL_INTERFACE_H /* - * Copyright (c) 2020 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,21 +20,18 @@ namespace Dali { - namespace Toolkit { - -using Uint32Pair = std::pair; +using Uint32Pair = std::pair; +using string = std::string; namespace Text { - /** * @brief An interface that the Text::Controller used for text selection functionality. */ class SelectableControlInterface { public: - /** * @brief Virtual destructor. */ @@ -45,13 +42,46 @@ public: * @param start start selection position (pass NULL to ignore). * @param end end selection position (pass NULL to ignore). */ - virtual void SetTextSelectionRange(const uint32_t *start, const uint32_t *end) = 0; + virtual void SetTextSelectionRange(const uint32_t* start, const uint32_t* end) = 0; /** * @brief Called to return the selection postions in the texts. * @return pair contains start and end positions. */ virtual Uint32Pair GetTextSelectionRange() const = 0; + + /** + * @brief Called to select the whole texts. + */ + virtual void SelectWholeText() = 0; + + /** + * @brief Called to unselect the whole texts. + */ + virtual void SelectNone() = 0; + + /** + * @brief Called to set the selection postions in the texts. + * @param start start selection position. + * @param end end selection position. + */ + virtual void SelectText(const uint32_t start, const uint32_t end) = 0; + + /** + * @brief Retrive Selected text. + * @return The seletced text. + */ + virtual string GetSelectedText() const = 0; + + /** + * @brief Called when the selection has been changed. + * + * @param oldStart the selection handles start position before the change. + * @param oldEnd the selection handles end position before the change. + * @param newStart the selection handles start position after the change. + * @param newEnd the selection handles end position after the change. + */ + virtual void SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t newStart, uint32_t newEnd) = 0; }; } // namespace Text