361607a03662131dc681687e63312d49917544f0
[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/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   }
746 }
747
748 Property::Value TextEditor::PropertyHandler::GetProperty(Toolkit::TextEditor textEditor, Property::Index index)
749 {
750   Property::Value value;
751   TextEditor&     impl(GetImpl(textEditor));
752   DALI_ASSERT_DEBUG(impl.mController && "No text controller");
753   DALI_ASSERT_DEBUG(impl.mDecorator && "No text decorator");
754
755   switch(index)
756   {
757     case Toolkit::DevelTextEditor::Property::RENDERING_BACKEND:
758     {
759       value = impl.mRenderingBackend;
760       break;
761     }
762     case Toolkit::TextEditor::Property::TEXT:
763     {
764       std::string text;
765       impl.mController->GetText(text);
766       DALI_LOG_INFO(gTextEditorLogFilter, Debug::General, "TextEditor %p returning text: %s\n", impl.mController.Get(), text.c_str());
767       value = text;
768       break;
769     }
770     case Toolkit::TextEditor::Property::TEXT_COLOR:
771     {
772       value = impl.mController->GetDefaultColor();
773       break;
774     }
775     case Toolkit::TextEditor::Property::FONT_FAMILY:
776     {
777       value = impl.mController->GetDefaultFontFamily();
778       break;
779     }
780     case Toolkit::TextEditor::Property::FONT_STYLE:
781     {
782       GetFontStyleProperty(impl.mController, value, Text::FontStyle::DEFAULT);
783       break;
784     }
785     case Toolkit::TextEditor::Property::POINT_SIZE:
786     {
787       value = impl.mController->GetDefaultFontSize(Text::Controller::POINT_SIZE);
788       break;
789     }
790     case Toolkit::TextEditor::Property::HORIZONTAL_ALIGNMENT:
791     {
792       const char* name = Text::GetHorizontalAlignmentString(impl.mController->GetHorizontalAlignment());
793       if(name)
794       {
795         value = std::string(name);
796       }
797       break;
798     }
799     case Toolkit::DevelTextEditor::Property::VERTICAL_ALIGNMENT:
800     {
801       const char* name = Text::GetVerticalAlignmentString(impl.mController->GetVerticalAlignment());
802
803       if(name)
804       {
805         value = std::string(name);
806       }
807       break;
808     }
809     case Toolkit::TextEditor::Property::SCROLL_THRESHOLD:
810     {
811       value = impl.mDecorator->GetScrollThreshold();
812       break;
813     }
814     case Toolkit::TextEditor::Property::SCROLL_SPEED:
815     {
816       value = impl.mDecorator->GetScrollSpeed();
817       break;
818     }
819     case Toolkit::TextEditor::Property::PRIMARY_CURSOR_COLOR:
820     {
821       value = impl.mDecorator->GetColor(Text::PRIMARY_CURSOR);
822       break;
823     }
824     case Toolkit::TextEditor::Property::SECONDARY_CURSOR_COLOR:
825     {
826       value = impl.mDecorator->GetColor(Text::SECONDARY_CURSOR);
827       break;
828     }
829     case Toolkit::TextEditor::Property::ENABLE_CURSOR_BLINK:
830     {
831       value = impl.mController->GetEnableCursorBlink();
832       break;
833     }
834     case Toolkit::TextEditor::Property::CURSOR_BLINK_INTERVAL:
835     {
836       value = impl.mDecorator->GetCursorBlinkInterval();
837       break;
838     }
839     case Toolkit::TextEditor::Property::CURSOR_BLINK_DURATION:
840     {
841       value = impl.mDecorator->GetCursorBlinkDuration();
842       break;
843     }
844     case Toolkit::TextEditor::Property::CURSOR_WIDTH:
845     {
846       value = impl.mDecorator->GetCursorWidth();
847       break;
848     }
849     case Toolkit::TextEditor::Property::GRAB_HANDLE_IMAGE:
850     {
851       value = impl.mDecorator->GetHandleImage(Text::GRAB_HANDLE, Text::HANDLE_IMAGE_RELEASED);
852       break;
853     }
854     case Toolkit::TextEditor::Property::GRAB_HANDLE_PRESSED_IMAGE:
855     {
856       value = impl.mDecorator->GetHandleImage(Text::GRAB_HANDLE, Text::HANDLE_IMAGE_PRESSED);
857       break;
858     }
859     case Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_LEFT:
860     {
861       impl.GetHandleImagePropertyValue(value, Text::LEFT_SELECTION_HANDLE, Text::HANDLE_IMAGE_RELEASED);
862       break;
863     }
864     case Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_RIGHT:
865     {
866       impl.GetHandleImagePropertyValue(value, Text::RIGHT_SELECTION_HANDLE, Text::HANDLE_IMAGE_RELEASED);
867       break;
868     }
869     case Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
870     {
871       impl.GetHandleImagePropertyValue(value, Text::LEFT_SELECTION_HANDLE, Text::HANDLE_IMAGE_PRESSED);
872       break;
873     }
874     case Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
875     {
876       impl.GetHandleImagePropertyValue(value, Text::RIGHT_SELECTION_HANDLE, Text::HANDLE_IMAGE_PRESSED);
877       break;
878     }
879     case Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
880     {
881       impl.GetHandleImagePropertyValue(value, Text::LEFT_SELECTION_HANDLE_MARKER, Text::HANDLE_IMAGE_RELEASED);
882       break;
883     }
884     case Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
885     {
886       impl.GetHandleImagePropertyValue(value, Text::RIGHT_SELECTION_HANDLE_MARKER, Text::HANDLE_IMAGE_RELEASED);
887       break;
888     }
889     case Toolkit::TextEditor::Property::SELECTION_HIGHLIGHT_COLOR:
890     {
891       value = impl.mDecorator->GetHighlightColor();
892       break;
893     }
894     case Toolkit::TextEditor::Property::DECORATION_BOUNDING_BOX:
895     {
896       Rect<int> boundingBox;
897       impl.mDecorator->GetBoundingBox(boundingBox);
898       value = boundingBox;
899       break;
900     }
901     case Toolkit::TextEditor::Property::ENABLE_MARKUP:
902     {
903       value = impl.mController->IsMarkupProcessorEnabled();
904       break;
905     }
906     case Toolkit::TextEditor::Property::INPUT_COLOR:
907     {
908       value = impl.mController->GetInputColor();
909       break;
910     }
911     case Toolkit::TextEditor::Property::INPUT_FONT_FAMILY:
912     {
913       value = impl.mController->GetInputFontFamily();
914       break;
915     }
916     case Toolkit::TextEditor::Property::INPUT_FONT_STYLE:
917     {
918       GetFontStyleProperty(impl.mController, value, Text::FontStyle::INPUT);
919       break;
920     }
921     case Toolkit::TextEditor::Property::INPUT_POINT_SIZE:
922     {
923       value = impl.mController->GetInputFontPointSize();
924       break;
925     }
926     case Toolkit::TextEditor::Property::LINE_SPACING:
927     {
928       value = impl.mController->GetDefaultLineSpacing();
929       break;
930     }
931     case Toolkit::TextEditor::Property::INPUT_LINE_SPACING:
932     {
933       value = impl.mController->GetInputLineSpacing();
934       break;
935     }
936     case Toolkit::TextEditor::Property::UNDERLINE:
937     {
938       GetUnderlineProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
939       break;
940     }
941     case Toolkit::TextEditor::Property::INPUT_UNDERLINE:
942     {
943       GetUnderlineProperties(impl.mController, value, Text::EffectStyle::INPUT);
944       break;
945     }
946     case Toolkit::TextEditor::Property::SHADOW:
947     {
948       GetShadowProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
949       break;
950     }
951     case Toolkit::TextEditor::Property::INPUT_SHADOW:
952     {
953       GetShadowProperties(impl.mController, value, Text::EffectStyle::INPUT);
954       break;
955     }
956     case Toolkit::TextEditor::Property::EMBOSS:
957     {
958       GetEmbossProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
959       break;
960     }
961     case Toolkit::TextEditor::Property::INPUT_EMBOSS:
962     {
963       GetEmbossProperties(impl.mController, value, Text::EffectStyle::INPUT);
964       break;
965     }
966     case Toolkit::TextEditor::Property::OUTLINE:
967     {
968       GetOutlineProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
969       break;
970     }
971     case Toolkit::TextEditor::Property::INPUT_OUTLINE:
972     {
973       GetOutlineProperties(impl.mController, value, Text::EffectStyle::INPUT);
974       break;
975     }
976     case Toolkit::TextEditor::Property::SMOOTH_SCROLL:
977     {
978       value = impl.mScrollAnimationEnabled;
979       break;
980     }
981     case Toolkit::TextEditor::Property::SMOOTH_SCROLL_DURATION:
982     {
983       value = impl.mScrollAnimationDuration;
984       break;
985     }
986     case Toolkit::TextEditor::Property::ENABLE_SCROLL_BAR:
987     {
988       value = impl.mScrollBarEnabled;
989       break;
990     }
991     case Toolkit::TextEditor::Property::SCROLL_BAR_SHOW_DURATION:
992     {
993       value = impl.mAnimationPeriod.delaySeconds;
994       break;
995     }
996     case Toolkit::TextEditor::Property::SCROLL_BAR_FADE_DURATION:
997     {
998       value = impl.mAnimationPeriod.durationSeconds;
999       break;
1000     }
1001     case Toolkit::TextEditor::Property::PIXEL_SIZE:
1002     {
1003       value = impl.mController->GetDefaultFontSize(Text::Controller::PIXEL_SIZE);
1004       break;
1005     }
1006     case Toolkit::TextEditor::Property::LINE_COUNT:
1007     {
1008       float width = textEditor.GetProperty(Actor::Property::SIZE_WIDTH).Get<float>();
1009       value       = impl.mController->GetLineCount(width);
1010       break;
1011     }
1012     case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT:
1013     {
1014       std::string text;
1015       impl.mController->GetPlaceholderText(Text::Controller::PLACEHOLDER_TYPE_INACTIVE, text);
1016       value = text;
1017       break;
1018     }
1019     case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR:
1020     {
1021       value = impl.mController->GetPlaceholderTextColor();
1022       break;
1023     }
1024     case Toolkit::TextEditor::Property::ENABLE_SELECTION:
1025     {
1026       value = impl.mController->IsSelectionEnabled();
1027       break;
1028     }
1029     case Toolkit::TextEditor::Property::PLACEHOLDER:
1030     {
1031       Property::Map map;
1032       impl.mController->GetPlaceholderProperty(map);
1033       value = map;
1034       break;
1035     }
1036     case Toolkit::TextEditor::Property::LINE_WRAP_MODE:
1037     {
1038       value = impl.mController->GetLineWrapMode();
1039       break;
1040     }
1041     case Toolkit::DevelTextEditor::Property::STRIKETHROUGH:
1042     {
1043       GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
1044       break;
1045     }
1046     case Toolkit::DevelTextEditor::Property::INPUT_STRIKETHROUGH:
1047     {
1048       GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT);
1049       break;
1050     }
1051     case Toolkit::DevelTextEditor::Property::ENABLE_SHIFT_SELECTION:
1052     {
1053       value = impl.mController->IsShiftSelectionEnabled();
1054       break;
1055     }
1056     case Toolkit::DevelTextEditor::Property::ENABLE_GRAB_HANDLE:
1057     {
1058       value = impl.mController->IsGrabHandleEnabled();
1059       break;
1060     }
1061     case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
1062     {
1063       value = impl.mController->GetMatchLayoutDirection() != DevelText::MatchLayoutDirection::CONTENTS;
1064       break;
1065     }
1066     case Toolkit::DevelTextEditor::Property::MAX_LENGTH:
1067     {
1068       value = impl.mController->GetMaximumNumberOfCharacters();
1069       break;
1070     }
1071     case Toolkit::DevelTextEditor::Property::SELECTED_TEXT:
1072     {
1073       value = impl.mController->GetSelectedText();
1074       break;
1075     }
1076     case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_START:
1077     {
1078       Uint32Pair range = impl.GetTextSelectionRange();
1079       value            = static_cast<int>(range.first);
1080       break;
1081     }
1082     case Toolkit::DevelTextEditor::Property::SELECTED_TEXT_END:
1083     {
1084       Uint32Pair range = impl.GetTextSelectionRange();
1085       value            = static_cast<int>(range.second);
1086       break;
1087     }
1088     case Toolkit::DevelTextEditor::Property::ENABLE_EDITING:
1089     {
1090       value = impl.IsEditable();
1091       break;
1092     }
1093     case Toolkit::DevelTextEditor::Property::HORIZONTAL_SCROLL_POSITION:
1094     {
1095       value = impl.GetHorizontalScrollPosition();
1096       break;
1097     }
1098     case Toolkit::DevelTextEditor::Property::VERTICAL_SCROLL_POSITION:
1099     {
1100       value = impl.GetVerticalScrollPosition();
1101       break;
1102     }
1103     case Toolkit::DevelTextEditor::Property::FONT_SIZE_SCALE:
1104     {
1105       value = impl.mController->GetFontSizeScale();
1106       break;
1107     }
1108     case Toolkit::DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE:
1109     {
1110       value = impl.mController->IsFontSizeScaleEnabled();
1111       break;
1112     }
1113     case Toolkit::DevelTextEditor::Property::PRIMARY_CURSOR_POSITION:
1114     {
1115       value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
1116       break;
1117     }
1118     case Toolkit::DevelTextEditor::Property::GRAB_HANDLE_COLOR:
1119     {
1120       value = impl.mDecorator->GetHandleColor();
1121       break;
1122     }
1123     case Toolkit::DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP:
1124     {
1125       value = impl.mController->IsGrabHandlePopupEnabled();
1126       break;
1127     }
1128     case Toolkit::DevelTextEditor::Property::INPUT_METHOD_SETTINGS:
1129     {
1130       Property::Map map;
1131       impl.mInputMethodOptions.RetrieveProperty(map);
1132       value = map;
1133       break;
1134     }
1135     case Toolkit::DevelTextEditor::Property::INPUT_FILTER:
1136     {
1137       Property::Map map;
1138       impl.mController->GetInputFilterOption(map);
1139       value = map;
1140       break;
1141     }
1142     case Toolkit::DevelTextEditor::Property::ELLIPSIS:
1143     {
1144       value = impl.mController->IsTextElideEnabled();
1145       break;
1146     }
1147     case Toolkit::DevelTextEditor::Property::ELLIPSIS_POSITION:
1148     {
1149       value = impl.mController->GetEllipsisPosition();
1150       break;
1151     }
1152     case Toolkit::DevelTextEditor::Property::MIN_LINE_SIZE:
1153     {
1154       value = impl.mController->GetDefaultLineSize();
1155       break;
1156     }
1157     case Toolkit::DevelTextEditor::Property::CHARACTER_SPACING:
1158     {
1159       value = impl.mController->GetCharacterSpacing();
1160       break;
1161     }
1162     case Toolkit::DevelTextEditor::Property::RELATIVE_LINE_SIZE:
1163     {
1164       value = impl.mController->GetRelativeLineSize();
1165       break;
1166     }
1167   } //switch
1168   return value;
1169 }
1170
1171 } // namespace Dali::Toolkit::Internal