Merge "Add text selection popup style" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / text-controls / text-editor-devel.h
1 #ifndef DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H
2 #define DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H
3
4 /*
5  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 // EXTERNAL INCLUDES
21 #include <dali/devel-api/adaptor-framework/input-method-context.h>
22
23 // INTERNAL INCLUDES
24 #include <dali-toolkit/public-api/controls/text-controls/input-filter-properties.h>
25 #include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31 namespace DevelTextEditor
32 {
33 namespace Property
34 {
35 enum Type
36 {
37   TEXT                                 = Dali::Toolkit::TextEditor::Property::TEXT,
38   TEXT_COLOR                           = Dali::Toolkit::TextEditor::Property::TEXT_COLOR,
39   FONT_FAMILY                          = Dali::Toolkit::TextEditor::Property::FONT_FAMILY,
40   FONT_STYLE                           = Dali::Toolkit::TextEditor::Property::FONT_STYLE,
41   POINT_SIZE                           = Dali::Toolkit::TextEditor::Property::POINT_SIZE,
42   HORIZONTAL_ALIGNMENT                 = Dali::Toolkit::TextEditor::Property::HORIZONTAL_ALIGNMENT,
43   SCROLL_THRESHOLD                     = Dali::Toolkit::TextEditor::Property::SCROLL_THRESHOLD,
44   SCROLL_SPEED                         = Dali::Toolkit::TextEditor::Property::SCROLL_SPEED,
45   PRIMARY_CURSOR_COLOR                 = Dali::Toolkit::TextEditor::Property::PRIMARY_CURSOR_COLOR,
46   SECONDARY_CURSOR_COLOR               = Dali::Toolkit::TextEditor::Property::SECONDARY_CURSOR_COLOR,
47   ENABLE_CURSOR_BLINK                  = Dali::Toolkit::TextEditor::Property::ENABLE_CURSOR_BLINK,
48   CURSOR_BLINK_INTERVAL                = Dali::Toolkit::TextEditor::Property::CURSOR_BLINK_INTERVAL,
49   CURSOR_BLINK_DURATION                = Dali::Toolkit::TextEditor::Property::CURSOR_BLINK_DURATION,
50   CURSOR_WIDTH                         = Dali::Toolkit::TextEditor::Property::CURSOR_WIDTH,
51   GRAB_HANDLE_IMAGE                    = Dali::Toolkit::TextEditor::Property::GRAB_HANDLE_IMAGE,
52   GRAB_HANDLE_PRESSED_IMAGE            = Dali::Toolkit::TextEditor::Property::GRAB_HANDLE_PRESSED_IMAGE,
53   SELECTION_HANDLE_IMAGE_LEFT          = Dali::Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_LEFT,
54   SELECTION_HANDLE_IMAGE_RIGHT         = Dali::Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_RIGHT,
55   SELECTION_HANDLE_PRESSED_IMAGE_LEFT  = Dali::Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT,
56   SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = Dali::Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT,
57   SELECTION_HANDLE_MARKER_IMAGE_LEFT   = Dali::Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT,
58   SELECTION_HANDLE_MARKER_IMAGE_RIGHT  = Dali::Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT,
59   SELECTION_HIGHLIGHT_COLOR            = Dali::Toolkit::TextEditor::Property::SELECTION_HIGHLIGHT_COLOR,
60   DECORATION_BOUNDING_BOX              = Dali::Toolkit::TextEditor::Property::DECORATION_BOUNDING_BOX,
61   ENABLE_MARKUP                        = Dali::Toolkit::TextEditor::Property::ENABLE_MARKUP,
62   INPUT_COLOR                          = Dali::Toolkit::TextEditor::Property::INPUT_COLOR,
63   INPUT_FONT_FAMILY                    = Dali::Toolkit::TextEditor::Property::INPUT_FONT_FAMILY,
64   INPUT_FONT_STYLE                     = Dali::Toolkit::TextEditor::Property::INPUT_FONT_STYLE,
65   INPUT_POINT_SIZE                     = Dali::Toolkit::TextEditor::Property::INPUT_POINT_SIZE,
66   LINE_SPACING                         = Dali::Toolkit::TextEditor::Property::LINE_SPACING,
67   INPUT_LINE_SPACING                   = Dali::Toolkit::TextEditor::Property::INPUT_LINE_SPACING,
68   UNDERLINE                            = Dali::Toolkit::TextEditor::Property::UNDERLINE,
69   INPUT_UNDERLINE                      = Dali::Toolkit::TextEditor::Property::INPUT_UNDERLINE,
70   SHADOW                               = Dali::Toolkit::TextEditor::Property::SHADOW,
71   INPUT_SHADOW                         = Dali::Toolkit::TextEditor::Property::INPUT_SHADOW,
72   EMBOSS                               = Dali::Toolkit::TextEditor::Property::EMBOSS,
73   INPUT_EMBOSS                         = Dali::Toolkit::TextEditor::Property::INPUT_EMBOSS,
74   OUTLINE                              = Dali::Toolkit::TextEditor::Property::OUTLINE,
75   INPUT_OUTLINE                        = Dali::Toolkit::TextEditor::Property::INPUT_OUTLINE,
76   SMOOTH_SCROLL                        = Dali::Toolkit::TextEditor::Property::SMOOTH_SCROLL,
77   SMOOTH_SCROLL_DURATION               = Dali::Toolkit::TextEditor::Property::SMOOTH_SCROLL_DURATION,
78   ENABLE_SCROLL_BAR                    = Dali::Toolkit::TextEditor::Property::ENABLE_SCROLL_BAR,
79   SCROLL_BAR_SHOW_DURATION             = Dali::Toolkit::TextEditor::Property::SCROLL_BAR_SHOW_DURATION,
80   SCROLL_BAR_FADE_DURATION             = Dali::Toolkit::TextEditor::Property::SCROLL_BAR_FADE_DURATION,
81   PIXEL_SIZE                           = Dali::Toolkit::TextEditor::Property::PIXEL_SIZE,
82   LINE_COUNT                           = Dali::Toolkit::TextEditor::Property::LINE_COUNT,
83   ENABLE_SELECTION                     = Dali::Toolkit::TextEditor::Property::ENABLE_SELECTION,
84   PLACEHOLDER                          = Dali::Toolkit::TextEditor::Property::PLACEHOLDER,
85   LINE_WRAP_MODE                       = Dali::Toolkit::TextEditor::Property::LINE_WRAP_MODE,
86
87   /**
88    * @brief The text to display when the TextEditor is empty and inactive.
89    * @details Name "placeholderText", type Property::STRING.
90    */
91   PLACEHOLDER_TEXT,
92
93   /**
94    * @brief The placeholder-text color.
95    * @details Name "placeholderTextColor", type Property::VECTOR4.
96    */
97   PLACEHOLDER_TEXT_COLOR,
98
99   /**
100    * @brief Enables Text selection using Shift key.
101    * @details Name "enableShiftSelection", type Property::BOOLEAN.
102    */
103   ENABLE_SHIFT_SELECTION,
104
105   /**
106    * @brief Enables the grab handles for text selection.
107    * @details Name "enableGrabHandle", type Property::BOOLEAN.
108    * @note The default value is true, which means the grab handles are enabled by default.
109    */
110   ENABLE_GRAB_HANDLE,
111
112   /**
113    * @brief Modifies the default text alignment to match the direction of the system language.
114    * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write
115    * @note The default value is true
116    */
117   MATCH_SYSTEM_LANGUAGE_DIRECTION,
118
119   /**
120    * @brief The type or rendering e.g. bitmap-based.
121    * @details Name "renderingBackend", type Property::INTEGER.
122    */
123   RENDERING_BACKEND,
124
125   /**
126    * @brief The maximum number of characters that can be inserted.
127    * @details Name "maxLength", type Property::INTEGER.
128    */
129   MAX_LENGTH,
130
131   /**
132    * @brief The selected text start position.
133    * @details Name "selectedTextStart", type Property::INTEGER.
134    */
135   SELECTED_TEXT_START,
136
137   /**
138    * @brief The selected text range end position.
139    * @details Name "selectedTextEnd", type Property::INTEGER.
140    */
141   SELECTED_TEXT_END,
142
143   /**
144    * @brief The horizontal scroll position in pixels.
145    * @details Name "horizontalScrollPosition", type Property::FLOAT.
146    */
147   HORIZONTAL_SCROLL_POSITION,
148
149   /**
150    * @brief The vertical scroll position in pixels.
151    * @details Name "verticalScrollPosition", type Property::FLOAT.
152    */
153   VERTICAL_SCROLL_POSITION,
154
155   /**
156    * @brief The Editable state of control.
157    * @details Name "enableEditing", type Property::BOOLEAN.
158    */
159   ENABLE_EDITING,
160
161   /**
162    * @brief The selected text in UTF-8 format.
163    * @details Name "selectedText", type Property::STRING.
164    * @note This property is read-only.
165    */
166   SELECTED_TEXT,
167
168   /**
169    * @brief The font size scale.
170    * @details name "fontSizeScale", type Property::FLOAT.
171    * @note The default value is 1.0 which does nothing.
172    * The given font size scale value is used for multiplying the specified font size before querying fonts.
173    *
174    * e.g. The rendering results of both cases are same.
175    *  - fontSize: 15pt, fontSizeScale: 1.0
176    *  - fontSize: 10pt, fontSizeScale: 1.5
177    */
178   FONT_SIZE_SCALE,
179
180   /**
181    * @brief True to enable the font size scale or false to disable.
182    * @details Name "enableFontSizeScale", type Property::BOOLEAN.
183    * @note The default value is true.
184    * If false, font size scale is not apppied.
185    */
186   ENABLE_FONT_SIZE_SCALE,
187
188   /**
189    * @brief The position for primary cursor.
190    * @details Name "primaryCursorPosition", type Property::INTEGER.
191    */
192   PRIMARY_CURSOR_POSITION,
193
194   /**
195    * @brief The color of the grab color.
196    * @details Name "grabHandleColor", type Property::VECTOR4.
197    */
198   GRAB_HANDLE_COLOR,
199
200   /**
201    * @brief Enables the grab handle popup for text selection.
202    * @details Name "enableGrabHandlePopup", type Property::BOOLEAN.
203    * @note The default value is true, which means the grab handle popup is enabled by default.
204    */
205   ENABLE_GRAB_HANDLE_POPUP,
206
207   /**
208    * @brief The settings to relating to the System's Input Method, Key and Value.
209    * @details Name "inputMethodSettings", type Property::MAP.
210    *
211    * @note VARIATION key can be changed depending on PANEL_LAYOUT.
212    * For example, when PANEL_LAYOUT key is InputMethod::PanelLayout::NORMAL,
213    * then VARIATION would be among NORMAL, WITH_FILENAME, and WITH_PERSON_NAME in Dali::InputMethod::NormalLayout.
214    * For more information, see Dali::InputMethod::Category.
215    *
216    * Example Usage:
217    * @code
218    *   Property::Map propertyMap;
219    *   InputMethod::PanelLayout::Type panelLayout = InputMethod::PanelLayout::NUMBER;
220    *   InputMethod::AutoCapital::Type autoCapital = InputMethod::AutoCapital::WORD;
221    *   InputMethod::ButtonAction::Type buttonAction = InputMethod::ButtonAction::GO;
222    *   int inputVariation = 1;
223    *   propertyMap["PANEL_LAYOUT"] = panelLayout;
224    *   propertyMap["AUTO_CAPITALIZE"] = autoCapital;
225    *   propertyMap["BUTTON_ACTION"] = buttonAction;
226    *   propertyMap["VARIATION"] = inputVariation;
227    *
228    *   editor.SetProperty(DevelTextEditor::Property::INPUT_METHOD_SETTINGS, propertyMap);
229    * @endcode
230    */
231   INPUT_METHOD_SETTINGS,
232
233   /**
234    * @brief The input filter
235    * @details Name "inputFilter", type Property::MAP.
236    *
237    * The inputFilter map contains the following keys:
238    *
239    * | %Property Name       | Type     | Required | Description                                                                                                         |
240    * |----------------------|----------|----------|---------------------------------------------------------------------------------------------------------------------|
241    * | accepted             | STRING   | No       | A regular expression in the set of characters to be accepted by the inputFilter (the default value is empty string) |
242    * | rejected             | STRING   | No       | A regular expression in the set of characters to be rejected by the inputFilter (the default value is empty string) |
243    *
244    * @note Optional.
245    * The character set must follow the regular expression rules.
246    * Behaviour can not be guaranteed for incorrect grammars.
247    * Refer the link below for detailed rules.
248    * The functions in std::regex library use the ECMAScript grammar:
249    * http://cplusplus.com/reference/regex/ECMAScript/
250    *
251    * You can use enums instead of "accepted" and "rejected" strings.
252    * @see Dali::Toolkit::InputFilter::Property::Type
253    *
254    * Example Usage:
255    * @code
256    *   Property::Map filter;
257    *   filter[InputFilter::Property::ACCEPTED] = "[\\d]"; // accept whole digits
258    *   filter[InputFilter::Property::REJECTED] = "[0-5]"; // reject 0, 1, 2, 3, 4, 5
259    *
260    *   editor.SetProperty(DevelTextEditor::Property::INPUT_FILTER, filter); // acceptable inputs are 6, 7, 8, 9
261    * @endcode
262    */
263   INPUT_FILTER,
264
265   /**
266   * @brief Whether we should show the ellipsis if required.
267   * @details Name "ellipsis", type Property::BOOLEAN.
268   */
269   ELLIPSIS,
270
271   /**
272   * @brief The enumerations used to specify whether to position the ellipsis at the END, START or MIDDLE of the text.
273   * @details Name "EllipsisPosition", type [Type](@ref Dali::Toolkit::DevelText::EllipsisPosition::Type) (Property::INTEGER), or Property::STRING. Read/Write
274   * @note Default is EllipsisPosition::END.
275   * @see DevelText::EllipsisPosition
276   */
277   ELLIPSIS_POSITION,
278
279   /**
280    * @brief Sets the height of the line in points.
281    * @details Name "minLineSize", type Property::FLOAT.
282    * @note If the font size is larger than the line size, it works with the font size.
283    */
284   MIN_LINE_SIZE,
285
286   /**
287    * @brief A horizontal line through the text center.
288    * @details Name "strikethrough", type Property::MAP.
289    */
290   STRIKETHROUGH,
291
292   /**
293    * @brief The strikethrough parameters of the new input text.
294    * @details Name "inputStrikethrough", type Property::MAP.
295    */
296   INPUT_STRIKETHROUGH,
297
298   /**
299   * @brief The spaces between characters in Pixels.
300   * @details Name "characterSpacing", type Property::FLOAT.
301   * @note
302   *   A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).
303   *   The default value is 0.f which does nothing.
304   */
305   CHARACTER_SPACING,
306
307   /**
308    * @brief the relative height of the line (a factor that will be multiplied by text height).
309    * @details Name "relativeLineSize", type Property::FLOAT.
310    * @note If the value is less than 1, the lines could to be overlapped.
311    */
312   RELATIVE_LINE_SIZE,
313
314   /**
315    * @brief The line vertical alignment.
316    * @details Name "verticalAlignment", type Property::STRING or type VerticalAlignment::Type (Property::INTEGER).
317    *          Values "TOP", "CENTER", "BOTTOM", default TOP.
318    * @note Return type is Property::STRING
319    */
320   VERTICAL_ALIGNMENT,
321
322   /**
323    * @brief Sets the selection popup style
324    * @details Name "selectionPopupStyle", type Property::MAP.
325    * @see Dali::Toolkit::TextSelectionPopup::Property
326    */
327   SELECTION_POPUP_STYLE,
328 };
329
330 } // namespace Property
331
332 /**
333  * @brief Return the input method context of TextEditor.
334  *
335  * @param[in] textEditor The instance of TextEditor.
336  * @return InputMethodContext instance.
337  */
338 DALI_TOOLKIT_API InputMethodContext GetInputMethodContext(TextEditor textEditor);
339
340 /**
341  * @brief Max Characters Exceed signal type.
342   */
343 using MaxLengthReachedSignalType = Signal<void(TextEditor)>;
344
345 /**
346  * @brief This signal is emitted when inserted text exceeds the maximum character limit.
347  *
348  * A callback of the following type may be connected:
349  * @code
350  *   void YourCallbackName( TextEditor textEditor );
351  * @endcode
352  * @param[in] textEditor The instance of TextEditor.
353  * @return The signal to connect to
354  */
355 DALI_TOOLKIT_API MaxLengthReachedSignalType& MaxLengthReachedSignal(TextEditor textEditor);
356
357 /**
358  * @brief Anchor clicked signal type.
359  *
360  * @note Signal
361  *  - const char* : href of clicked anchor.
362  *  - uint32_t    : length of href.
363  */
364 using AnchorClickedSignalType = Signal<void(TextEditor, const char*, uint32_t)>;
365
366 /**
367  * @brief This signal is emitted when the anchor is clicked.
368  *
369  * A callback of the following type may be connected:
370  * @code
371  *   void YourCallbackName(TextEditor textEditor, const char* href, uint32_t hrefLength);
372  * @endcode
373  * @param[in] textEditor The instance of TextEditor.
374  * @return The signal to connect to.
375  */
376 DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextEditor textEditor);
377
378 /**
379  * @brief cursor position changed signal type.
380  *
381  * @note Signal
382  *  - uint32_t    : old position.
383  */
384 using CursorPositionChangedSignalType = Signal<void(TextEditor, uint32_t)>;
385
386 /**
387  * @brief This signal is emitted when the cursor position has been changed.
388  *
389  * A callback of the following type may be connected:
390  * @code
391  *   void YourCallbackName(TextEditor textEditor, uint32_t oldPosition);
392  * @endcode
393  * @param[in] textEditor The instance of TextEditor.
394  * @return The signal to connect to.
395  */
396 DALI_TOOLKIT_API CursorPositionChangedSignalType& CursorPositionChangedSignal(TextEditor textEditor);
397
398 /**
399  * @brief Input filtered signal type.
400  */
401 using InputFilteredSignalType = Signal<void(TextEditor, Toolkit::InputFilter::Property::Type)>;
402
403 /**
404  * @brief This signal is emitted when the character to be inserted is filtered by the input filter.
405  *
406  * A callback of the following type may be connected:
407  * @code
408  *   void YourCallbackName(TextEditor textEditor, Toolkit::InputFilter::Property::Type type);
409  *
410  *   DevelTextEditor::InputFilteredSignal(textEditor).Connect(this, &OnInputFiltered);
411  *
412  *   void OnInputFiltered(TextEditor textEditor, InputFilter::Property::Type type)
413  *   {
414  *     if (type == InputFilter::Property::ACCEPTED)
415  *     {
416  *       // If the input has been filtered with an accepted filter, the type is ACCEPTED.
417  *     }
418  *     else if (type == InputFilter::Property::REJECTED)
419  *     {
420  *       // If the input has been filtered with an rejected filter, the type is REJECTED.
421  *     }
422  *   }
423  * @endcode
424  * @param[in] textEditor The instance of TextEditor.
425  * @return The signal to connect to.
426  */
427 DALI_TOOLKIT_API InputFilteredSignalType& InputFilteredSignal(TextEditor textEditor);
428
429 /**
430  * @brief selection changed signal type.
431  *
432  * @note Signal
433  *  - uint32_t  : selection start before the change.
434  *  - uint32_t  : selection end before the change.
435  */
436 using SelectionChangedSignalType = Signal<void(TextEditor, uint32_t, uint32_t)>;
437
438 /**
439  * @brief This signal is emitted when the selection has been changed.
440  *
441  * A callback of the following type may be connected:
442  * @code
443  *   void YourCallbackName( TextEditor textEditor, uint32_t oldStart, uint32_t oldEnd);
444  * @endcode
445  * @param[in] textEditor The instance of TextEditor.
446  * @return The signal to connect to
447  */
448 DALI_TOOLKIT_API SelectionChangedSignalType& SelectionChangedSignal(TextEditor textEditor);
449
450 /**
451  * @brief selection cleared signal type.
452  */
453 using SelectionClearedSignalType = Signal<void(TextEditor)>;
454
455 /**
456  * @brief This signal is emitted when the selection has been cleared.
457  *
458  * A callback of the following type may be connected:
459  * @code
460  *   void YourCallbackName( TextEditor textEditor);
461  * @endcode
462  * @param[in] textEditor The instance of TextEditor.
463  * @return The signal to connect to
464  */
465 DALI_TOOLKIT_API SelectionClearedSignalType& SelectionClearedSignal(TextEditor textEditor);
466
467 /**
468  * @brief selection start signal type.
469  */
470 using SelectionStartedSignalType = Signal<void(TextEditor)>;
471
472 /**
473  * @brief This signal is emitted when the selection start.
474  *
475  * A callback of the following type may be connected:
476  * @code
477  *   void YourCallbackName( TextEditor textEditor);
478  * @endcode
479  * @param[in] textEditor The instance of TextEditor.
480  * @return The signal to connect to
481  */
482 DALI_TOOLKIT_API SelectionStartedSignalType& SelectionStartedSignal(TextEditor textEditor);
483
484 /**
485  * @brief Select the whole text of TextEditor.
486  *
487  * @param[in] textEditor The instance of TextEditor.
488  */
489 DALI_TOOLKIT_API void SelectWholeText(TextEditor textEditor);
490
491 /**
492  * @brief Unselect the whole text of TextEditor.
493  *
494  * @param[in] textEditor The instance of TextEditor.
495  */
496 DALI_TOOLKIT_API void SelectNone(TextEditor textEditor);
497
498 /**
499  * @brief Select the text from start index to end index of TextEditor.
500  * @note
501  * The selection index is based on the cursor index.
502  *
503  * text   H e l l o
504  * index 0 1 2 3 4 5
505  * if textEditor.SelectText(1, 4); is executed, "ell" is selected.
506  *
507  * @param[in] textEditor The instance of TextEditor.
508  * @param[in] start The start index of the text to select. (The starting point of start index is 0.)
509  * @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.)
510  */
511 DALI_TOOLKIT_API void SelectText(TextEditor textEditor, const uint32_t start, const uint32_t end);
512
513 /**
514  * @brief Scroll the TextEditor by specific amount.
515  *
516  * @param[in] textEditor The instance of TextEditor.
517  * @param[in] scroll amount (in pixels) of scrolling in horizontal & vectical directions.
518  */
519 DALI_TOOLKIT_API void ScrollBy(TextEditor textEditor, Vector2 scroll);
520
521 /**
522  * @brief Get the rendered size of a specific text range.
523  * if the requested text is at multilines, multiple sizes will be returned for each text located in a separate line.
524  * if a line contains characters with different directions, multiple sizes will be returned for each block of contiguous characters with the same direction.
525  *
526  * @param[in] textEditor The instance of TextEditor.
527  * @param[in] startIndex start index of the text requested to calculate size for.
528  * @param[in] endIndex end index(included) of the text requested to calculate size for.
529  * @return list of sizes of the reuested text.
530  */
531 DALI_TOOLKIT_API Vector<Vector2> GetTextSize(TextEditor textEditor, const uint32_t startIndex, const uint32_t endIndex);
532
533 /**
534  * @brief Get the top/left rendered position of a specific text range.
535  * if the requested text is at multilines, multiple positions will be returned for each text located in a separate line.
536  * if a line contains characters with different directions, multiple positions will be returned for each block of contiguous characters with the same direction.
537  *
538  * @param[in] textEditor The instance of TextEditor.
539  * @param[in] startIndex start index of the text requested to get position to.
540  * @param[in] endIndex end index(included) of the text requested to get position to.
541  * @return list of positions of the requested text.
542  */
543 DALI_TOOLKIT_API Vector<Vector2> GetTextPosition(TextEditor textEditor, const uint32_t startIndex, const uint32_t endIndex);
544
545 /**
546  * @brief Copy and return the selected text of TextEditor.
547  *
548  * @param[in] textEditor The instance of TextEditor.
549  * @return The copied text.
550  */
551 DALI_TOOLKIT_API std::string CopyText(TextEditor textEditor);
552
553 /**
554  * @brief Cut and return the selected text of TextEditor.
555  *
556  * @param[in] textEditor The instance of TextEditor.
557  * @return The cut text.
558  */
559 DALI_TOOLKIT_API std::string CutText(TextEditor textEditor);
560
561 /**
562  * @brief Paste the most recent clipboard text item into the TextEditor.
563  *
564  * @param[in] textEditor The instance of TextEditor.
565  */
566 DALI_TOOLKIT_API void PasteText(TextEditor textEditor);
567
568 } // namespace DevelTextEditor
569
570 } // namespace Toolkit
571
572 } // namespace Dali
573
574 #endif // DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H