X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Ftext-controls%2Ftext-field-devel.h;h=c81210a58db27deb5112dc9852ea78753d53579e;hp=377b606848d542486a65c3e9129b3731be416918;hb=ff6ce970724ccc8bee65f7c93411b274907c09d7;hpb=21080c3c8107e51c71da5b319d83162a57c171b4 diff --git a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h index 377b606..c81210a 100644 --- a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_FIELD_DEVEL_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -163,6 +163,14 @@ enum FONT_SIZE_SCALE, /** + * @brief True to enable the font size scale or false to disable. + * @details Name "enableFontSizeScale", type Property::BOOLEAN. + * @note The default value is true. + * If false, font size scale is not apppied. + */ + ENABLE_FONT_SIZE_SCALE, + + /** * @brief The position for primary cursor. * @details Name "primaryCursorPosition", type Property::INTEGER. */ @@ -213,6 +221,34 @@ enum * @see DevelText::EllipsisPosition */ ELLIPSIS_POSITION, + + /** + * @brief A horizontal line through the text center. + * @details Name "strikethrough", type Property::MAP. + */ + STRIKETHROUGH, + + /** + * @brief The strikethrough parameters of the new input text. + * @details Name "inputStrikethrough", type Property::MAP. + */ + INPUT_STRIKETHROUGH, + + /** + * @brief The spaces between characters in Pixels. + * @details Name "characterSpacing", type Property::FLOAT. + * @note + * A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed). + * The default value is 0.f which does nothing. + */ + CHARACTER_SPACING, + + /** + * @brief Sets the selection popup style + * @details Name "selectionPopupStyle", type Property::MAP. + * @see Dali::Toolkit::TextSelectionPopup::Property + */ + SELECTION_POPUP_STYLE, }; } // namespace Property @@ -247,6 +283,26 @@ using AnchorClickedSignalType = Signal; DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextField textField); /** + * @brief cursor position changed signal type. + * + * @note Signal + * - uint32_t : old position. + */ +using CursorPositionChangedSignalType = Signal; + +/** + * @brief This signal is emitted when the cursor position has been changed. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(TextField textField, uint32_t oldPosition); + * @endcode + * @param[in] textField The instance of TextField. + * @return The signal to connect to. + */ +DALI_TOOLKIT_API CursorPositionChangedSignalType& CursorPositionChangedSignal(TextField textField); + +/** * @brief Input filtered signal type. */ using InputFilteredSignalType = Signal; @@ -278,6 +334,85 @@ using InputFilteredSignalType = Signal; + +/** + * @brief This signal is emitted when the selection has been changed. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( TextField textField, uint32_t oldStart, uint32_t oldEnd); + * @endcode + * @param[in] textField The instance of TextField. + * @return The signal to connect to + */ +DALI_TOOLKIT_API SelectionChangedSignalType& SelectionChangedSignal(TextField textField); + +/** + * @brief selection cleared signal type. + */ +using SelectionClearedSignalType = Signal; + +/** + * @brief This signal is emitted when the selection has been cleared. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( TextField textField); + * @endcode + * @param[in] textField The instance of TextField. + * @return The signal to connect to + */ +DALI_TOOLKIT_API SelectionClearedSignalType& SelectionClearedSignal(TextField textField); + +/** + * @brief selection start signal type. + */ +using SelectionStartedSignalType = Signal; + +/** + * @brief This signal is emitted when the selection start. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( TextField textField); + * @endcode + * @param[in] textField The instance of TextField. + * @return The signal to connect to + */ +DALI_TOOLKIT_API SelectionStartedSignalType& SelectionStartedSignal(TextField textField); + +/** + * @brief Get the rendered size of a specific text range. + * if the requested text is at multilines, multiple sizes will be returned for each text located in a separate line. + * if a line contains characters with different directions, multiple sizes will be returned for each block of contiguous characters with the same direction. + * + * @param[in] textField The instance of TextField. + * @param[in] startIndex start index of the text requested to calculate size for. + * @param[in] endIndex end index(included) of the text requested to calculate size for. + * @return list of sizes of the reuested text. + */ +DALI_TOOLKIT_API Vector GetTextSize(TextField textField, const uint32_t startIndex, const uint32_t endIndex); + +/** + * @brief Get the top/left rendered position of a specific text range. + * if the requested text is at multilines, multiple positions will be returned for each text located in a separate line. + * if a line contains characters with different directions, multiple positions will be returned for each block of contiguous characters with the same direction. + * + * @param[in] textField The instance of TextField. + * @param[in] startIndex start index of the text requested to get position to. + * @param[in] endIndex end index(included) of the text requested to get position to. + * @return list of positions of the requested text. + */ +DALI_TOOLKIT_API Vector GetTextPosition(TextField textField, const uint32_t startIndex, const uint32_t endIndex); + +/** * @brief Select the whole text of TextField. * * @param[in] textField The instance of TextField. @@ -291,6 +426,44 @@ DALI_TOOLKIT_API void SelectWholeText(TextField textField); */ DALI_TOOLKIT_API void SelectNone(TextField textField); +/** + * @brief Select the text from start index to end index of TextField. + * @note + * The selection index is based on the cursor index. + * + * text H e l l o + * index 0 1 2 3 4 5 + * if textField.SelectText(1, 4); is executed, "ell" is selected. + * + * @param[in] textField The instance of TextField. + * @param[in] start The start index of the text to select. (The starting point of start index is 0.) + * @param[in] end The end index of the text to select. (If end index > text's length, the end index is set to the length of the text.) + */ +DALI_TOOLKIT_API void SelectText(TextField textField, const uint32_t start, const uint32_t end); + +/** + * @brief Copy and return the selected text of TextField. + * + * @param[in] textField The instance of TextField. + * @return The copied text. + */ +DALI_TOOLKIT_API std::string CopyText(TextField textField); + +/** + * @brief Cut and return the selected text of TextField. + * + * @param[in] textField The instance of TextField. + * @return The cut text. + */ +DALI_TOOLKIT_API std::string CutText(TextField textField); + +/** + * @brief Paste the most recent clipboard text item into the TextField. + * + * @param[in] textField The instance of TextField. + */ +DALI_TOOLKIT_API void PasteText(TextField textField); + } // namespace DevelTextField } // namespace Toolkit