#define DALI_TOOLKIT_TEXT_EDITOR_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.
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.
*/
* @see DevelText::EllipsisPosition
*/
ELLIPSIS_POSITION,
+
+ /**
+ * @brief Sets the height of the line in points.
+ * @details Name "minLineSize", type Property::FLOAT.
+ * @note If the font size is larger than the line size, it works with the font size.
+ */
+ MIN_LINE_SIZE,
+
+ /**
+ * @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 the relative height of the line (a factor that will be multiplied by text height).
+ * @details Name "relativeLineSize", type Property::FLOAT.
+ * @note If the value is less than 1, the lines could to be overlapped.
+ */
+ RELATIVE_LINE_SIZE,
};
} // namespace Property
DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextEditor textEditor);
/**
+ * @brief cursor position changed signal type.
+ *
+ * @note Signal
+ * - uint32_t : old position.
+ */
+using CursorPositionChangedSignalType = Signal<void(TextEditor, uint32_t)>;
+
+/**
+ * @brief This signal is emitted when the cursor position has been changed.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName(TextEditor textEditor, uint32_t oldPosition);
+ * @endcode
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The signal to connect to.
+ */
+DALI_TOOLKIT_API CursorPositionChangedSignalType& CursorPositionChangedSignal(TextEditor textEditor);
+
+/**
* @brief Input filtered signal type.
*/
using InputFilteredSignalType = Signal<void(TextEditor, Toolkit::InputFilter::Property::Type)>;
DALI_TOOLKIT_API InputFilteredSignalType& InputFilteredSignal(TextEditor textEditor);
/**
+ * @brief selection changed signal type.
+ *
+ * @note Signal
+ * - uint32_t : selection start before the change.
+ * - uint32_t : selection end before the change.
+ */
+using SelectionChangedSignalType = Signal<void(TextEditor, uint32_t, uint32_t)>;
+
+/**
+ * @brief This signal is emitted when the selection has been changed.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( TextEditor textEditor, uint32_t oldStart, uint32_t oldEnd);
+ * @endcode
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The signal to connect to
+ */
+DALI_TOOLKIT_API SelectionChangedSignalType& SelectionChangedSignal(TextEditor textEditor);
+
+/**
+ * @brief selection cleared signal type.
+ */
+using SelectionClearedSignalType = Signal<void(TextEditor)>;
+
+/**
+ * @brief This signal is emitted when the selection has been cleared.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( TextEditor textEditor);
+ * @endcode
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The signal to connect to
+ */
+DALI_TOOLKIT_API SelectionClearedSignalType& SelectionClearedSignal(TextEditor textEditor);
+
+/**
+ * @brief selection start signal type.
+ */
+using SelectionStartedSignalType = Signal<void(TextEditor)>;
+
+/**
+ * @brief This signal is emitted when the selection start.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( TextEditor textEditor);
+ * @endcode
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The signal to connect to
+ */
+DALI_TOOLKIT_API SelectionStartedSignalType& SelectionStartedSignal(TextEditor textEditor);
+
+/**
* @brief Select the whole text of TextEditor.
*
* @param[in] textEditor The instance of TextEditor.
DALI_TOOLKIT_API void SelectNone(TextEditor textEditor);
/**
+ * @brief Select the text from start index to end index of TextEditor.
+ * @note
+ * The selection index is based on the cursor index.
+ *
+ * text H e l l o
+ * index 0 1 2 3 4 5
+ * if textEditor.SelectText(1, 4); is executed, "ell" is selected.
+ *
+ * @param[in] textEditor The instance of TextEditor.
+ * @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(TextEditor textEditor, const uint32_t start, const uint32_t end);
+
+/**
* @brief Scroll the TextEditor by specific amount.
*
* @param[in] textEditor The instance of TextEditor.
*/
DALI_TOOLKIT_API void ScrollBy(TextEditor textEditor, Vector2 scroll);
+/**
+ * @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] textEditor The instance of TextEditor.
+ * @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<Vector2> GetTextSize(TextEditor textEditor, 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] textEditor The instance of TextEditor.
+ * @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<Vector2> GetTextPosition(TextEditor textEditor, const uint32_t startIndex, const uint32_t endIndex);
+
+/**
+ * @brief Copy and return the selected text of TextEditor.
+ *
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The copied text.
+ */
+DALI_TOOLKIT_API std::string CopyText(TextEditor textEditor);
+
+/**
+ * @brief Cut and return the selected text of TextEditor.
+ *
+ * @param[in] textEditor The instance of TextEditor.
+ * @return The cut text.
+ */
+DALI_TOOLKIT_API std::string CutText(TextEditor textEditor);
+
+/**
+ * @brief Paste the most recent clipboard text item into the TextEditor.
+ *
+ * @param[in] textEditor The instance of TextEditor.
+ */
+DALI_TOOLKIT_API void PasteText(TextEditor textEditor);
+
} // namespace DevelTextEditor
} // namespace Toolkit