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
58 TEXTINPUT_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
59 TEXTINPUT_PROPERTY_END_INDEX = TEXTINPUT_PROPERTY_START_INDEX + 512 ///< Reserving property indices
63 * Create a new TextInput
64 * @return instrusive ptr to a TextInput
66 static Dali::Toolkit::TextInput New();
69 * @copydoc Toolkit::TextInput::GetText
71 std::string GetText() const;
74 * @copydoc Toolkit::TextInput::GetMarkupText()
76 std::string GetMarkupText() const;
79 * @copydoc Toolkit::TextInput::SetPlaceholderText
81 void SetPlaceholderText( const std::string& placeHolderText );
84 * @copydoc Toolkit::TextInput::SetPlaceholderText
86 std::string GetPlaceholderText();
89 * @copydoc Toolkit::TextInput::SetInitialText
91 void SetInitialText(const std::string& initialText);
94 * set the text to be displayed in text-input, will overwrite any existing text.
95 * can be used to clear the text-input by passing an empty string.
96 * @param [in] initialText text to be initially displayed
98 void SetText(const std::string& initialText);
101 * @copydoc Toolkit::TextInput::SetMaxCharacterLength
103 void SetMaxCharacterLength(std::size_t maxChars);
106 * @copydoc Toolkit::TextInput::SetNumberOfLinesLimit
108 void SetNumberOfLinesLimit(std::size_t maxLines);
111 * @copydoc Toolkit::TextInput::GetNumberOfLinesLimit
113 std::size_t GetNumberOfLinesLimit() const;
116 * @copydoc Toolkit::TextInput::GetFont
118 Font GetFont() const;
121 * @copydoc Toolkit::TextInput::SetFont
123 void SetFont(Font font);
126 * @copydoc Toolkit::TextInput::InputStartedSignal()
128 Toolkit::TextInput::InputSignalType& InputStartedSignal();
131 * @copydoc Toolkit::TextInput::InputFinishedSignal()
133 Toolkit::TextInput::InputSignalType& InputFinishedSignal();
136 * @copydoc Toolkit::TextInput::CutAndPasteToolBarDisplayedSignal()
138 Toolkit::TextInput::InputSignalType& CutAndPasteToolBarDisplayedSignal();
141 * @copydoc Toolkit::TextInput::StyleChangedSignal()
143 Toolkit::TextInput::StyleChangedSignalType& StyleChangedSignal();
146 * @copydoc Toolkit::TextInput::TextModifiedSignal()
148 Toolkit::TextInput::TextModifiedSignalType& TextModifiedSignal();
151 * @copydoc Toolkit::TextInput::MaxInputCharactersReachedSignal()
153 Toolkit::TextInput::MaxInputCharactersReachedSignalType& MaxInputCharactersReachedSignal();
156 * @copydoc Toolkit::TextInput::InputTextExceedBoundariesSignal()
158 Toolkit::TextInput::InputTextExceedBoundariesSignalType& InputTextExceedBoundariesSignal();
161 * Connects a callback function with the object's signals.
162 * @param[in] object The object providing the signal.
163 * @param[in] tracker Used to disconnect the signal.
164 * @param[in] signalName The signal to connect to.
165 * @param[in] functor A newly allocated FunctorDelegate.
166 * @return True if the signal was connected.
167 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
169 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
172 * @see Toolkit::TextInput::SetEditMode(bool editMode)
173 * @see Toolkit::TextInput::SetEditMode(bool editMode, const Vector2& touchPoint)
175 * @param[in] editMode true or false to indicate editMode on or off.
176 * @param[in] setCursorOnTouchPoint Whether to use the touch point to set the cursor position.
177 * @param[in] touchPoint A position in actor coordinates within the text-input.
179 void SetEditable(bool editMode, bool setCursorOnTouchPoint, const Vector2& touchPoint = Vector2::ZERO);
182 * @copydoc Toolkit::TextInput::GetEditMode
184 bool IsEditable() const;
187 * @copydoc Toolkit::TextInput::SetTextSelectable
189 void SetTextSelectable(bool textSelectable = true);
192 * @copydoc Toolkit::TextInput::IsTextSelectable
194 bool IsTextSelectable() const;
197 * @copydoc Toolkit::TextInput::IsTextSelected
199 bool IsTextSelected() const;
202 * @copydoc Toolkit::TextInput::DeSelectText
207 * @copydoc Toolkit::TextInput::SetEditOnTouch
209 void SetEditOnTouch(bool editOnTouch);
212 * @copydoc Toolkit::TextInput::IsEditOnTouch
214 bool IsEditOnTouch() const;
217 * @copydoc Toolkit::TextInput::SetGrabHandleImage
219 void SetGrabHandleImage(Dali::Image image);
222 * @copydoc Toolkit::TextInput::SetCursorImage
224 void SetCursorImage(Dali::Image image, const Vector4& border );
227 * @copydoc Toolkit::TextInput::GetSelectionHandleSize
229 Vector3 GetSelectionHandleSize();
232 * @copydoc Toolkit::TextInput::SetRTLCursorImage
234 void SetRTLCursorImage(Dali::Image image, const Vector4& border );
237 * @copydoc Toolkit::TextInput::EnableGrabHandle
239 void EnableGrabHandle(bool toggle);
242 * @copydoc Toolkit::TextInput::IsGrabHandleEnabled
244 bool IsGrabHandleEnabled();
247 * @copydoc Toolkit::TextInput::EnableSelectionHandleFlip
249 void EnableSelectionHandleFlip( bool toggle );
252 * @copydoc Toolkit::TextInput::IsSelectionHandleFlipEnabled
254 bool IsSelectionHandleFlipEnabled();
257 * @copydoc Toolkit::TextInput::SetSelectionHandleFlipMargin
259 void SetSelectionHandleFlipMargin( const Vector4& margin );
262 * @copydoc Toolkit::TextInput::SetBoundingRectangle
264 void SetBoundingRectangle( const Rect<float>& boundingRectangle );
267 * @copydoc Toolkit::TextInput::GetBoundingRectangle
269 const Rect<float> GetBoundingRectangle() const;
272 * @copydoc Toolkit::TextInput::GetSelectionHandleFlipMargin
274 const Vector4& GetSelectionHandleFlipMargin();
277 * @copydoc Toolkit::TextInput::SetTextColor
279 void SetTextColor( const Vector4& color );
282 * @copydoc Toolkit::TextInput::SetActiveStyle
284 void SetActiveStyle( const TextStyle& style, const TextStyle::Mask mask );
287 * @copydoc Toolkit::TextInput::ApplyStyle
289 void ApplyStyle( const TextStyle& style, const TextStyle::Mask mask );
292 * @copydoc Toolkit::TextInput::ApplyStyleToAll
294 void ApplyStyleToAll( const TextStyle& style, const TextStyle::Mask mask );
297 * @copydoc Toolkit::TextInput::GetStyleAtCursor
299 TextStyle GetStyleAtCursor() const;
302 * Retrieves the character style for the given position.
303 * @param[in] position The character position which style is required.
304 * @return The style for the given position.
306 TextStyle GetStyleAt( std::size_t position ) const;
309 * @copydoc Toolkit::TextInput::SetTextAlignment()
311 void SetTextAlignment( Toolkit::Alignment::Type align );
314 * @copydoc Toolkit::TextInput::SetTextLineJustification()
316 void SetTextLineJustification( Toolkit::TextView::LineJustification justification );
319 * @copydoc Toolkit::TextInput::SetFadeBoundary()
321 void SetFadeBoundary( const Toolkit::TextView::FadeBoundary& fadeBoundary );
324 * @copydoc Toolkit::TextInput::GetFadeBoundary()
326 const Toolkit::TextView::FadeBoundary& GetFadeBoundary() const;
329 * @copydoc Toolkit::TextInput::GetTextAlignment()
331 Toolkit::Alignment::Type GetTextAlignment() const;
334 * @copydoc Toolkit::TextInput::SetMultilinePolicy()
336 void SetMultilinePolicy( Toolkit::TextView::MultilinePolicy policy );
339 * @copydoc Toolkit::TextInput::GetMultilinePolicy()
341 Toolkit::TextView::MultilinePolicy GetMultilinePolicy() const;
344 * @copydoc Toolkit::TextInput::SetWidthExceedPolicy()
346 void SetWidthExceedPolicy( Toolkit::TextView::ExceedPolicy policy );
349 * @copydoc Toolkit::TextInput::GetWidthExceedPolicy()
351 Toolkit::TextView::ExceedPolicy GetWidthExceedPolicy() const;
354 * @copydoc Toolkit::TextInput::SetHeightExceedPolicy()
356 void SetHeightExceedPolicy( Toolkit::TextView::ExceedPolicy policy );
359 * @copydoc Toolkit::TextInput::GetHeightExceedPolicy()
361 Toolkit::TextView::ExceedPolicy GetHeightExceedPolicy() const;
364 * @copydoc Toolkit::TextInput::SetExceedEnabled()
366 void SetExceedEnabled( bool enable );
369 * @copydoc Toolkit::TextInput::GetExceedEnabled()
371 bool GetExceedEnabled() const;
374 * @copydoc Toolkit::TextInput::SetBackground
376 void SetBackground(Dali::Image image );
379 * @copydoc Toolkit::TextInput::SetNumberOfLines
381 void SetNumberOfLines(std::size_t lines);
384 * @copydoc Toolkit::TextInput::GetNumberOfLines
386 std::size_t GetNumberOfLines();
389 * @copydoc Toolkit::TextInput::GetNumberOfCharacters
391 std::size_t GetNumberOfCharacters() const;
398 * Set the diffuse color for the highlight
399 * @param[in] color color to use
401 void SetMaterialDiffuseColor( const Vector4& color );
404 * Get the diffuse color used by the highlight
407 const Vector4& GetMaterialDiffuseColor() const;
412 * structure to hold each highlight box needed for text selection
416 Vector3 size; ///< size of the highlight box
417 Vector3 position; ///< position of highlight box
418 ImageActor highlightBoxActor; ///< as actor that is the highlight box
422 * structure to hold each character in displayed string and its position from the left
426 char character; ///< todo change to UTF to aid multi-language support
432 * structure to hold coordinates of each quad, which will make up the mesh.
434 struct QuadCoordinates
437 * Default constructor
445 * @param[in] x1 left co-ordinate
446 * @param[in] y1 top co-ordinate
447 * @param[in] x2 right co-ordinate
448 * @param[in] y2 bottom co-ordinate
450 QuadCoordinates(float x1, float y1, float x2, float y2)
456 Vector2 min; ///< top-left (minimum) position of quad
457 Vector2 max; ///< bottom-right (maximum) position of quad
460 typedef std::vector<QuadCoordinates> QuadContainer;
463 * structure for information required to build the highlight mesh
468 * Adds a Quad (2D rectangular sub-selection)
469 * @param[in] x1 left co-ordinate
470 * @param[in] y1 top co-ordinate
471 * @param[in] x2 right co-ordinate
472 * @param[in] y2 bottom co-ordinate
474 void AddQuad( float x1, float y1, float x2, float y2 );
477 * Clamps all quads to fit within a min -> max 2D boundary.
479 void Clamp2D(const Vector2& min, const Vector2& max);
481 QuadContainer mQuadList; ///< List of quads (sub-selections that form to create complete selection)
485 * Holds requested selection start and end points for highlighted text.
487 struct SelectionParameters
489 SelectionParameters( size_t start, size_t end )
490 : mStartOfSelection( start ), mEndOfSelection( end )
495 size_t mStartOfSelection;
496 size_t mEndOfSelection;
505 enum SelectionHandleId
507 HandleOne, ///< Selection handle one which is on the left
508 HandleTwo ///< Selection handle two which is on the right
512 * Two different behaviours are needed to convert a touch point into a character index.
513 * When a tap is received and the touch point doesn't hit any character, the final character selected might
514 * be different than the one selected if the event is a pan.
515 * i.e. If a tap is received and the touch point doesn't hit any character the expected position of the cursor
516 * would be the end or the beginning of a line. However, this behaviour would be weird while panning.
520 TapMode, ///< Touch point to character index conversion mode used for Tap events.
521 DragMode ///< Touch point to character index conversion mode used for Pan events.
525 * Used to set the direction when find the next visible character.
527 enum FindVisibleCharacterDirection
529 Left, ///< Find visible characters on the left.
530 Right, ///< Find visible characters on the right.
531 ByEnd ///< Start finding visible characters by the end.
537 virtual bool OnTouchEvent(const TouchEvent& event);
540 * From CustomActorImpl; called after the Text Input actor is touched
541 * @param[in] event The KeyEvent event.
542 * @return True if the event should be consumed.
544 virtual bool OnKeyEvent(const KeyEvent& event);
547 * From CustomActorImpl; called when this actor gains keyboard focus.
549 virtual void OnKeyInputFocusGained();
552 * From CustomActorImpl; called when this actor loses keyboard focus.
554 virtual void OnKeyInputFocusLost();
557 * From Control; called whenever the control is added to the stage.
559 virtual void OnControlStageConnection();
561 private: // From Control
564 * Creation of the layer that is used by top level active parts of the TextInput like handles
566 void CreateActiveLayer();
569 * @copydoc Control::OnInitialize()
571 virtual void OnInitialize();
574 * @copydoc Control::OnControlSizeSet()
576 virtual void OnControlSizeSet(const Vector3& targetSize);
579 * @copydoc Control::OnRelayout()
581 virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
584 * Retrieves the text-input's natural size by calling TextView::GetNaturalSize().
586 * @return The natural size.
588 virtual Vector3 GetNaturalSize();
591 * Retrieves the text-input's \e height for a given \e width by calling TextView::GetHeightForWidth().
593 * @param[in] width The given \e width.
595 * @return The \e height for the given \e width.
597 virtual float GetHeightForWidth( float width );
602 * Construct a new TextInput.
607 * A reference counted object may only be deleted by calling Unreference()
609 virtual ~TextInput();
614 TextInput(const TextInput&);
617 TextInput& operator=(const TextInput& rhs);
620 * Callback when a handle is panned/moved, either selection handles or grab handle
621 * @param actor Handle of the selection or grab handle.
622 * @param gesture Data structure with the parameters of the gesture.
624 void OnHandlePan(Actor actor, const PanGesture& gesture);
627 * Callback for touch down on Grab handle
628 * @param[in] actor touched
629 * @param[in] touch touch event
631 bool OnPressDown(Dali::Actor actor, const TouchEvent& touch);
634 * Callback for touch down on Selection handle one
635 * @param[in] actor touched
636 * @param[in] touch touch event, used to determine if down or up event
638 bool OnHandleOneTouched(Dali::Actor actor, const TouchEvent& touch);
641 * Callback for touch down on Selection handle two
642 * @param[in] actor touched
643 * @param[in] touch touch event, used to determine if down or up event
645 bool OnHandleTwoTouched(Dali::Actor actor, const TouchEvent& touch);
648 * Callback for tap on TextInput
650 * @param[in] tap touch event
652 void OnTextTap(Dali::Actor actor, const Dali::TapGesture& tap);
655 * Callback for double tap on TextInput
657 * @param[in] tap touch event
659 void OnDoubleTap(Dali::Actor actor, const Dali::TapGesture& tap);
662 * Callback for long press on TextInput
664 * @param[in] longPress long press event
666 void OnLongPress(Dali::Actor actor, const Dali::LongPressGesture& longPress);
669 * Callback for the ClipboardEventNotifier when text is selected in the clipboard window.
670 * @param[in] notifier The Clipboard Event Notifier.
672 void OnClipboardTextSelected( ClipboardEventNotifier& notifier );
675 * Callback for when a button is pressed in popup panel
676 * @param[in] button handle to the button pressed.
678 bool OnPopupButtonPressed( Toolkit::Button button );
681 * Callback when handle timer ticks.
683 * Cursor should become visible/invisible to simulate blinking.
685 * @return True if the timer should be keep running.
687 bool OnCursorBlinkTimerTick();
690 * Invoked upon popup Hide animation completing.
691 * @note Only called for animating hide, not called for instantaneous (animate = false)
692 * @param[in] popup The popup which was hidden.
694 void OnPopupHideFinished(TextInputPopup& popup);
697 * Called in OnKeyEvent to handle key down events.
698 * @param[in] event The KeyEvent event.
699 * @return True if the event should be consumed.
701 bool OnKeyDownEvent(const KeyEvent& event);
704 * Called in OnKeyEvent to handle key up events.
705 * @param[in] event The KeyEvent event.
706 * @return True if the event should be consumed.
708 bool OnKeyUpEvent(const KeyEvent& event);
711 * Chooses from all handle position and alternative handle positions where to set the position of the two selection handles.
713 * @param[in] cursorPositionOne The initial position of the first selection handle.
714 * @param[in] cursorPositionTwo The initial position of the second selection handle.
715 * @param[in] altPositionValidOne Whether there is an alternative position for the first selection handle.
716 * @param[in] altPositionValidTwo Whether there is an alternative position for the second selection handle.
717 * @param[in] altPositionOne The alternative position of the first selection handle.
718 * @param[in] altPositionTwo The alternative position of the second selection handle.
720 void ChooseRtlSelectionHandlePosition( const Vector3& cursorPositionOne,
721 const Vector3& cursorPositionTwo,
722 bool altPositionValidOne,
723 bool altPositionValidTwo,
724 const Vector3& altPositionOne,
725 const Vector3& altPositionTwo );
727 * Callback called when the text-view is scrolled.
729 * Updates the selection and grab handles, and the highlighted text.
731 * @param[in] textView Handle of the text-view.
732 * @param[in] scrollPosition The difference with the previous scroll position.
734 void OnTextViewScrolled( Toolkit::TextView textView, Vector2 scrollPosition );
737 * Scrolls the text-view to make the cursor visible.
739 * @param[in] cursorPosition The actual cursor position in actor coordinates.
741 void ScrollTextViewToMakeCursorVisible( const Vector3& cursorPosition );
744 * Creates and starts a timer to scroll the text when handles are close to the edges of the text-input.
746 * It only starts the timer if it's already created.
748 void StartScrollTimer();
751 * Stops the timer used to scroll the text.
753 void StopScrollTimer();
756 * Callback called by the timer used to scroll the text.
758 * It calculates and sets a new scroll position.
760 bool OnScrollTimerTick();
762 public: // Public to allow internal testing.
765 * Register for touch events
767 void SetUpTouchEvents();
770 * Sets up TextView Actor
772 void CreateTextViewActor();
775 * Set Styled Text for text input.
776 * @param[in] styleText The new styled text for the text input.
778 void SetText( const MarkupProcessor::StyledTextArray& styleText );
781 * Start a timer to signal cursor to blink.
783 void StartCursorBlinkTimer();
786 * Stop the timer signalling the cursor to blink.
788 void StopCursorBlinkTimer();
791 * Starts input, setting focus and showing keyboard..
793 void StartEditMode();
796 * Called when End of input and focus no longer required, keyboard is hidden.
801 * Applies a style to the current pre-edit / predicted word to show it is being edited.
802 * @param[in] preEditStartPosition position in text array that the predicted word starts at
803 * @param[in] preEditStringLength used to calculate how many characters need their style changed.
805 void ApplyPreEditStyle( std::size_t preEditStartPosition, std::size_t preEditStringLength );
808 * Restores style to value before applying Pre-Edit style.
810 void RemovePreEditStyle();
813 * Event received from IMF manager
814 * @return ImfCallbackData data struture undicating if update is needed, cursor position and current text
816 ImfManager::ImfCallbackData ImfEventReceived( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& test );
819 * Called when the OnKey event is a Pre-edit string
820 * @param[in] keyString String received in Pre-edit
821 * @param[in] cursorOffset the cursor offset from where the pre-edit word starts
822 * @return bool true if preedit reset is required.
824 bool PreEditReceived( const std::string& keyString, std::size_t cursorOffset );
827 * Called when the OnKey event is a Commit string
828 * @param[in] keyString String received in Comment
829 * @return update flag to trigger cursor update of TextInput only when needed.
831 bool CommitReceived( const std::string& keyString );
834 * Deletes Pre-edit string
835 * By default it doesn't update the character's size and position table, which is a costly
836 * operation. As in many cases deletion and insertion (InsertAt) of text
837 * occurs in the same action i.e. preedit/commit. It makes sense to
838 * delete without updating, and then insert with updating.
840 * @return The number of characters to be deleted.
842 std::size_t DeletePreEdit();
845 * Reset all pre-edit flag and signal IMF keyboard that the current pre-edit word has been comitted.
846 * This may be due to the cursor being moved by user or reached the max character limit.
847 * @param[in] preserveCursorPosition Set true to keep cursor in current position, eg. touch event caused cursor to move.
849 void PreEditReset( bool preserveCursorPosition );
852 * Called after cursor position needs updating.
853 * Redraws cursor and notifies VirtualKeyboard
858 * Delete highlighted characters
859 * @param[in] inheritStyle Whether style from previous character in the string should be inherited.
861 void DeleteHighlightedText( bool inheritStyle );
864 * Delete range of characters
865 * @param[in] start position of characters to delete
866 * @param[in] ncharacters number of characters to delete
868 void DeleteRange(std::size_t start, std::size_t ncharacters);
871 * Delete character at current cursor position and redisplay
872 * @param[in] positionToDelete position of character to delete
874 void DeleteCharacter( std::size_t positionToDelete );
877 * Add or replaces characters to currently displayed string at cursor position
878 * By default it doesn't update the character's size and position table, which is a costly
879 * operation. As in many cases deletion and insertion (InsertAt) of text
880 * occurs in the same action i.e. preedit/commit. It makes sense to
881 * delete without updating, and then insert with updating.
882 * @param[in] newText string to add to TextInput display string.
883 * @param[in] insertionPosition position to insert at.
884 * @param[in] numberOfCharactersToReplace The number of characters to replace.
885 * @return number of characters to offset the cursor by.
887 std::size_t InsertAt( const Text& newText, const std::size_t insertionPosition, const std::size_t numberOfCharactersToReplace );
891 * @param[in] color the cursor color.
892 * @return the image actor to be used as the cursor.
894 ImageActor CreateCursor( const Vector4 &color );
897 * Moves cursor to the right
898 * param[in] reverse if true then cursor moves in the reverse direction (to the left)
899 * param[in] places number of character cursor should move.
901 void AdvanceCursor(bool reverse = false, std::size_t places = 1);
904 * Draw a cursor / caret at position where new text should appear
909 * Sets cursor visibility
910 * This sets visibility of the cursor. Which is comprised of 2
911 * cursors. The conventional cursor, and the alternate (RTL) cursor,
912 * which only appears when the cursor is at a character that can have
913 * a character appended to different visual positions depending on whether that
914 * character to be appended is RTL or LTR.
915 * @param[in] visible true - enable visibility for cursor, false - disable visiblity for cursor
917 void SetCursorVisibility( bool visible );
920 * Sets alternate cursor enable state
921 * @see SetCursorVisibility
922 * alternate cursor will only be visible if both SetCursorVisiblity
923 * and cursor enabled have been set to true.
925 void SetAltCursorEnabled( bool enabled );
928 * Create the grab handle that positions the cursor
929 * @param[in] image to be used for grab handle
932 void CreateGrabHandle(Image image=Image());
935 * Create Grab area to be used by Grab Handle
937 void CreateGrabArea( Actor& parent);
940 * Move grab handle to the required character position
942 * @param[in] displacement Displacement of the grab handle in actor coordinates.
944 * @return The new actual position the handle has been set to.
946 Vector3 MoveGrabHandle( const Vector2& displacement );
949 * Show or hide the grab handle without baking the visibility flag.
950 * Used when the Grab handle needs to be invisible due to text-view scrolling making it out of view
952 * @param[in] visible bool flag to set as true is grab handle should be shown, else false to hide.
954 void ShowGrabHandle( bool visible );
957 * Show or hide the grab handle and bake the visibility flag.
958 * 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.
959 * Calls ShowGrabHandle.
961 * @param[in] visible bool flag to set as true is grab handle should be shown, else false to hide.
963 void ShowGrabHandleAndSetVisibility( bool visible );
965 /* Boundary Property Notifications when handle exceed bounding box*/
968 * PropertyNotification Callback when left boundary exceeded so handle can be flipped.
969 * @param[in] source PropertyNotification
971 void OnLeftBoundaryExceeded( PropertyNotification& source );
973 * PropertyNotification Callback when within left boundary so handle can be flipped back.
974 * @param[in] source PropertyNotification
976 void OnReturnToLeftBoundary( PropertyNotification& source );
978 * PropertyNotification Callback when right boundary exceeded so handle can be flipped.
979 * @param[in] source PropertyNotification
981 void OnRightBoundaryExceeded( PropertyNotification& source );
983 * * PropertyNotification Callback when within right boundary so handle can be flipped back.
984 * @param[in] source PropertyNotification
986 void OnReturnToRightBoundary( PropertyNotification& source );
989 * PropertyNotification Callbacks for hiding handle one when it exceeds boundary.
990 * @param[in] source PropertyNotification
992 void OnHandleOneLeavesBoundary( PropertyNotification& source );
994 * PropertyNotification Callbacks for showing hidden handle one when returns within boundary
995 * @param[in] source PropertyNotification
997 void OnHandleOneWithinBoundary( PropertyNotification& source );
999 * PropertyNotification Callbacks for hiding handle two it when exceeds boundary.
1000 * @param[in] source PropertyNotification
1002 void OnHandleTwoLeavesBoundary( PropertyNotification& source );
1004 * PropertyNotification Callbacks for showing hidden handle two when returns within boundary
1005 * * @param[in] source PropertyNotification
1007 void OnHandleTwoWithinBoundary( PropertyNotification& source );
1010 * Set up property notifications on the position of the handles to facilitate flipping and hiding when at screen boundary.
1012 void SetUpHandlePropertyNotifications();
1015 * Create the selection handles that bound text to be selected for copy/cut.
1016 * @param[in] start initial position of start selection handle.
1017 * @param[in] end initial position of end selection handle.
1018 * @param[in] handleOneImage (optional) to be used for selection handle
1019 * @param[in] handleTwoImage (optional) to be used for selection handle
1021 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() );
1024 * Move the selection handles to required positions in text.
1026 * @param[in] handleId the handle to position
1027 * @param[in] displacement Displacement of the selection handle in actor coordinates.
1029 * @return The new actual position the handle has been set to.
1031 Vector3 MoveSelectionHandle(SelectionHandleId handleId, const Vector2& displacement);
1034 * Calculate and position the specified selection handle the given index position
1036 * @param[in] handleId the handle to position
1038 void SetSelectionHandlePosition(SelectionHandleId handleId);
1041 * Gets a table of the visual text positions which has a flag
1042 * for each Character. The flag is either true (character selected)
1043 * or false (character deselected)
1044 * @note startSelection can be greater or less than endSelection
1046 * @param[in,out] selectedVisualText The vector to be resized and populated with the selected flags
1047 * @param[in] startSelection The start selection point for the text
1048 * @param[in] endSelection The end selection point for the text
1050 void GetVisualTextSelection(std::vector<bool>& selectedVisualText, std::size_t startSelection, std::size_t endSelection);
1053 * Iterates between selection handles and computes the info required to build the highlight mesh
1055 HighlightInfo CalculateHighlightInfo();
1058 * 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.
1060 HighlightInfo CalculateHighlightInfoRtl();
1063 * Calculates new Mesh data so highlight moves with selection handles.
1065 void UpdateHighlight();
1068 * Removes popup, and its options.
1073 * Adds Popup options which have been enabled.
1075 void AddPopupOptions();
1078 * Sets popup position
1079 * @param[in] position The actual position for this popup.
1080 * @param[in] alternativePosition Alternative popup position if no space in upper area.
1082 void SetPopupPosition(const Vector3& position, const Vector2& alternativePosition );
1086 * @param[in] animate (optional) whether to animate popup to hide state over time (i.e. tween).
1087 * @param[in] signalFinished (optional) whether to perform an animation finish operation after the hide animation completes. Requires animate to be true.
1089 void HidePopup( bool animate = true, bool signalFinished = true );
1093 * @param[in] animate (optional) whether to animate popup to show state over time (i.e. tween).
1095 void ShowPopup(bool animate = true);
1098 * Shows the cut-copy-paste popup
1100 void ShowPopupCutCopyPaste();
1103 * Setup the selection popup and clipboard if relevant so the correct options are shown when ShowPopup is called.
1104 * @param[in] showCutButton Flag to show or hide cut button, in some cases like whitespace we do not want to cut just select.
1107 void SetUpPopupSelection( bool showCutButton = true );
1110 * Return the logical index containing the character position closest to the source.
1111 * Used for positioning the grab handle at characters when dragged along.
1112 * Two different behaviours are needed in case the source point doesn't actually touch a
1113 * character. @see TouchToIndex.
1114 * @param[in] source float to match against
1115 * @param[out] closestIndex index to the vector of character's size and position.
1116 * @return \e true if the source point is actually inside the geometry provided by TextView.
1118 bool ReturnClosestIndex(const Vector2& source, std::size_t& closestIndex );
1121 * Returns the X-position of the current line justification
1122 * (relative to left of text-view container)
1123 * @return X position for line justification
1125 float GetLineJustificationPosition() const;
1128 * Currently the cursor is positioned at the previous characters position plus it's width.
1129 * If the previous character is on a different line then this function returns the correct position.
1130 * @param[in] characterPosition the character position index that the cursor should be at
1131 * @return position of cursor/handle
1133 Vector3 PositionCursorAfterWordWrap( std::size_t characterPosition ) const;
1137 * Return a vector which is the actual position for the given character position
1138 * The character position is where a cursor would be position for that character.
1139 * @param[in] characterPosition the logical (input) position in the 'string' of characters.
1141 * @return Vector3 the actual x,y,z position
1143 Vector3 GetActualPositionFromCharacterPosition(std::size_t characterPosition ) const;
1146 * Return a vector which is the actual position for the given character position
1147 * The character position is where a cursor would be positioned for that character to be inserted.
1148 * An additional alternatePosition is also set in circumstances where the possible writing
1149 * of characters would be in the opposite direction.
1150 * e.g. "HelloشقشلاهؤEnglish"
1153 * [*] - Primary actual position for cursor i.e. continuing writing LTR (English)
1154 * [+] - Alternate actual position for cursor i.e. writing RTL (Arabic)
1156 * @param[in] characterPosition the logical (input) position in the 'string' of characters.
1157 * @param[out] directionRTL Whether the actual x,y,z position is after LTR (false) or RTL (true) text.
1158 * @param[out] alternatePosition the actual x,y,z position of the cursor if user types
1159 * in alternate direction to current flow of text.
1160 * @param[out] alternatePositionValid whether this alternate position is valid.
1161 * @return Vector3 the actual x,y,z position
1163 Vector3 GetActualPositionFromCharacterPosition(std::size_t characterPosition, bool& directionRTL, Vector3& alternatePosition, bool& alternatePositionValid ) const;
1166 * Retrieve the character position of the first character on the row of text
1167 * that this character resides on.
1168 * @param[in] logicalPosition the position in the 'string' of characters.
1169 * @return logical character position of start of row.
1171 std::size_t GetRowStartFromCharacterPosition(std::size_t logicalPosition) const;
1174 * Retrieves the first character of a group of characters with the same direction.
1176 * @param[in] logicalPosition Index to a character.
1178 * @return Index to the character.
1180 std::size_t GetFirstCharacterWithSameDirection( std::size_t logicalPosition ) const;
1183 * Retrieve the dimensions of this row of text that the character resides on.
1184 * @param[in] characterPosition the position in the 'string' of characters.
1185 * @return The size of the rectangle representing this row
1187 Size GetRowRectFromCharacterPosition(std::size_t characterPosition) const;
1190 * Retrieve the dimensions (and min-max) of this row of text that the character resides on.
1191 * @param[in] characterPosition the position in the 'string' of characters.
1192 * @param[out] min the top-left position of the rectangle representing this row
1193 * @param[out] max the bottom-right position of the rectangle representing this row
1194 * @return The size of the rectangle representing this row (max - min)
1196 Size GetRowRectFromCharacterPosition(std::size_t characterPosition, Vector2& min, Vector2& max) const;
1199 * Checks if the provided touchedActor was this text-input
1200 * @param[in] touchedActor the touched actor that will be checked against this text-input
1201 * @return true if the touchActor was the text-input or one of its children
1203 bool WasTouchedCheck( const Actor& touchedActor ) const;
1206 * Connect to the stage touch event
1208 void StartMonitoringStageForTouch();
1211 * Disconnect from the stage touch event
1213 void EndMonitoringStageForTouch();
1216 * Callback for when the screen is touched, this will be connected when selection starts and disconnected when it ends.
1217 * @param[in] event The touch event
1219 void OnStageTouched(const TouchEvent& event);
1223 * Select the text between the given values
1224 * @param[in] start position within array to start selection
1225 * @param[in] end position within array to end selection
1227 void SelectText(std::size_t start, std::size_t end);
1230 * Gets selected text and returns it as a StyleText vector
1231 * @return StyledText vector that is selected.
1233 MarkupProcessor::StyledTextArray GetSelectedText();
1236 * Applies the given style to all text, selected or not selected.
1237 * By default all style settings are applied but a bit mask could be used to modify only certain style settings.
1239 void ApplyStyleToRange(const TextStyle& style, const TextStyle::Mask mask, const std::size_t begin, const std::size_t end);
1242 * Callback for when the keyboard status changes
1243 * @param[in] keyboardShown Whether the keyboard has just been shown or not.
1245 void KeyboardStatusChanged(bool keyboardShown);
1248 * Hide highlight shown between selection handles.
1249 * @param[in] hidePopup flag to hide the popup too, default is to hide popup.
1251 void RemoveHighlight( bool hidePopup = true );
1254 * Highlights text that has been selected
1256 void CreateHighlight();
1259 * Copies selected text to clipboard
1260 * @return bool true if copy was successful.
1262 bool CopySelectedTextToClipboard();
1265 * Pastes the given text to currently displayed string at the current cursor position
1266 * @param[in] text Text to be pasted
1268 void PasteText( const Text& text );
1271 * Sets the direction of the text if it is empty.
1273 void SetTextDirection();
1276 * Updates the line height accordingly with the current text input style.
1278 void UpdateLineHeight();
1281 * Finds a visible character.
1283 * The \e direction parameters specifies from where to start to look for a visible character. \e Left means start by characters in lower
1284 * positions than \e cursorPosition, \e Right means start by characters in greater positions than \e cursorPosition and \e ByEnd starts
1285 * by the last characters.
1287 * If \e Left or \e Right is provided and any character is found, then looks in the other direction.
1289 * @param[in] direction Direction used to find a visible character.
1290 * @param[in] cursorPosition Starting position.
1292 * @return The found visible character.
1294 std::size_t FindVisibleCharacter( const FindVisibleCharacterDirection direction , const std::size_t cursorPosition ) const;
1297 * @copydoc SetSortModifier()
1299 void SetSortModifier( float depthOffset );
1302 * @copydoc SetSnapshotModeEnabled()
1304 void SetSnapshotModeEnabled( bool enable );
1307 * @copydoc IsSnapshotModeEnabled()
1309 bool IsSnapshotModeEnabled() const;
1312 * @copydoc SetScrollEnabled()
1314 void SetScrollEnabled( bool enable );
1317 * @copydoc IsScrollEnabled()
1319 bool IsScrollEnabled() const;
1322 * @copydoc SetScrollPosition()
1324 void SetScrollPosition( const Vector2& position );
1327 * @copydoc GetScrollPosition()
1329 Vector2 GetScrollPosition() const;
1332 * @brief Sets whether markup processing should be carried out.
1334 * @param[in] enable whether markup processing is carried out or not.
1336 void SetMarkupProcessingEnabled( bool enable );
1339 * @brief Returns whether markup processing is enabled or not
1341 * @return true is markup processing is enabled
1343 bool IsMarkupProcessingEnabled() const;
1346 * Insert or replaces the given text in the given position. It checks if the text exceeds the maximum allowed number of characters
1347 * and if it fits in the text-input's boundaries.
1349 * @param[in] text Text to be inserted.
1350 * @param[in] position Position where the text is inserted.
1351 * @param[in] numberOfCharactersToReplace The number of characters to replace.
1352 * @param[out] textExceedsMaximunNumberOfCharacters The number of characters that have been inserted.
1353 * @param[out] textExceedsBoundary Whether the inserted text has exceeded the boundaries of the text-input.
1355 * @return The number of characters that have been inserted.
1357 std::size_t DoInsertAt( const Text& text, std::size_t position, std::size_t numberOfCharactersToReplace, bool& textExceedsMaximunNumberOfCharacters, bool& textExceedsBoundary );
1360 * Retrieve Text-view's layout info.
1362 void GetTextLayoutInfo();
1365 * Set the offset for positioning Popup from the TextInput
1366 * @param[in] offset in the order, left, top, right, bottom
1368 void SetOffsetFromText( const Vector4& offset );
1371 * Get the offset of the Popup from the TextInput
1372 * @return Vector4 with the offset in the order, left, top, right, bottom
1374 const Vector4& GetOffsetFromText() const;
1377 * Show the Placeholder text with an already created StyleTextArray
1378 * @param[in] stylePlaceHolderText Required placeholder text to be used
1380 void ShowPlaceholderText( const MarkupProcessor::StyledTextArray& stylePlaceHolderText );
1385 * Called when a property of an object of this type is set.
1386 * @param[in] object The object whose property is set.
1387 * @param[in] index The property index.
1388 * @param[in] value The new property value.
1390 static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
1393 * Called to retrieve a property of an object of this type.
1394 * @param[in] object The object whose property is to be retrieved.
1395 * @param[in] index The property index.
1396 * @return The current value of the property.
1398 static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
1401 * Emits the style changed signal.
1403 void EmitStyleChangedSignal();
1406 * Emit signal when text is modified.
1408 void EmitTextModified();
1411 * Emits max input characters reached signal.
1413 void EmitMaxInputCharactersReachedSignal();
1416 * Emits a signal when the input text exceeds the boundaries of the text-input.
1418 void EmitInputTextExceedsBoundariesSignal();
1422 State mState; ///< Current State of Text input.
1423 MarkupProcessor::StyledTextArray mStyledText; ///< String currently displayed by TextView with style info.
1424 TextStyle mInputStyle; ///< Stores the current input style.
1425 float mLineHeight; ///< Stores the current line height accordingly with the input style.
1426 Toolkit::TextView mDisplayedTextView; ///< Actor which actually display text
1428 MarkupProcessor::StyledTextArray mStyledPlaceHolderText; ///< Text used as place holder with style info.
1430 std::size_t mMaxStringLength; ///< Max number of characters for string
1431 std::size_t mNumberOflinesLimit; ///< Limit on the number of lines this TextInput will display.
1433 ImageActor mCursor; ///< Cursor overlayed on Text to show where new text will be inserted
1434 ImageActor mCursorRTL; ///< Right To Left Cursor overlayed on Text (where new RTL text would be inserted)
1435 Animation mCursorAnimation; ///< animator for cursor blinking.
1436 std::size_t mCursorPosition; ///< position along string cursor is at.
1437 Timer mCursorBlinkTimer; ///< Timer to signal cursor to blink
1439 Layer mActiveLayer; ///< Layer for active handles and alike that ensures they are above all else.
1441 Image mGrabHandleImage; ///< image to be used for grab handle
1442 ImageActor mGrabHandle; ///< Handle used to move cursor for editing
1444 Actor mGrabArea; ///< invisible actor that receives pans events for the grab handle.
1445 PanGestureDetector mPanGestureDetector; ///< Pan gesture for handles
1446 TapGestureDetector mTapDetector; ///< used to start editing
1447 TapGestureDetector mDoubleTapDetector; ///< double tap detector
1449 Vector3 mActualGrabHandlePosition; ///< actual position of grab handle, this might not be snapped to a character
1451 LongPressGestureDetector mLongPressDetector; ///< Gesture to start selection
1453 /*Selection handles*/
1454 Image mSelectionHandleOneImage; ///< image used for selection handle one
1455 Image mSelectionHandleOneImagePressed; ///< image used for selection handle one pressed state
1456 Image mSelectionHandleTwoImage; ///< image used for selection handle two
1457 Image mSelectionHandleTwoImagePressed; ///< image used for selection handle two pressed state
1459 bool mIsSelectionHandleOneFlipped:1; ///< Flag to know whether the handle one is flipped or not.
1460 bool mIsSelectionHandleTwoFlipped:1; ///< Flag to know whether the handle two is flipped or not.
1461 Vector3 mSelectionHandleOneOffset; ///< Handle One's Offset
1462 Vector3 mSelectionHandleTwoOffset; ///< Handle Two's Offset
1463 Vector3 mSelectionHandleOneActualPosition; ///< Actual x y position of handle
1464 Vector3 mSelectionHandleTwoActualPosition; ///< Actual x y position of handle
1465 std::size_t mSelectionHandleOnePosition; ///< Position of handle along the string of text
1466 std::size_t mSelectionHandleTwoPosition; ///< Position of handle along the string of text
1467 ImageActor mSelectionHandleOne; ///< First selection handle used for selecting text to cut&paste
1468 ImageActor mSelectionHandleTwo; ///< Second selection handle used for selecting text to cut&paste
1469 Actor mHandleOneGrabArea; ///< invisible actor that receives pans events for the selection handle.
1470 Actor mHandleTwoGrabArea; ///< invisible actor that receives pans events for the selection handle.
1472 Mesh mHighlightMesh; ///< Mesh Data for highlight
1473 MeshActor mHighlightMeshActor; ///< Mesh Actor to display highlight
1474 MeshData mMeshData; ///< Container to hold meshData for highlight
1475 Material mCustomMaterial; ///< Custom material used for highlight
1476 HighlightInfo mNewHighlightInfo; ///< Geometry info to create highlight.
1478 Text mPreEditString; ///< Holds current input string prior to it being committed.
1479 std::size_t mPreEditStartPosition; ///< Cursor position for start of pre-edit string
1480 std::size_t mPreEditLength; ///< Cursor position for length of current pre-edit string after purging characters that do not fit.
1481 std::size_t mNumberOfSurroundingCharactersDeleted; ///< Stores the number of surrounding characters deleted.
1482 unsigned long mTouchStartTime; ///< Touch Start time (time in ms when down press began)
1484 Toolkit::TextView::TextLayoutInfo mTextLayoutInfo; ///< It contains a table layout info per character sorted by the character's visual index (retrieved from TextView),
1485 ///< a reorder map that stores each character's visual (output) index according to its logical (input) index,
1486 ///< a reorder map that stores each character's logical (input) index according to its visual (output) index,
1487 ///< the text size after layout and the scroll offset.
1489 MarkupProcessor::StyledTextArray mCurrentCopySelecton; ///< Array to store copied text.
1490 TextInputPopup mPopupPanel; ///< Panel to house cut and paste, select all buttons.
1493 Vector2 mScrollDisplacement;
1494 Vector3 mCurrentHandlePosition;
1495 SelectionHandleId mCurrentSelectionId;
1496 Vector3 mCurrentSelectionHandlePosition;
1497 SelectionParameters mRequestedSelection;
1498 Vector4 mSelectionHandleFlipMargin;
1499 Vector4 mBoundingRectangleWorldCoordinates;
1501 Clipboard mClipboard; ///< Handle to clipboard
1504 Vector4 mMaterialColor; // Color of the highlight
1505 Vector4 mPopupOffsetFromText; // Offset of Popup from the TextInput.
1507 bool mOverrideAutomaticAlignment:1; ///< Whether to override the alignment automatically set by the text content (e.g. european LTR or arabic RTL)
1508 bool mCursorRTLEnabled:1; ///< Enable state of Alternate RTL Cursor (need to keep track of this as it's not always enabled)
1509 bool mClosestCursorPositionEOL:1; ///< closest cursor position is end of line.
1510 bool mCursorBlinkStatus:1; ///< \e true shows the cursor, \e false hiddes it.
1512 bool mCursorVisibility:1; ///< Visibility status of Cursor
1513 bool mGrabHandleVisibility:1; ///< Visibility status of the grab handle.
1515 bool mIsCursorInScrollArea:1; ///< Whether the cursor is inside the boundaries of the text-input.
1516 bool mIsGrabHandleInScrollArea:1; ///< Whether the grab handle is inside the boundaries of the text-input.
1518 bool mEditModeActive:1; ///< true to indicate TextInput is in edit mode.
1519 bool mEditOnTouch:1; ///< true indicates edit mode starts by touching/tapping the TextInput
1520 bool mTextSelection:1; ///< true indicates text selection is enabled.
1521 bool mExceedEnabled:1; ///< Whether text-input editing text beyond its boundary is enabled or not. By default is enabled.
1522 bool mGrabHandleEnabled:1; ///< Flag to enable the grab handle instead of the default magnifier.
1523 bool mIsSelectionHandleFlipEnabled:1; ///< Flag to enable the selection handle flip
1525 bool mPreEditFlag:1; ///< Flag to indicate if key string received is still in pre-edit mode (Ecore IMF keyboard)
1526 bool mIgnoreCommitFlag:1; ///< Flag to indicate if the commit string should be ignored, maybe due to a keyboard reset.
1527 bool mIgnoreFirstCommitFlag:1; ///< Whether to ignore the first commit.
1528 bool mSelectingText:1; ///< Ignore surrounding text as selecting text
1530 bool mPreserveCursorPosition:1; ///< Indicates that the commit message is from a reset and does not require the cursor to be moved
1532 bool mSelectTextOnCommit:1;
1534 bool mUnderlinedPriorToPreEdit:1; ///< As predictive text adds underline style this flag enables us to revert back or keep underline.
1536 bool mCommitByKeyInput:1; ///< Set if a commit is done by key input rather than automatically (usually when a space bar or enter is pressed).
1538 bool mPlaceHolderSet:1; ///< Whether the place holder text is set.
1539 bool mMarkUpEnabled:1; ///< enable to scan for mark-up
1541 Toolkit::TextInput::InputSignalType mInputStartedSignal; ///< Signal emitted when input starts
1542 Toolkit::TextInput::InputSignalType mInputFinishedSignal; ///< Signal emitted when input ends
1543 Toolkit::TextInput::StyleChangedSignalType mStyleChangedSignal; ///< Signal emitted when style changes.
1544 Toolkit::TextInput::TextModifiedSignalType mTextModifiedSignal; ///< Signal emitted when text modified.
1545 Toolkit::TextInput::MaxInputCharactersReachedSignalType mMaxInputCharactersReachedSignal; ///< Signal emitted when max input characters is reached.
1546 Toolkit::TextInput::InputSignalType mCutAndPasteToolBarDisplayed; ///< Signal emitted when toolbar displayed
1547 Toolkit::TextInput::InputTextExceedBoundariesSignalType mInputTextExceedBoundariesSignal; ///< Signal emitted when input text exceeds the boundaries of the text-input.
1550 } // namespace Internal
1552 // Helpers for public-api forwarding methods
1554 inline Toolkit::Internal::TextInput& GetImpl(Toolkit::TextInput& textInput)
1556 DALI_ASSERT_ALWAYS(textInput);
1558 Dali::RefObject& handle = textInput.GetImplementation();
1560 return static_cast<Toolkit::Internal::TextInput&>(handle);
1563 inline const Toolkit::Internal::TextInput& GetImpl(const Toolkit::TextInput& textInput)
1565 DALI_ASSERT_ALWAYS(textInput);
1567 const Dali::RefObject& handle = textInput.GetImplementation();
1569 return static_cast<const Toolkit::Internal::TextInput&>(handle);
1572 } // namespace Toolkit
1576 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_INPUT_H__