1 #ifndef __DALI_TOOLKIT_INTERNAL_TEXT_INPUT_H__
2 #define __DALI_TOOLKIT_INTERNAL_TEXT_INPUT_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/adaptor-framework/clipboard.h>
23 #include <dali/public-api/adaptor-framework/clipboard-event-notifier.h>
24 #include <dali/public-api/adaptor-framework/imf-manager.h>
25 #include <dali/public-api/adaptor-framework/timer.h>
26 #include <dali/public-api/common/dali-vector.h>
29 #include <dali-toolkit/public-api/controls/control-impl.h>
30 #include <dali-toolkit/public-api/controls/text-input/text-input.h>
31 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
32 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
33 #include <dali-toolkit/internal/controls/text-input/text-input-popup-impl.h>
47 typedef IntrusivePtr<TextInput> TextInputPtr;
49 class TextInput : public Control
56 TEXTINPUT_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
57 TEXTINPUT_PROPERTY_END_INDEX = TEXTINPUT_PROPERTY_START_INDEX + 512 ///< Reserving property indices
61 * Create a new TextInput
62 * @return instrusive ptr to a TextInput
64 static Dali::Toolkit::TextInput New();
67 * @copydoc Toolkit::TextInput::GetText
69 std::string GetText() const;
72 * @copydoc Toolkit::TextInput::GetMarkupText()
74 std::string GetMarkupText() const;
77 * @copydoc Toolkit::TextInput::SetPlaceholderText
79 void SetPlaceholderText( const std::string& placeHolderText );
82 * @copydoc Toolkit::TextInput::SetPlaceholderText
84 std::string GetPlaceholderText();
87 * @copydoc Toolkit::TextInput::SetInitialText
89 void SetInitialText(const std::string& initialText);
92 * set the text to be displayed in text-input, will overwrite any existing text.
93 * can be used to clear the text-input by passing an empty string.
94 * @param [in] initialText text to be initially displayed
96 void SetText(const std::string& initialText);
99 * @copydoc Toolkit::TextInput::SetMaxCharacterLength
101 void SetMaxCharacterLength(std::size_t maxChars);
104 * @copydoc Toolkit::TextInput::SetNumberOfLinesLimit
106 void SetNumberOfLinesLimit(std::size_t maxLines);
109 * @copydoc Toolkit::TextInput::GetNumberOfLinesLimit
111 std::size_t GetNumberOfLinesLimit() const;
114 * @copydoc Toolkit::TextInput::GetFont
116 Font GetFont() const;
119 * @copydoc Toolkit::TextInput::SetFont
121 void SetFont(Font font);
124 * @copydoc Toolkit::TextInput::InputStartedSignal()
126 Toolkit::TextInput::InputSignalType& InputStartedSignal();
129 * @copydoc Toolkit::TextInput::InputFinishedSignal()
131 Toolkit::TextInput::InputSignalType& InputFinishedSignal();
134 * @copydoc Toolkit::TextInput::CutAndPasteToolBarDisplayedSignal()
136 Toolkit::TextInput::InputSignalType& CutAndPasteToolBarDisplayedSignal();
139 * @copydoc Toolkit::TextInput::StyleChangedSignal()
141 Toolkit::TextInput::StyleChangedSignalType& StyleChangedSignal();
144 * @copydoc Toolkit::TextInput::TextModifiedSignal()
146 Toolkit::TextInput::TextModifiedSignalType& TextModifiedSignal();
149 * @copydoc Toolkit::TextInput::MaxInputCharactersReachedSignal()
151 Toolkit::TextInput::MaxInputCharactersReachedSignalType& MaxInputCharactersReachedSignal();
154 * @copydoc Toolkit::TextInput::InputTextExceedBoundariesSignal()
156 Toolkit::TextInput::InputTextExceedBoundariesSignalType& InputTextExceedBoundariesSignal();
159 * Connects a callback function with the object's signals.
160 * @param[in] object The object providing the signal.
161 * @param[in] tracker Used to disconnect the signal.
162 * @param[in] signalName The signal to connect to.
163 * @param[in] functor A newly allocated FunctorDelegate.
164 * @return True if the signal was connected.
165 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
167 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
170 * @see Toolkit::TextInput::SetEditMode(bool editMode)
171 * @see Toolkit::TextInput::SetEditMode(bool editMode, const Vector2& touchPoint)
173 * @param[in] editMode true or false to indicate editMode on or off.
174 * @param[in] setCursorOnTouchPoint Whether to use the touch point to set the cursor position.
175 * @param[in] touchPoint A position in actor coordinates within the text-input.
177 void SetEditable(bool editMode, bool setCursorOnTouchPoint, const Vector2& touchPoint = Vector2::ZERO);
180 * @copydoc Toolkit::TextInput::GetEditMode
182 bool IsEditable() const;
185 * @copydoc Toolkit::TextInput::SetTextSelectable
187 void SetTextSelectable(bool textSelectable = true);
190 * @copydoc Toolkit::TextInput::IsTextSelectable
192 bool IsTextSelectable() const;
195 * @copydoc Toolkit::TextInput::IsTextSelected
197 bool IsTextSelected() const;
200 * @copydoc Toolkit::TextInput::DeSelectText
205 * @copydoc Toolkit::TextInput::SetEditOnTouch
207 void SetEditOnTouch(bool editOnTouch);
210 * @copydoc Toolkit::TextInput::IsEditOnTouch
212 bool IsEditOnTouch() const;
215 * @copydoc Toolkit::TextInput::SetGrabHandleImage
217 void SetGrabHandleImage(Dali::Image image);
220 * @copydoc Toolkit::TextInput::SetCursorImage
222 void SetCursorImage(Dali::Image image, const Vector4& border );
225 * @copydoc Toolkit::TextInput::GetSelectionHandleSize
227 Vector3 GetSelectionHandleSize();
230 * @copydoc Toolkit::TextInput::SetRTLCursorImage
232 void SetRTLCursorImage(Dali::Image image, const Vector4& border );
235 * @copydoc Toolkit::TextInput::EnableGrabHandle
237 void EnableGrabHandle(bool toggle);
240 * @copydoc Toolkit::TextInput::IsGrabHandleEnabled
242 bool IsGrabHandleEnabled();
245 * @copydoc Toolkit::TextInput::EnableSelectionHandleFlip
247 void EnableSelectionHandleFlip( bool toggle );
250 * @copydoc Toolkit::TextInput::IsSelectionHandleFlipEnabled
252 bool IsSelectionHandleFlipEnabled();
255 * @copydoc Toolkit::TextInput::SetSelectionHandleFlipMargin
257 void SetSelectionHandleFlipMargin( const Vector4& margin );
260 * @copydoc Toolkit::TextInput::SetBoundingRectangle
262 void SetBoundingRectangle( const Rect<float>& boundingRectangle );
265 * @copydoc Toolkit::TextInput::GetBoundingRectangle
267 const Rect<float> GetBoundingRectangle() const;
270 * @copydoc Toolkit::TextInput::GetSelectionHandleFlipMargin
272 const Vector4& GetSelectionHandleFlipMargin();
275 * @copydoc Toolkit::TextInput::SetTextColor
277 void SetTextColor( const Vector4& color );
280 * @copydoc Toolkit::TextInput::SetActiveStyle
282 void SetActiveStyle( const TextStyle& style, const TextStyle::Mask mask );
285 * @copydoc Toolkit::TextInput::ApplyStyle
287 void ApplyStyle( const TextStyle& style, const TextStyle::Mask mask );
290 * @copydoc Toolkit::TextInput::ApplyStyleToAll
292 void ApplyStyleToAll( const TextStyle& style, const TextStyle::Mask mask );
295 * @copydoc Toolkit::TextInput::GetStyleAtCursor
297 TextStyle GetStyleAtCursor() const;
300 * Retrieves the character style for the given position.
301 * @param[in] position The character position which style is required.
302 * @return The style for the given position.
304 TextStyle GetStyleAt( std::size_t position ) const;
307 * @copydoc Toolkit::TextInput::SetTextAlignment()
309 void SetTextAlignment( Toolkit::Alignment::Type align );
312 * @copydoc Toolkit::TextInput::SetTextLineJustification()
314 void SetTextLineJustification( Toolkit::TextView::LineJustification justification );
317 * @copydoc Toolkit::TextInput::SetFadeBoundary()
319 void SetFadeBoundary( const Toolkit::TextView::FadeBoundary& fadeBoundary );
322 * @copydoc Toolkit::TextInput::GetFadeBoundary()
324 const Toolkit::TextView::FadeBoundary& GetFadeBoundary() const;
327 * @copydoc Toolkit::TextInput::GetTextAlignment()
329 Toolkit::Alignment::Type GetTextAlignment() const;
332 * @copydoc Toolkit::TextInput::SetMultilinePolicy()
334 void SetMultilinePolicy( Toolkit::TextView::MultilinePolicy policy );
337 * @copydoc Toolkit::TextInput::GetMultilinePolicy()
339 Toolkit::TextView::MultilinePolicy GetMultilinePolicy() const;
342 * @copydoc Toolkit::TextInput::SetWidthExceedPolicy()
344 void SetWidthExceedPolicy( Toolkit::TextView::ExceedPolicy policy );
347 * @copydoc Toolkit::TextInput::GetWidthExceedPolicy()
349 Toolkit::TextView::ExceedPolicy GetWidthExceedPolicy() const;
352 * @copydoc Toolkit::TextInput::SetHeightExceedPolicy()
354 void SetHeightExceedPolicy( Toolkit::TextView::ExceedPolicy policy );
357 * @copydoc Toolkit::TextInput::GetHeightExceedPolicy()
359 Toolkit::TextView::ExceedPolicy GetHeightExceedPolicy() const;
362 * @copydoc Toolkit::TextInput::SetExceedEnabled()
364 void SetExceedEnabled( bool enable );
367 * @copydoc Toolkit::TextInput::GetExceedEnabled()
369 bool GetExceedEnabled() const;
372 * @copydoc Toolkit::TextInput::SetBackground
374 void SetBackground(Dali::Image image );
377 * @copydoc Toolkit::TextInput::SetNumberOfLines
379 void SetNumberOfLines(std::size_t lines);
382 * @copydoc Toolkit::TextInput::GetNumberOfLines
384 std::size_t GetNumberOfLines();
387 * @copydoc Toolkit::TextInput::GetNumberOfCharacters
389 std::size_t GetNumberOfCharacters() const;
396 * Set the diffuse color for the highlight
397 * @param[in] color color to use
399 void SetMaterialDiffuseColor( const Vector4& color );
402 * Get the diffuse color used by the highlight
405 const Vector4& GetMaterialDiffuseColor() const;
410 * structure to hold each highlight box needed for text selection
414 Vector3 size; ///< size of the highlight box
415 Vector3 position; ///< position of highlight box
416 ImageActor highlightBoxActor; ///< as actor that is the highlight box
420 * structure to hold each character in displayed string and its position from the left
424 char character; ///< todo change to UTF to aid multi-language support
430 * structure to hold coordinates of each quad, which will make up the mesh.
432 struct QuadCoordinates
435 * Default constructor
443 * @param[in] x1 left co-ordinate
444 * @param[in] y1 top co-ordinate
445 * @param[in] x2 right co-ordinate
446 * @param[in] y2 bottom co-ordinate
448 QuadCoordinates(float x1, float y1, float x2, float y2)
454 Vector2 min; ///< top-left (minimum) position of quad
455 Vector2 max; ///< bottom-right (maximum) position of quad
458 typedef std::vector<QuadCoordinates> QuadContainer;
461 * structure for information required to build the highlight mesh
466 * Adds a Quad (2D rectangular sub-selection)
467 * @param[in] x1 left co-ordinate
468 * @param[in] y1 top co-ordinate
469 * @param[in] x2 right co-ordinate
470 * @param[in] y2 bottom co-ordinate
472 void AddQuad( float x1, float y1, float x2, float y2 );
475 * Clamps all quads to fit within a min -> max 2D boundary.
477 void Clamp2D(const Vector2& min, const Vector2& max);
479 QuadContainer mQuadList; ///< List of quads (sub-selections that form to create complete selection)
483 * Holds requested selection start and end points for highlighted text.
485 struct SelectionParameters
487 SelectionParameters( size_t start, size_t end )
488 : mStartOfSelection( start ), mEndOfSelection( end )
493 size_t mStartOfSelection;
494 size_t mEndOfSelection;
503 enum SelectionHandleId
505 HandleOne, ///< Selection handle one which is on the left
506 HandleTwo ///< Selection handle two which is on the right
510 * Two different behaviours are needed to convert a touch point into a character index.
511 * When a tap is received and the touch point doesn't hit any character, the final character selected might
512 * be different than the one selected if the event is a pan.
513 * i.e. If a tap is received and the touch point doesn't hit any character the expected position of the cursor
514 * would be the end or the beginning of a line. However, this behaviour would be weird while panning.
518 TapMode, ///< Touch point to character index conversion mode used for Tap events.
519 DragMode ///< Touch point to character index conversion mode used for Pan events.
523 * Used to set the direction when find the next visible character.
525 enum FindVisibleCharacterDirection
527 Left, ///< Find visible characters on the left.
528 Right, ///< Find visible characters on the right.
529 ByEnd ///< Start finding visible characters by the end.
535 virtual bool OnTouchEvent(const TouchEvent& event);
538 * From CustomActorImpl; called after the Text Input actor is touched
539 * @param[in] event The KeyEvent event.
540 * @return True if the event should be consumed.
542 virtual bool OnKeyEvent(const KeyEvent& event);
545 * From CustomActorImpl; called when this actor gains keyboard focus.
547 virtual void OnKeyInputFocusGained();
550 * From CustomActorImpl; called when this actor loses keyboard focus.
552 virtual void OnKeyInputFocusLost();
555 * From Control; called whenever the control is added to the stage.
557 virtual void OnControlStageConnection();
559 private: // From Control
562 * Creation of the layer that is used by top level active parts of the TextInput like handles
564 void CreateActiveLayer();
567 * @copydoc Control::OnInitialize()
569 virtual void OnInitialize();
572 * @copydoc Control::OnControlSizeSet()
574 virtual void OnControlSizeSet(const Vector3& targetSize);
577 * @copydoc Control::OnRelayout()
579 virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
582 * Retrieves the text-input's natural size by calling TextView::GetNaturalSize().
584 * @return The natural size.
586 virtual Vector3 GetNaturalSize();
589 * Retrieves the text-input's \e height for a given \e width by calling TextView::GetHeightForWidth().
591 * @param[in] width The given \e width.
593 * @return The \e height for the given \e width.
595 virtual float GetHeightForWidth( float width );
600 * Construct a new TextInput.
605 * A reference counted object may only be deleted by calling Unreference()
607 virtual ~TextInput();
612 TextInput(const TextInput&);
615 TextInput& operator=(const TextInput& rhs);
618 * Callback when a handle is panned/moved, either selection handles or grab handle
619 * @param actor Handle of the selection or grab handle.
620 * @param gesture Data structure with the parameters of the gesture.
622 void OnHandlePan(Actor actor, const PanGesture& gesture);
625 * Callback for touch down on Grab handle
626 * @param[in] actor touched
627 * @param[in] touch touch event
629 bool OnPressDown(Dali::Actor actor, const TouchEvent& touch);
632 * Callback for touch down on Selection handle one
633 * @param[in] actor touched
634 * @param[in] touch touch event, used to determine if down or up event
636 bool OnHandleOneTouched(Dali::Actor actor, const TouchEvent& touch);
639 * Callback for touch down on Selection handle two
640 * @param[in] actor touched
641 * @param[in] touch touch event, used to determine if down or up event
643 bool OnHandleTwoTouched(Dali::Actor actor, const TouchEvent& touch);
646 * Callback for tap on TextInput
648 * @param[in] tap touch event
650 void OnTextTap(Dali::Actor actor, const Dali::TapGesture& tap);
653 * Callback for double tap on TextInput
655 * @param[in] tap touch event
657 void OnDoubleTap(Dali::Actor actor, const Dali::TapGesture& tap);
660 * Callback for long press on TextInput
662 * @param[in] longPress long press event
664 void OnLongPress(Dali::Actor actor, const Dali::LongPressGesture& longPress);
667 * Callback for the ClipboardEventNotifier when text is selected in the clipboard window.
668 * @param[in] notifier The Clipboard Event Notifier.
670 void OnClipboardTextSelected( ClipboardEventNotifier& notifier );
673 * Callback for when a button is pressed in popup panel
674 * @param[in] button handle to the button pressed.
676 bool OnPopupButtonPressed( Toolkit::Button button );
679 * Callback when handle timer ticks.
681 * Cursor should become visible/invisible to simulate blinking.
683 * @return True if the timer should be keep running.
685 bool OnCursorBlinkTimerTick();
688 * Invoked upon popup Hide animation completing.
689 * @note Only called for animating hide, not called for instantaneous (animate = false)
690 * @param[in] popup The popup which was hidden.
692 void OnPopupHideFinished(TextInputPopup& popup);
695 * Called in OnKeyEvent to handle key down events.
696 * @param[in] event The KeyEvent event.
697 * @return True if the event should be consumed.
699 bool OnKeyDownEvent(const KeyEvent& event);
702 * Called in OnKeyEvent to handle key up events.
703 * @param[in] event The KeyEvent event.
704 * @return True if the event should be consumed.
706 bool OnKeyUpEvent(const KeyEvent& event);
709 * Chooses from all handle position and alternative handle positions where to set the position of the two selection handles.
711 * @param[in] cursorPositionOne The initial position of the first selection handle.
712 * @param[in] cursorPositionTwo The initial position of the second selection handle.
713 * @param[in] altPositionValidOne Whether there is an alternative position for the first selection handle.
714 * @param[in] altPositionValidTwo Whether there is an alternative position for the second selection handle.
715 * @param[in] altPositionOne The alternative position of the first selection handle.
716 * @param[in] altPositionTwo The alternative position of the second selection handle.
718 void ChooseRtlSelectionHandlePosition( const Vector3& cursorPositionOne,
719 const Vector3& cursorPositionTwo,
720 bool altPositionValidOne,
721 bool altPositionValidTwo,
722 const Vector3& altPositionOne,
723 const Vector3& altPositionTwo );
725 * Callback called when the text-view is scrolled.
727 * Updates the selection and grab handles, and the highlighted text.
729 * @param[in] textView Handle of the text-view.
730 * @param[in] scrollPosition The difference with the previous scroll position.
732 void OnTextViewScrolled( Toolkit::TextView textView, Vector2 scrollPosition );
735 * Scrolls the text-view to make the cursor visible.
737 * @param[in] cursorPosition The actual cursor position in actor coordinates.
739 void ScrollTextViewToMakeCursorVisible( const Vector3& cursorPosition );
742 * Creates and starts a timer to scroll the text when handles are close to the edges of the text-input.
744 * It only starts the timer if it's already created.
746 void StartScrollTimer();
749 * Stops the timer used to scroll the text.
751 void StopScrollTimer();
754 * Callback called by the timer used to scroll the text.
756 * It calculates and sets a new scroll position.
758 bool OnScrollTimerTick();
760 public: // Public to allow internal testing.
763 * Register for touch events
765 void SetUpTouchEvents();
768 * Sets up TextView Actor
770 void CreateTextViewActor();
773 * Set Styled Text for text input.
774 * @param[in] styleText The new styled text for the text input.
776 void SetText( const MarkupProcessor::StyledTextArray& styleText );
779 * Start a timer to signal cursor to blink.
781 void StartCursorBlinkTimer();
784 * Stop the timer signalling the cursor to blink.
786 void StopCursorBlinkTimer();
789 * Starts input, setting focus and showing keyboard..
791 void StartEditMode();
794 * Called when End of input and focus no longer required, keyboard is hidden.
799 * Applies a style to the current pre-edit / predicted word to show it is being edited.
800 * @param[in] preEditStartPosition position in text array that the predicted word starts at
801 * @param[in] preEditStringLength used to calculate how many characters need their style changed.
803 void ApplyPreEditStyle( std::size_t preEditStartPosition, std::size_t preEditStringLength );
806 * Restores style to value before applying Pre-Edit style.
808 void RemovePreEditStyle();
811 * Event received from IMF manager
812 * @return ImfCallbackData data struture undicating if update is needed, cursor position and current text
814 ImfManager::ImfCallbackData ImfEventReceived( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& test );
817 * Called when the OnKey event is a Pre-edit string
818 * @param[in] keyString String received in Pre-edit
819 * @param[in] cursorOffset the cursor offset from where the pre-edit word starts
820 * @return bool true if preedit reset is required.
822 bool PreEditReceived( const std::string& keyString, std::size_t cursorOffset );
825 * Called when the OnKey event is a Commit string
826 * @param[in] keyString String received in Comment
827 * @return update flag to trigger cursor update of TextInput only when needed.
829 bool CommitReceived( const std::string& keyString );
832 * Deletes Pre-edit string
833 * By default it doesn't update the character's size and position table, which is a costly
834 * operation. As in many cases deletion and insertion (InsertAt) of text
835 * occurs in the same action i.e. preedit/commit. It makes sense to
836 * delete without updating, and then insert with updating.
838 * @return The number of characters to be deleted.
840 std::size_t DeletePreEdit();
843 * Reset all pre-edit flag and signal IMF keyboard that the current pre-edit word has been comitted.
844 * This may be due to the cursor being moved by user or reached the max character limit.
845 * @param[in] preserveCursorPosition Set true to keep cursor in current position, eg. touch event caused cursor to move.
847 void PreEditReset( bool preserveCursorPosition );
850 * Called after cursor position needs updating.
851 * Redraws cursor and notifies VirtualKeyboard
856 * Delete highlighted characters
857 * @param[in] inheritStyle Whether style from previous character in the string should be inherited.
859 void DeleteHighlightedText( bool inheritStyle );
862 * Delete range of characters
863 * @param[in] start position of characters to delete
864 * @param[in] ncharacters number of characters to delete
866 void DeleteRange(std::size_t start, std::size_t ncharacters);
869 * Delete character at current cursor position and redisplay
870 * @param[in] positionToDelete position of character to delete
872 void DeleteCharacter( std::size_t positionToDelete );
875 * Add or replaces characters to currently displayed string at cursor position
876 * By default it doesn't update the character's size and position table, which is a costly
877 * operation. As in many cases deletion and insertion (InsertAt) of text
878 * occurs in the same action i.e. preedit/commit. It makes sense to
879 * delete without updating, and then insert with updating.
880 * @param[in] newText string to add to TextInput display string.
881 * @param[in] insertionPosition position to insert at.
882 * @param[in] numberOfCharactersToReplace The number of characters to replace.
883 * @return number of characters to offset the cursor by.
885 std::size_t InsertAt( const Text& newText, const std::size_t insertionPosition, const std::size_t numberOfCharactersToReplace );
889 * @param[in] color the cursor color.
890 * @return the image actor to be used as the cursor.
892 ImageActor CreateCursor( const Vector4 &color );
895 * Moves cursor to the right
896 * param[in] reverse if true then cursor moves in the reverse direction (to the left)
897 * param[in] places number of character cursor should move.
899 void AdvanceCursor(bool reverse = false, std::size_t places = 1);
902 * Draw a cursor / caret at position where new text should appear
907 * Sets cursor visibility
908 * This sets visibility of the cursor. Which is comprised of 2
909 * cursors. The conventional cursor, and the alternate (RTL) cursor,
910 * which only appears when the cursor is at a character that can have
911 * a character appended to different visual positions depending on whether that
912 * character to be appended is RTL or LTR.
913 * @param[in] visible true - enable visibility for cursor, false - disable visiblity for cursor
915 void SetCursorVisibility( bool visible );
918 * Sets alternate cursor enable state
919 * @see SetCursorVisibility
920 * alternate cursor will only be visible if both SetCursorVisiblity
921 * and cursor enabled have been set to true.
923 void SetAltCursorEnabled( bool enabled );
926 * Create the grab handle that positions the cursor
927 * @param[in] image to be used for grab handle
930 void CreateGrabHandle(Image image=Image());
933 * Create Grab area to be used by Grab Handle
935 void CreateGrabArea( Actor& parent);
938 * Move grab handle to the required character position
940 * @param[in] displacement Displacement of the grab handle in actor coordinates.
942 * @return The new actual position the handle has been set to.
944 Vector3 MoveGrabHandle( const Vector2& displacement );
947 * Show or hide the grab handle without baking the visibility flag.
948 * Used when the Grab handle needs to be invisible due to text-view scrolling making it out of view
950 * @param[in] visible bool flag to set as true is grab handle should be shown, else false to hide.
952 void ShowGrabHandle( bool visible );
955 * Show or hide the grab handle and bake the visibility flag.
956 * Used when the state of text-input changes to a state which the grabhandle is not required. E.g. Selection mode starts or edit mode ends.
957 * Calls ShowGrabHandle.
959 * @param[in] visible bool flag to set as true is grab handle should be shown, else false to hide.
961 void ShowGrabHandleAndSetVisibility( bool visible );
963 /* Boundary Property Notifications when handle exceed bounding box*/
966 * PropertyNotification Callback when left boundary exceeded so handle can be flipped.
967 * @param[in] source PropertyNotification
969 void OnLeftBoundaryExceeded( PropertyNotification& source );
971 * PropertyNotification Callback when within left boundary so handle can be flipped back.
972 * @param[in] source PropertyNotification
974 void OnReturnToLeftBoundary( PropertyNotification& source );
976 * PropertyNotification Callback when right boundary exceeded so handle can be flipped.
977 * @param[in] source PropertyNotification
979 void OnRightBoundaryExceeded( PropertyNotification& source );
981 * * PropertyNotification Callback when within right boundary so handle can be flipped back.
982 * @param[in] source PropertyNotification
984 void OnReturnToRightBoundary( PropertyNotification& source );
987 * PropertyNotification Callbacks for hiding handle one when it exceeds boundary.
988 * @param[in] source PropertyNotification
990 void OnHandleOneLeavesBoundary( PropertyNotification& source );
992 * PropertyNotification Callbacks for showing hidden handle one when returns within boundary
993 * @param[in] source PropertyNotification
995 void OnHandleOneWithinBoundary( PropertyNotification& source );
997 * PropertyNotification Callbacks for hiding handle two it when exceeds boundary.
998 * @param[in] source PropertyNotification
1000 void OnHandleTwoLeavesBoundary( PropertyNotification& source );
1002 * PropertyNotification Callbacks for showing hidden handle two when returns within boundary
1003 * * @param[in] source PropertyNotification
1005 void OnHandleTwoWithinBoundary( PropertyNotification& source );
1008 * Set up property notifications on the position of the handles to facilitate flipping and hiding when at screen boundary.
1010 void SetUpHandlePropertyNotifications();
1013 * Create the selection handles that bound text to be selected for copy/cut.
1014 * @param[in] start initial position of start selection handle.
1015 * @param[in] end initial position of end selection handle.
1016 * @param[in] handleOneImage (optional) to be used for selection handle
1017 * @param[in] handleTwoImage (optional) to be used for selection handle
1019 void CreateSelectionHandles( std::size_t start = 0, std::size_t end = std::numeric_limits<std::size_t>::max(), Dali::Image handleOneImage = Dali::Image(), Dali::Image handleTwoImage = Dali::Image() );
1022 * Move the selection handles to required positions in text.
1024 * @param[in] handleId the handle to position
1025 * @param[in] displacement Displacement of the selection handle in actor coordinates.
1027 * @return The new actual position the handle has been set to.
1029 Vector3 MoveSelectionHandle(SelectionHandleId handleId, const Vector2& displacement);
1032 * Calculate and position the specified selection handle the given index position
1034 * @param[in] handleId the handle to position
1036 void SetSelectionHandlePosition(SelectionHandleId handleId);
1039 * Gets a table of the visual text positions which has a flag
1040 * for each Character. The flag is either true (character selected)
1041 * or false (character deselected)
1042 * @note startSelection can be greater or less than endSelection
1044 * @param[in,out] selectedVisualText The vector to be resized and populated with the selected flags
1045 * @param[in] startSelection The start selection point for the text
1046 * @param[in] endSelection The end selection point for the text
1048 void GetVisualTextSelection(std::vector<bool>& selectedVisualText, std::size_t startSelection, std::size_t endSelection);
1051 * Iterates between selection handles and computes the info required to build the highlight mesh
1053 HighlightInfo CalculateHighlightInfo();
1056 * This method was added to fix a PLM. it creates one quad per character so the mesh can show different selection boxes when a mix of right to left and left to right text is selected.
1058 HighlightInfo CalculateHighlightInfoRtl();
1061 * Calculates new Mesh data so highlight moves with selection handles.
1063 void UpdateHighlight();
1066 * Removes popup, and its options.
1071 * Adds Popup options which have been enabled.
1073 void AddPopupOptions();
1076 * Sets popup position
1077 * @param[in] position The actual position for this popup.
1078 * @param[in] alternativePosition Alternative popup position if no space in upper area.
1080 void SetPopupPosition(const Vector3& position, const Vector2& alternativePosition );
1084 * @param[in] animate (optional) whether to animate popup to hide state over time (i.e. tween).
1085 * @param[in] signalFinished (optional) whether to perform an animation finish operation after the hide animation completes. Requires animate to be true.
1087 void HidePopup( bool animate = true, bool signalFinished = true );
1091 * @param[in] animate (optional) whether to animate popup to show state over time (i.e. tween).
1093 void ShowPopup(bool animate = true);
1096 * Shows the cut-copy-paste popup
1098 void ShowPopupCutCopyPaste();
1101 * Setup the selection popup and clipboard if relevant so the correct options are shown when ShowPopup is called.
1102 * @param[in] showCutButton Flag to show or hide cut button, in some cases like whitespace we do not want to cut just select.
1105 void SetUpPopupSelection( bool showCutButton = true );
1108 * Return the logical index containing the character position closest to the source.
1109 * Used for positioning the grab handle at characters when dragged along.
1110 * Two different behaviours are needed in case the source point doesn't actually touch a
1111 * character. @see TouchToIndex.
1112 * @param[in] source float to match against
1113 * @param[out] closestIndex index to the vector of character's size and position.
1114 * @return \e true if the source point is actually inside the geometry provided by TextView.
1116 bool ReturnClosestIndex(const Vector2& source, std::size_t& closestIndex );
1119 * Returns the X-position of the current line justification
1120 * (relative to left of text-view container)
1121 * @return X position for line justification
1123 float GetLineJustificationPosition() const;
1126 * Currently the cursor is positioned at the previous characters position plus it's width.
1127 * If the previous character is on a different line then this function returns the correct position.
1128 * @param[in] characterPosition the character position index that the cursor should be at
1129 * @return position of cursor/handle
1131 Vector3 PositionCursorAfterWordWrap( std::size_t characterPosition ) const;
1135 * Return a vector which is the actual position for the given character position
1136 * The character position is where a cursor would be position for that character.
1137 * @param[in] characterPosition the logical (input) position in the 'string' of characters.
1139 * @return Vector3 the actual x,y,z position
1141 Vector3 GetActualPositionFromCharacterPosition(std::size_t characterPosition ) const;
1144 * Return a vector which is the actual position for the given character position
1145 * The character position is where a cursor would be positioned for that character to be inserted.
1146 * An additional alternatePosition is also set in circumstances where the possible writing
1147 * of characters would be in the opposite direction.
1148 * e.g. "HelloشقشلاهؤEnglish"
1151 * [*] - Primary actual position for cursor i.e. continuing writing LTR (English)
1152 * [+] - Alternate actual position for cursor i.e. writing RTL (Arabic)
1154 * @param[in] characterPosition the logical (input) position in the 'string' of characters.
1155 * @param[out] directionRTL Whether the actual x,y,z position is after LTR (false) or RTL (true) text.
1156 * @param[out] alternatePosition the actual x,y,z position of the cursor if user types
1157 * in alternate direction to current flow of text.
1158 * @param[out] alternatePositionValid whether this alternate position is valid.
1159 * @return Vector3 the actual x,y,z position
1161 Vector3 GetActualPositionFromCharacterPosition(std::size_t characterPosition, bool& directionRTL, Vector3& alternatePosition, bool& alternatePositionValid ) const;
1164 * Retrieve the character position of the first character on the row of text
1165 * that this character resides on.
1166 * @param[in] logicalPosition the position in the 'string' of characters.
1167 * @return logical character position of start of row.
1169 std::size_t GetRowStartFromCharacterPosition(std::size_t logicalPosition) const;
1172 * Retrieves the first character of a group of characters with the same direction.
1174 * @param[in] logicalPosition Index to a character.
1176 * @return Index to the character.
1178 std::size_t GetFirstCharacterWithSameDirection( std::size_t logicalPosition ) const;
1181 * Retrieve the dimensions of this row of text that the character resides on.
1182 * @param[in] characterPosition the position in the 'string' of characters.
1183 * @return The size of the rectangle representing this row
1185 Size GetRowRectFromCharacterPosition(std::size_t characterPosition) const;
1188 * Retrieve the dimensions (and min-max) of this row of text that the character resides on.
1189 * @param[in] characterPosition the position in the 'string' of characters.
1190 * @param[out] min the top-left position of the rectangle representing this row
1191 * @param[out] max the bottom-right position of the rectangle representing this row
1192 * @return The size of the rectangle representing this row (max - min)
1194 Size GetRowRectFromCharacterPosition(std::size_t characterPosition, Vector2& min, Vector2& max) const;
1197 * Checks if the provided touchedActor was this text-input
1198 * @param[in] touchedActor the touched actor that will be checked against this text-input
1199 * @return true if the touchActor was the text-input or one of its children
1201 bool WasTouchedCheck( const Actor& touchedActor ) const;
1204 * Connect to the stage touch event
1206 void StartMonitoringStageForTouch();
1209 * Disconnect from the stage touch event
1211 void EndMonitoringStageForTouch();
1214 * Callback for when the screen is touched, this will be connected when selection starts and disconnected when it ends.
1215 * @param[in] event The touch event
1217 void OnStageTouched(const TouchEvent& event);
1221 * Select the text between the given values
1222 * @param[in] start position within array to start selection
1223 * @param[in] end position within array to end selection
1225 void SelectText(std::size_t start, std::size_t end);
1228 * Gets selected text and returns it as a StyleText vector
1229 * @return StyledText vector that is selected.
1231 MarkupProcessor::StyledTextArray GetSelectedText();
1234 * Applies the given style to all text, selected or not selected.
1235 * By default all style settings are applied but a bit mask could be used to modify only certain style settings.
1237 void ApplyStyleToRange(const TextStyle& style, const TextStyle::Mask mask, const std::size_t begin, const std::size_t end);
1240 * Callback for when the keyboard status changes
1241 * @param[in] keyboardShown Whether the keyboard has just been shown or not.
1243 void KeyboardStatusChanged(bool keyboardShown);
1246 * Hide highlight shown between selection handles.
1247 * @param[in] hidePopup flag to hide the popup too, default is to hide popup.
1249 void RemoveHighlight( bool hidePopup = true );
1252 * Highlights text that has been selected
1254 void CreateHighlight();
1257 * Copies selected text to clipboard
1258 * @return bool true if copy was successful.
1260 bool CopySelectedTextToClipboard();
1263 * Pastes the given text to currently displayed string at the current cursor position
1264 * @param[in] text Text to be pasted
1266 void PasteText( const Text& text );
1269 * Sets the direction of the text if it is empty.
1271 void SetTextDirection();
1274 * Updates the line height accordingly with the current text input style.
1276 void UpdateLineHeight();
1279 * Finds a visible character.
1281 * The \e direction parameters specifies from where to start to look for a visible character. \e Left means start by characters in lower
1282 * positions than \e cursorPosition, \e Right means start by characters in greater positions than \e cursorPosition and \e ByEnd starts
1283 * by the last characters.
1285 * If \e Left or \e Right is provided and any character is found, then looks in the other direction.
1287 * @param[in] direction Direction used to find a visible character.
1288 * @param[in] cursorPosition Starting position.
1290 * @return The found visible character.
1292 std::size_t FindVisibleCharacter( const FindVisibleCharacterDirection direction , const std::size_t cursorPosition ) const;
1295 * @copydoc SetSortModifier()
1297 void SetSortModifier( float depthOffset );
1300 * @copydoc SetSnapshotModeEnabled()
1302 void SetSnapshotModeEnabled( bool enable );
1305 * @copydoc IsSnapshotModeEnabled()
1307 bool IsSnapshotModeEnabled() const;
1310 * @copydoc SetScrollEnabled()
1312 void SetScrollEnabled( bool enable );
1315 * @copydoc IsScrollEnabled()
1317 bool IsScrollEnabled() const;
1320 * @copydoc SetScrollPosition()
1322 void SetScrollPosition( const Vector2& position );
1325 * @copydoc GetScrollPosition()
1327 Vector2 GetScrollPosition() const;
1330 * @brief Sets whether markup processing should be carried out.
1332 * @param[in] enable whether markup processing is carried out or not.
1334 void SetMarkupProcessingEnabled( bool enable );
1337 * @brief Returns whether markup processing is enabled or not
1339 * @return true is markup processing is enabled
1341 bool IsMarkupProcessingEnabled() const;
1344 * Insert or replaces the given text in the given position. It checks if the text exceeds the maximum allowed number of characters
1345 * and if it fits in the text-input's boundaries.
1347 * @param[in] text Text to be inserted.
1348 * @param[in] position Position where the text is inserted.
1349 * @param[in] numberOfCharactersToReplace The number of characters to replace.
1350 * @param[out] textExceedsMaximunNumberOfCharacters The number of characters that have been inserted.
1351 * @param[out] textExceedsBoundary Whether the inserted text has exceeded the boundaries of the text-input.
1353 * @return The number of characters that have been inserted.
1355 std::size_t DoInsertAt( const Text& text, std::size_t position, std::size_t numberOfCharactersToReplace, bool& textExceedsMaximunNumberOfCharacters, bool& textExceedsBoundary );
1358 * Retrieve Text-view's layout info.
1360 void GetTextLayoutInfo();
1363 * Set the offset for positioning Popup from the TextInput
1364 * @param[in] offset in the order, left, top, right, bottom
1366 void SetOffsetFromText( const Vector4& offset );
1369 * Get the offset of the Popup from the TextInput
1370 * @return Vector4 with the offset in the order, left, top, right, bottom
1372 const Vector4& GetOffsetFromText() const;
1375 * Show the Placeholder text with an already created StyleTextArray
1376 * @param[in] stylePlaceHolderText Required placeholder text to be used
1378 void ShowPlaceholderText( const MarkupProcessor::StyledTextArray& stylePlaceHolderText );
1383 * Called when a property of an object of this type is set.
1384 * @param[in] object The object whose property is set.
1385 * @param[in] index The property index.
1386 * @param[in] value The new property value.
1388 static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
1391 * Called to retrieve a property of an object of this type.
1392 * @param[in] object The object whose property is to be retrieved.
1393 * @param[in] index The property index.
1394 * @return The current value of the property.
1396 static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
1399 * Emits the style changed signal.
1401 void EmitStyleChangedSignal();
1404 * Emit signal when text is modified.
1406 void EmitTextModified();
1409 * Emits max input characters reached signal.
1411 void EmitMaxInputCharactersReachedSignal();
1414 * Emits a signal when the input text exceeds the boundaries of the text-input.
1416 void EmitInputTextExceedsBoundariesSignal();
1420 State mState; ///< Current State of Text input.
1421 MarkupProcessor::StyledTextArray mStyledText; ///< String currently displayed by TextView with style info.
1422 TextStyle mInputStyle; ///< Stores the current input style.
1423 float mLineHeight; ///< Stores the current line height accordingly with the input style.
1424 Toolkit::TextView mDisplayedTextView; ///< Actor which actually display text
1426 MarkupProcessor::StyledTextArray mStyledPlaceHolderText; ///< Text used as place holder with style info.
1428 std::size_t mMaxStringLength; ///< Max number of characters for string
1429 std::size_t mNumberOflinesLimit; ///< Limit on the number of lines this TextInput will display.
1431 ImageActor mCursor; ///< Cursor overlayed on Text to show where new text will be inserted
1432 ImageActor mCursorRTL; ///< Right To Left Cursor overlayed on Text (where new RTL text would be inserted)
1433 Animation mCursorAnimation; ///< animator for cursor blinking.
1434 std::size_t mCursorPosition; ///< position along string cursor is at.
1435 Timer mCursorBlinkTimer; ///< Timer to signal cursor to blink
1437 Layer mActiveLayer; ///< Layer for active handles and alike that ensures they are above all else.
1439 Image mGrabHandleImage; ///< image to be used for grab handle
1440 ImageActor mGrabHandle; ///< Handle used to move cursor for editing
1442 Actor mGrabArea; ///< invisible actor that receives pans events for the grab handle.
1443 PanGestureDetector mPanGestureDetector; ///< Pan gesture for handles
1444 TapGestureDetector mTapDetector; ///< used to start editing
1445 TapGestureDetector mDoubleTapDetector; ///< double tap detector
1447 Vector3 mActualGrabHandlePosition; ///< actual position of grab handle, this might not be snapped to a character
1449 LongPressGestureDetector mLongPressDetector; ///< Gesture to start selection
1451 /*Selection handles*/
1452 Image mSelectionHandleOneImage; ///< image used for selection handle one
1453 Image mSelectionHandleOneImagePressed; ///< image used for selection handle one pressed state
1454 Image mSelectionHandleTwoImage; ///< image used for selection handle two
1455 Image mSelectionHandleTwoImagePressed; ///< image used for selection handle two pressed state
1457 bool mIsSelectionHandleOneFlipped:1; ///< Flag to know whether the handle one is flipped or not.
1458 bool mIsSelectionHandleTwoFlipped:1; ///< Flag to know whether the handle two is flipped or not.
1459 Vector3 mSelectionHandleOneOffset; ///< Handle One's Offset
1460 Vector3 mSelectionHandleTwoOffset; ///< Handle Two's Offset
1461 Vector3 mSelectionHandleOneActualPosition; ///< Actual x y position of handle
1462 Vector3 mSelectionHandleTwoActualPosition; ///< Actual x y position of handle
1463 std::size_t mSelectionHandleOnePosition; ///< Position of handle along the string of text
1464 std::size_t mSelectionHandleTwoPosition; ///< Position of handle along the string of text
1465 ImageActor mSelectionHandleOne; ///< First selection handle used for selecting text to cut&paste
1466 ImageActor mSelectionHandleTwo; ///< Second selection handle used for selecting text to cut&paste
1467 Actor mHandleOneGrabArea; ///< invisible actor that receives pans events for the selection handle.
1468 Actor mHandleTwoGrabArea; ///< invisible actor that receives pans events for the selection handle.
1470 HighlightInfo mNewHighlightInfo; ///< Geometry info to create highlight.
1472 Text mPreEditString; ///< Holds current input string prior to it being committed.
1473 std::size_t mPreEditStartPosition; ///< Cursor position for start of pre-edit string
1474 std::size_t mPreEditLength; ///< Cursor position for length of current pre-edit string after purging characters that do not fit.
1475 std::size_t mNumberOfSurroundingCharactersDeleted; ///< Stores the number of surrounding characters deleted.
1476 unsigned long mTouchStartTime; ///< Touch Start time (time in ms when down press began)
1478 Toolkit::TextView::TextLayoutInfo mTextLayoutInfo; ///< It contains a table layout info per character sorted by the character's visual index (retrieved from TextView),
1479 ///< a reorder map that stores each character's visual (output) index according to its logical (input) index,
1480 ///< a reorder map that stores each character's logical (input) index according to its visual (output) index,
1481 ///< the text size after layout and the scroll offset.
1483 MarkupProcessor::StyledTextArray mCurrentCopySelecton; ///< Array to store copied text.
1484 TextInputPopup mPopupPanel; ///< Panel to house cut and paste, select all buttons.
1487 Vector2 mScrollDisplacement;
1488 Vector3 mCurrentHandlePosition;
1489 SelectionHandleId mCurrentSelectionId;
1490 Vector3 mCurrentSelectionHandlePosition;
1491 SelectionParameters mRequestedSelection;
1492 Vector4 mSelectionHandleFlipMargin;
1493 Vector4 mBoundingRectangleWorldCoordinates;
1495 Clipboard mClipboard; ///< Handle to clipboard
1498 Vector4 mMaterialColor; // Color of the highlight
1499 Vector4 mPopupOffsetFromText; // Offset of Popup from the TextInput.
1501 bool mOverrideAutomaticAlignment:1; ///< Whether to override the alignment automatically set by the text content (e.g. european LTR or arabic RTL)
1502 bool mCursorRTLEnabled:1; ///< Enable state of Alternate RTL Cursor (need to keep track of this as it's not always enabled)
1503 bool mClosestCursorPositionEOL:1; ///< closest cursor position is end of line.
1504 bool mCursorBlinkStatus:1; ///< \e true shows the cursor, \e false hiddes it.
1506 bool mCursorVisibility:1; ///< Visibility status of Cursor
1507 bool mGrabHandleVisibility:1; ///< Visibility status of the grab handle.
1509 bool mIsCursorInScrollArea:1; ///< Whether the cursor is inside the boundaries of the text-input.
1510 bool mIsGrabHandleInScrollArea:1; ///< Whether the grab handle is inside the boundaries of the text-input.
1512 bool mEditModeActive:1; ///< true to indicate TextInput is in edit mode.
1513 bool mEditOnTouch:1; ///< true indicates edit mode starts by touching/tapping the TextInput
1514 bool mTextSelection:1; ///< true indicates text selection is enabled.
1515 bool mExceedEnabled:1; ///< Whether text-input editing text beyond its boundary is enabled or not. By default is enabled.
1516 bool mGrabHandleEnabled:1; ///< Flag to enable the grab handle instead of the default magnifier.
1517 bool mIsSelectionHandleFlipEnabled:1; ///< Flag to enable the selection handle flip
1519 bool mPreEditFlag:1; ///< Flag to indicate if key string received is still in pre-edit mode (Ecore IMF keyboard)
1520 bool mIgnoreCommitFlag:1; ///< Flag to indicate if the commit string should be ignored, maybe due to a keyboard reset.
1521 bool mIgnoreFirstCommitFlag:1; ///< Whether to ignore the first commit.
1522 bool mSelectingText:1; ///< Ignore surrounding text as selecting text
1524 bool mPreserveCursorPosition:1; ///< Indicates that the commit message is from a reset and does not require the cursor to be moved
1526 bool mSelectTextOnCommit:1;
1528 bool mUnderlinedPriorToPreEdit:1; ///< As predictive text adds underline style this flag enables us to revert back or keep underline.
1530 bool mCommitByKeyInput:1; ///< Set if a commit is done by key input rather than automatically (usually when a space bar or enter is pressed).
1532 bool mPlaceHolderSet:1; ///< Whether the place holder text is set.
1533 bool mMarkUpEnabled:1; ///< enable to scan for mark-up
1535 Toolkit::TextInput::InputSignalType mInputStartedSignal; ///< Signal emitted when input starts
1536 Toolkit::TextInput::InputSignalType mInputFinishedSignal; ///< Signal emitted when input ends
1537 Toolkit::TextInput::StyleChangedSignalType mStyleChangedSignal; ///< Signal emitted when style changes.
1538 Toolkit::TextInput::TextModifiedSignalType mTextModifiedSignal; ///< Signal emitted when text modified.
1539 Toolkit::TextInput::MaxInputCharactersReachedSignalType mMaxInputCharactersReachedSignal; ///< Signal emitted when max input characters is reached.
1540 Toolkit::TextInput::InputSignalType mCutAndPasteToolBarDisplayed; ///< Signal emitted when toolbar displayed
1541 Toolkit::TextInput::InputTextExceedBoundariesSignalType mInputTextExceedBoundariesSignal; ///< Signal emitted when input text exceeds the boundaries of the text-input.
1544 } // namespace Internal
1546 // Helpers for public-api forwarding methods
1548 inline Toolkit::Internal::TextInput& GetImpl(Toolkit::TextInput& textInput)
1550 DALI_ASSERT_ALWAYS(textInput);
1552 Dali::RefObject& handle = textInput.GetImplementation();
1554 return static_cast<Toolkit::Internal::TextInput&>(handle);
1557 inline const Toolkit::Internal::TextInput& GetImpl(const Toolkit::TextInput& textInput)
1559 DALI_ASSERT_ALWAYS(textInput);
1561 const Dali::RefObject& handle = textInput.GetImplementation();
1563 return static_cast<const Toolkit::Internal::TextInput&>(handle);
1566 } // namespace Toolkit
1570 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_INPUT_H__