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