2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali-toolkit/internal/controls/text-controls/text-field-impl.h>
22 #include <dali/devel-api/actors/actor-devel.h>
23 #include <dali/devel-api/adaptor-framework/key-devel.h>
24 #include <dali/devel-api/common/stage.h>
25 #include <dali/devel-api/object/property-helper-devel.h>
26 #include <dali/integration-api/debug.h>
27 #include <dali/public-api/actors/layer.h>
28 #include <dali/public-api/adaptor-framework/key.h>
29 #include <dali/public-api/common/dali-common.h>
30 #include <dali/public-api/object/type-registry-helper.h>
34 #include <dali-toolkit/devel-api/controls/control-devel.h>
35 #include <dali-toolkit/devel-api/controls/text-controls/text-field-devel.h>
36 #include <dali-toolkit/devel-api/text/rendering-backend.h>
37 #include <dali-toolkit/internal/controls/text-controls/common-text-utils.h>
38 #include <dali-toolkit/internal/controls/text-controls/text-field-property-handler.h>
39 #include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
40 #include <dali-toolkit/internal/styling/style-manager-impl.h>
41 #include <dali-toolkit/internal/text/rendering/text-backend.h>
42 #include <dali-toolkit/internal/text/text-effects-style.h>
43 #include <dali-toolkit/internal/text/text-enumerations-impl.h>
44 #include <dali-toolkit/internal/text/text-font-style.h>
45 #include <dali-toolkit/internal/text/text-view.h>
46 #include <dali-toolkit/public-api/text/text-enumerations.h>
47 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
48 #include <dali-toolkit/public-api/visuals/visual-properties.h>
49 #include <dali/integration-api/adaptor-framework/adaptor.h>
51 using namespace Dali::Toolkit::Text;
53 #if defined(DEBUG_ENABLED)
54 Debug::Filter* gTextFieldLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS");
63 namespace // unnamed namespace
65 const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::DevelText::DEFAULT_RENDERING_BACKEND;
66 } // unnamed namespace
73 return Toolkit::TextField::New();
77 // Setup properties, signals and actions using the type-registry.
78 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextField, Toolkit::Control, Create );
80 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "text", STRING, TEXT )
81 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "placeholderText", STRING, PLACEHOLDER_TEXT )
82 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "placeholderTextFocused", STRING, PLACEHOLDER_TEXT_FOCUSED )
83 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "fontFamily", STRING, FONT_FAMILY )
84 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "fontStyle", MAP, FONT_STYLE )
85 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "pointSize", FLOAT, POINT_SIZE )
86 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "maxLength", INTEGER, MAX_LENGTH )
87 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "exceedPolicy", INTEGER, EXCEED_POLICY )
88 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "horizontalAlignment", STRING, HORIZONTAL_ALIGNMENT )
89 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "verticalAlignment", STRING, VERTICAL_ALIGNMENT )
90 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "textColor", VECTOR4, TEXT_COLOR )
91 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "placeholderTextColor", VECTOR4, PLACEHOLDER_TEXT_COLOR )
92 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "primaryCursorColor", VECTOR4, PRIMARY_CURSOR_COLOR )
93 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "secondaryCursorColor", VECTOR4, SECONDARY_CURSOR_COLOR )
94 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "enableCursorBlink", BOOLEAN, ENABLE_CURSOR_BLINK )
95 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "cursorBlinkInterval", FLOAT, CURSOR_BLINK_INTERVAL )
96 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "cursorBlinkDuration", FLOAT, CURSOR_BLINK_DURATION )
97 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "cursorWidth", INTEGER, CURSOR_WIDTH )
98 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "grabHandleImage", STRING, GRAB_HANDLE_IMAGE )
99 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "grabHandlePressedImage", STRING, GRAB_HANDLE_PRESSED_IMAGE )
100 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "scrollThreshold", FLOAT, SCROLL_THRESHOLD )
101 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "scrollSpeed", FLOAT, SCROLL_SPEED )
102 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "selectionHandleImageLeft", MAP, SELECTION_HANDLE_IMAGE_LEFT )
103 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "selectionHandleImageRight", MAP, SELECTION_HANDLE_IMAGE_RIGHT )
104 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "selectionHandlePressedImageLeft", MAP, SELECTION_HANDLE_PRESSED_IMAGE_LEFT )
105 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "selectionHandlePressedImageRight", MAP, SELECTION_HANDLE_PRESSED_IMAGE_RIGHT)
106 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "selectionHandleMarkerImageLeft", MAP, SELECTION_HANDLE_MARKER_IMAGE_LEFT )
107 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "selectionHandleMarkerImageRight", MAP, SELECTION_HANDLE_MARKER_IMAGE_RIGHT )
108 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "selectionHighlightColor", VECTOR4, SELECTION_HIGHLIGHT_COLOR )
109 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "decorationBoundingBox", RECTANGLE, DECORATION_BOUNDING_BOX )
110 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputMethodSettings", MAP, INPUT_METHOD_SETTINGS )
111 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputColor", VECTOR4, INPUT_COLOR )
112 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "enableMarkup", BOOLEAN, ENABLE_MARKUP )
113 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputFontFamily", STRING, INPUT_FONT_FAMILY )
114 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputFontStyle", MAP, INPUT_FONT_STYLE )
115 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputPointSize", FLOAT, INPUT_POINT_SIZE )
116 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "underline", MAP, UNDERLINE )
117 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputUnderline", MAP, INPUT_UNDERLINE )
118 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "shadow", MAP, SHADOW )
119 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputShadow", MAP, INPUT_SHADOW )
120 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "emboss", MAP, EMBOSS )
121 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputEmboss", MAP, INPUT_EMBOSS )
122 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "outline", MAP, OUTLINE )
123 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "inputOutline", MAP, INPUT_OUTLINE )
124 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "hiddenInputSettings", MAP, HIDDEN_INPUT_SETTINGS )
125 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "pixelSize", FLOAT, PIXEL_SIZE )
126 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "enableSelection", BOOLEAN, ENABLE_SELECTION )
127 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "placeholder", MAP, PLACEHOLDER )
128 DALI_PROPERTY_REGISTRATION(Toolkit, TextField, "ellipsis", BOOLEAN, ELLIPSIS )
129 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableShiftSelection", BOOLEAN, ENABLE_SHIFT_SELECTION )
130 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableGrabHandle", BOOLEAN, ENABLE_GRAB_HANDLE )
131 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION )
132 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP )
133 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "textBackground", VECTOR4, BACKGROUND )
134 DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY(Toolkit, TextField, "selectedText", STRING, SELECTED_TEXT )
135 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "renderingBackend", INTEGER, RENDERING_BACKEND )
136 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "selectedTextStart", INTEGER, SELECTED_TEXT_START )
137 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "selectedTextEnd", INTEGER, SELECTED_TEXT_END )
138 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableEditing", BOOLEAN, ENABLE_EDITING )
139 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
140 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableFontSizeScale", BOOLEAN, ENABLE_FONT_SIZE_SCALE )
141 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
142 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
143 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "inputFilter", MAP, INPUT_FILTER )
144 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "ellipsisPosition", INTEGER, ELLIPSIS_POSITION )
145 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "strikethrough", MAP, STRIKETHROUGH )
146 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "inputStrikethrough", MAP, INPUT_STRIKETHROUGH )
147 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "characterSpacing", FLOAT, CHARACTER_SPACING )
149 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED )
150 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED )
151 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED )
152 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "anchorClicked", SIGNAL_ANCHOR_CLICKED )
153 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "inputFiltered", SIGNAL_INPUT_FILTERED )
154 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "cursorPositionChanged", SIGNAL_CURSOR_POSITION_CHANGED)
155 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "selectionChanged", SIGNAL_SELECTION_CHANGED )
156 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "selectionCleared", SIGNAL_SELECTION_CLEARED )
157 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "selectionStarted", SIGNAL_SELECTION_STARTED )
159 DALI_TYPE_REGISTRATION_END()
162 Toolkit::TextField::InputStyle::Mask ConvertInputStyle(Text::InputStyle::Mask inputStyleMask)
164 Toolkit::TextField::InputStyle::Mask fieldInputStyleMask = Toolkit::TextField::InputStyle::NONE;
166 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_COLOR))
168 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::COLOR);
170 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_FONT_FAMILY))
172 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::FONT_FAMILY);
174 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_POINT_SIZE))
176 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::POINT_SIZE);
178 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_FONT_WEIGHT))
180 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::FONT_STYLE);
182 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_FONT_WIDTH))
184 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::FONT_STYLE);
186 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_FONT_SLANT))
188 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::FONT_STYLE);
190 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_UNDERLINE))
192 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::UNDERLINE);
194 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_SHADOW))
196 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::SHADOW);
198 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_EMBOSS))
200 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::EMBOSS);
202 if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_OUTLINE))
204 fieldInputStyleMask = static_cast<Toolkit::TextField::InputStyle::Mask>(fieldInputStyleMask | Toolkit::TextField::InputStyle::OUTLINE);
206 return fieldInputStyleMask;
211 Toolkit::TextField TextField::New()
213 // Create the implementation, temporarily owned by this handle on stack
214 IntrusivePtr<TextField> impl = new TextField();
216 // Pass ownership to CustomActor handle
217 Toolkit::TextField handle(*impl);
219 // Second-phase init of the implementation
220 // This can only be done after the CustomActor connection has been made...
226 void TextField::SetProperty(BaseObject* object, Property::Index index, const Property::Value& value)
228 Toolkit::TextField textField = Toolkit::TextField::DownCast(Dali::BaseHandle(object));
230 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField SetProperty\n");
234 PropertyHandler::SetProperty(textField, index, value);
238 Property::Value TextField::GetProperty(BaseObject* object, Property::Index index)
240 Property::Value value;
242 Toolkit::TextField textField = Toolkit::TextField::DownCast(Dali::BaseHandle(object));
246 value = PropertyHandler::GetProperty(textField, index);
252 void TextField::SelectWholeText()
254 if(mController && mController->IsShowingRealText())
256 mController->SelectWholeText();
261 void TextField::SelectNone()
263 if(mController && mController->IsShowingRealText())
265 mController->SelectNone();
269 void TextField::SelectText(const uint32_t start, const uint32_t end)
271 if(mController && mController->IsShowingRealText())
273 mController->SelectText(start, end);
278 string TextField::GetSelectedText() const
280 string selectedText = "";
281 if(mController && mController->IsShowingRealText())
283 selectedText = mController->GetSelectedText();
288 void TextField::SetTextSelectionRange(const uint32_t* start, const uint32_t* end)
290 if(mController && mController->IsShowingRealText())
292 mController->SetTextSelectionRange(start, end);
297 Uint32Pair TextField::GetTextSelectionRange() const
300 if(mController && mController->IsShowingRealText())
302 range = mController->GetTextSelectionRange();
307 string TextField::CopyText()
309 string copiedText = "";
310 if(mController && mController->IsShowingRealText())
312 copiedText = mController->CopyText();
317 string TextField::CutText()
320 if(mController && mController->IsShowingRealText())
322 cutText = mController->CutText();
327 void TextField::PasteText()
331 SetKeyInputFocus(); //Giving focus to the field that was passed to the PasteText in case the passed field (current field) doesn't have focus.
332 mController->PasteText();
336 InputMethodContext TextField::GetInputMethodContext()
338 return mInputMethodContext;
341 bool TextField::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
343 Dali::BaseHandle handle(object);
345 bool connected(true);
346 Toolkit::TextField field = Toolkit::TextField::DownCast(handle);
348 if(0 == strcmp(signalName.c_str(), SIGNAL_TEXT_CHANGED))
350 field.TextChangedSignal().Connect(tracker, functor);
352 else if(0 == strcmp(signalName.c_str(), SIGNAL_MAX_LENGTH_REACHED))
354 field.MaxLengthReachedSignal().Connect(tracker, functor);
356 else if(0 == strcmp(signalName.c_str(), SIGNAL_INPUT_STYLE_CHANGED))
358 field.InputStyleChangedSignal().Connect(tracker, functor);
360 else if(0 == strcmp(signalName.c_str(), SIGNAL_ANCHOR_CLICKED))
364 Internal::TextField& fieldImpl(GetImpl(field));
365 fieldImpl.AnchorClickedSignal().Connect(tracker, functor);
368 else if(0 == strcmp(signalName.c_str(), SIGNAL_CURSOR_POSITION_CHANGED))
372 Internal::TextField& fieldImpl(GetImpl(field));
373 fieldImpl.CursorPositionChangedSignal().Connect(tracker, functor);
376 else if(0 == strcmp(signalName.c_str(), SIGNAL_INPUT_FILTERED))
380 Internal::TextField& fieldImpl(GetImpl(field));
381 fieldImpl.InputFilteredSignal().Connect(tracker, functor);
384 else if(0 == strcmp(signalName.c_str(), SIGNAL_SELECTION_CHANGED))
388 Internal::TextField& fieldImpl(GetImpl(field));
389 fieldImpl.SelectionChangedSignal().Connect(tracker, functor);
392 else if(0 == strcmp(signalName.c_str(), SIGNAL_SELECTION_CLEARED))
396 Internal::TextField& fieldImpl(GetImpl(field));
397 fieldImpl.SelectionClearedSignal().Connect(tracker, functor);
400 else if(0 == strcmp(signalName.c_str(), SIGNAL_SELECTION_STARTED))
404 Internal::TextField& fieldImpl(GetImpl(field));
405 fieldImpl.SelectionStartedSignal().Connect(tracker, functor);
410 // signalName does not match any signal
417 Toolkit::TextField::TextChangedSignalType& TextField::TextChangedSignal()
419 return mTextChangedSignal;
422 Toolkit::TextField::MaxLengthReachedSignalType& TextField::MaxLengthReachedSignal()
424 return mMaxLengthReachedSignal;
427 Toolkit::TextField::InputStyleChangedSignalType& TextField::InputStyleChangedSignal()
429 return mInputStyleChangedSignal;
432 DevelTextField::AnchorClickedSignalType& TextField::AnchorClickedSignal()
434 return mAnchorClickedSignal;
437 DevelTextField::CursorPositionChangedSignalType& TextField::CursorPositionChangedSignal()
439 return mCursorPositionChangedSignal;
442 DevelTextField::InputFilteredSignalType& TextField::InputFilteredSignal()
444 return mInputFilteredSignal;
447 DevelTextField::SelectionChangedSignalType& TextField::SelectionChangedSignal()
449 return mSelectionChangedSignal;
452 DevelTextField::SelectionClearedSignalType& TextField::SelectionClearedSignal()
454 return mSelectionClearedSignal;
457 DevelTextField::SelectionStartedSignalType& TextField::SelectionStartedSignal()
459 return mSelectionStartedSignal;
462 void TextField::OnAccessibilityStatusChanged()
464 CommonTextUtils::SynchronizeTextAnchorsInParent(Self(), mController, mAnchorActors);
467 void TextField::OnInitialize()
471 mController = Text::Controller::New(this, this, this, this);
473 // When using the vector-based rendering, the size of the GLyphs are different
474 TextAbstraction::GlyphType glyphType = (DevelText::RENDERING_VECTOR_BASED == mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
475 mController->SetGlyphType(glyphType);
477 mDecorator = Text::Decorator::New(*mController,
480 mInputMethodContext = InputMethodContext::New(self);
482 mController->GetLayoutEngine().SetLayout(Layout::Engine::SINGLE_LINE_BOX);
484 // Enables the text input.
485 mController->EnableTextInput(mDecorator, mInputMethodContext);
487 // Enables the horizontal scrolling after the text input has been enabled.
488 mController->SetHorizontalScrollEnabled(true);
490 // Disables the vertical scrolling.
491 mController->SetVerticalScrollEnabled(false);
493 // Disable the smooth handle panning.
494 mController->SetSmoothHandlePanEnabled(false);
496 mController->SetNoTextDoubleTapAction(Controller::NoTextTap::HIGHLIGHT);
497 mController->SetNoTextLongPressAction(Controller::NoTextTap::HIGHLIGHT);
499 // Sets layoutDirection value
500 Dali::Stage stage = Dali::Stage::GetCurrent();
501 Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>(stage.GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
502 mController->SetLayoutDirection(layoutDirection);
504 self.LayoutDirectionChangedSignal().Connect(this, &TextField::OnLayoutDirectionChanged);
506 // Forward input events to controller
507 EnableGestureDetection(static_cast<GestureType::Value>(GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS));
508 GetTapGestureDetector().SetMaximumTapsRequired(2);
509 GetTapGestureDetector().ReceiveAllTapEvents(true);
511 self.TouchedSignal().Connect(this, &TextField::OnTouched);
513 // Set BoundingBox to stage size if not already set.
514 Rect<int> boundingBox;
515 mDecorator->GetBoundingBox(boundingBox);
517 if(boundingBox.IsEmpty())
519 Vector2 stageSize = Dali::Stage::GetCurrent().GetSize();
520 mDecorator->SetBoundingBox(Rect<int>(0.0f, 0.0f, stageSize.width, stageSize.height));
523 // Flip vertically the 'left' selection handle
524 mDecorator->FlipHandleVertically(LEFT_SELECTION_HANDLE, true);
526 // Fill-parent area by default
527 self.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
528 self.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT);
529 self.OnSceneSignal().Connect(this, &TextField::OnSceneConnect);
531 DevelControl::SetInputMethodContext(*this, mInputMethodContext);
533 if(Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy)
539 self.SetProperty(DevelControl::Property::ACCESSIBILITY_ROLE, Dali::Accessibility::Role::ENTRY);
540 self.SetProperty(DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true);
542 Accessibility::Bridge::EnabledSignal().Connect(this, &TextField::OnAccessibilityStatusChanged);
543 Accessibility::Bridge::DisabledSignal().Connect(this, &TextField::OnAccessibilityStatusChanged);
546 DevelControl::ControlAccessible* TextField::CreateAccessibleObject()
548 return new TextFieldAccessible(Self());
551 void TextField::OnStyleChange(Toolkit::StyleManager styleManager, StyleChange::Type change)
553 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnStyleChange\n");
557 case StyleChange::DEFAULT_FONT_CHANGE:
559 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnStyleChange DEFAULT_FONT_CHANGE\n");
560 const std::string& newFont = GetImpl(styleManager).GetDefaultFontFamily();
561 // Property system did not set the font so should update it.
562 mController->UpdateAfterFontChange(newFont);
567 case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
569 GetImpl(styleManager).ApplyThemeStyle(Toolkit::Control(GetOwner()));
573 case StyleChange::THEME_CHANGE:
575 // Nothing to do, let control base class handle this
580 // Up call to Control
581 Control::OnStyleChange(styleManager, change);
584 Vector3 TextField::GetNaturalSize()
587 padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
589 Vector3 naturalSize = mController->GetNaturalSize();
590 naturalSize.width += (padding.start + padding.end);
591 naturalSize.height += (padding.top + padding.bottom);
596 float TextField::GetHeightForWidth(float width)
599 padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
600 return mController->GetHeightForWidth(width) + padding.top + padding.bottom;
603 void TextField::ResizeActor(Actor& actor, const Vector2& size)
605 if(actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
607 actor.SetProperty(Actor::Property::SIZE, size);
611 void TextField::OnPropertySet(Property::Index index, const Property::Value& propertyValue)
613 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnPropertySet index[%d]\n", index);
617 case DevelActor::Property::USER_INTERACTION_ENABLED:
619 const bool enabled = propertyValue.Get<bool>();
620 mController->SetUserInteractionEnabled(enabled);
623 float opacity = enabled ? 1.0f : mController->GetDisabledColorOpacity();
624 mStencil.SetProperty(Actor::Property::OPACITY, opacity);
630 Control::OnPropertySet(index, propertyValue); // up call to control for non-handled properties
636 void TextField::OnRelayout(const Vector2& size, RelayoutContainer& container)
638 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField OnRelayout\n");
643 padding = self.GetProperty<Extents>(Toolkit::Control::Property::PADDING);
645 Vector2 contentSize(size.x - (padding.start + padding.end), size.y - (padding.top + padding.bottom));
647 // Support Right-To-Left of padding
648 Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(self);
650 if(Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection)
652 std::swap(padding.start, padding.end);
657 mStencil.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
658 ResizeActor(mStencil, contentSize);
662 mActiveLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
663 ResizeActor(mActiveLayer, contentSize);
667 mCursorLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
668 ResizeActor(mCursorLayer, contentSize);
671 // If there is text changed, callback is called.
674 EmitTextChangedSignal();
677 const Text::Controller::UpdateTextType updateTextType = mController->Relayout(contentSize, layoutDirection);
679 if((Text::Controller::NONE_UPDATED != updateTextType) ||
682 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnRelayout %p Displaying new contents\n", mController.Get());
685 (Text::Controller::NONE_UPDATED != (Text::Controller::DECORATOR_UPDATED & updateTextType)))
687 mDecorator->Relayout(contentSize);
692 mRenderer = Backend::Get().NewRenderer(mRenderingBackend);
695 RenderText(updateTextType);
698 if(mCursorPositionChanged)
700 EmitCursorPositionChangedSignal();
703 if(mSelectionStarted)
705 EmitSelectionStartedSignal();
708 if(mSelectionChanged)
710 EmitSelectionChangedSignal();
713 if(mSelectionCleared)
715 EmitSelectionClearedSignal();
718 // The text-field emits signals when the input style changes. These changes of style are
719 // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
720 // can't be emitted during the size negotiation as the callbacks may update the UI.
721 // The text-field adds an idle callback to the adaptor to emit the signals after the size negotiation.
722 if(!mController->IsInputStyleChangedSignalsQueueEmpty())
724 if(Adaptor::IsAvailable())
726 Adaptor& adaptor = Adaptor::Get();
728 if(NULL == mIdleCallback)
730 // @note: The callback manager takes the ownership of the callback object.
731 mIdleCallback = MakeCallback(this, &TextField::OnIdleSignal);
732 adaptor.AddIdle(mIdleCallback, false);
738 Text::ControllerPtr TextField::GetTextController()
743 void TextField::RenderText(Text::Controller::UpdateTextType updateTextType)
745 CommonTextUtils::RenderText(Self(), mRenderer, mController, mDecorator, mAlignmentOffset, mRenderableActor, mBackgroundActor, mCursorLayer, mStencil, mClippingDecorationActors, mAnchorActors, updateTextType);
748 void TextField::OnKeyInputFocusGained()
750 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get());
751 if(mInputMethodContext && IsEditable())
753 // All input panel properties, such as layout, return key type, and input hint, should be set before input panel activates (or shows).
754 mInputMethodContext.ApplyOptions(mInputMethodOptions);
755 mInputMethodContext.NotifyTextInputMultiLine(false);
757 mInputMethodContext.StatusChangedSignal().Connect(this, &TextField::KeyboardStatusChanged);
759 mInputMethodContext.EventReceivedSignal().Connect(this, &TextField::OnInputMethodContextEvent);
761 // Notify that the text editing start.
762 mInputMethodContext.Activate();
764 // When window gain lost focus, the inputMethodContext is deactivated. Thus when window gain focus again, the inputMethodContext must be activated.
765 mInputMethodContext.SetRestoreAfterFocusLost(true);
767 ClipboardEventNotifier notifier(ClipboardEventNotifier::Get());
771 notifier.ContentSelectedSignal().Connect(this, &TextField::OnClipboardTextSelected);
774 if(IsEditable() && mController->IsUserInteractionEnabled())
776 mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event
779 EmitKeyInputFocusSignal(true); // Calls back into the Control hence done last.
782 void TextField::OnKeyInputFocusLost()
784 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField:OnKeyInputFocusLost %p\n", mController.Get());
785 if(mInputMethodContext)
787 mInputMethodContext.StatusChangedSignal().Disconnect(this, &TextField::KeyboardStatusChanged);
788 // The text editing is finished. Therefore the inputMethodContext don't have restore activation.
789 mInputMethodContext.SetRestoreAfterFocusLost(false);
791 // Notify that the text editing finish.
792 mInputMethodContext.Deactivate();
794 mInputMethodContext.EventReceivedSignal().Disconnect(this, &TextField::OnInputMethodContextEvent);
796 ClipboardEventNotifier notifier(ClipboardEventNotifier::Get());
800 notifier.ContentSelectedSignal().Disconnect(this, &TextField::OnClipboardTextSelected);
803 mController->KeyboardFocusLostEvent();
805 EmitKeyInputFocusSignal(false); // Calls back into the Control hence done last.
808 bool TextField::OnAccessibilityActivated()
814 void TextField::OnTap(const TapGesture& gesture)
816 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnTap %p\n", mController.Get());
817 if(mInputMethodContext && IsEditable())
819 mInputMethodContext.Activate();
821 // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
823 padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
824 const Vector2& localPoint = gesture.GetLocalPoint();
825 mController->TapEvent(gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top);
826 mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top);
828 Dali::Toolkit::KeyboardFocusManager keyboardFocusManager = Dali::Toolkit::KeyboardFocusManager::Get();
829 if (keyboardFocusManager)
831 keyboardFocusManager.SetCurrentFocusActor(Self());
836 void TextField::OnPan(const PanGesture& gesture)
838 mController->PanEvent(gesture.GetState(), gesture.GetDisplacement());
841 void TextField::OnLongPress(const LongPressGesture& gesture)
843 if(mInputMethodContext && IsEditable())
845 mInputMethodContext.Activate();
848 padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
849 const Vector2& localPoint = gesture.GetLocalPoint();
850 mController->LongPressEvent(gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top);
855 bool TextField::OnKeyEvent(const KeyEvent& event)
857 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnKeyEvent %p keyCode %d\n", mController.Get(), event.GetKeyCode());
859 if(Dali::DALI_KEY_ESCAPE == event.GetKeyCode() && mController->ShouldClearFocusOnEscape())
861 // Make sure ClearKeyInputFocus when only key is up
862 if(event.GetState() == KeyEvent::UP)
864 Dali::Toolkit::KeyboardFocusManager keyboardFocusManager = Dali::Toolkit::KeyboardFocusManager::Get();
865 if (keyboardFocusManager)
867 keyboardFocusManager.ClearFocus();
869 ClearKeyInputFocus();
874 else if(Dali::DevelKey::DALI_KEY_RETURN == event.GetKeyCode())
876 // Do nothing when enter is comming.
880 return mController->KeyEvent(event);
883 void TextField::RequestTextRelayout()
888 bool TextField::IsEditable() const
890 return mController->IsEditable();
893 void TextField::SetEditable(bool editable)
895 mController->SetEditable(editable);
896 if(mInputMethodContext && !editable)
898 mInputMethodContext.Deactivate();
902 void TextField::TextInserted(unsigned int position, unsigned int length, const std::string& content)
904 GetAccessibleObject()->EmitTextInserted(position, length, content);
907 void TextField::TextDeleted(unsigned int position, unsigned int length, const std::string& content)
909 GetAccessibleObject()->EmitTextDeleted(position, length, content);
912 void TextField::CursorPositionChanged(unsigned int oldPosition, unsigned int newPosition)
914 GetAccessibleObject()->EmitTextCursorMoved(newPosition);
916 if((oldPosition != newPosition) && !mCursorPositionChanged)
918 mCursorPositionChanged = true;
919 mOldPosition = oldPosition;
923 void TextField::TextChanged(bool immediate)
925 if(immediate) // Emits TextChangedSignal immediately
927 EmitTextChangedSignal();
935 void TextField::EmitTextChangedSignal()
937 Dali::Toolkit::TextField handle(GetOwner());
938 mTextChangedSignal.Emit(handle);
939 mTextChanged = false;
942 void TextField::MaxLengthReached()
944 Dali::Toolkit::TextField handle(GetOwner());
945 mMaxLengthReachedSignal.Emit(handle);
948 void TextField::InputStyleChanged(Text::InputStyle::Mask inputStyleMask)
950 Dali::Toolkit::TextField handle(GetOwner());
951 mInputStyleChangedSignal.Emit(handle, ConvertInputStyle(inputStyleMask));
954 void TextField::AnchorClicked(const std::string& href)
956 Dali::Toolkit::TextField handle(GetOwner());
957 mAnchorClickedSignal.Emit(handle, href.c_str(), href.length());
960 void TextField::EmitCursorPositionChangedSignal()
962 Dali::Toolkit::TextField handle(GetOwner());
963 mCursorPositionChangedSignal.Emit(handle, mOldPosition);
964 mCursorPositionChanged = false;
967 void TextField::InputFiltered(Toolkit::InputFilter::Property::Type type)
969 Dali::Toolkit::TextField handle(GetOwner());
970 mInputFilteredSignal.Emit(handle, type);
973 void TextField::EmitSelectionChangedSignal()
975 Dali::Toolkit::TextField handle(GetOwner());
976 mSelectionChangedSignal.Emit(handle, mOldSelectionStart, mOldSelectionEnd);
977 mSelectionChanged = false;
980 void TextField::EmitSelectionClearedSignal()
982 Dali::Toolkit::TextField handle(GetOwner());
983 mSelectionClearedSignal.Emit(handle);
984 mSelectionCleared = false;
987 void TextField::EmitSelectionStartedSignal()
989 Dali::Toolkit::TextField handle(GetOwner());
990 mSelectionStartedSignal.Emit(handle);
991 mSelectionStarted = false;
994 void TextField::SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t newStart, uint32_t newEnd)
996 if(((oldStart != newStart) || (oldEnd != newEnd)) && !mSelectionChanged)
998 if(newStart == newEnd)
1000 mSelectionCleared = true;
1004 if(oldStart == oldEnd)
1006 mSelectionStarted = true;
1010 mSelectionChanged = true;
1011 mOldSelectionStart = oldStart;
1012 mOldSelectionEnd = oldEnd;
1014 if(mOldSelectionStart > mOldSelectionEnd)
1017 uint32_t temp = mOldSelectionStart;
1018 mOldSelectionStart = mOldSelectionEnd;
1019 mOldSelectionEnd = temp;
1024 void TextField::AddDecoration(Actor& actor, DecorationType type, bool needsClipping)
1030 mClippingDecorationActors.push_back(actor);
1033 // If the actor is a layer type, add it.
1034 if(type == DecorationType::ACTIVE_LAYER)
1036 AddLayer(mActiveLayer, actor);
1038 else if(type == DecorationType::CURSOR_LAYER)
1040 AddLayer(mCursorLayer, actor);
1045 void TextField::AddLayer(Actor& layer, Actor& actor)
1047 actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
1048 actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
1053 void TextField::GetControlBackgroundColor(Vector4& color) const
1055 Property::Value propValue = Self().GetProperty(Toolkit::Control::Property::BACKGROUND);
1056 Property::Map* resultMap = propValue.GetMap();
1058 Property::Value* colorValue = nullptr;
1059 if(resultMap && (colorValue = resultMap->Find(ColorVisual::Property::MIX_COLOR)))
1061 colorValue->Get(color);
1065 void TextField::OnSceneConnect(Dali::Actor actor)
1069 RenderText(static_cast<Text::Controller::UpdateTextType>(Text::Controller::MODEL_UPDATED | Text::Controller::DECORATOR_UPDATED));
1073 mHasBeenStaged = true;
1077 InputMethodContext::CallbackData TextField::OnInputMethodContextEvent(Dali::InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent)
1079 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnInputMethodContextEvent %p eventName %d\n", mController.Get(), inputMethodContextEvent.eventName);
1080 return mController->OnInputMethodContextEvent(inputMethodContext, inputMethodContextEvent);
1083 void TextField::GetHandleImagePropertyValue(Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType)
1088 map[PropertyHandler::IMAGE_MAP_FILENAME_STRING] = mDecorator->GetHandleImage(handleType, handleImageType);
1094 void TextField::EnableClipping()
1098 // Creates an extra control to be used as stencil buffer.
1099 mStencil = Control::New();
1100 mStencil.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
1101 mStencil.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
1103 // Creates a background visual. Even if the color is transparent it updates the stencil.
1104 mStencil.SetProperty(Toolkit::Control::Property::BACKGROUND,
1105 Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR).Add(ColorVisual::Property::MIX_COLOR, Color::TRANSPARENT));
1107 // Enable the clipping property.
1108 mStencil.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX);
1109 mStencil.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
1111 Self().Add(mStencil);
1115 void TextField::OnClipboardTextSelected(ClipboardEventNotifier& clipboard)
1117 mController->PasteClipboardItemEvent();
1120 void TextField::KeyboardStatusChanged(bool keyboardShown)
1122 DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::KeyboardStatusChanged %p keyboardShown %d\n", mController.Get(), keyboardShown);
1124 // Just hide the grab handle when keyboard is hidden.
1127 mController->KeyboardFocusLostEvent();
1131 mController->KeyboardFocusGainEvent(); // Initially called by OnKeyInputFocusGained
1135 void TextField::OnSceneConnection(int depth)
1137 // Sets the depth to the visuals inside the text's decorator.
1138 mDecorator->SetTextDepth(depth);
1140 // The depth of the text renderer is set in the RenderText() called from OnRelayout().
1142 // Call the Control::OnSceneConnection() to set the depth of the background.
1143 Control::OnSceneConnection(depth);
1146 bool TextField::OnTouched(Actor actor, const TouchEvent& touch)
1151 void TextField::OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type)
1153 mController->ChangedLayoutDirection();
1156 void TextField::OnIdleSignal()
1158 // Emits the change of input style signals.
1159 mController->ProcessInputStyleChangedSignals();
1161 // Set the pointer to null as the callback manager deletes the callback after execute it.
1162 mIdleCallback = NULL;
1165 TextField::TextField()
1166 : Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)),
1167 mIdleCallback(NULL),
1168 mAlignmentOffset(0.f),
1169 mRenderingBackend(DEFAULT_RENDERING_BACKEND),
1170 mExceedPolicy(Dali::Toolkit::TextField::EXCEED_POLICY_CLIP),
1171 mHasBeenStaged(false),
1172 mTextChanged(false),
1173 mCursorPositionChanged(false),
1174 mSelectionChanged(false),
1175 mSelectionCleared(false),
1177 mOldSelectionStart(0u),
1178 mOldSelectionEnd(0u),
1179 mSelectionStarted(false)
1183 TextField::~TextField()
1185 UnparentAndReset(mStencil);
1187 if((NULL != mIdleCallback) && Adaptor::IsAvailable())
1189 Adaptor::Get().RemoveIdle(mIdleCallback);
1193 Vector<Vector2> TextField::GetTextSize(const uint32_t startIndex, const uint32_t endIndex) const
1195 return mController->GetTextSize(startIndex, endIndex);
1198 Vector<Vector2> TextField::GetTextPosition(const uint32_t startIndex, const uint32_t endIndex) const
1200 return mController->GetTextPosition(startIndex, endIndex);
1203 std::string TextField::TextFieldAccessible::GetName() const
1210 return GetWholeText();
1213 const std::vector<Toolkit::TextAnchor>& TextField::TextFieldAccessible::GetTextAnchors() const
1215 auto self = Toolkit::TextField::DownCast(Self());
1217 return Toolkit::GetImpl(self).mAnchorActors;
1220 Toolkit::Text::ControllerPtr TextField::TextFieldAccessible::GetTextController() const
1222 auto self = Toolkit::TextField::DownCast(Self());
1224 return Toolkit::GetImpl(self).GetTextController();
1227 std::uint32_t TextField::TextFieldAccessible::GetSubstituteCharacter() const
1229 auto self = Toolkit::TextField::DownCast(Self());
1230 auto hiddenInputSettings = self.GetProperty<Property::Map>(Toolkit::TextField::Property::HIDDEN_INPUT_SETTINGS);
1231 auto substChar = hiddenInputSettings.Find(Toolkit::HiddenInput::Property::SUBSTITUTE_CHARACTER);
1235 return static_cast<std::uint32_t>(substChar->Get<int>());
1238 return TextControlAccessible::GetSubstituteCharacter();
1241 bool TextField::TextFieldAccessible::IsHiddenInput() const
1243 auto self = Toolkit::TextField::DownCast(Self());
1244 auto hiddenInputSettings = self.GetProperty<Property::Map>(Toolkit::TextField::Property::HIDDEN_INPUT_SETTINGS);
1245 auto mode = hiddenInputSettings.Find(Toolkit::HiddenInput::Property::MODE);
1247 return (mode && (mode->Get<int>() != Toolkit::HiddenInput::Mode::HIDE_NONE));
1250 void TextField::TextFieldAccessible::RequestTextRelayout()
1252 auto self = Toolkit::TextField::DownCast(Self());
1253 auto& selfImpl = Toolkit::GetImpl(self);
1255 selfImpl.RequestTextRelayout();
1258 } // namespace Internal
1260 } // namespace Toolkit