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/actors/mesh-actor.h>
23 #include <dali/public-api/adaptor-framework/clipboard.h>
24 #include <dali/public-api/adaptor-framework/clipboard-event-notifier.h>
25 #include <dali/public-api/adaptor-framework/imf-manager.h>
26 #include <dali/public-api/adaptor-framework/timer.h>
27 #include <dali/public-api/common/dali-vector.h>
28 #include <dali/public-api/geometry/mesh.h>
31 #include <dali-toolkit/public-api/controls/control-impl.h>
32 #include <dali-toolkit/public-api/controls/text-input/text-input.h>
33 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
34 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
35 #include <dali-toolkit/internal/controls/text-input/text-input-popup-impl.h>
49 typedef IntrusivePtr<TextInput> TextInputPtr;
51 class TextInput : public Control
56 * Create a new TextInput
57 * @return instrusive ptr to a TextInput
59 static Dali::Toolkit::TextInput New();
62 * @copydoc Toolkit::TextInput::GetText
64 std::string GetText() const;
67 * @copydoc Toolkit::TextInput::GetMarkupText()
69 std::string GetMarkupText() const;
72 * @copydoc Toolkit::TextInput::SetPlaceholderText
74 void SetPlaceholderText( const std::string& placeHolderText );
77 * @copydoc Toolkit::TextInput::SetPlaceholderText
79 std::string GetPlaceholderText();
82 * @copydoc Toolkit::TextInput::SetInitialText
84 void SetInitialText(const std::string& initialText);
87 * set the text to be displayed in text-input, will overwrite any existing text.
88 * can be used to clear the text-input by passing an empty string.
89 * @param [in] initialText text to be initially displayed
91 void SetText(const std::string& initialText);
94 * @copydoc Toolkit::TextInput::SetMaxCharacterLength
96 void SetMaxCharacterLength(std::size_t maxChars);
99 * @copydoc Toolkit::TextInput::SetNumberOfLinesLimit
101 void SetNumberOfLinesLimit(std::size_t maxLines);
104 * @copydoc Toolkit::TextInput::GetNumberOfLinesLimit
106 std::size_t GetNumberOfLinesLimit() const;
109 * @copydoc Toolkit::TextInput::GetFont
111 Font GetFont() const;
114 * @copydoc Toolkit::TextInput::SetFont
116 void SetFont(Font font);
119 * @copydoc Toolkit::TextInput::InputStartedSignal()
121 Toolkit::TextInput::InputSignalType& InputStartedSignal();
124 * @copydoc Toolkit::TextInput::InputFinishedSignal()
126 Toolkit::TextInput::InputSignalType& InputFinishedSignal();
129 * @copydoc Toolkit::TextInput::CutAndPasteToolBarDisplayedSignal()
131 Toolkit::TextInput::InputSignalType& CutAndPasteToolBarDisplayedSignal();
134 * @copydoc Toolkit::TextInput::StyleChangedSignal()
136 Toolkit::TextInput::StyleChangedSignalType& StyleChangedSignal();
139 * @copydoc Toolkit::TextInput::TextModifiedSignal()
141 Toolkit::TextInput::TextModifiedSignalType& TextModifiedSignal();
144 * @copydoc Toolkit::TextInput::MaxInputCharactersReachedSignal()
146 Toolkit::TextInput::MaxInputCharactersReachedSignalType& MaxInputCharactersReachedSignal();
149 * @copydoc Toolkit::TextInput::InputTextExceedBoundariesSignal()
151 Toolkit::TextInput::InputTextExceedBoundariesSignalType& InputTextExceedBoundariesSignal();
154 * Connects a callback function with the object's signals.
155 * @param[in] object The object providing the signal.
156 * @param[in] tracker Used to disconnect the signal.
157 * @param[in] signalName The signal to connect to.
158 * @param[in] functor A newly allocated FunctorDelegate.
159 * @return True if the signal was connected.
160 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
162 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
165 * @see Toolkit::TextInput::SetEditMode(bool editMode)
166 * @see Toolkit::TextInput::SetEditMode(bool editMode, const Vector2& touchPoint)
168 * @param[in] editMode true or false to indicate editMode on or off.
169 * @param[in] setCursorOnTouchPoint Whether to use the touch point to set the cursor position.
170 * @param[in] touchPoint A position in actor coordinates within the text-input.
172 void SetEditable(bool editMode, bool setCursorOnTouchPoint, const Vector2& touchPoint = Vector2::ZERO);
175 * @copydoc Toolkit::TextInput::GetEditMode
177 bool IsEditable() const;
180 * @copydoc Toolkit::TextInput::SetTextSelectable
182 void SetTextSelectable(bool textSelectable = true);
185 * @copydoc Toolkit::TextInput::IsTextSelectable
187 bool IsTextSelectable() const;
190 * @copydoc Toolkit::TextInput::IsTextSelected
192 bool IsTextSelected() const;
195 * @copydoc Toolkit::TextInput::DeSelectText
200 * @copydoc Toolkit::TextInput::SetEditOnTouch
202 void SetEditOnTouch(bool editOnTouch);
205 * @copydoc Toolkit::TextInput::IsEditOnTouch
207 bool IsEditOnTouch() const;
210 * @copydoc Toolkit::TextInput::SetGrabHandleImage
212 void SetGrabHandleImage(Dali::Image image);
215 * @copydoc Toolkit::TextInput::SetCursorImage
217 void SetCursorImage(Dali::Image image, const Vector4& border );
220 * @copydoc Toolkit::TextInput::GetSelectionHandleSize
222 Vector3 GetSelectionHandleSize();
225 * @copydoc Toolkit::TextInput::SetRTLCursorImage
227 void SetRTLCursorImage(Dali::Image image, const Vector4& border );
230 * @copydoc Toolkit::TextInput::EnableGrabHandle
232 void EnableGrabHandle(bool toggle);
235 * @copydoc Toolkit::TextInput::IsGrabHandleEnabled
237 bool IsGrabHandleEnabled();
240 * @copydoc Toolkit::TextInput::EnableSelectionHandleFlip
242 void EnableSelectionHandleFlip( bool toggle );
245 * @copydoc Toolkit::TextInput::IsSelectionHandleFlipEnabled
247 bool IsSelectionHandleFlipEnabled();
250 * @copydoc Toolkit::TextInput::SetSelectionHandleFlipMargin
252 void SetSelectionHandleFlipMargin( const Vector4& margin );
255 * @copydoc Toolkit::TextInput::SetBoundingRectangle
257 void SetBoundingRectangle( const Rect<float>& boundingRectangle );
260 * @copydoc Toolkit::TextInput::GetBoundingRectangle
262 const Rect<float> GetBoundingRectangle() const;
265 * @copydoc Toolkit::TextInput::GetSelectionHandleFlipMargin
267 const Vector4& GetSelectionHandleFlipMargin();
270 * @copydoc Toolkit::TextInput::SetTextColor
272 void SetTextColor( const Vector4& color );
275 * @copydoc Toolkit::TextInput::SetActiveStyle
277 void SetActiveStyle( const TextStyle& style, const TextStyle::Mask mask );
280 * @copydoc Toolkit::TextInput::ApplyStyle
282 void ApplyStyle( const TextStyle& style, const TextStyle::Mask mask );
285 * @copydoc Toolkit::TextInput::ApplyStyleToAll
287 void ApplyStyleToAll( const TextStyle& style, const TextStyle::Mask mask );
290 * @copydoc Toolkit::TextInput::GetStyleAtCursor
292 TextStyle GetStyleAtCursor() const;
295 * Retrieves the character style for the given position.
296 * @param[in] position The character position which style is required.
297 * @return The style for the given position.
299 TextStyle GetStyleAt( std::size_t position ) const;
302 * @copydoc Toolkit::TextInput::SetTextAlignment()
304 void SetTextAlignment( Toolkit::Alignment::Type align );
307 * @copydoc Toolkit::TextInput::SetTextLineJustification()
309 void SetTextLineJustification( Toolkit::TextView::LineJustification justification );
312 * @copydoc Toolkit::TextInput::SetFadeBoundary()
314 void SetFadeBoundary( const Toolkit::TextView::FadeBoundary& fadeBoundary );
317 * @copydoc Toolkit::TextInput::GetFadeBoundary()
319 const Toolkit::TextView::FadeBoundary& GetFadeBoundary() const;
322 * @copydoc Toolkit::TextInput::GetTextAlignment()
324 Toolkit::Alignment::Type GetTextAlignment() const;
327 * @copydoc Toolkit::TextInput::SetMultilinePolicy()
329 void SetMultilinePolicy( Toolkit::TextView::MultilinePolicy policy );
332 * @copydoc Toolkit::TextInput::GetMultilinePolicy()
334 Toolkit::TextView::MultilinePolicy GetMultilinePolicy() const;
337 * @copydoc Toolkit::TextInput::SetWidthExceedPolicy()
339 void SetWidthExceedPolicy( Toolkit::TextView::ExceedPolicy policy );
342 * @copydoc Toolkit::TextInput::GetWidthExceedPolicy()
344 Toolkit::TextView::ExceedPolicy GetWidthExceedPolicy() const;
347 * @copydoc Toolkit::TextInput::SetHeightExceedPolicy()
349 void SetHeightExceedPolicy( Toolkit::TextView::ExceedPolicy policy );
352 * @copydoc Toolkit::TextInput::GetHeightExceedPolicy()
354 Toolkit::TextView::ExceedPolicy GetHeightExceedPolicy() const;
357 * @copydoc Toolkit::TextInput::SetExceedEnabled()
359 void SetExceedEnabled( bool enable );
362 * @copydoc Toolkit::TextInput::GetExceedEnabled()
364 bool GetExceedEnabled() const;
367 * @copydoc Toolkit::TextInput::SetBackground
369 void SetBackground(Dali::Image image );
372 * @copydoc Toolkit::TextInput::SetNumberOfLines
374 void SetNumberOfLines(std::size_t lines);
377 * @copydoc Toolkit::TextInput::GetNumberOfLines
379 std::size_t GetNumberOfLines();
382 * @copydoc Toolkit::TextInput::GetNumberOfCharacters
384 std::size_t GetNumberOfCharacters() const;
391 * Set the diffuse color for the highlight
392 * @param[in] color color to use
394 void SetMaterialDiffuseColor( const Vector4& color );
397 * Get the diffuse color used by the highlight
400 const Vector4& GetMaterialDiffuseColor() const;
405 * structure to hold each highlight box needed for text selection
409 Vector3 size; ///< size of the highlight box
410 Vector3 position; ///< position of highlight box
411 ImageActor highlightBoxActor; ///< as actor that is the highlight box
415 * structure to hold each character in displayed string and its position from the left
419 char character; ///< todo change to UTF to aid multi-language support
425 * structure to hold coordinates of each quad, which will make up the mesh.
427 struct QuadCoordinates
430 * Default constructor
438 * @param[in] x1 left co-ordinate
439 * @param[in] y1 top co-ordinate
440 * @param[in] x2 right co-ordinate
441 * @param[in] y2 bottom co-ordinate
443 QuadCoordinates(float x1, float y1, float x2, float y2)
449 Vector2 min; ///< top-left (minimum) position of quad
450 Vector2 max; ///< bottom-right (maximum) position of quad
453 typedef std::vector<QuadCoordinates> QuadContainer;
456 * structure for information required to build the highlight mesh
461 * Adds a Quad (2D rectangular sub-selection)
462 * @param[in] x1 left co-ordinate
463 * @param[in] y1 top co-ordinate
464 * @param[in] x2 right co-ordinate
465 * @param[in] y2 bottom co-ordinate
467 void AddQuad( float x1, float y1, float x2, float y2 );
470 * Clamps all quads to fit within a min -> max 2D boundary.
472 void Clamp2D(const Vector2& min, const Vector2& max);
474 QuadContainer mQuadList; ///< List of quads (sub-selections that form to create complete selection)
478 * Holds requested selection start and end points for highlighted text.
480 struct SelectionParameters
482 SelectionParameters( size_t start, size_t end )
483 : mStartOfSelection( start ), mEndOfSelection( end )
488 size_t mStartOfSelection;
489 size_t mEndOfSelection;
498 enum SelectionHandleId
500 HandleOne, ///< Selection handle one which is on the left
501 HandleTwo ///< Selection handle two which is on the right
505 * Two different behaviours are needed to convert a touch point into a character index.
506 * When a tap is received and the touch point doesn't hit any character, the final character selected might
507 * be different than the one selected if the event is a pan.
508 * i.e. If a tap is received and the touch point doesn't hit any character the expected position of the cursor
509 * would be the end or the beginning of a line. However, this behaviour would be weird while panning.
513 TapMode, ///< Touch point to character index conversion mode used for Tap events.
514 DragMode ///< Touch point to character index conversion mode used for Pan events.
518 * Used to set the direction when find the next visible character.
520 enum FindVisibleCharacterDirection
522 Left, ///< Find visible characters on the left.
523 Right, ///< Find visible characters on the right.
524 ByEnd ///< Start finding visible characters by the end.
530 virtual bool OnTouchEvent(const TouchEvent& event);
533 * From CustomActorImpl; called after the Text Input actor is touched
534 * @param[in] event The KeyEvent event.
535 * @return True if the event should be consumed.
537 virtual bool OnKeyEvent(const KeyEvent& event);
540 * From CustomActorImpl; called when this actor gains keyboard focus.
542 virtual void OnKeyInputFocusGained();
545 * From CustomActorImpl; called when this actor loses keyboard focus.
547 virtual void OnKeyInputFocusLost();
550 * From Control; called whenever the control is added to the stage.
552 virtual void OnControlStageConnection();
554 private: // From Control
557 * Creation of the layer that is used by top level active parts of the TextInput like handles
559 void CreateActiveLayer();
562 * @copydoc Control::OnInitialize()
564 virtual void OnInitialize();
567 * @copydoc Control::OnControlSizeSet()
569 virtual void OnControlSizeSet(const Vector3& targetSize);
572 * @copydoc Control::OnRelayout()
574 virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
577 * Retrieves the text-input's natural size by calling TextView::GetNaturalSize().
579 * @return The natural size.
581 virtual Vector3 GetNaturalSize();
584 * Retrieves the text-input's \e height for a given \e width by calling TextView::GetHeightForWidth().
586 * @param[in] width The given \e width.
588 * @return The \e height for the given \e width.
590 virtual float GetHeightForWidth( float width );
595 * Construct a new TextInput.
600 * A reference counted object may only be deleted by calling Unreference()
602 virtual ~TextInput();
607 TextInput(const TextInput&);
610 TextInput& operator=(const TextInput& rhs);
613 * Callback when a handle is panned/moved, either selection handles or grab handle
614 * @param actor Handle of the selection or grab handle.
615 * @param gesture Data structure with the parameters of the gesture.
617 void OnHandlePan(Actor actor, const PanGesture& gesture);
620 * Callback for touch down on Grab handle
621 * @param[in] actor touched
622 * @param[in] touch touch event
624 bool OnPressDown(Dali::Actor actor, const TouchEvent& touch);
627 * Callback for touch down on Selection handle one
628 * @param[in] actor touched
629 * @param[in] touch touch event, used to determine if down or up event
631 bool OnHandleOneTouched(Dali::Actor actor, const TouchEvent& touch);
634 * Callback for touch down on Selection handle two
635 * @param[in] actor touched
636 * @param[in] touch touch event, used to determine if down or up event
638 bool OnHandleTwoTouched(Dali::Actor actor, const TouchEvent& touch);
641 * Callback for tap on TextInput
643 * @param[in] tap touch event
645 void OnTextTap(Dali::Actor actor, const Dali::TapGesture& tap);
648 * Callback for double tap on TextInput
650 * @param[in] tap touch event
652 void OnDoubleTap(Dali::Actor actor, const Dali::TapGesture& tap);
655 * Callback for long press on TextInput
657 * @param[in] longPress long press event
659 void OnLongPress(Dali::Actor actor, const Dali::LongPressGesture& longPress);
662 * Callback for the ClipboardEventNotifier when text is selected in the clipboard window.
663 * @param[in] notifier The Clipboard Event Notifier.
665 void OnClipboardTextSelected( ClipboardEventNotifier& notifier );
668 * Callback for when a button is pressed in popup panel
669 * @param[in] button handle to the button pressed.
671 bool OnPopupButtonPressed( Toolkit::Button button );
674 * Callback when handle timer ticks.
676 * Cursor should become visible/invisible to simulate blinking.
678 * @return True if the timer should be keep running.
680 bool OnCursorBlinkTimerTick();
683 * Invoked upon popup Hide animation completing.
684 * @note Only called for animating hide, not called for instantaneous (animate = false)
685 * @param[in] popup The popup which was hidden.
687 void OnPopupHideFinished(TextInputPopup& popup);
690 * Called in OnKeyEvent to handle key down events.
691 * @param[in] event The KeyEvent event.
692 * @return True if the event should be consumed.
694 bool OnKeyDownEvent(const KeyEvent& event);
697 * Called in OnKeyEvent to handle key up events.
698 * @param[in] event The KeyEvent event.
699 * @return True if the event should be consumed.
701 bool OnKeyUpEvent(const KeyEvent& event);
704 * Chooses from all handle position and alternative handle positions where to set the position of the two selection handles.
706 * @param[in] cursorPositionOne The initial position of the first selection handle.
707 * @param[in] cursorPositionTwo The initial position of the second selection handle.
708 * @param[in] altPositionValidOne Whether there is an alternative position for the first selection handle.
709 * @param[in] altPositionValidTwo Whether there is an alternative position for the second selection handle.
710 * @param[in] altPositionOne The alternative position of the first selection handle.
711 * @param[in] altPositionTwo The alternative position of the second selection handle.
713 void ChooseRtlSelectionHandlePosition( const Vector3& cursorPositionOne,
714 const Vector3& cursorPositionTwo,
715 bool altPositionValidOne,
716 bool altPositionValidTwo,
717 const Vector3& altPositionOne,
718 const Vector3& altPositionTwo );
720 * Callback called when the text-view is scrolled.
722 * Updates the selection and grab handles, and the highlighted text.
724 * @param[in] textView Handle of the text-view.
725 * @param[in] scrollPosition The difference with the previous scroll position.
727 void OnTextViewScrolled( Toolkit::TextView textView, Vector2 scrollPosition );
730 * Scrolls the text-view to make the cursor visible.
732 * @param[in] cursorPosition The actual cursor position in actor coordinates.
734 void ScrollTextViewToMakeCursorVisible( const Vector3& cursorPosition );
737 * Creates and starts a timer to scroll the text when handles are close to the edges of the text-input.
739 * It only starts the timer if it's already created.
741 void StartScrollTimer();
744 * Stops the timer used to scroll the text.
746 void StopScrollTimer();
749 * Callback called by the timer used to scroll the text.
751 * It calculates and sets a new scroll position.
753 bool OnScrollTimerTick();
755 public: // Public to allow internal testing.
758 * Register for touch events
760 void SetUpTouchEvents();
763 * Sets up TextView Actor
765 void CreateTextViewActor();
768 * Set Styled Text for text input.
769 * @param[in] styleText The new styled text for the text input.
771 void SetText( const MarkupProcessor::StyledTextArray& styleText );
774 * Start a timer to signal cursor to blink.
776 void StartCursorBlinkTimer();
779 * Stop the timer signalling the cursor to blink.
781 void StopCursorBlinkTimer();
784 * Starts input, setting focus and showing keyboard..
786 void StartEditMode();
789 * Called when End of input and focus no longer required, keyboard is hidden.
794 * Applies a style to the current pre-edit / predicted word to show it is being edited.
795 * @param[in] preEditStartPosition position in text array that the predicted word starts at
796 * @param[in] preEditStringLength used to calculate how many characters need their style changed.
798 void ApplyPreEditStyle( std::size_t preEditStartPosition, std::size_t preEditStringLength );
801 * Restores style to value before applying Pre-Edit style.
803 void RemovePreEditStyle();
806 * Event received from IMF manager
807 * @return ImfCallbackData data struture undicating if update is needed, cursor position and current text
809 ImfManager::ImfCallbackData ImfEventReceived( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& test );
812 * Called when the OnKey event is a Pre-edit string
813 * @param[in] keyString String received in Pre-edit
814 * @param[in] cursorOffset the cursor offset from where the pre-edit word starts
815 * @return bool true if preedit reset is required.
817 bool PreEditReceived( const std::string& keyString, std::size_t cursorOffset );
820 * Called when the OnKey event is a Commit string
821 * @param[in] keyString String received in Comment
822 * @return update flag to trigger cursor update of TextInput only when needed.
824 bool CommitReceived( const std::string& keyString );
827 * Deletes Pre-edit string
828 * By default it doesn't update the character's size and position table, which is a costly
829 * operation. As in many cases deletion and insertion (InsertAt) of text
830 * occurs in the same action i.e. preedit/commit. It makes sense to
831 * delete without updating, and then insert with updating.
833 * @return The number of characters to be deleted.
835 std::size_t DeletePreEdit();
838 * Reset all pre-edit flag and signal IMF keyboard that the current pre-edit word has been comitted.
839 * This may be due to the cursor being moved by user or reached the max character limit.
840 * @param[in] preserveCursorPosition Set true to keep cursor in current position, eg. touch event caused cursor to move.
842 void PreEditReset( bool preserveCursorPosition );
845 * Called after cursor position needs updating.
846 * Redraws cursor and notifies VirtualKeyboard
851 * Delete highlighted characters
852 * @param[in] inheritStyle Whether style from previous character in the string should be inherited.
854 void DeleteHighlightedText( bool inheritStyle );
857 * Delete range of characters
858 * @param[in] start position of characters to delete
859 * @param[in] ncharacters number of characters to delete
861 void DeleteRange(std::size_t start, std::size_t ncharacters);
864 * Delete character at current cursor position and redisplay
865 * @param[in] positionToDelete position of character to delete
867 void DeleteCharacter( std::size_t positionToDelete );
870 * Add or replaces characters to currently displayed string at cursor position
871 * By default it doesn't update the character's size and position table, which is a costly
872 * operation. As in many cases deletion and insertion (InsertAt) of text
873 * occurs in the same action i.e. preedit/commit. It makes sense to
874 * delete without updating, and then insert with updating.
875 * @param[in] newText string to add to TextInput display string.
876 * @param[in] insertionPosition position to insert at.
877 * @param[in] numberOfCharactersToReplace The number of characters to replace.
878 * @return number of characters to offset the cursor by.
880 std::size_t InsertAt( const Text& newText, const std::size_t insertionPosition, const std::size_t numberOfCharactersToReplace );
884 * @param[in] color the cursor color.
885 * @return the image actor to be used as the cursor.
887 ImageActor CreateCursor( const Vector4 &color );
890 * Moves cursor to the right
891 * param[in] reverse if true then cursor moves in the reverse direction (to the left)
892 * param[in] places number of character cursor should move.
894 void AdvanceCursor(bool reverse = false, std::size_t places = 1);
897 * Draw a cursor / caret at position where new text should appear
902 * Sets cursor visibility
903 * This sets visibility of the cursor. Which is comprised of 2
904 * cursors. The conventional cursor, and the alternate (RTL) cursor,
905 * which only appears when the cursor is at a character that can have
906 * a character appended to different visual positions depending on whether that
907 * character to be appended is RTL or LTR.
908 * @param[in] visible true - enable visibility for cursor, false - disable visiblity for cursor
910 void SetCursorVisibility( bool visible );
913 * Sets alternate cursor enable state
914 * @see SetCursorVisibility
915 * alternate cursor will only be visible if both SetCursorVisiblity
916 * and cursor enabled have been set to true.
918 void SetAltCursorEnabled( bool enabled );
921 * Create the grab handle that positions the cursor
922 * @param[in] image to be used for grab handle
925 void CreateGrabHandle(Image image=Image());
928 * Create Grab area to be used by Grab Handle
930 void CreateGrabArea( Actor& parent);
933 * Move grab handle to the required character position
935 * @param[in] displacement Displacement of the grab handle in actor coordinates.
937 * @return The new actual position the handle has been set to.
939 Vector3 MoveGrabHandle( const Vector2& displacement );
942 * Show or hide the grab handle without baking the visibility flag.
943 * Used when the Grab handle needs to be invisible due to text-view scrolling making it out of view
945 * @param[in] visible bool flag to set as true is grab handle should be shown, else false to hide.
947 void ShowGrabHandle( bool visible );
950 * Show or hide the grab handle and bake the visibility flag.
951 * 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.
952 * Calls ShowGrabHandle.
954 * @param[in] visible bool flag to set as true is grab handle should be shown, else false to hide.
956 void ShowGrabHandleAndSetVisibility( bool visible );
958 /* Boundary Property Notifications when handle exceed bounding box*/
961 * PropertyNotification Callback when left boundary exceeded so handle can be flipped.
962 * @param[in] source PropertyNotification
964 void OnLeftBoundaryExceeded( PropertyNotification& source );
966 * PropertyNotification Callback when within left boundary so handle can be flipped back.
967 * @param[in] source PropertyNotification
969 void OnReturnToLeftBoundary( PropertyNotification& source );
971 * PropertyNotification Callback when right boundary exceeded so handle can be flipped.
972 * @param[in] source PropertyNotification
974 void OnRightBoundaryExceeded( PropertyNotification& source );
976 * * PropertyNotification Callback when within right boundary so handle can be flipped back.
977 * @param[in] source PropertyNotification
979 void OnReturnToRightBoundary( PropertyNotification& source );
982 * PropertyNotification Callbacks for hiding handle one when it exceeds boundary.
983 * @param[in] source PropertyNotification
985 void OnHandleOneLeavesBoundary( PropertyNotification& source );
987 * PropertyNotification Callbacks for showing hidden handle one when returns within boundary
988 * @param[in] source PropertyNotification
990 void OnHandleOneWithinBoundary( PropertyNotification& source );
992 * PropertyNotification Callbacks for hiding handle two it when exceeds boundary.
993 * @param[in] source PropertyNotification
995 void OnHandleTwoLeavesBoundary( PropertyNotification& source );
997 * PropertyNotification Callbacks for showing hidden handle two when returns within boundary
998 * * @param[in] source PropertyNotification
1000 void OnHandleTwoWithinBoundary( PropertyNotification& source );
1003 * Set up property notifications on the position of the handles to facilitate flipping and hiding when at screen boundary.
1005 void SetUpHandlePropertyNotifications();
1008 * Create the selection handles that bound text to be selected for copy/cut.
1009 * @param[in] start initial position of start selection handle.
1010 * @param[in] end initial position of end selection handle.
1011 * @param[in] handleOneImage (optional) to be used for selection handle
1012 * @param[in] handleTwoImage (optional) to be used for selection handle
1014 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() );
1017 * Move the selection handles to required positions in text.
1019 * @param[in] handleId the handle to position
1020 * @param[in] displacement Displacement of the selection handle in actor coordinates.
1022 * @return The new actual position the handle has been set to.
1024 Vector3 MoveSelectionHandle(SelectionHandleId handleId, const Vector2& displacement);
1027 * Calculate and position the specified selection handle the given index position
1029 * @param[in] handleId the handle to position
1031 void SetSelectionHandlePosition(SelectionHandleId handleId);
1034 * Gets a table of the visual text positions which has a flag
1035 * for each Character. The flag is either true (character selected)
1036 * or false (character deselected)
1037 * @note startSelection can be greater or less than endSelection
1039 * @param[in,out] selectedVisualText The vector to be resized and populated with the selected flags
1040 * @param[in] startSelection The start selection point for the text
1041 * @param[in] endSelection The end selection point for the text
1043 void GetVisualTextSelection(std::vector<bool>& selectedVisualText, std::size_t startSelection, std::size_t endSelection);
1046 * Iterates between selection handles and computes the info required to build the highlight mesh
1048 HighlightInfo CalculateHighlightInfo();
1051 * 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.
1053 HighlightInfo CalculateHighlightInfoRtl();
1056 * Calculates new Mesh data so highlight moves with selection handles.
1058 void UpdateHighlight();
1061 * Removes popup, and its options.
1066 * Adds Popup options which have been enabled.
1068 void AddPopupOptions();
1071 * Sets popup position
1072 * @param[in] position The actual position for this popup.
1073 * @param[in] alternativePosition Alternative popup position if no space in upper area.
1075 void SetPopupPosition(const Vector3& position, const Vector2& alternativePosition );
1079 * @param[in] animate (optional) whether to animate popup to hide state over time (i.e. tween).
1080 * @param[in] signalFinished (optional) whether to perform an animation finish operation after the hide animation completes. Requires animate to be true.
1082 void HidePopup( bool animate = true, bool signalFinished = true );
1086 * @param[in] animate (optional) whether to animate popup to show state over time (i.e. tween).
1088 void ShowPopup(bool animate = true);
1091 * Shows the cut-copy-paste popup
1093 void ShowPopupCutCopyPaste();
1096 * Setup the selection popup and clipboard if relevant so the correct options are shown when ShowPopup is called.
1097 * @param[in] showCutButton Flag to show or hide cut button, in some cases like whitespace we do not want to cut just select.
1100 void SetUpPopupSelection( bool showCutButton = true );
1103 * Return the logical index containing the character position closest to the source.
1104 * Used for positioning the grab handle at characters when dragged along.
1105 * Two different behaviours are needed in case the source point doesn't actually touch a
1106 * character. @see TouchToIndex.
1107 * @param[in] source float to match against
1108 * @param[out] closestIndex index to the vector of character's size and position.
1109 * @return \e true if the source point is actually inside the geometry provided by TextView.
1111 bool ReturnClosestIndex(const Vector2& source, std::size_t& closestIndex );
1114 * Returns the X-position of the current line justification
1115 * (relative to left of text-view container)
1116 * @return X position for line justification
1118 float GetLineJustificationPosition() const;
1121 * Currently the cursor is positioned at the previous characters position plus it's width.
1122 * If the previous character is on a different line then this function returns the correct position.
1123 * @param[in] characterPosition the character position index that the cursor should be at
1124 * @return position of cursor/handle
1126 Vector3 PositionCursorAfterWordWrap( std::size_t characterPosition ) const;
1130 * Return a vector which is the actual position for the given character position
1131 * The character position is where a cursor would be position for that character.
1132 * @param[in] characterPosition the logical (input) position in the 'string' of characters.
1134 * @return Vector3 the actual x,y,z position
1136 Vector3 GetActualPositionFromCharacterPosition(std::size_t characterPosition ) const;
1139 * Return a vector which is the actual position for the given character position
1140 * The character position is where a cursor would be positioned for that character to be inserted.
1141 * An additional alternatePosition is also set in circumstances where the possible writing
1142 * of characters would be in the opposite direction.
1143 * e.g. "HelloشقشلاهؤEnglish"
1146 * [*] - Primary actual position for cursor i.e. continuing writing LTR (English)
1147 * [+] - Alternate actual position for cursor i.e. writing RTL (Arabic)
1149 * @param[in] characterPosition the logical (input) position in the 'string' of characters.
1150 * @param[out] directionRTL Whether the actual x,y,z position is after LTR (false) or RTL (true) text.
1151 * @param[out] alternatePosition the actual x,y,z position of the cursor if user types
1152 * in alternate direction to current flow of text.
1153 * @param[out] alternatePositionValid whether this alternate position is valid.
1154 * @return Vector3 the actual x,y,z position
1156 Vector3 GetActualPositionFromCharacterPosition(std::size_t characterPosition, bool& directionRTL, Vector3& alternatePosition, bool& alternatePositionValid ) const;
1159 * Retrieve the character position of the first character on the row of text
1160 * that this character resides on.
1161 * @param[in] logicalPosition the position in the 'string' of characters.
1162 * @return logical character position of start of row.
1164 std::size_t GetRowStartFromCharacterPosition(std::size_t logicalPosition) const;
1167 * Retrieves the first character of a group of characters with the same direction.
1169 * @param[in] logicalPosition Index to a character.
1171 * @return Index to the character.
1173 std::size_t GetFirstCharacterWithSameDirection( std::size_t logicalPosition ) const;
1176 * Retrieve the dimensions of this row of text that the character resides on.
1177 * @param[in] characterPosition the position in the 'string' of characters.
1178 * @return The size of the rectangle representing this row
1180 Size GetRowRectFromCharacterPosition(std::size_t characterPosition) const;
1183 * Retrieve the dimensions (and min-max) of this row of text that the character resides on.
1184 * @param[in] characterPosition the position in the 'string' of characters.
1185 * @param[out] min the top-left position of the rectangle representing this row
1186 * @param[out] max the bottom-right position of the rectangle representing this row
1187 * @return The size of the rectangle representing this row (max - min)
1189 Size GetRowRectFromCharacterPosition(std::size_t characterPosition, Vector2& min, Vector2& max) const;
1192 * Checks if the provided touchedActor was this text-input
1193 * @param[in] touchedActor the touched actor that will be checked against this text-input
1194 * @return true if the touchActor was the text-input or one of its children
1196 bool WasTouchedCheck( const Actor& touchedActor ) const;
1199 * Connect to the stage touch event
1201 void StartMonitoringStageForTouch();
1204 * Disconnect from the stage touch event
1206 void EndMonitoringStageForTouch();
1209 * Callback for when the screen is touched, this will be connected when selection starts and disconnected when it ends.
1210 * @param[in] event The touch event
1212 void OnStageTouched(const TouchEvent& event);
1216 * Select the text between the given values
1217 * @param[in] start position within array to start selection
1218 * @param[in] end position within array to end selection
1220 void SelectText(std::size_t start, std::size_t end);
1223 * Gets selected text and returns it as a StyleText vector
1224 * @return StyledText vector that is selected.
1226 MarkupProcessor::StyledTextArray GetSelectedText();
1229 * Applies the given style to all text, selected or not selected.
1230 * By default all style settings are applied but a bit mask could be used to modify only certain style settings.
1232 void ApplyStyleToRange(const TextStyle& style, const TextStyle::Mask mask, const std::size_t begin, const std::size_t end);
1235 * Callback for when the keyboard status changes
1236 * @param[in] keyboardShown Whether the keyboard has just been shown or not.
1238 void KeyboardStatusChanged(bool keyboardShown);
1241 * Hide highlight shown between selection handles.
1242 * @param[in] hidePopup flag to hide the popup too, default is to hide popup.
1244 void RemoveHighlight( bool hidePopup = true );
1247 * Highlights text that has been selected
1249 void CreateHighlight();
1252 * Copies selected text to clipboard
1253 * @return bool true if copy was successful.
1255 bool CopySelectedTextToClipboard();
1258 * Pastes the given text to currently displayed string at the current cursor position
1259 * @param[in] text Text to be pasted
1261 void PasteText( const Text& text );
1264 * Sets the direction of the text if it is empty.
1266 void SetTextDirection();
1269 * Updates the line height accordingly with the current text input style.
1271 void UpdateLineHeight();
1274 * Finds a visible character.
1276 * The \e direction parameters specifies from where to start to look for a visible character. \e Left means start by characters in lower
1277 * positions than \e cursorPosition, \e Right means start by characters in greater positions than \e cursorPosition and \e ByEnd starts
1278 * by the last characters.
1280 * If \e Left or \e Right is provided and any character is found, then looks in the other direction.
1282 * @param[in] direction Direction used to find a visible character.
1283 * @param[in] cursorPosition Starting position.
1285 * @return The found visible character.
1287 std::size_t FindVisibleCharacter( const FindVisibleCharacterDirection direction , const std::size_t cursorPosition ) const;
1290 * @copydoc SetSortModifier()
1292 void SetSortModifier( float depthOffset );
1295 * @copydoc SetSnapshotModeEnabled()
1297 void SetSnapshotModeEnabled( bool enable );
1300 * @copydoc IsSnapshotModeEnabled()
1302 bool IsSnapshotModeEnabled() const;
1305 * @copydoc SetScrollEnabled()
1307 void SetScrollEnabled( bool enable );
1310 * @copydoc IsScrollEnabled()
1312 bool IsScrollEnabled() const;
1315 * @copydoc SetScrollPosition()
1317 void SetScrollPosition( const Vector2& position );
1320 * @copydoc GetScrollPosition()
1322 Vector2 GetScrollPosition() const;
1325 * @brief Sets whether markup processing should be carried out.
1327 * @param[in] enable whether markup processing is carried out or not.
1329 void SetMarkupProcessingEnabled( bool enable );
1332 * @brief Returns whether markup processing is enabled or not
1334 * @return true is markup processing is enabled
1336 bool IsMarkupProcessingEnabled() const;
1339 * Insert or replaces the given text in the given position. It checks if the text exceeds the maximum allowed number of characters
1340 * and if it fits in the text-input's boundaries.
1342 * @param[in] text Text to be inserted.
1343 * @param[in] position Position where the text is inserted.
1344 * @param[in] numberOfCharactersToReplace The number of characters to replace.
1345 * @param[out] textExceedsMaximunNumberOfCharacters The number of characters that have been inserted.
1346 * @param[out] textExceedsBoundary Whether the inserted text has exceeded the boundaries of the text-input.
1348 * @return The number of characters that have been inserted.
1350 std::size_t DoInsertAt( const Text& text, std::size_t position, std::size_t numberOfCharactersToReplace, bool& textExceedsMaximunNumberOfCharacters, bool& textExceedsBoundary );
1353 * Retrieve Text-view's layout info.
1355 void GetTextLayoutInfo();
1358 * Set the offset for positioning Popup from the TextInput
1359 * @param[in] offset in the order, left, top, right, bottom
1361 void SetOffsetFromText( const Vector4& offset );
1364 * Get the offset of the Popup from the TextInput
1365 * @return Vector4 with the offset in the order, left, top, right, bottom
1367 const Vector4& GetOffsetFromText() const;
1370 * Show the Placeholder text with an already created StyleTextArray
1371 * @param[in] stylePlaceHolderText Required placeholder text to be used
1373 void ShowPlaceholderText( const MarkupProcessor::StyledTextArray& stylePlaceHolderText );
1378 * Called when a property of an object of this type is set.
1379 * @param[in] object The object whose property is set.
1380 * @param[in] index The property index.
1381 * @param[in] value The new property value.
1383 static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
1386 * Called to retrieve a property of an object of this type.
1387 * @param[in] object The object whose property is to be retrieved.
1388 * @param[in] index The property index.
1389 * @return The current value of the property.
1391 static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
1394 * Emits the style changed signal.
1396 void EmitStyleChangedSignal();
1399 * Emit signal when text is modified.
1401 void EmitTextModified();
1404 * Emits max input characters reached signal.
1406 void EmitMaxInputCharactersReachedSignal();
1409 * Emits a signal when the input text exceeds the boundaries of the text-input.
1411 void EmitInputTextExceedsBoundariesSignal();
1415 State mState; ///< Current State of Text input.
1416 MarkupProcessor::StyledTextArray mStyledText; ///< String currently displayed by TextView with style info.
1417 TextStyle mInputStyle; ///< Stores the current input style.
1418 float mLineHeight; ///< Stores the current line height accordingly with the input style.
1419 Toolkit::TextView mDisplayedTextView; ///< Actor which actually display text
1421 MarkupProcessor::StyledTextArray mStyledPlaceHolderText; ///< Text used as place holder with style info.
1423 std::size_t mMaxStringLength; ///< Max number of characters for string
1424 std::size_t mNumberOflinesLimit; ///< Limit on the number of lines this TextInput will display.
1426 ImageActor mCursor; ///< Cursor overlayed on Text to show where new text will be inserted
1427 ImageActor mCursorRTL; ///< Right To Left Cursor overlayed on Text (where new RTL text would be inserted)
1428 Animation mCursorAnimation; ///< animator for cursor blinking.
1429 std::size_t mCursorPosition; ///< position along string cursor is at.
1430 Timer mCursorBlinkTimer; ///< Timer to signal cursor to blink
1432 Layer mActiveLayer; ///< Layer for active handles and alike that ensures they are above all else.
1434 Image mGrabHandleImage; ///< image to be used for grab handle
1435 ImageActor mGrabHandle; ///< Handle used to move cursor for editing
1437 Actor mGrabArea; ///< invisible actor that receives pans events for the grab handle.
1438 PanGestureDetector mPanGestureDetector; ///< Pan gesture for handles
1439 TapGestureDetector mTapDetector; ///< used to start editing
1440 TapGestureDetector mDoubleTapDetector; ///< double tap detector
1442 Vector3 mActualGrabHandlePosition; ///< actual position of grab handle, this might not be snapped to a character
1444 LongPressGestureDetector mLongPressDetector; ///< Gesture to start selection
1446 /*Selection handles*/
1447 Image mSelectionHandleOneImage; ///< image used for selection handle one
1448 Image mSelectionHandleOneImagePressed; ///< image used for selection handle one pressed state
1449 Image mSelectionHandleTwoImage; ///< image used for selection handle two
1450 Image mSelectionHandleTwoImagePressed; ///< image used for selection handle two pressed state
1452 bool mIsSelectionHandleOneFlipped:1; ///< Flag to know whether the handle one is flipped or not.
1453 bool mIsSelectionHandleTwoFlipped:1; ///< Flag to know whether the handle two is flipped or not.
1454 Vector3 mSelectionHandleOneOffset; ///< Handle One's Offset
1455 Vector3 mSelectionHandleTwoOffset; ///< Handle Two's Offset
1456 Vector3 mSelectionHandleOneActualPosition; ///< Actual x y position of handle
1457 Vector3 mSelectionHandleTwoActualPosition; ///< Actual x y position of handle
1458 std::size_t mSelectionHandleOnePosition; ///< Position of handle along the string of text
1459 std::size_t mSelectionHandleTwoPosition; ///< Position of handle along the string of text
1460 ImageActor mSelectionHandleOne; ///< First selection handle used for selecting text to cut&paste
1461 ImageActor mSelectionHandleTwo; ///< Second selection handle used for selecting text to cut&paste
1462 Actor mHandleOneGrabArea; ///< invisible actor that receives pans events for the selection handle.
1463 Actor mHandleTwoGrabArea; ///< invisible actor that receives pans events for the selection handle.
1465 Mesh mHighlightMesh; ///< Mesh Data for highlight
1466 MeshActor mHighlightMeshActor; ///< Mesh Actor to display highlight
1467 MeshData mMeshData; ///< Container to hold meshData for highlight
1468 Material mCustomMaterial; ///< Custom material used for highlight
1469 HighlightInfo mNewHighlightInfo; ///< Geometry info to create highlight.
1471 Text mPreEditString; ///< Holds current input string prior to it being committed.
1472 std::size_t mPreEditStartPosition; ///< Cursor position for start of pre-edit string
1473 std::size_t mPreEditLength; ///< Cursor position for length of current pre-edit string after purging characters that do not fit.
1474 std::size_t mNumberOfSurroundingCharactersDeleted; ///< Stores the number of surrounding characters deleted.
1475 unsigned long mTouchStartTime; ///< Touch Start time (time in ms when down press began)
1477 Toolkit::TextView::TextLayoutInfo mTextLayoutInfo; ///< It contains a table layout info per character sorted by the character's visual index (retrieved from TextView),
1478 ///< a reorder map that stores each character's visual (output) index according to its logical (input) index,
1479 ///< a reorder map that stores each character's logical (input) index according to its visual (output) index,
1480 ///< the text size after layout and the scroll offset.
1482 MarkupProcessor::StyledTextArray mCurrentCopySelecton; ///< Array to store copied text.
1483 TextInputPopup mPopupPanel; ///< Panel to house cut and paste, select all buttons.
1486 Vector2 mScrollDisplacement;
1487 Vector3 mCurrentHandlePosition;
1488 SelectionHandleId mCurrentSelectionId;
1489 Vector3 mCurrentSelectionHandlePosition;
1490 SelectionParameters mRequestedSelection;
1491 Vector4 mSelectionHandleFlipMargin;
1492 Vector4 mBoundingRectangleWorldCoordinates;
1494 Clipboard mClipboard; ///< Handle to clipboard
1497 Vector4 mMaterialColor; // Color of the highlight
1498 Vector4 mPopupOffsetFromText; // Offset of Popup from the TextInput.
1500 bool mOverrideAutomaticAlignment:1; ///< Whether to override the alignment automatically set by the text content (e.g. european LTR or arabic RTL)
1501 bool mCursorRTLEnabled:1; ///< Enable state of Alternate RTL Cursor (need to keep track of this as it's not always enabled)
1502 bool mClosestCursorPositionEOL:1; ///< closest cursor position is end of line.
1503 bool mCursorBlinkStatus:1; ///< \e true shows the cursor, \e false hiddes it.
1505 bool mCursorVisibility:1; ///< Visibility status of Cursor
1506 bool mGrabHandleVisibility:1; ///< Visibility status of the grab handle.
1508 bool mIsCursorInScrollArea:1; ///< Whether the cursor is inside the boundaries of the text-input.
1509 bool mIsGrabHandleInScrollArea:1; ///< Whether the grab handle is inside the boundaries of the text-input.
1511 bool mEditModeActive:1; ///< true to indicate TextInput is in edit mode.
1512 bool mEditOnTouch:1; ///< true indicates edit mode starts by touching/tapping the TextInput
1513 bool mTextSelection:1; ///< true indicates text selection is enabled.
1514 bool mExceedEnabled:1; ///< Whether text-input editing text beyond its boundary is enabled or not. By default is enabled.
1515 bool mGrabHandleEnabled:1; ///< Flag to enable the grab handle instead of the default magnifier.
1516 bool mIsSelectionHandleFlipEnabled:1; ///< Flag to enable the selection handle flip
1518 bool mPreEditFlag:1; ///< Flag to indicate if key string received is still in pre-edit mode (Ecore IMF keyboard)
1519 bool mIgnoreCommitFlag:1; ///< Flag to indicate if the commit string should be ignored, maybe due to a keyboard reset.
1520 bool mIgnoreFirstCommitFlag:1; ///< Whether to ignore the first commit.
1521 bool mSelectingText:1; ///< Ignore surrounding text as selecting text
1523 bool mPreserveCursorPosition:1; ///< Indicates that the commit message is from a reset and does not require the cursor to be moved
1525 bool mSelectTextOnCommit:1;
1527 bool mUnderlinedPriorToPreEdit:1; ///< As predictive text adds underline style this flag enables us to revert back or keep underline.
1529 bool mCommitByKeyInput:1; ///< Set if a commit is done by key input rather than automatically (usually when a space bar or enter is pressed).
1531 bool mPlaceHolderSet:1; ///< Whether the place holder text is set.
1532 bool mMarkUpEnabled:1; ///< enable to scan for mark-up
1534 Toolkit::TextInput::InputSignalType mInputStartedSignal; ///< Signal emitted when input starts
1535 Toolkit::TextInput::InputSignalType mInputFinishedSignal; ///< Signal emitted when input ends
1536 Toolkit::TextInput::StyleChangedSignalType mStyleChangedSignal; ///< Signal emitted when style changes.
1537 Toolkit::TextInput::TextModifiedSignalType mTextModifiedSignal; ///< Signal emitted when text modified.
1538 Toolkit::TextInput::MaxInputCharactersReachedSignalType mMaxInputCharactersReachedSignal; ///< Signal emitted when max input characters is reached.
1539 Toolkit::TextInput::InputSignalType mCutAndPasteToolBarDisplayed; ///< Signal emitted when toolbar displayed
1540 Toolkit::TextInput::InputTextExceedBoundariesSignalType mInputTextExceedBoundariesSignal; ///< Signal emitted when input text exceeds the boundaries of the text-input.
1543 } // namespace Internal
1545 // Helpers for public-api forwarding methods
1547 inline Toolkit::Internal::TextInput& GetImpl(Toolkit::TextInput& textInput)
1549 DALI_ASSERT_ALWAYS(textInput);
1551 Dali::RefObject& handle = textInput.GetImplementation();
1553 return static_cast<Toolkit::Internal::TextInput&>(handle);
1556 inline const Toolkit::Internal::TextInput& GetImpl(const Toolkit::TextInput& textInput)
1558 DALI_ASSERT_ALWAYS(textInput);
1560 const Dali::RefObject& handle = textInput.GetImplementation();
1562 return static_cast<const Toolkit::Internal::TextInput&>(handle);
1565 } // namespace Toolkit
1569 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_INPUT_H__