[dali_2.3.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-editor-property-handler.cpp
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <dali-toolkit/internal/controls/text-controls/common-text-utils.h>
18 #include <dali-toolkit/internal/controls/text-controls/text-editor-property-handler.h>
19
20 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
21
22 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
23 #include <dali-toolkit/internal/text/controller/text-controller.h>
24 #include <dali-toolkit/internal/text/text-effects-style.h>
25 #include <dali-toolkit/internal/text/text-enumerations-impl.h>
26 #include <dali-toolkit/internal/text/text-font-style.h>
27 #include <dali-toolkit/public-api/text/text-enumerations.h>
28 #include <dali/integration-api/debug.h>
29
30 #if defined(DEBUG_ENABLED)
31 extern Debug::Filter* gTextEditorLogFilter;
32 #endif
33
34 namespace Dali::Toolkit::Internal
35 {
36 const char* const TextEditor::PropertyHandler::IMAGE_MAP_FILENAME_STRING{"filename"};
37
38 /// Retrieves a filename from a value that is a Property::Map
39 std::string TextEditor::PropertyHandler::GetImageFileNameFromPropertyValue(const Property::Value& value)
40 {
41   std::string          filename;
42   const Property::Map* map = value.GetMap();
43   if(map)
44   {
45     const Property::Value* filenameValue = map->Find(TextEditor::PropertyHandler::IMAGE_MAP_FILENAME_STRING);
46     if(filenameValue)
47     {
48       filenameValue->Get(filename);
49     }
50   }
51   return filename;
52 }
53
54 void TextEditor::PropertyHandler::SetProperty(Toolkit::TextEditor textEditor, Property::Index index, const Property::Value& value)
55 {
56   TextEditor& impl(GetImpl(textEditor));
57   DALI_ASSERT_DEBUG(impl.mController && "No text controller");
58   DALI_ASSERT_DEBUG(impl.mDecorator && "No text decorator");
59
60   switch(index)
61   {
62     case Toolkit::DevelTextEditor::Property::RENDERING_BACKEND:
63     {
64       int backend = value.Get<int>();
65       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p RENDERING_BACKEND %d\n", impl.mController.Get(), backend);
66
67       if(impl.mRenderingBackend != backend)
68       {
69         impl.mRenderingBackend = backend;
70         impl.mRenderer.Reset();
71         impl.RequestTextRelayout();
72       }
73       break;
74     }
75     case Toolkit::TextEditor::Property::TEXT:
76     {
77       const std::string& text = value.Get<std::string>();
78       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p TEXT %s\n", impl.mController.Get(), text.c_str());
79
80       impl.mController->SetText(text);
81       break;
82     }
83     case Toolkit::TextEditor::Property::TEXT_COLOR:
84     {
85       const Vector4& textColor = value.Get<Vector4>();
86       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a);
87
88       if(impl.mController->GetDefaultColor() != textColor)
89       {
90         impl.mController->SetDefaultColor(textColor);
91         impl.mController->SetInputColor(textColor);
92         impl.mRenderer.Reset();
93       }
94       break;
95     }
96     case Toolkit::TextEditor::Property::FONT_FAMILY:
97     {
98       const std::string& fontFamily = value.Get<std::string>();
99       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p FONT_FAMILY %s\n", impl.mController.Get(), fontFamily.c_str());
100       impl.mController->SetDefaultFontFamily(fontFamily);
101       break;
102     }
103     case Toolkit::TextEditor::Property::FONT_STYLE:
104     {
105       SetFontStyleProperty(impl.mController, value, Text::FontStyle::DEFAULT);
106       break;
107     }
108     case Toolkit::TextEditor::Property::POINT_SIZE:
109     {
110       const float pointSize = value.Get<float>();
111       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p POINT_SIZE %f\n", impl.mController.Get(), pointSize);
112
113       if(!Equals(impl.mController->GetDefaultFontSize(Text::Controller::POINT_SIZE), pointSize))
114       {
115         impl.mController->SetDefaultFontSize(pointSize, Text::Controller::POINT_SIZE);
116       }
117       break;
118     }
119     case Toolkit::TextEditor::Property::HORIZONTAL_ALIGNMENT:
120     {
121       Text::HorizontalAlignment::Type alignment(static_cast<Text::HorizontalAlignment::Type>(-1)); // Set to invalid value to ensure a valid mode does get set
122       if(Text::GetHorizontalAlignmentEnumeration(value, alignment))
123       {
124         DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p HORIZONTAL_ALIGNMENT %d\n", impl.mController.Get(), alignment);
125         impl.mController->SetHorizontalAlignment(alignment);
126       }
127       break;
128     }
129     case Toolkit::DevelTextEditor::Property::VERTICAL_ALIGNMENT:
130     {
131       Toolkit::Text::VerticalAlignment::Type alignment(static_cast<Text::VerticalAlignment::Type>(-1)); // Set to invalid value to ensure a valid mode does get set
132       if(Text::GetVerticalAlignmentEnumeration(value, alignment))
133       {
134         impl.mController->SetVerticalAlignment(alignment);
135         DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p VERTICAL_ALIGNMENT %d\n", impl.mController.Get(), alignment);
136       }
137       break;
138     }
139     case Toolkit::TextEditor::Property::SCROLL_THRESHOLD:
140     {
141       const float threshold = value.Get<float>();
142       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p SCROLL_THRESHOLD %f\n", impl.mController.Get(), threshold);
143
144       impl.mDecorator->SetScrollThreshold(threshold);
145       break;
146     }
147     case Toolkit::TextEditor::Property::SCROLL_SPEED:
148     {
149       const float speed = value.Get<float>();
150       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p SCROLL_SPEED %f\n", impl.mController.Get(), speed);
151
152       impl.mDecorator->SetScrollSpeed(speed);
153       break;
154     }
155     case Toolkit::TextEditor::Property::PRIMARY_CURSOR_COLOR:
156     {
157       const Vector4& color = value.Get<Vector4>();
158       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p PRIMARY_CURSOR_COLOR %f,%f,%f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a);
159
160       impl.mDecorator->SetCursorColor(Toolkit::Text::PRIMARY_CURSOR, color);
161       impl.RequestTextRelayout();
162       break;
163     }
164     case Toolkit::TextEditor::Property::SECONDARY_CURSOR_COLOR:
165     {
166       const Vector4& color = value.Get<Vector4>();
167       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p SECONDARY_CURSOR_COLOR %f,%f,%f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a);
168
169       impl.mDecorator->SetCursorColor(Toolkit::Text::SECONDARY_CURSOR, color);
170       impl.RequestTextRelayout();
171       break;
172     }
173     case Toolkit::TextEditor::Property::ENABLE_CURSOR_BLINK:
174     {
175       const bool enable = value.Get<bool>();
176       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p ENABLE_CURSOR_BLINK %d\n", impl.mController.Get(), enable);
177
178       impl.mController->SetEnableCursorBlink(enable);
179       impl.RequestTextRelayout();
180       break;
181     }
182     case Toolkit::TextEditor::Property::CURSOR_BLINK_INTERVAL:
183     {
184       const float interval = value.Get<float>();
185       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p CURSOR_BLINK_INTERVAL %f\n", impl.mController.Get(), interval);
186
187       impl.mDecorator->SetCursorBlinkInterval(interval);
188       break;
189     }
190     case Toolkit::TextEditor::Property::CURSOR_BLINK_DURATION:
191     {
192       const float duration = value.Get<float>();
193       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p CURSOR_BLINK_DURATION %f\n", impl.mController.Get(), duration);
194
195       impl.mDecorator->SetCursorBlinkDuration(duration);
196       break;
197     }
198     case Toolkit::TextEditor::Property::CURSOR_WIDTH:
199     {
200       const int width = value.Get<int>();
201       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p CURSOR_WIDTH %d\n", impl.mController.Get(), width);
202
203       impl.mDecorator->SetCursorWidth(width);
204       impl.mController->GetLayoutEngine().SetCursorWidth(width);
205       break;
206     }
207     case Toolkit::TextEditor::Property::GRAB_HANDLE_IMAGE:
208     {
209       const std::string imageFileName = value.Get<std::string>();
210       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p GRAB_HANDLE_IMAGE %s\n", impl.mController.Get(), imageFileName.c_str());
211
212       if(imageFileName.size())
213       {
214         impl.mDecorator->SetHandleImage(Toolkit::Text::GRAB_HANDLE, Toolkit::Text::HANDLE_IMAGE_RELEASED, imageFileName);
215         impl.RequestTextRelayout();
216       }
217       break;
218     }
219     case Toolkit::TextEditor::Property::GRAB_HANDLE_PRESSED_IMAGE:
220     {
221       const std::string imageFileName = value.Get<std::string>();
222       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p GRAB_HANDLE_PRESSED_IMAGE %s\n", impl.mController.Get(), imageFileName.c_str());
223
224       if(imageFileName.size())
225       {
226         impl.mDecorator->SetHandleImage(Toolkit::Text::GRAB_HANDLE, Toolkit::Text::HANDLE_IMAGE_PRESSED, imageFileName);
227         impl.RequestTextRelayout();
228       }
229       break;
230     }
231     case Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_LEFT:
232     {
233       const std::string filename = GetImageFileNameFromPropertyValue(value);
234
235       if(filename.size())
236       {
237         impl.mDecorator->SetHandleImage(Toolkit::Text::LEFT_SELECTION_HANDLE, Toolkit::Text::HANDLE_IMAGE_RELEASED, filename);
238         impl.RequestTextRelayout();
239       }
240       break;
241     }
242     case Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_RIGHT:
243     {
244       const std::string filename = GetImageFileNameFromPropertyValue(value);
245
246       if(filename.size())
247       {
248         impl.mDecorator->SetHandleImage(Toolkit::Text::RIGHT_SELECTION_HANDLE, Toolkit::Text::HANDLE_IMAGE_RELEASED, filename);
249         impl.RequestTextRelayout();
250       }
251       break;
252     }
253     case Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
254     {
255       const std::string filename = GetImageFileNameFromPropertyValue(value);
256
257       if(filename.size())
258       {
259         impl.mDecorator->SetHandleImage(Toolkit::Text::LEFT_SELECTION_HANDLE, Toolkit::Text::HANDLE_IMAGE_PRESSED, filename);
260         impl.RequestTextRelayout();
261       }
262       break;
263     }
264     case Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
265     {
266       const std::string filename = GetImageFileNameFromPropertyValue(value);
267
268       if(filename.size())
269       {
270         impl.mDecorator->SetHandleImage(Toolkit::Text::RIGHT_SELECTION_HANDLE, Toolkit::Text::HANDLE_IMAGE_PRESSED, filename);
271         impl.RequestTextRelayout();
272       }
273       break;
274     }
275     case Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
276     {
277       const std::string filename = GetImageFileNameFromPropertyValue(value);
278
279       if(filename.size())
280       {
281         impl.mDecorator->SetHandleImage(Toolkit::Text::LEFT_SELECTION_HANDLE_MARKER,
282                                         Toolkit::Text::HANDLE_IMAGE_RELEASED,
283                                         filename);
284         impl.RequestTextRelayout();
285       }
286       break;
287     }
288     case Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
289     {
290       const std::string filename = GetImageFileNameFromPropertyValue(value);
291
292       if(filename.size())
293       {
294         impl.mDecorator->SetHandleImage(Toolkit::Text::RIGHT_SELECTION_HANDLE_MARKER,
295                                         Toolkit::Text::HANDLE_IMAGE_RELEASED,
296                                         filename);
297         impl.RequestTextRelayout();
298       }
299       break;
300     }
301     case Toolkit::TextEditor::Property::SELECTION_HIGHLIGHT_COLOR:
302     {
303       const Vector4 color = value.Get<Vector4>();
304       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p SELECTION_HIGHLIGHT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a);
305
306       impl.mDecorator->SetHighlightColor(color);
307       impl.RequestTextRelayout();
308       break;
309     }
310     case Toolkit::TextEditor::Property::DECORATION_BOUNDING_BOX:
311     {
312       const Rect<int>& box = value.Get<Rect<int> >();
313       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p DECORATION_BOUNDING_BOX %d,%d %dx%d\n", impl.mController.Get(), box.x, box.y, box.width, box.height);
314
315       impl.mDecorator->SetBoundingBox(box);
316       impl.RequestTextRelayout();
317       break;
318     }
319     case Toolkit::TextEditor::Property::ENABLE_MARKUP:
320     {
321       const bool enableMarkup = value.Get<bool>();
322       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p ENABLE_MARKUP %d\n", impl.mController.Get(), enableMarkup);
323
324       impl.mController->SetMarkupProcessorEnabled(enableMarkup);
325       CommonTextUtils::SynchronizeTextAnchorsInParent(textEditor, impl.mController, impl.mAnchorActors);
326       break;
327     }
328     case Toolkit::TextEditor::Property::INPUT_COLOR:
329     {
330       const Vector4& inputColor = value.Get<Vector4>();
331       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p INPUT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), inputColor.r, inputColor.g, inputColor.b, inputColor.a);
332
333       impl.mController->SetInputColor(inputColor);
334       break;
335     }
336     case Toolkit::TextEditor::Property::INPUT_FONT_FAMILY:
337     {
338       const std::string& fontFamily = value.Get<std::string>();
339       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p INPUT_FONT_FAMILY %s\n", impl.mController.Get(), fontFamily.c_str());
340       impl.mController->SetInputFontFamily(fontFamily);
341       break;
342     }
343     case Toolkit::TextEditor::Property::INPUT_FONT_STYLE:
344     {
345       SetFontStyleProperty(impl.mController, value, Text::FontStyle::INPUT);
346       break;
347     }
348     case Toolkit::TextEditor::Property::INPUT_POINT_SIZE:
349     {
350       const float pointSize = value.Get<float>();
351       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p INPUT_POINT_SIZE %f\n", impl.mController.Get(), pointSize);
352       impl.mController->SetInputFontPointSize(pointSize);
353       break;
354     }
355     case Toolkit::TextEditor::Property::LINE_SPACING:
356     {
357       const float lineSpacing = value.Get<float>();
358       impl.mController->SetDefaultLineSpacing(lineSpacing);
359       impl.mRenderer.Reset();
360       break;
361     }
362     case Toolkit::TextEditor::Property::INPUT_LINE_SPACING:
363     {
364       const float lineSpacing = value.Get<float>();
365       impl.mController->SetInputLineSpacing(lineSpacing);
366       impl.mRenderer.Reset();
367       break;
368     }
369     case Toolkit::TextEditor::Property::UNDERLINE:
370     {
371       const bool update = SetUnderlineProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
372       if(update)
373       {
374         impl.mRenderer.Reset();
375       }
376       break;
377     }
378     case Toolkit::TextEditor::Property::INPUT_UNDERLINE:
379     {
380       const bool update = SetUnderlineProperties(impl.mController, value, Text::EffectStyle::INPUT);
381       if(update)
382       {
383         impl.mRenderer.Reset();
384       }
385       break;
386     }
387     case Toolkit::TextEditor::Property::SHADOW:
388     {
389       const bool update = SetShadowProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
390       if(update)
391       {
392         impl.mRenderer.Reset();
393       }
394       break;
395     }
396     case Toolkit::TextEditor::Property::INPUT_SHADOW:
397     {
398       const bool update = SetShadowProperties(impl.mController, value, Text::EffectStyle::INPUT);
399       if(update)
400       {
401         impl.mRenderer.Reset();
402       }
403       break;
404     }
405     case Toolkit::TextEditor::Property::EMBOSS:
406     {
407       const bool update = SetEmbossProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
408       if(update)
409       {
410         impl.mRenderer.Reset();
411       }
412       break;
413     }
414     case Toolkit::TextEditor::Property::INPUT_EMBOSS:
415     {
416       const bool update = SetEmbossProperties(impl.mController, value, Text::EffectStyle::INPUT);
417       if(update)
418       {
419         impl.mRenderer.Reset();
420       }
421       break;
422     }
423     case Toolkit::TextEditor::Property::OUTLINE:
424     {
425       const bool update = SetOutlineProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
426       if(update)
427       {
428         impl.mRenderer.Reset();
429       }
430       break;
431     }
432     case Toolkit::TextEditor::Property::INPUT_OUTLINE:
433     {
434       const bool update = SetOutlineProperties(impl.mController, value, Text::EffectStyle::INPUT);
435       if(update)
436       {
437         impl.mRenderer.Reset();
438       }
439       break;
440     }
441     case Toolkit::TextEditor::Property::SMOOTH_SCROLL:
442     {
443       const bool enable = value.Get<bool>();
444       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor SMOOTH_SCROLL %d\n", enable);
445
446       impl.mScrollAnimationEnabled = enable;
447       break;
448     }
449     case Toolkit::TextEditor::Property::SMOOTH_SCROLL_DURATION:
450     {
451       const float duration = value.Get<float>();
452       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor SMOOTH_SCROLL_DURATION %f\n", duration);
453
454       impl.mScrollAnimationDuration = duration;
455       if(impl.mTextVerticalScroller)
456       {
457         impl.mTextVerticalScroller->SetDuration(duration);
458       }
459       break;
460     }
461     case Toolkit::TextEditor::Property::ENABLE_SCROLL_BAR:
462     {
463       const bool enable = value.Get<bool>();
464       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor SHOW_SCROLL_BAR %d\n", enable);
465
466       impl.mScrollBarEnabled = enable;
467       break;
468     }
469     case Toolkit::TextEditor::Property::SCROLL_BAR_SHOW_DURATION:
470     {
471       const float duration = value.Get<float>();
472       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor SCROLL_BAR_SHOW_DURATION %f\n", duration);
473
474       impl.mAnimationPeriod.delaySeconds = duration;
475       break;
476     }
477     case Toolkit::TextEditor::Property::SCROLL_BAR_FADE_DURATION:
478     {
479       const float duration = value.Get<float>();
480       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor SCROLL_BAR_FADE_DURATION %f\n", duration);
481
482       impl.mAnimationPeriod.durationSeconds = duration;
483       break;
484     }
485     case Toolkit::TextEditor::Property::PIXEL_SIZE:
486     {
487       const float pixelSize = value.Get<float>();
488       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p PIXEL_SIZE %f\n", impl.mController.Get(), pixelSize);
489
490       if(!Equals(impl.mController->GetDefaultFontSize(Text::Controller::PIXEL_SIZE), pixelSize))
491       {
492         impl.mController->SetDefaultFontSize(pixelSize, Text::Controller::PIXEL_SIZE);
493       }
494       break;
495     }
496     case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT:
497     {
498       const std::string& text = value.Get<std::string>();
499       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor::OnPropertySet %p PLACEHOLDER_TEXT %s\n", impl.mController.Get(), text.c_str());
500
501       impl.mController->SetPlaceholderText(Text::Controller::PLACEHOLDER_TYPE_INACTIVE, text);
502       break;
503     }
504     case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR:
505     {
506       const Vector4& textColor = value.Get<Vector4>();
507       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p PLACEHOLDER_TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a);
508
509       if(impl.mController->GetPlaceholderTextColor() != textColor)
510       {
511         impl.mController->SetPlaceholderTextColor(textColor);
512         impl.mRenderer.Reset();
513       }
514       break;
515     }
516     case Toolkit::TextEditor::Property::ENABLE_SELECTION:
517     {
518       const bool enableSelection = value.Get<bool>();
519       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p ENABLE_SELECTION %d\n", impl.mController.Get(), enableSelection);
520       impl.mController->SetSelectionEnabled(enableSelection);
521       break;
522     }
523     case Toolkit::TextEditor::Property::PLACEHOLDER:
524     {
525       const Property::Map* map = value.GetMap();
526       if(map)
527       {
528         impl.mController->SetPlaceholderProperty(*map);
529       }
530       break;
531     }
532     case Toolkit::TextEditor::Property::LINE_WRAP_MODE:
533     {
534       Text::LineWrap::Mode lineWrapMode(static_cast<Text::LineWrap::Mode>(-1)); // Set to invalid value to ensure a valid mode does get set
535       if(Toolkit::Text::GetLineWrapModeEnumeration(value, lineWrapMode))
536       {
537         DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p LineWrap::MODE %d\n", impl.mController.Get(), lineWrapMode);
538         impl.mController->SetLineWrapMode(lineWrapMode);
539       }
540       break;
541     }
542     case Toolkit::DevelTextEditor::Property::ENABLE_SHIFT_SELECTION:
543     {
544       const bool shiftSelection = value.Get<bool>();
545       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p ENABLE_SHIFT_SELECTION %d\n", impl.mController.Get(), shiftSelection);
546
547       impl.mController->SetShiftSelectionEnabled(shiftSelection);
548       break;
549     }
550     case Toolkit::DevelTextEditor::Property::ENABLE_GRAB_HANDLE:
551     {
552       const bool grabHandleEnabled = value.Get<bool>();
553       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p ENABLE_GRAB_HANDLE %d\n", impl.mController.Get(), grabHandleEnabled);
554
555       impl.mController->SetGrabHandleEnabled(grabHandleEnabled);
556       break;
557     }
558     case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
559     {
560       impl.mController->SetMatchLayoutDirection(value.Get<bool>() ? DevelText::MatchLayoutDirection::LOCALE : DevelText::MatchLayoutDirection::CONTENTS);
561       break;
562     }
563     case Toolkit::DevelTextEditor::Property::MAX_LENGTH:
564     {
565       const int max = value.Get<int>();
566       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p MAX_LENGTH %d\n", impl.mController.Get(), max);
567
568       impl.mController->SetMaximumNumberOfCharacters(max);
569       break;
570     }
571     case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_START:
572     {
573       uint32_t start = static_cast<uint32_t>(value.Get<int>());
574       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p SELECTED_TEXT_START %d\n", impl.mController.Get(), start);
575       impl.SetTextSelectionRange(&start, nullptr);
576       break;
577     }
578     case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_END:
579     {
580       uint32_t end = static_cast<uint32_t>(value.Get<int>());
581       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p SELECTED_TEXT_END %d\n", impl.mController.Get(), end);
582       impl.SetTextSelectionRange(nullptr, &end);
583       break;
584     }
585     case Toolkit::DevelTextEditor::Property::ENABLE_EDITING:
586     {
587       const bool editable = value.Get<bool>();
588       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p ENABLE_EDITING %d\n", impl.mController.Get(), editable);
589       impl.SetEditable(editable);
590       break;
591     }
592     case Toolkit::DevelTextEditor::Property::HORIZONTAL_SCROLL_POSITION:
593     {
594       float horizontalScroll = value.Get<float>();
595       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p HORIZONTAL_SCROLL_POSITION %d\n", impl.mController.Get(), horizontalScroll);
596       if(horizontalScroll >= 0.0f)
597       {
598         impl.ScrollBy(Vector2(horizontalScroll - impl.GetHorizontalScrollPosition(), 0));
599       }
600       break;
601     }
602     case Toolkit::DevelTextEditor::Property::VERTICAL_SCROLL_POSITION:
603     {
604       float verticalScroll = value.Get<float>();
605       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p VERTICAL_SCROLL_POSITION %d\n", impl.mController.Get(), verticalScroll);
606       if(verticalScroll >= 0.0f)
607       {
608         impl.ScrollBy(Vector2(0, verticalScroll - impl.GetVerticalScrollPosition()));
609       }
610       break;
611     }
612     case Toolkit::DevelTextEditor::Property::FONT_SIZE_SCALE:
613     {
614       const float scale = value.Get<float>();
615       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p FONT_SIZE_SCALE %f\n", impl.mController.Get(), scale);
616
617       if(!Equals(impl.mController->GetFontSizeScale(), scale))
618       {
619         impl.mController->SetFontSizeScale(scale);
620       }
621       break;
622     }
623     case Toolkit::DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE:
624     {
625       const bool enableFontSizeScale = value.Get<bool>();
626       if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale))
627       {
628         impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale);
629       }
630       break;
631     }
632     case Toolkit::DevelTextEditor::Property::PRIMARY_CURSOR_POSITION:
633     {
634       uint32_t position = static_cast<uint32_t>(value.Get<int>());
635       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p PRIMARY_CURSOR_POSITION %d\n", impl.mController.Get(), position);
636       if(impl.mController->SetPrimaryCursorPosition(position, impl.HasKeyInputFocus()))
637       {
638         impl.SetKeyInputFocus();
639       }
640       break;
641     }
642     case Toolkit::DevelTextEditor::Property::GRAB_HANDLE_COLOR:
643     {
644       const Vector4 color = value.Get<Vector4>();
645       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p GRAB_HANDLE_COLOR %f,%f,%f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a);
646
647       impl.mDecorator->SetHandleColor(color);
648       impl.RequestTextRelayout();
649       break;
650     }
651     case Toolkit::DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP:
652     {
653       const bool grabHandlePopupEnabled = value.Get<bool>();
654       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p ENABLE_GRAB_HANDLE_POPUP %d\n", impl.mController.Get(), grabHandlePopupEnabled);
655
656       impl.mController->SetGrabHandlePopupEnabled(grabHandlePopupEnabled);
657       break;
658     }
659     case Toolkit::DevelTextEditor::Property::INPUT_METHOD_SETTINGS:
660     {
661       const Property::Map* map = value.GetMap();
662       if(map)
663       {
664         impl.mInputMethodOptions.ApplyProperty(*map);
665       }
666       impl.mController->SetInputModePassword(impl.mInputMethodOptions.IsPassword());
667
668       Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
669       if(control == textEditor)
670       {
671         impl.mInputMethodContext.ApplyOptions(impl.mInputMethodOptions);
672       }
673       break;
674     }
675     case Toolkit::DevelTextEditor::Property::INPUT_FILTER:
676     {
677       const Property::Map* map = value.GetMap();
678       if(map)
679       {
680         impl.mController->SetInputFilterOption(*map);
681       }
682       break;
683     }
684     case Toolkit::DevelTextEditor::Property::ELLIPSIS:
685     {
686       const bool ellipsis = value.Get<bool>();
687       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p ELLIPSIS %d\n", impl.mController.Get(), ellipsis);
688
689       impl.mController->SetTextElideEnabled(ellipsis);
690       break;
691     }
692     case Toolkit::DevelTextEditor::Property::ELLIPSIS_POSITION:
693     {
694       DevelText::EllipsisPosition::Type ellipsisPositionType(static_cast<DevelText::EllipsisPosition::Type>(-1)); // Set to invalid value to ensure a valid mode does get set
695       if(Text::GetEllipsisPositionTypeEnumeration(value, ellipsisPositionType))
696       {
697         DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p EllipsisPosition::Type %d\n", impl.mController.Get(), ellipsisPositionType);
698         impl.mController->SetEllipsisPosition(ellipsisPositionType);
699       }
700       break;
701     }
702     case Toolkit::DevelTextEditor::Property::MIN_LINE_SIZE:
703     {
704       const float minLineSize = value.Get<float>();
705       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p MIN_LINE_SIZE %f\n", impl.mController.Get(), minLineSize);
706
707       impl.mController->SetDefaultLineSize(minLineSize);
708       impl.mRenderer.Reset();
709       break;
710     }
711     case Toolkit::DevelTextEditor::Property::STRIKETHROUGH:
712     {
713       const bool update = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
714       if(update)
715       {
716         impl.mRenderer.Reset();
717       }
718       break;
719     }
720     case Toolkit::DevelTextEditor::Property::INPUT_STRIKETHROUGH:
721     {
722       const bool update = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT);
723       if(update)
724       {
725         impl.mRenderer.Reset();
726       }
727       break;
728     }
729     case Toolkit::DevelTextEditor::Property::CHARACTER_SPACING:
730     {
731       const float characterSpacing = value.Get<float>();
732       impl.mController->SetCharacterSpacing(characterSpacing);
733       impl.mRenderer.Reset();
734       break;
735     }
736     case Toolkit::DevelTextEditor::Property::RELATIVE_LINE_SIZE:
737     {
738       const float relativeLineSize = value.Get<float>();
739       DALI_LOG_INFO(gTextEditorLogFilter, Debug::Verbose, "TextEditor %p RELATIVE_LINE_SIZE %f\n", impl.mController.Get(), relativeLineSize);
740
741       impl.mController->SetRelativeLineSize(relativeLineSize);
742       impl.mRenderer.Reset();
743       break;
744     }
745     case Toolkit::DevelTextEditor::Property::SELECTION_POPUP_STYLE:
746     {
747       const Property::Map* map = value.GetMap();
748       if(map)
749       {
750         impl.mDecorator->SetSelectionPopupStyle(*map);
751       }
752       break;
753     }
754     case Toolkit::DevelTextEditor::Property::REMOVE_FRONT_INSET:
755     {
756       const bool remove = value.Get<bool>();
757       impl.mController->SetRemoveFrontInset(remove);
758       break;
759     }
760     case Toolkit::DevelTextEditor::Property::REMOVE_BACK_INSET:
761     {
762       const bool remove = value.Get<bool>();
763       impl.mController->SetRemoveBackInset(remove);
764       break;
765     }
766   }
767 }
768
769 Property::Value TextEditor::PropertyHandler::GetProperty(Toolkit::TextEditor textEditor, Property::Index index)
770 {
771   Property::Value value;
772   TextEditor&     impl(GetImpl(textEditor));
773   DALI_ASSERT_DEBUG(impl.mController && "No text controller");
774   DALI_ASSERT_DEBUG(impl.mDecorator && "No text decorator");
775
776   switch(index)
777   {
778     case Toolkit::DevelTextEditor::Property::RENDERING_BACKEND:
779     {
780       value = impl.mRenderingBackend;
781       break;
782     }
783     case Toolkit::TextEditor::Property::TEXT:
784     {
785       std::string text;
786       impl.mController->GetText(text);
787       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p returning text: %s\n", impl.mController.Get(), text.c_str());
788       value = text;
789       break;
790     }
791     case Toolkit::TextEditor::Property::TEXT_COLOR:
792     {
793       value = impl.mController->GetDefaultColor();
794       break;
795     }
796     case Toolkit::TextEditor::Property::FONT_FAMILY:
797     {
798       value = impl.mController->GetDefaultFontFamily();
799       break;
800     }
801     case Toolkit::TextEditor::Property::FONT_STYLE:
802     {
803       GetFontStyleProperty(impl.mController, value, Text::FontStyle::DEFAULT);
804       break;
805     }
806     case Toolkit::TextEditor::Property::POINT_SIZE:
807     {
808       value = impl.mController->GetDefaultFontSize(Text::Controller::POINT_SIZE);
809       break;
810     }
811     case Toolkit::TextEditor::Property::HORIZONTAL_ALIGNMENT:
812     {
813       const char* name = Text::GetHorizontalAlignmentString(impl.mController->GetHorizontalAlignment());
814       if(name)
815       {
816         value = std::string(name);
817       }
818       break;
819     }
820     case Toolkit::DevelTextEditor::Property::VERTICAL_ALIGNMENT:
821     {
822       const char* name = Text::GetVerticalAlignmentString(impl.mController->GetVerticalAlignment());
823
824       if(name)
825       {
826         value = std::string(name);
827       }
828       break;
829     }
830     case Toolkit::TextEditor::Property::SCROLL_THRESHOLD:
831     {
832       value = impl.mDecorator->GetScrollThreshold();
833       break;
834     }
835     case Toolkit::TextEditor::Property::SCROLL_SPEED:
836     {
837       value = impl.mDecorator->GetScrollSpeed();
838       break;
839     }
840     case Toolkit::TextEditor::Property::PRIMARY_CURSOR_COLOR:
841     {
842       value = impl.mDecorator->GetColor(Text::PRIMARY_CURSOR);
843       break;
844     }
845     case Toolkit::TextEditor::Property::SECONDARY_CURSOR_COLOR:
846     {
847       value = impl.mDecorator->GetColor(Text::SECONDARY_CURSOR);
848       break;
849     }
850     case Toolkit::TextEditor::Property::ENABLE_CURSOR_BLINK:
851     {
852       value = impl.mController->GetEnableCursorBlink();
853       break;
854     }
855     case Toolkit::TextEditor::Property::CURSOR_BLINK_INTERVAL:
856     {
857       value = impl.mDecorator->GetCursorBlinkInterval();
858       break;
859     }
860     case Toolkit::TextEditor::Property::CURSOR_BLINK_DURATION:
861     {
862       value = impl.mDecorator->GetCursorBlinkDuration();
863       break;
864     }
865     case Toolkit::TextEditor::Property::CURSOR_WIDTH:
866     {
867       value = impl.mDecorator->GetCursorWidth();
868       break;
869     }
870     case Toolkit::TextEditor::Property::GRAB_HANDLE_IMAGE:
871     {
872       value = impl.mDecorator->GetHandleImage(Text::GRAB_HANDLE, Text::HANDLE_IMAGE_RELEASED);
873       break;
874     }
875     case Toolkit::TextEditor::Property::GRAB_HANDLE_PRESSED_IMAGE:
876     {
877       value = impl.mDecorator->GetHandleImage(Text::GRAB_HANDLE, Text::HANDLE_IMAGE_PRESSED);
878       break;
879     }
880     case Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_LEFT:
881     {
882       impl.GetHandleImagePropertyValue(value, Text::LEFT_SELECTION_HANDLE, Text::HANDLE_IMAGE_RELEASED);
883       break;
884     }
885     case Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_RIGHT:
886     {
887       impl.GetHandleImagePropertyValue(value, Text::RIGHT_SELECTION_HANDLE, Text::HANDLE_IMAGE_RELEASED);
888       break;
889     }
890     case Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
891     {
892       impl.GetHandleImagePropertyValue(value, Text::LEFT_SELECTION_HANDLE, Text::HANDLE_IMAGE_PRESSED);
893       break;
894     }
895     case Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
896     {
897       impl.GetHandleImagePropertyValue(value, Text::RIGHT_SELECTION_HANDLE, Text::HANDLE_IMAGE_PRESSED);
898       break;
899     }
900     case Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
901     {
902       impl.GetHandleImagePropertyValue(value, Text::LEFT_SELECTION_HANDLE_MARKER, Text::HANDLE_IMAGE_RELEASED);
903       break;
904     }
905     case Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
906     {
907       impl.GetHandleImagePropertyValue(value, Text::RIGHT_SELECTION_HANDLE_MARKER, Text::HANDLE_IMAGE_RELEASED);
908       break;
909     }
910     case Toolkit::TextEditor::Property::SELECTION_HIGHLIGHT_COLOR:
911     {
912       value = impl.mDecorator->GetHighlightColor();
913       break;
914     }
915     case Toolkit::TextEditor::Property::DECORATION_BOUNDING_BOX:
916     {
917       Rect<int> boundingBox;
918       impl.mDecorator->GetBoundingBox(boundingBox);
919       value = boundingBox;
920       break;
921     }
922     case Toolkit::TextEditor::Property::ENABLE_MARKUP:
923     {
924       value = impl.mController->IsMarkupProcessorEnabled();
925       break;
926     }
927     case Toolkit::TextEditor::Property::INPUT_COLOR:
928     {
929       value = impl.mController->GetInputColor();
930       break;
931     }
932     case Toolkit::TextEditor::Property::INPUT_FONT_FAMILY:
933     {
934       value = impl.mController->GetInputFontFamily();
935       break;
936     }
937     case Toolkit::TextEditor::Property::INPUT_FONT_STYLE:
938     {
939       GetFontStyleProperty(impl.mController, value, Text::FontStyle::INPUT);
940       break;
941     }
942     case Toolkit::TextEditor::Property::INPUT_POINT_SIZE:
943     {
944       value = impl.mController->GetInputFontPointSize();
945       break;
946     }
947     case Toolkit::TextEditor::Property::LINE_SPACING:
948     {
949       value = impl.mController->GetDefaultLineSpacing();
950       break;
951     }
952     case Toolkit::TextEditor::Property::INPUT_LINE_SPACING:
953     {
954       value = impl.mController->GetInputLineSpacing();
955       break;
956     }
957     case Toolkit::TextEditor::Property::UNDERLINE:
958     {
959       GetUnderlineProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
960       break;
961     }
962     case Toolkit::TextEditor::Property::INPUT_UNDERLINE:
963     {
964       GetUnderlineProperties(impl.mController, value, Text::EffectStyle::INPUT);
965       break;
966     }
967     case Toolkit::TextEditor::Property::SHADOW:
968     {
969       GetShadowProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
970       break;
971     }
972     case Toolkit::TextEditor::Property::INPUT_SHADOW:
973     {
974       GetShadowProperties(impl.mController, value, Text::EffectStyle::INPUT);
975       break;
976     }
977     case Toolkit::TextEditor::Property::EMBOSS:
978     {
979       GetEmbossProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
980       break;
981     }
982     case Toolkit::TextEditor::Property::INPUT_EMBOSS:
983     {
984       GetEmbossProperties(impl.mController, value, Text::EffectStyle::INPUT);
985       break;
986     }
987     case Toolkit::TextEditor::Property::OUTLINE:
988     {
989       GetOutlineProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
990       break;
991     }
992     case Toolkit::TextEditor::Property::INPUT_OUTLINE:
993     {
994       GetOutlineProperties(impl.mController, value, Text::EffectStyle::INPUT);
995       break;
996     }
997     case Toolkit::TextEditor::Property::SMOOTH_SCROLL:
998     {
999       value = impl.mScrollAnimationEnabled;
1000       break;
1001     }
1002     case Toolkit::TextEditor::Property::SMOOTH_SCROLL_DURATION:
1003     {
1004       value = impl.mScrollAnimationDuration;
1005       break;
1006     }
1007     case Toolkit::TextEditor::Property::ENABLE_SCROLL_BAR:
1008     {
1009       value = impl.mScrollBarEnabled;
1010       break;
1011     }
1012     case Toolkit::TextEditor::Property::SCROLL_BAR_SHOW_DURATION:
1013     {
1014       value = impl.mAnimationPeriod.delaySeconds;
1015       break;
1016     }
1017     case Toolkit::TextEditor::Property::SCROLL_BAR_FADE_DURATION:
1018     {
1019       value = impl.mAnimationPeriod.durationSeconds;
1020       break;
1021     }
1022     case Toolkit::TextEditor::Property::PIXEL_SIZE:
1023     {
1024       value = impl.mController->GetDefaultFontSize(Text::Controller::PIXEL_SIZE);
1025       break;
1026     }
1027     case Toolkit::TextEditor::Property::LINE_COUNT:
1028     {
1029       float width = textEditor.GetProperty(Actor::Property::SIZE_WIDTH).Get<float>();
1030       value       = impl.mController->GetLineCount(width);
1031       break;
1032     }
1033     case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT:
1034     {
1035       std::string text;
1036       impl.mController->GetPlaceholderText(Text::Controller::PLACEHOLDER_TYPE_INACTIVE, text);
1037       value = text;
1038       break;
1039     }
1040     case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR:
1041     {
1042       value = impl.mController->GetPlaceholderTextColor();
1043       break;
1044     }
1045     case Toolkit::TextEditor::Property::ENABLE_SELECTION:
1046     {
1047       value = impl.mController->IsSelectionEnabled();
1048       break;
1049     }
1050     case Toolkit::TextEditor::Property::PLACEHOLDER:
1051     {
1052       Property::Map map;
1053       impl.mController->GetPlaceholderProperty(map);
1054       value = map;
1055       break;
1056     }
1057     case Toolkit::TextEditor::Property::LINE_WRAP_MODE:
1058     {
1059       value = impl.mController->GetLineWrapMode();
1060       break;
1061     }
1062     case Toolkit::DevelTextEditor::Property::STRIKETHROUGH:
1063     {
1064       GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
1065       break;
1066     }
1067     case Toolkit::DevelTextEditor::Property::INPUT_STRIKETHROUGH:
1068     {
1069       GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT);
1070       break;
1071     }
1072     case Toolkit::DevelTextEditor::Property::ENABLE_SHIFT_SELECTION:
1073     {
1074       value = impl.mController->IsShiftSelectionEnabled();
1075       break;
1076     }
1077     case Toolkit::DevelTextEditor::Property::ENABLE_GRAB_HANDLE:
1078     {
1079       value = impl.mController->IsGrabHandleEnabled();
1080       break;
1081     }
1082     case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
1083     {
1084       value = impl.mController->GetMatchLayoutDirection() != DevelText::MatchLayoutDirection::CONTENTS;
1085       break;
1086     }
1087     case Toolkit::DevelTextEditor::Property::MAX_LENGTH:
1088     {
1089       value = impl.mController->GetMaximumNumberOfCharacters();
1090       break;
1091     }
1092     case Toolkit::DevelTextEditor::Property::SELECTED_TEXT:
1093     {
1094       value = impl.mController->GetSelectedText();
1095       break;
1096     }
1097     case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_START:
1098     {
1099       Uint32Pair range = impl.GetTextSelectionRange();
1100       value            = static_cast<int>(range.first);
1101       break;
1102     }
1103     case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_END:
1104     {
1105       Uint32Pair range = impl.GetTextSelectionRange();
1106       value            = static_cast<int>(range.second);
1107       break;
1108     }
1109     case Toolkit::DevelTextEditor::Property::ENABLE_EDITING:
1110     {
1111       value = impl.IsEditable();
1112       break;
1113     }
1114     case Toolkit::DevelTextEditor::Property::HORIZONTAL_SCROLL_POSITION:
1115     {
1116       value = impl.GetHorizontalScrollPosition();
1117       break;
1118     }
1119     case Toolkit::DevelTextEditor::Property::VERTICAL_SCROLL_POSITION:
1120     {
1121       value = impl.GetVerticalScrollPosition();
1122       break;
1123     }
1124     case Toolkit::DevelTextEditor::Property::FONT_SIZE_SCALE:
1125     {
1126       value = impl.mController->GetFontSizeScale();
1127       break;
1128     }
1129     case Toolkit::DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE:
1130     {
1131       value = impl.mController->IsFontSizeScaleEnabled();
1132       break;
1133     }
1134     case Toolkit::DevelTextEditor::Property::PRIMARY_CURSOR_POSITION:
1135     {
1136       value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
1137       break;
1138     }
1139     case Toolkit::DevelTextEditor::Property::GRAB_HANDLE_COLOR:
1140     {
1141       value = impl.mDecorator->GetHandleColor();
1142       break;
1143     }
1144     case Toolkit::DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP:
1145     {
1146       value = impl.mController->IsGrabHandlePopupEnabled();
1147       break;
1148     }
1149     case Toolkit::DevelTextEditor::Property::INPUT_METHOD_SETTINGS:
1150     {
1151       Property::Map map;
1152       impl.mInputMethodOptions.RetrieveProperty(map);
1153       value = map;
1154       break;
1155     }
1156     case Toolkit::DevelTextEditor::Property::INPUT_FILTER:
1157     {
1158       Property::Map map;
1159       impl.mController->GetInputFilterOption(map);
1160       value = map;
1161       break;
1162     }
1163     case Toolkit::DevelTextEditor::Property::ELLIPSIS:
1164     {
1165       value = impl.mController->IsTextElideEnabled();
1166       break;
1167     }
1168     case Toolkit::DevelTextEditor::Property::ELLIPSIS_POSITION:
1169     {
1170       value = impl.mController->GetEllipsisPosition();
1171       break;
1172     }
1173     case Toolkit::DevelTextEditor::Property::MIN_LINE_SIZE:
1174     {
1175       value = impl.mController->GetDefaultLineSize();
1176       break;
1177     }
1178     case Toolkit::DevelTextEditor::Property::CHARACTER_SPACING:
1179     {
1180       value = impl.mController->GetCharacterSpacing();
1181       break;
1182     }
1183     case Toolkit::DevelTextEditor::Property::RELATIVE_LINE_SIZE:
1184     {
1185       value = impl.mController->GetRelativeLineSize();
1186       break;
1187     }
1188     case Toolkit::DevelTextEditor::Property::SELECTION_POPUP_STYLE:
1189     {
1190       Property::Map map;
1191       impl.mDecorator->GetSelectionPopupStyle(map);
1192       value = map;
1193       break;
1194     }
1195     case Toolkit::DevelTextEditor::Property::REMOVE_FRONT_INSET:
1196     {
1197       value = impl.mController->IsRemoveFrontInset();
1198       break;
1199     }
1200     case Toolkit::DevelTextEditor::Property::REMOVE_BACK_INSET:
1201     {
1202       value = impl.mController->IsRemoveBackInset();
1203       break;
1204     }
1205   } //switch
1206   return value;
1207 }
1208
1209 } // namespace Dali::Toolkit::Internal