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-scroller-interface.h>
41 class ControlInterface;
42 class EditableControlInterface;
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, public Text::ScrollerInterface
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 );
153 * @brief Sets the text-control interface.
155 * @param[in] controlInterface The text-control interface.
157 void SetTextControlInterface( ControlInterface* controlInterface );
159 public: // Configure the text controller.
162 * @brief Called to enable text input.
164 * @note Selectable or editable controls should call this once after Controller::New().
165 * @param[in] decorator Used to create cursor, selection handle decorations etc.
167 void EnableTextInput( DecoratorPtr decorator );
170 * @brief Used to switch between bitmap & vector based glyphs
172 * @param[in] glyphType The type of glyph; note that metrics for bitmap & vector based glyphs are different.
174 void SetGlyphType( TextAbstraction::GlyphType glyphType );
177 * @brief Enables/disables the mark-up processor.
179 * By default is disabled.
181 * @param[in] enable Whether to enable the mark-up processor.
183 void SetMarkupProcessorEnabled( bool enable );
186 * @brief Retrieves whether the mark-up processor is enabled.
188 * By default is disabled.
190 * @return @e true if the mark-up processor is enabled, otherwise returns @e false.
192 bool IsMarkupProcessorEnabled() const;
195 * @brief Enables/disables the auto text scrolling
197 * By default is disabled.
199 * @param[in] enable Whether to enable the auto scrolling
201 void SetAutoScrollEnabled( bool enable );
204 * @brief Retrieves whether auto text scrolling is enabled.
206 * By default is disabled.
208 * @return @e true if auto scrolling is enabled, otherwise returns @e false.
210 bool IsAutoScrollEnabled() const;
213 * @brief Sets the speed the text should automatically scroll at.
215 * @param[in] scrollSpeed The speed of scrolling in pixels per second.
217 void SetAutoscrollSpeed( int scrollSpeed );
220 * @brief Retrieves the auto scroll speed.
222 * @return The auto scroll speed in pixels per second.
224 int GetAutoScrollSpeed() const;
227 * @brief Sets the number of loops the text should scroll.
229 * @param[in] loopCount The number of loops.
231 void SetAutoScrollLoopCount( int loopCount );
234 * @brief Retrieves the number of loops the text should scroll.
236 * @return The numebr of loops.
238 int GetAutoScrollLoopCount() const;
241 * @brief Sets the gap before text wraps around when scrolling.
243 * @param[in] wrapGap The gap in pixels.
245 void SetAutoScrollWrapGap( float wrapGap );
248 * @brief Retrieves the gap before text wraps around when scrolling.
250 * @return The gap in pixels.
252 float GetAutoScrollWrapGap() const;
255 * @brief Retrieves the text's autoscroll data.
257 * @return The text's autoscroll data.
259 const ScrollerData* const GetAutoScrollData();
262 * @brief Enables the horizontal scrolling.
264 * @param[in] enable Whether to enable the horizontal scrolling.
266 void SetHorizontalScrollEnabled( bool enable );
269 * @brief Retrieves whether the horizontal scrolling is enabled.
271 * @return @e true if the horizontal scrolling is enabled, otherwise it returns @e false.
273 bool IsHorizontalScrollEnabled() const;
276 * @brief Enables the vertical scrolling.
278 * @param[in] enable Whether to enable the vertical scrolling.
280 void SetVerticalScrollEnabled( bool enable );
283 * @brief Retrieves whether the verticall scrolling is enabled.
285 * @return @e true if the vertical scrolling is enabled, otherwise it returns @e false.
287 bool IsVerticalScrollEnabled() const;
290 * @brief Enables the smooth handle panning.
292 * @param[in] enable Whether to enable the smooth handle panning.
294 void SetSmoothHandlePanEnabled( bool enable );
297 * @brief Retrieves whether the smooth handle panning is enabled.
299 * @return @e true if the smooth handle panning is enabled.
301 bool IsSmoothHandlePanEnabled() const;
304 * @brief Sets the maximum number of characters that can be inserted into the TextModel
306 * @param[in] maxCharacters maximum number of characters to be accepted
308 void SetMaximumNumberOfCharacters( Length maxCharacters );
311 * @brief Sets the maximum number of characters that can be inserted into the TextModel
313 * @param[in] maxCharacters maximum number of characters to be accepted
315 int GetMaximumNumberOfCharacters();
318 * @brief Called to enable/disable cursor blink.
320 * @note Only editable controls should calls this.
321 * @param[in] enabled Whether the cursor should blink or not.
323 void SetEnableCursorBlink( bool enable );
326 * @brief Query whether cursor blink is enabled.
328 * @return Whether the cursor should blink or not.
330 bool GetEnableCursorBlink() const;
333 * @brief Whether to enable the multi-line layout.
335 * @param[in] enable \e true enables the multi-line (by default)
337 void SetMultiLineEnabled( bool enable );
340 * @return Whether the multi-line layout is enabled.
342 bool IsMultiLineEnabled() const;
345 * @copydoc Dali::Toolkit::Text::LayoutEngine::SetHorizontalAlignment()
347 void SetHorizontalAlignment( LayoutEngine::HorizontalAlignment alignment );
350 * @copydoc Dali::Toolkit::Text::LayoutEngine::GetHorizontalAlignment()
352 LayoutEngine::HorizontalAlignment GetHorizontalAlignment() const;
355 * @copydoc Dali::Toolkit::Text::LayoutEngine::SetVerticalAlignment()
357 void SetVerticalAlignment( LayoutEngine::VerticalAlignment alignment );
360 * @copydoc Dali::Toolkit::Text::LayoutEngine::GetVerticalAlignment()
362 LayoutEngine::VerticalAlignment GetVerticalAlignment() const;
367 * @brief Replaces any text previously set.
369 * @note This will be converted into UTF-32 when stored in the text model.
370 * @param[in] text A string of UTF-8 characters.
372 void SetText( const std::string& text );
375 * @brief Retrieve any text previously set.
377 * @param[out] text A string of UTF-8 characters.
379 void GetText( std::string& text ) const;
382 * @brief Replaces any placeholder text previously set.
384 * @param[in] type Different placeholder-text can be shown when the control is active/inactive.
385 * @param[in] text A string of UTF-8 characters.
387 void SetPlaceholderText( PlaceholderType type, const std::string& text );
390 * @brief Retrieve any placeholder text previously set.
392 * @param[in] type Different placeholder-text can be shown when the control is active/inactive.
393 * @param[out] A string of UTF-8 characters.
395 void GetPlaceholderText( PlaceholderType type, std::string& text ) const;
398 * @ brief Update the text after a font change
399 * @param[in] newDefaultFont The new font to change to
401 void UpdateAfterFontChange( const std::string& newDefaultFont );
403 public: // Default style & Input style
406 * @brief Set the default font family.
408 * @param[in] defaultFontFamily The default font family.
410 void SetDefaultFontFamily( const std::string& defaultFontFamily );
413 * @brief Retrieve the default font family.
415 * @return The default font family.
417 const std::string& GetDefaultFontFamily() const;
420 * @brief Sets the default font weight.
422 * @param[in] weight The font weight.
424 void SetDefaultFontWeight( FontWeight weight );
427 * @brief Whether the font's weight has been defined.
429 bool IsDefaultFontWeightDefined() const;
432 * @brief Retrieves the default font weight.
434 * @return The default font weight.
436 FontWeight GetDefaultFontWeight() const;
439 * @brief Sets the default font width.
441 * @param[in] width The font width.
443 void SetDefaultFontWidth( FontWidth width );
446 * @brief Whether the font's width has been defined.
448 bool IsDefaultFontWidthDefined() const;
451 * @brief Retrieves the default font width.
453 * @return The default font width.
455 FontWidth GetDefaultFontWidth() const;
458 * @brief Sets the default font slant.
460 * @param[in] slant The font slant.
462 void SetDefaultFontSlant( FontSlant slant );
465 * @brief Whether the font's slant has been defined.
467 bool IsDefaultFontSlantDefined() const;
470 * @brief Retrieves the default font slant.
472 * @return The default font slant.
474 FontSlant GetDefaultFontSlant() const;
477 * @brief Set the default point size.
479 * @param[in] pointSize The default point size.
481 void SetDefaultPointSize( float pointSize );
484 * @brief Retrieve the default point size.
486 * @return The default point size.
488 float GetDefaultPointSize() const;
491 * @brief Set the text color
493 * @param textColor The text color
495 void SetTextColor( const Vector4& textColor );
498 * @brief Retrieve the text color
500 * @return The text color
502 const Vector4& GetTextColor() const;
505 * @brief Set the text color
507 * @param textColor The text color
509 void SetPlaceholderTextColor( const Vector4& textColor );
512 * @brief Retrieve the text color
514 * @return The text color
516 const Vector4& GetPlaceholderTextColor() const;
519 * @brief Set the shadow offset.
521 * @param[in] shadowOffset The shadow offset, 0,0 indicates no shadow.
523 void SetShadowOffset( const Vector2& shadowOffset );
526 * @brief Retrieve the shadow offset.
528 * @return The shadow offset.
530 const Vector2& GetShadowOffset() const;
533 * @brief Set the shadow color.
535 * @param[in] shadowColor The shadow color.
537 void SetShadowColor( const Vector4& shadowColor );
540 * @brief Retrieve the shadow color.
542 * @return The shadow color.
544 const Vector4& GetShadowColor() const;
547 * @brief Set the underline color.
549 * @param[in] color color of underline.
551 void SetUnderlineColor( const Vector4& color );
554 * @brief Retrieve the underline color.
556 * @return The underline color.
558 const Vector4& GetUnderlineColor() const;
561 * @brief Set the underline enabled flag.
563 * @param[in] enabled The underline enabled flag.
565 void SetUnderlineEnabled( bool enabled );
568 * @brief Returns whether the text is underlined or not.
570 * @return The underline state.
572 bool IsUnderlineEnabled() const;
575 * @brief Set the override used for underline height, 0 indicates height will be supplied by font metrics
577 * @param[in] height The height in pixels of the underline
579 void SetUnderlineHeight( float height );
582 * @brief Retrieves the override height of an underline, 0 indicates height is supplied by font metrics
584 * @return The height of the underline, or 0 if height is not overrided.
586 float GetUnderlineHeight() const;
589 * @brief Sets the emboss's properties string.
591 * @note The string is stored to be recovered.
593 * @param[in] embossProperties The emboss's properties string.
595 void SetDefaultEmbossProperties( const std::string& embossProperties );
598 * @brief Retrieves the emboss's properties string.
600 * @return The emboss's properties string.
602 const std::string& GetDefaultEmbossProperties() const;
605 * @brief Sets the outline's properties string.
607 * @note The string is stored to be recovered.
609 * @param[in] outlineProperties The outline's properties string.
611 void SetDefaultOutlineProperties( const std::string& outlineProperties );
614 * @brief Retrieves the outline's properties string.
616 * @return The outline's properties string.
618 const std::string& GetDefaultOutlineProperties() const;
621 * @brief Sets the default line spacing.
623 * @param[in] lineSpacing The line spacing.
625 void SetDefaultLineSpacing( float lineSpacing );
628 * @brief Retrieves the default line spacing.
630 * @return The line spacing.
632 float GetDefaultLineSpacing() const;
635 * @brief Sets the input text's color.
637 * @param[in] color The input text's color.
639 void SetInputColor( const Vector4& color );
642 * @brief Retrieves the input text's color.
644 * @return The input text's color.
646 const Vector4& GetInputColor() const;
649 * @brief Sets the input text's font family name.
651 * @param[in] fontFamily The text's font family name.
653 void SetInputFontFamily( const std::string& fontFamily );
656 * @brief Retrieves the input text's font family name.
658 * @return The input text's font family name.
660 const std::string& GetInputFontFamily() const;
663 * @brief Sets the input font's weight.
665 * @param[in] weight The input font's weight.
667 void SetInputFontWeight( FontWeight weight );
670 * @return Whether the font's weight has been defined.
672 bool IsInputFontWeightDefined() const;
675 * @brief Retrieves the input font's weight.
677 * @return The input font's weight.
679 FontWeight GetInputFontWeight() const;
682 * @brief Sets the input font's width.
684 * @param[in] width The input font's width.
686 void SetInputFontWidth( FontWidth width );
689 * @return Whether the font's width has been defined.
691 bool IsInputFontWidthDefined() const;
694 * @brief Retrieves the input font's width.
696 * @return The input font's width.
698 FontWidth GetInputFontWidth() const;
701 * @brief Sets the input font's slant.
703 * @param[in] slant The input font's slant.
705 void SetInputFontSlant( FontSlant slant );
708 * @return Whether the font's slant has been defined.
710 bool IsInputFontSlantDefined() const;
713 * @brief Retrieves the input font's slant.
715 * @return The input font's slant.
717 FontSlant GetInputFontSlant() const;
720 * @brief Sets the input font's point size.
722 * @param[in] size The input font's point size.
724 void SetInputFontPointSize( float size );
727 * @brief Retrieves the input font's point size.
729 * @return The input font's point size.
731 float GetInputFontPointSize() const;
734 * @brief Sets the input line spacing.
736 * @param[in] lineSpacing The line spacing.
738 void SetInputLineSpacing( float lineSpacing );
741 * @brief Retrieves the input line spacing.
743 * @return The line spacing.
745 float GetInputLineSpacing() const;
748 * @brief Sets the input shadow's properties string.
750 * @note The string is stored to be recovered.
752 * @param[in] shadowProperties The shadow's properties string.
754 void SetInputShadowProperties( const std::string& shadowProperties );
757 * @brief Retrieves the input shadow's properties string.
759 * @return The shadow's properties string.
761 const std::string& GetInputShadowProperties() const;
764 * @brief Sets the input underline's properties string.
766 * @note The string is stored to be recovered.
768 * @param[in] underlineProperties The underline's properties string.
770 void SetInputUnderlineProperties( const std::string& underlineProperties );
773 * @brief Retrieves the input underline's properties string.
775 * @return The underline's properties string.
777 const std::string& GetInputUnderlineProperties() const;
780 * @brief Sets the input emboss's properties string.
782 * @note The string is stored to be recovered.
784 * @param[in] embossProperties The emboss's properties string.
786 void SetInputEmbossProperties( const std::string& embossProperties );
789 * @brief Retrieves the input emboss's properties string.
791 * @return The emboss's properties string.
793 const std::string& GetInputEmbossProperties() const;
796 * @brief Sets input the outline's properties string.
798 * @note The string is stored to be recovered.
800 * @param[in] outlineProperties The outline's properties string.
802 void SetInputOutlineProperties( const std::string& outlineProperties );
805 * @brief Retrieves the input outline's properties string.
807 * @return The outline's properties string.
809 const std::string& GetInputOutlineProperties() const;
811 public: // Queries & retrieves.
814 * @brief Return the layout engine.
816 * @return A reference to the layout engine.
818 LayoutEngine& GetLayoutEngine();
821 * @brief Return a view of the text.
823 * @return A reference to the view.
828 * @brief Query the current scroll position; the UI control is responsible for moving actors to this position.
830 * @return The scroll position.
832 const Vector2& GetScrollPosition() const;
835 * @copydoc Control::GetNaturalSize()
837 Vector3 GetNaturalSize();
840 * @copydoc Control::GetHeightForWidth()
842 float GetHeightForWidth( float width );
847 * @brief Triggers a relayout which updates View (if necessary).
849 * @note UI Controls are expected to minimize calls to this method e.g. call once after size negotiation.
850 * @param[in] size A the size of a bounding box to layout text within.
852 * @return Whether the text model or decorations were updated.
854 UpdateTextType Relayout( const Size& size );
857 * @brief Request a relayout using the ControlInterface.
859 void RequestRelayout();
861 public: // Input style change signals.
864 * @return Whether the queue of input style changed signals is empty.
866 bool IsInputStyleChangedSignalsQueueEmpty();
869 * @brief Process all pending input style changed signals.
871 * Calls the Text::ControlInterface::InputStyleChanged() method which is overriden by the
872 * text controls. Text controls may send signals to state the input style has changed.
874 void ProcessInputStyleChangedSignals();
876 public: // Text-input Event Queuing.
879 * @brief Called by editable UI controls when keyboard focus is gained.
881 void KeyboardFocusGainEvent();
884 * @brief Called by editable UI controls when focus is lost.
886 void KeyboardFocusLostEvent();
889 * @brief Called by editable UI controls when key events are received.
891 * @param[in] event The key event.
892 * @param[in] type Used to distinguish between regular key events and IMF events.
894 bool KeyEvent( const Dali::KeyEvent& event );
897 * @brief Called by editable UI controls when a tap gesture occurs.
898 * @param[in] tapCount The number of taps.
899 * @param[in] x The x position relative to the top-left of the parent control.
900 * @param[in] y The y position relative to the top-left of the parent control.
902 void TapEvent( unsigned int tapCount, float x, float y );
905 * @brief Called by editable UI controls when a pan gesture occurs.
907 * @param[in] state The state of the gesture.
908 * @param[in] displacement This distance panned since the last pan gesture.
910 void PanEvent( Gesture::State state, const Vector2& displacement );
913 * @brief Called by editable UI controls when a long press gesture occurs.
915 * @param[in] state The state of the gesture.
916 * @param[in] x The x position relative to the top-left of the parent control.
917 * @param[in] y The y position relative to the top-left of the parent control.
919 void LongPressEvent( Gesture::State state, float x, float y );
922 * @brief Event received from IMF manager
924 * @param[in] imfManager The IMF manager.
925 * @param[in] imfEvent The event received.
926 * @return A data struture indicating if update is needed, cursor position and current text.
928 ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent );
931 * @brief Event from Clipboard notifying an Item has been selected for pasting
933 void PasteClipboardItemEvent();
935 protected: // Inherit from Text::Decorator::ControllerInterface.
938 * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::GetTargetSize()
940 virtual void GetTargetSize( Vector2& targetSize );
943 * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::AddDecoration()
945 virtual void AddDecoration( Actor& actor, bool needsClipping );
948 * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::DecorationEvent()
950 virtual void DecorationEvent( HandleType handle, HandleState state, float x, float y );
952 protected: // Inherit from TextSelectionPopup::TextPopupButtonCallbackInterface.
955 * @copydoc Dali::Toolkit::TextSelectionPopup::TextPopupButtonCallbackInterface::TextPopupButtonTouched()
957 virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button );
959 private: // Inherit from TextScroller
962 * @copydoc Text::ScrollerInterface::ScrollingFinished()
964 virtual void ScrollingFinished();
969 * @brief Called by editable UI controls when key events are received.
971 * @param[in] text The text to insert.
972 * @param[in] type Used to distinguish between regular key events and IMF events.
974 void InsertText( const std::string& text, InsertType type );
977 * @brief Paste given string into Text model
978 * @param[in] stringToPaste this string will be inserted into the text model
980 void PasteText( const std::string& stringToPaste );
983 * @brief Remove a given number of characters
985 * When predictve text is used the pre-edit text is removed and inserted again with the new characters.
986 * The UpdateInputStyleType @type parameter if set to DONT_UPDATE_INPUT_STYLE avoids to update the input
987 * style when pre-edit text is removed.
989 * @param[in] cursorOffset Start position from the current cursor position to start deleting characters.
990 * @param[in] numberOfCharacters The number of characters to delete from the cursorOffset.
991 * @param[in] type Whether to update the input style.
992 * @return True if the remove was successful.
994 bool RemoveText( int cursorOffset,
995 int numberOfCharacters,
996 UpdateInputStyleType type );
999 * @brief Checks if text is selected and if so removes it.
1000 * @return true if text was removed
1002 bool RemoveSelectedText();
1004 private: // Relayout.
1007 * @brief Lays-out the text.
1009 * GetNaturalSize(), GetHeightForWidth() and Relayout() calls this method.
1011 * @param[in] size A the size of a bounding box to layout text within.
1012 * @param[in] operations The layout operations which need to be done.
1013 * @param[out] layoutSize The size of the laid-out text.
1015 bool DoRelayout( const Size& size,
1016 OperationsMask operations,
1020 * @brief Calulates the vertical offset to align the text inside the bounding box.
1022 * @param[in] size The size of the bounding box.
1024 void CalculateVerticalOffset( const Size& size );
1029 * @brief Process queued events which modify the model.
1031 void ProcessModifyEvents();
1034 * @brief Used to process an event queued from SetText()
1036 void TextReplacedEvent();
1039 * @brief Used to process an event queued from key events etc.
1041 void TextInsertedEvent();
1044 * @brief Used to process an event queued from backspace key etc.
1046 void TextDeletedEvent();
1049 * @brief Creates a selection event.
1051 * It could be called from the TapEvent (double tap) or when the text selection popup's sellect all button is pressed.
1053 * @param[in] x The x position relative to the top-left of the parent control.
1054 * @param[in] y The y position relative to the top-left of the parent control.
1055 * @param[in] selectAll Whether the whole text is selected.
1057 void SelectEvent( float x, float y, bool selectAll );
1060 * @brief Helper to KeyEvent() to handle the backspace case.
1062 * @return True if a character was deleted.
1064 bool BackspaceKeyEvent();
1066 private: // Helpers.
1069 * @brief Used to remove the text included the placeholder text.
1074 * @brief Helper to show the place holder text..
1076 void ShowPlaceholderText();
1079 * @brief Helper to clear font-specific data (only).
1081 void ClearFontData();
1084 * @brief Helper to clear text's style data.
1086 void ClearStyleData();
1089 * @brief Used to reset the cursor position after setting a new text.
1091 * @param[in] cursorIndex Where to place the cursor.
1093 void ResetCursorPosition( CharacterIndex cursorIndex );
1096 * @brief Used to reset the scroll position after setting a new text.
1098 void ResetScrollPosition();
1100 private: // Private contructors & copy operator.
1103 * @brief Private constructor.
1108 * @brief Private constructor.
1110 Controller( ControlInterface* controlInterface );
1113 * @brief Private constructor.
1115 Controller( ControlInterface* controlInterface,
1116 EditableControlInterface* editableControlInterface );
1119 Controller( const Controller& handle );
1122 Controller& operator=( const Controller& handle );
1124 protected: // Destructor.
1127 * @brief A reference counted object may only be deleted by calling Unreference().
1129 virtual ~Controller();
1139 } // namespace Toolkit
1143 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_H