1 #ifndef DALI_TOOLKIT_TEXT_CONTROLLER_H
2 #define DALI_TOOLKIT_TEXT_CONTROLLER_H
5 * Copyright (c) 2016 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/devel-api/adaptor-framework/imf-manager.h>
23 #include <dali/public-api/events/gesture.h>
26 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
27 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
28 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
29 #include <dali-toolkit/internal/text/text-model-interface.h>
41 class ControlInterface;
42 class EditableControlInterface;
44 class RenderingController;
46 typedef IntrusivePtr<Controller> ControllerPtr;
49 * @brief A Text Controller is used by UI Controls which display text.
51 * It manipulates the Logical & Visual text models on behalf of the UI Controls.
52 * It provides a view of the text that can be used by rendering back-ends.
54 * For selectable/editable UI controls, the controller handles input events from the UI control
55 * and decorations (grab handles etc) via the Decorator::ControllerInterface interface.
57 * The text selection popup button callbacks are as well handled via the TextSelectionPopupCallbackInterface interface.
59 class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface
61 public: // Enumerated types.
64 * @brief Text related operations to be done in the relayout process.
68 NO_OPERATION = 0x0000,
69 CONVERT_TO_UTF32 = 0x0001,
71 VALIDATE_FONTS = 0x0004,
72 GET_LINE_BREAKS = 0x0008,
73 GET_WORD_BREAKS = 0x0010,
76 GET_GLYPH_METRICS = 0x0080,
78 UPDATE_LAYOUT_SIZE = 0x0200,
82 UPDATE_DIRECTION = 0x2000,
83 ALL_OPERATIONS = 0xFFFF
87 * @brief Used to distinguish between regular key events and IMF events
96 * @brief Used to specify whether to update the input style.
98 enum UpdateInputStyleType
101 DONT_UPDATE_INPUT_STYLE
105 * @brief Used to specify what has been updated after the Relayout() method has been called.
109 NONE_UPDATED = 0x0, ///< Nothing has been updated.
110 MODEL_UPDATED = 0x1, ///< The text's model has been updated.
111 DECORATOR_UPDATED = 0x2 ///< The decoration has been updated.
115 * @brief Different placeholder-text can be shown when the control is active/inactive.
119 PLACEHOLDER_TYPE_ACTIVE,
120 PLACEHOLDER_TYPE_INACTIVE,
123 public: // Constructor.
126 * @brief Create a new instance of a Controller.
128 * @return A pointer to a new Controller.
130 static ControllerPtr New();
133 * @brief Create a new instance of a Controller.
135 * @param[in] controlInterface The control's interface.
137 * @return A pointer to a new Controller.
139 static ControllerPtr New( ControlInterface* controlInterface );
142 * @brief Create a new instance of a Controller.
144 * @param[in] controlInterface The control's interface.
145 * @param[in] editableControlInterface The editable control's interface.
147 * @return A pointer to a new Controller.
149 static ControllerPtr New( ControlInterface* controlInterface,
150 EditableControlInterface* editableControlInterface );
152 public: // Configure the text controller.
155 * @brief Called to enable text input.
157 * @note Selectable or editable controls should call this once after Controller::New().
158 * @param[in] decorator Used to create cursor, selection handle decorations etc.
160 void EnableTextInput( DecoratorPtr decorator );
163 * @brief Used to switch between bitmap & vector based glyphs
165 * @param[in] glyphType The type of glyph; note that metrics for bitmap & vector based glyphs are different.
167 void SetGlyphType( TextAbstraction::GlyphType glyphType );
170 * @brief Enables/disables the mark-up processor.
172 * By default is disabled.
174 * @param[in] enable Whether to enable the mark-up processor.
176 void SetMarkupProcessorEnabled( bool enable );
179 * @brief Retrieves whether the mark-up processor is enabled.
181 * By default is disabled.
183 * @return @e true if the mark-up processor is enabled, otherwise returns @e false.
185 bool IsMarkupProcessorEnabled() const;
188 * @brief Enables/disables the auto text scrolling
190 * By default is disabled.
192 * @param[in] enable Whether to enable the auto scrolling
194 void SetAutoScrollEnabled( bool enable );
197 * @brief Retrieves whether auto text scrolling is enabled.
199 * By default is disabled.
201 * @return @e true if auto scrolling is enabled, otherwise returns @e false.
203 bool IsAutoScrollEnabled() const;
206 * @brief Get direction of the text from the first line of text,
207 * @return bool rtl (right to left) is true
209 CharacterDirection GetAutoScrollDirection() const;
212 * @brief Get the alignment offset of the first line of text.
214 * @return The alignment offset.
216 float GetAutoScrollLineAlignment() const;
219 * @brief Enables the horizontal scrolling.
221 * @param[in] enable Whether to enable the horizontal scrolling.
223 void SetHorizontalScrollEnabled( bool enable );
226 * @brief Retrieves whether the horizontal scrolling is enabled.
228 * @return @e true if the horizontal scrolling is enabled, otherwise it returns @e false.
230 bool IsHorizontalScrollEnabled() const;
233 * @brief Enables the vertical scrolling.
235 * @param[in] enable Whether to enable the vertical scrolling.
237 void SetVerticalScrollEnabled( bool enable );
240 * @brief Retrieves whether the verticall scrolling is enabled.
242 * @return @e true if the vertical scrolling is enabled, otherwise it returns @e false.
244 bool IsVerticalScrollEnabled() const;
247 * @brief Enables the smooth handle panning.
249 * @param[in] enable Whether to enable the smooth handle panning.
251 void SetSmoothHandlePanEnabled( bool enable );
254 * @brief Retrieves whether the smooth handle panning is enabled.
256 * @return @e true if the smooth handle panning is enabled.
258 bool IsSmoothHandlePanEnabled() const;
261 * @brief Sets the maximum number of characters that can be inserted into the TextModel
263 * @param[in] maxCharacters maximum number of characters to be accepted
265 void SetMaximumNumberOfCharacters( Length maxCharacters );
268 * @brief Sets the maximum number of characters that can be inserted into the TextModel
270 * @param[in] maxCharacters maximum number of characters to be accepted
272 int GetMaximumNumberOfCharacters();
275 * @brief Called to enable/disable cursor blink.
277 * @note Only editable controls should calls this.
278 * @param[in] enabled Whether the cursor should blink or not.
280 void SetEnableCursorBlink( bool enable );
283 * @brief Query whether cursor blink is enabled.
285 * @return Whether the cursor should blink or not.
287 bool GetEnableCursorBlink() const;
290 * @brief Whether to enable the multi-line layout.
292 * @param[in] enable \e true enables the multi-line (by default)
294 void SetMultiLineEnabled( bool enable );
297 * @return Whether the multi-line layout is enabled.
299 bool IsMultiLineEnabled() const;
302 * @brief Sets the text's horizontal alignment.
304 * @param[in] alignment The horizontal alignment.
306 void SetHorizontalAlignment( Layout::HorizontalAlignment alignment );
309 * @copydoc ModelInterface::GetHorizontalAlignment()
311 Layout::HorizontalAlignment GetHorizontalAlignment() const;
314 * @brief Sets the text's vertical alignment.
316 * @param[in] alignment The vertical alignment.
318 void SetVerticalAlignment( Layout::VerticalAlignment alignment );
321 * @copydoc ModelInterface::GetVerticalAlignment()
323 Layout::VerticalAlignment GetVerticalAlignment() const;
326 * @brief Enable or disable the text elide.
328 * @param[in] enabled Whether to enable the text elide.
330 void SetTextElideEnabled( bool enabled );
333 * @copydoc ModelInterface::IsTextElideEnabled()
335 bool IsTextElideEnabled() const;
338 * @brief Sets input type to password
340 * @note The string is displayed continuous "*"
342 * @param[in] passwordInput True if password input is enabled.
344 void SetInputModePassword( bool passwordInput );
347 * @brief Returns whether the input mode type is set as password.
349 * @return True if input mode type is password
351 bool IsInputModePassword();
356 * @brief Replaces any text previously set.
358 * @note This will be converted into UTF-32 when stored in the text model.
359 * @param[in] text A string of UTF-8 characters.
361 void SetText( const std::string& text );
364 * @brief Retrieve any text previously set.
366 * @param[out] text A string of UTF-8 characters.
368 void GetText( std::string& text ) const;
371 * @brief Replaces any placeholder text previously set.
373 * @param[in] type Different placeholder-text can be shown when the control is active/inactive.
374 * @param[in] text A string of UTF-8 characters.
376 void SetPlaceholderText( PlaceholderType type, const std::string& text );
379 * @brief Retrieve any placeholder text previously set.
381 * @param[in] type Different placeholder-text can be shown when the control is active/inactive.
382 * @param[out] A string of UTF-8 characters.
384 void GetPlaceholderText( PlaceholderType type, std::string& text ) const;
387 * @ brief Update the text after a font change
388 * @param[in] newDefaultFont The new font to change to
390 void UpdateAfterFontChange( const std::string& newDefaultFont );
392 public: // Default style & Input style
395 * @brief Set the default font family.
397 * @param[in] defaultFontFamily The default font family.
399 void SetDefaultFontFamily( const std::string& defaultFontFamily );
402 * @brief Retrieve the default font family.
404 * @return The default font family.
406 const std::string& GetDefaultFontFamily() const;
409 * @brief Sets the default font weight.
411 * @param[in] weight The font weight.
413 void SetDefaultFontWeight( FontWeight weight );
416 * @brief Whether the font's weight has been defined.
418 bool IsDefaultFontWeightDefined() const;
421 * @brief Retrieves the default font weight.
423 * @return The default font weight.
425 FontWeight GetDefaultFontWeight() const;
428 * @brief Sets the default font width.
430 * @param[in] width The font width.
432 void SetDefaultFontWidth( FontWidth width );
435 * @brief Whether the font's width has been defined.
437 bool IsDefaultFontWidthDefined() const;
440 * @brief Retrieves the default font width.
442 * @return The default font width.
444 FontWidth GetDefaultFontWidth() const;
447 * @brief Sets the default font slant.
449 * @param[in] slant The font slant.
451 void SetDefaultFontSlant( FontSlant slant );
454 * @brief Whether the font's slant has been defined.
456 bool IsDefaultFontSlantDefined() const;
459 * @brief Retrieves the default font slant.
461 * @return The default font slant.
463 FontSlant GetDefaultFontSlant() const;
466 * @brief Set the default point size.
468 * @param[in] pointSize The default point size.
470 void SetDefaultPointSize( float pointSize );
473 * @brief Retrieve the default point size.
475 * @return The default point size.
477 float GetDefaultPointSize() const;
480 * @brief Sets the text's default color.
482 * @param color The default color.
484 void SetDefaultColor( const Vector4& color );
487 * @brief Retrieves the text's default color.
489 * @return The default color.
491 const Vector4& GetDefaultColor() const;
494 * @brief Set the text color
496 * @param textColor The text color
498 void SetPlaceholderTextColor( const Vector4& textColor );
501 * @brief Retrieve the text color
503 * @return The text color
505 const Vector4& GetPlaceholderTextColor() const;
508 * @brief Set the shadow offset.
510 * @param[in] shadowOffset The shadow offset, 0,0 indicates no shadow.
512 void SetShadowOffset( const Vector2& shadowOffset );
515 * @brief Retrieve the shadow offset.
517 * @return The shadow offset.
519 const Vector2& GetShadowOffset() const;
522 * @brief Set the shadow color.
524 * @param[in] shadowColor The shadow color.
526 void SetShadowColor( const Vector4& shadowColor );
529 * @brief Retrieve the shadow color.
531 * @return The shadow color.
533 const Vector4& GetShadowColor() const;
536 * @brief Set the underline color.
538 * @param[in] color color of underline.
540 void SetUnderlineColor( const Vector4& color );
543 * @brief Retrieve the underline color.
545 * @return The underline color.
547 const Vector4& GetUnderlineColor() const;
550 * @brief Set the underline enabled flag.
552 * @param[in] enabled The underline enabled flag.
554 void SetUnderlineEnabled( bool enabled );
557 * @brief Returns whether the text is underlined or not.
559 * @return The underline state.
561 bool IsUnderlineEnabled() const;
564 * @brief Set the override used for underline height, 0 indicates height will be supplied by font metrics
566 * @param[in] height The height in pixels of the underline
568 void SetUnderlineHeight( float height );
571 * @brief Retrieves the override height of an underline, 0 indicates height is supplied by font metrics
573 * @return The height of the underline, or 0 if height is not overrided.
575 float GetUnderlineHeight() const;
578 * @brief Sets the emboss's properties string.
580 * @note The string is stored to be recovered.
582 * @param[in] embossProperties The emboss's properties string.
584 void SetDefaultEmbossProperties( const std::string& embossProperties );
587 * @brief Retrieves the emboss's properties string.
589 * @return The emboss's properties string.
591 const std::string& GetDefaultEmbossProperties() const;
594 * @brief Sets the outline's properties string.
596 * @note The string is stored to be recovered.
598 * @param[in] outlineProperties The outline's properties string.
600 void SetDefaultOutlineProperties( const std::string& outlineProperties );
603 * @brief Retrieves the outline's properties string.
605 * @return The outline's properties string.
607 const std::string& GetDefaultOutlineProperties() const;
610 * @brief Sets the default line spacing.
612 * @param[in] lineSpacing The line spacing.
614 void SetDefaultLineSpacing( float lineSpacing );
617 * @brief Retrieves the default line spacing.
619 * @return The line spacing.
621 float GetDefaultLineSpacing() const;
624 * @brief Sets the input text's color.
626 * @param[in] color The input text's color.
628 void SetInputColor( const Vector4& color );
631 * @brief Retrieves the input text's color.
633 * @return The input text's color.
635 const Vector4& GetInputColor() const;
638 * @brief Sets the input text's font family name.
640 * @param[in] fontFamily The text's font family name.
642 void SetInputFontFamily( const std::string& fontFamily );
645 * @brief Retrieves the input text's font family name.
647 * @return The input text's font family name.
649 const std::string& GetInputFontFamily() const;
652 * @brief Sets the input font's weight.
654 * @param[in] weight The input font's weight.
656 void SetInputFontWeight( FontWeight weight );
659 * @return Whether the font's weight has been defined.
661 bool IsInputFontWeightDefined() const;
664 * @brief Retrieves the input font's weight.
666 * @return The input font's weight.
668 FontWeight GetInputFontWeight() const;
671 * @brief Sets the input font's width.
673 * @param[in] width The input font's width.
675 void SetInputFontWidth( FontWidth width );
678 * @return Whether the font's width has been defined.
680 bool IsInputFontWidthDefined() const;
683 * @brief Retrieves the input font's width.
685 * @return The input font's width.
687 FontWidth GetInputFontWidth() const;
690 * @brief Sets the input font's slant.
692 * @param[in] slant The input font's slant.
694 void SetInputFontSlant( FontSlant slant );
697 * @return Whether the font's slant has been defined.
699 bool IsInputFontSlantDefined() const;
702 * @brief Retrieves the input font's slant.
704 * @return The input font's slant.
706 FontSlant GetInputFontSlant() const;
709 * @brief Sets the input font's point size.
711 * @param[in] size The input font's point size.
713 void SetInputFontPointSize( float size );
716 * @brief Retrieves the input font's point size.
718 * @return The input font's point size.
720 float GetInputFontPointSize() const;
723 * @brief Sets the input line spacing.
725 * @param[in] lineSpacing The line spacing.
727 void SetInputLineSpacing( float lineSpacing );
730 * @brief Retrieves the input line spacing.
732 * @return The line spacing.
734 float GetInputLineSpacing() const;
737 * @brief Sets the input shadow's properties string.
739 * @note The string is stored to be recovered.
741 * @param[in] shadowProperties The shadow's properties string.
743 void SetInputShadowProperties( const std::string& shadowProperties );
746 * @brief Retrieves the input shadow's properties string.
748 * @return The shadow's properties string.
750 const std::string& GetInputShadowProperties() const;
753 * @brief Sets the input underline's properties string.
755 * @note The string is stored to be recovered.
757 * @param[in] underlineProperties The underline's properties string.
759 void SetInputUnderlineProperties( const std::string& underlineProperties );
762 * @brief Retrieves the input underline's properties string.
764 * @return The underline's properties string.
766 const std::string& GetInputUnderlineProperties() const;
769 * @brief Sets the input emboss's properties string.
771 * @note The string is stored to be recovered.
773 * @param[in] embossProperties The emboss's properties string.
775 void SetInputEmbossProperties( const std::string& embossProperties );
778 * @brief Retrieves the input emboss's properties string.
780 * @return The emboss's properties string.
782 const std::string& GetInputEmbossProperties() const;
785 * @brief Sets input the outline's properties string.
787 * @note The string is stored to be recovered.
789 * @param[in] outlineProperties The outline's properties string.
791 void SetInputOutlineProperties( const std::string& outlineProperties );
794 * @brief Retrieves the input outline's properties string.
796 * @return The outline's properties string.
798 const std::string& GetInputOutlineProperties() const;
800 public: // Queries & retrieves.
803 * @brief Return the layout engine.
805 * @return A reference to the layout engine.
807 Layout::Engine& GetLayoutEngine();
810 * @brief Return a view of the text.
812 * @return A reference to the view.
817 * @copydoc Control::GetNaturalSize()
819 Vector3 GetNaturalSize();
822 * @copydoc Control::GetHeightForWidth()
824 float GetHeightForWidth( float width );
827 * @brief Retrieves the text's model.
829 * @return A pointer to the text's model.
831 const ModelInterface* const GetTextModel() const;
834 * @brief Used to get scrolled distance by user input
836 * @return Distance from last scroll offset to new scroll offset
838 float GetScrollAmountByUserInput();
843 * @brief Triggers a relayout which updates View (if necessary).
845 * @note UI Controls are expected to minimize calls to this method e.g. call once after size negotiation.
846 * @param[in] size A the size of a bounding box to layout text within.
848 * @return Whether the text model or decorations were updated.
850 UpdateTextType Relayout( const Size& size );
853 * @brief Request a relayout using the ControlInterface.
855 void RequestRelayout();
857 public: // Input style change signals.
860 * @return Whether the queue of input style changed signals is empty.
862 bool IsInputStyleChangedSignalsQueueEmpty();
865 * @brief Process all pending input style changed signals.
867 * Calls the Text::ControlInterface::InputStyleChanged() method which is overriden by the
868 * text controls. Text controls may send signals to state the input style has changed.
870 void ProcessInputStyleChangedSignals();
872 public: // Text-input Event Queuing.
875 * @brief Called by editable UI controls when keyboard focus is gained.
877 void KeyboardFocusGainEvent();
880 * @brief Called by editable UI controls when focus is lost.
882 void KeyboardFocusLostEvent();
885 * @brief Called by editable UI controls when key events are received.
887 * @param[in] event The key event.
888 * @param[in] type Used to distinguish between regular key events and IMF events.
890 bool KeyEvent( const Dali::KeyEvent& event );
893 * @brief Called by editable UI controls when a tap gesture occurs.
894 * @param[in] tapCount The number of taps.
895 * @param[in] x The x position relative to the top-left of the parent control.
896 * @param[in] y The y position relative to the top-left of the parent control.
898 void TapEvent( unsigned int tapCount, float x, float y );
901 * @brief Called by editable UI controls when a pan gesture occurs.
903 * @param[in] state The state of the gesture.
904 * @param[in] displacement This distance panned since the last pan gesture.
906 void PanEvent( Gesture::State state, const Vector2& displacement );
909 * @brief Called by editable UI controls when a long press gesture occurs.
911 * @param[in] state The state of the gesture.
912 * @param[in] x The x position relative to the top-left of the parent control.
913 * @param[in] y The y position relative to the top-left of the parent control.
915 void LongPressEvent( Gesture::State state, float x, float y );
918 * @brief Event received from IMF manager
920 * @param[in] imfManager The IMF manager.
921 * @param[in] imfEvent The event received.
922 * @return A data struture indicating if update is needed, cursor position and current text.
924 ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent );
927 * @brief Event from Clipboard notifying an Item has been selected for pasting
929 void PasteClipboardItemEvent();
931 protected: // Inherit from Text::Decorator::ControllerInterface.
934 * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::GetTargetSize()
936 virtual void GetTargetSize( Vector2& targetSize );
939 * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::AddDecoration()
941 virtual void AddDecoration( Actor& actor, bool needsClipping );
944 * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::DecorationEvent()
946 virtual void DecorationEvent( HandleType handle, HandleState state, float x, float y );
948 protected: // Inherit from TextSelectionPopup::TextPopupButtonCallbackInterface.
951 * @copydoc Dali::Toolkit::TextSelectionPopup::TextPopupButtonCallbackInterface::TextPopupButtonTouched()
953 virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button );
958 * @brief Called by editable UI controls when key events are received.
960 * @param[in] text The text to insert.
961 * @param[in] type Used to distinguish between regular key events and IMF events.
963 void InsertText( const std::string& text, InsertType type );
966 * @brief Paste given string into Text model
967 * @param[in] stringToPaste this string will be inserted into the text model
969 void PasteText( const std::string& stringToPaste );
972 * @brief Remove a given number of characters
974 * When predictve text is used the pre-edit text is removed and inserted again with the new characters.
975 * The UpdateInputStyleType @type parameter if set to DONT_UPDATE_INPUT_STYLE avoids to update the input
976 * style when pre-edit text is removed.
978 * @param[in] cursorOffset Start position from the current cursor position to start deleting characters.
979 * @param[in] numberOfCharacters The number of characters to delete from the cursorOffset.
980 * @param[in] type Whether to update the input style.
981 * @return True if the remove was successful.
983 bool RemoveText( int cursorOffset,
984 int numberOfCharacters,
985 UpdateInputStyleType type );
988 * @brief Checks if text is selected and if so removes it.
989 * @return true if text was removed
991 bool RemoveSelectedText();
993 private: // Relayout.
996 * @brief Lays-out the text.
998 * GetNaturalSize(), GetHeightForWidth() and Relayout() calls this method.
1000 * @param[in] size A the size of a bounding box to layout text within.
1001 * @param[in] operations The layout operations which need to be done.
1002 * @param[out] layoutSize The size of the laid-out text.
1004 bool DoRelayout( const Size& size,
1005 OperationsMask operations,
1009 * @brief Calulates the vertical offset to align the text inside the bounding box.
1011 * @param[in] size The size of the bounding box.
1013 void CalculateVerticalOffset( const Size& size );
1018 * @brief Process queued events which modify the model.
1020 void ProcessModifyEvents();
1023 * @brief Used to process an event queued from SetText()
1025 void TextReplacedEvent();
1028 * @brief Used to process an event queued from key events etc.
1030 void TextInsertedEvent();
1033 * @brief Used to process an event queued from backspace key etc.
1035 void TextDeletedEvent();
1038 * @brief Creates a selection event.
1040 * It could be called from the TapEvent (double tap) or when the text selection popup's sellect all button is pressed.
1042 * @param[in] x The x position relative to the top-left of the parent control.
1043 * @param[in] y The y position relative to the top-left of the parent control.
1044 * @param[in] selectAll Whether the whole text is selected.
1046 void SelectEvent( float x, float y, bool selectAll );
1049 * @brief Helper to KeyEvent() to handle the backspace case.
1051 * @return True if a character was deleted.
1053 bool BackspaceKeyEvent();
1055 private: // Helpers.
1058 * @brief Used to remove the text included the placeholder text.
1063 * @brief Helper to show the place holder text..
1065 void ShowPlaceholderText();
1068 * @brief Helper to clear font-specific data (only).
1070 void ClearFontData();
1073 * @brief Helper to clear text's style data.
1075 void ClearStyleData();
1078 * @brief Used to reset the cursor position after setting a new text.
1080 * @param[in] cursorIndex Where to place the cursor.
1082 void ResetCursorPosition( CharacterIndex cursorIndex );
1085 * @brief Used to reset the scroll position after setting a new text.
1087 void ResetScrollPosition();
1089 private: // Private contructors & copy operator.
1092 * @brief Private constructor.
1097 * @brief Private constructor.
1099 Controller( ControlInterface* controlInterface );
1102 * @brief Private constructor.
1104 Controller( ControlInterface* controlInterface,
1105 EditableControlInterface* editableControlInterface );
1108 Controller( const Controller& handle );
1111 Controller& operator=( const Controller& handle );
1113 protected: // Destructor.
1116 * @brief A reference counted object may only be deleted by calling Unreference().
1118 virtual ~Controller();
1128 } // namespace Toolkit
1132 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_H