Add support to unselect text And Get_SelectedText
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.h
1 #ifndef DALI_TOOLKIT_TEXT_CONTROLLER_H
2 #define DALI_TOOLKIT_TEXT_CONTROLLER_H
3
4 /*
5  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/devel-api/adaptor-framework/input-method-context.h>
23 #include <dali/public-api/events/gesture.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/public-api/text/text-enumerations.h>
27 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
28 #include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
29 #include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
30 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
31 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
32 #include <dali-toolkit/internal/text/hidden-text.h>
33 #include <dali-toolkit/internal/text/text-model-interface.h>
34
35 namespace Dali
36 {
37
38 namespace Toolkit
39 {
40
41 namespace Text
42 {
43
44 class Controller;
45 class ControlInterface;
46 class EditableControlInterface;
47 class View;
48 class RenderingController;
49
50   /**
51    * @brief Text selection operations .
52    */
53   enum SelectionType
54   {
55     INTERACTIVE        = 0x0000,
56     ALL                = 0x0001,
57     NONE               = 0x0002
58   };
59
60 typedef IntrusivePtr<Controller> ControllerPtr;
61
62 /**
63  * @brief A Text Controller is used by UI Controls which display text.
64  *
65  * It manipulates the Logical & Visual text models on behalf of the UI Controls.
66  * It provides a view of the text that can be used by rendering back-ends.
67  *
68  * For selectable/editable UI controls, the controller handles input events from the UI control
69  * and decorations (grab handles etc) via the Decorator::ControllerInterface interface.
70  *
71  * The text selection popup button callbacks are as well handled via the TextSelectionPopupCallbackInterface interface.
72  */
73 class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface, public HiddenText::Observer
74 {
75 public: // Enumerated types.
76
77   /**
78    * @brief Text related operations to be done in the relayout process.
79    */
80   enum OperationsMask
81   {
82     NO_OPERATION       = 0x0000,
83     CONVERT_TO_UTF32   = 0x0001,
84     GET_SCRIPTS        = 0x0002,
85     VALIDATE_FONTS     = 0x0004,
86     GET_LINE_BREAKS    = 0x0008,
87     BIDI_INFO          = 0x0010,
88     SHAPE_TEXT         = 0x0020,
89     GET_GLYPH_METRICS  = 0x0040,
90     LAYOUT             = 0x0080,
91     UPDATE_LAYOUT_SIZE = 0x0100,
92     REORDER            = 0x0200,
93     ALIGN              = 0x0400,
94     COLOR              = 0x0800,
95     UPDATE_DIRECTION   = 0x1000,
96     ALL_OPERATIONS     = 0xFFFF
97   };
98
99   /**
100    * @brief Used to distinguish between regular key events and InputMethodContext events
101    */
102   enum InsertType
103   {
104     COMMIT,
105     PRE_EDIT
106   };
107
108   /**
109    * @brief Used to specify whether to update the input style.
110    */
111   enum UpdateInputStyleType
112   {
113     UPDATE_INPUT_STYLE,
114     DONT_UPDATE_INPUT_STYLE
115   };
116
117   /**
118    * @brief Used to specify what has been updated after the Relayout() method has been called.
119    */
120   enum UpdateTextType
121   {
122     NONE_UPDATED      = 0x0, ///< Nothing has been updated.
123     MODEL_UPDATED     = 0x1, ///< The text's model has been updated.
124     DECORATOR_UPDATED = 0x2  ///< The decoration has been updated.
125   };
126
127   /**
128    * @brief Different placeholder-text can be shown when the control is active/inactive.
129    */
130   enum PlaceholderType
131   {
132     PLACEHOLDER_TYPE_ACTIVE,
133     PLACEHOLDER_TYPE_INACTIVE,
134   };
135
136   /**
137    * @brief Enumeration for Font Size Type.
138    */
139   enum FontSizeType
140   {
141     POINT_SIZE,   // The size of font in points.
142     PIXEL_SIZE    // The size of font in pixels.
143   };
144
145   struct NoTextTap
146   {
147     enum Action
148     {
149       NO_ACTION,           ///< Does no action if there is a tap on top of an area with no text.
150       HIGHLIGHT,           ///< Highlights the nearest text (at the beginning or end of the text) and shows the text's selection popup.
151       SHOW_SELECTION_POPUP ///< Shows the text's selection popup.
152     };
153   };
154
155   struct TextFitInfo
156   {
157     enum Property
158     {
159       TEXT_FIT_ENABLE,
160       TEXT_FIT_MIN_SIZE,
161       TEXT_FIT_MAX_SIZE,
162       TEXT_FIT_STEP_SIZE,
163       TEXT_FIT_FONT_SIZE_TYPE
164     };
165   };
166
167 public: // Constructor.
168
169   /**
170    * @brief Create a new instance of a Controller.
171    *
172    * @return A pointer to a new Controller.
173    */
174   static ControllerPtr New();
175
176   /**
177    * @brief Create a new instance of a Controller.
178    *
179    * @param[in] controlInterface The control's interface.
180    *
181    * @return A pointer to a new Controller.
182    */
183   static ControllerPtr New( ControlInterface* controlInterface );
184
185   /**
186    * @brief Create a new instance of a Controller.
187    *
188    * @param[in] controlInterface The control's interface.
189    * @param[in] editableControlInterface The editable control's interface.
190    *
191    * @return A pointer to a new Controller.
192    */
193   static ControllerPtr New( ControlInterface* controlInterface,
194                             EditableControlInterface* editableControlInterface );
195
196 public: // Configure the text controller.
197
198   /**
199    * @brief Called to enable text input.
200    *
201    * @note Selectable or editable controls should call this once after Controller::New().
202    * @param[in] decorator Used to create cursor, selection handle decorations etc.
203    * @param[in] inputMethodContext Used to manager ime.
204    */
205   void EnableTextInput( DecoratorPtr decorator, InputMethodContext& inputMethodContext );
206
207   /**
208    * @brief Used to switch between bitmap & vector based glyphs
209    *
210    * @param[in] glyphType The type of glyph; note that metrics for bitmap & vector based glyphs are different.
211    */
212   void SetGlyphType( TextAbstraction::GlyphType glyphType );
213
214   /**
215    * @brief Enables/disables the mark-up processor.
216    *
217    * By default is disabled.
218    *
219    * @param[in] enable Whether to enable the mark-up processor.
220    */
221   void SetMarkupProcessorEnabled( bool enable );
222
223   /**
224    * @brief Retrieves whether the mark-up processor is enabled.
225    *
226    * By default is disabled.
227    *
228    * @return @e true if the mark-up processor is enabled, otherwise returns @e false.
229    */
230   bool IsMarkupProcessorEnabled() const;
231
232   /**
233    * @brief Enables/disables the auto text scrolling
234    *
235    * By default is disabled.
236    *
237    * @param[in] enable Whether to enable the auto scrolling
238    */
239   void SetAutoScrollEnabled( bool enable );
240
241   /**
242    * @brief Retrieves whether auto text scrolling is enabled.
243    *
244    * By default is disabled.
245    *
246    * @return @e true if auto scrolling is enabled, otherwise returns @e false.
247    */
248   bool IsAutoScrollEnabled() const;
249
250   /**
251    * @brief Get direction of the text from the first line of text,
252    * @return bool rtl (right to left) is true
253    */
254   CharacterDirection GetAutoScrollDirection() const;
255
256   /**
257    * @brief Get the alignment offset of the first line of text.
258    *
259    * @return The alignment offset.
260    */
261   float GetAutoScrollLineAlignment() const;
262
263   /**
264    * @brief Enables the horizontal scrolling.
265    *
266    * @param[in] enable Whether to enable the horizontal scrolling.
267    */
268   void SetHorizontalScrollEnabled( bool enable );
269
270   /**
271    * @brief Retrieves whether the horizontal scrolling is enabled.
272    *
273    * @return @e true if the horizontal scrolling is enabled, otherwise it returns @e false.
274    */
275   bool IsHorizontalScrollEnabled() const;
276
277   /**
278    * @brief Enables the vertical scrolling.
279    *
280    * @param[in] enable Whether to enable the vertical scrolling.
281    */
282   void SetVerticalScrollEnabled( bool enable );
283
284   /**
285    * @brief Retrieves whether the verticall scrolling is enabled.
286    *
287    * @return @e true if the vertical scrolling is enabled, otherwise it returns @e false.
288    */
289   bool IsVerticalScrollEnabled() const;
290
291   /**
292    * @brief Enables the smooth handle panning.
293    *
294    * @param[in] enable Whether to enable the smooth handle panning.
295    */
296   void SetSmoothHandlePanEnabled( bool enable );
297
298   /**
299    * @brief Retrieves whether the smooth handle panning is enabled.
300    *
301    * @return @e true if the smooth handle panning is enabled.
302    */
303   bool IsSmoothHandlePanEnabled() const;
304
305   /**
306    * @brief Sets the maximum number of characters that can be inserted into the TextModel
307    *
308    * @param[in] maxCharacters maximum number of characters to be accepted
309    */
310   void SetMaximumNumberOfCharacters( Length maxCharacters );
311
312   /**
313    * @brief Sets the maximum number of characters that can be inserted into the TextModel
314    *
315    * @param[in] maxCharacters maximum number of characters to be accepted
316    */
317   int GetMaximumNumberOfCharacters();
318
319   /**
320    * @brief Called to enable/disable cursor blink.
321    *
322    * @note Only editable controls should calls this.
323    * @param[in] enabled Whether the cursor should blink or not.
324    */
325   void SetEnableCursorBlink( bool enable );
326
327   /**
328    * @brief Query whether cursor blink is enabled.
329    *
330    * @return Whether the cursor should blink or not.
331    */
332   bool GetEnableCursorBlink() const;
333
334   /**
335    * @brief Whether to enable the multi-line layout.
336    *
337    * @param[in] enable \e true enables the multi-line (by default)
338    */
339   void SetMultiLineEnabled( bool enable );
340
341   /**
342    * @return Whether the multi-line layout is enabled.
343    */
344   bool IsMultiLineEnabled() const;
345
346   /**
347    * @brief Sets the text's horizontal alignment.
348    *
349    * @param[in] alignment The horizontal alignment.
350    */
351   void SetHorizontalAlignment( HorizontalAlignment::Type alignment );
352
353   /**
354    * @copydoc ModelInterface::GetHorizontalAlignment()
355    */
356   HorizontalAlignment::Type GetHorizontalAlignment() const;
357
358   /**
359    * @brief Sets the text's vertical alignment.
360    *
361    * @param[in] alignment The vertical alignment.
362    */
363   void SetVerticalAlignment( VerticalAlignment::Type alignment );
364
365   /**
366    * @copydoc ModelInterface::GetVerticalAlignment()
367    */
368   VerticalAlignment::Type GetVerticalAlignment() const;
369
370   /**
371    * @brief Sets the text's wrap mode
372    * @param[in] text wrap mode The unit of wrapping
373    */
374   void SetLineWrapMode( Text::LineWrap::Mode textWarpMode );
375
376   /**
377    * @brief Retrieve text wrap mode previously set.
378    * @return text wrap mode
379    */
380   Text::LineWrap::Mode GetLineWrapMode() const;
381
382   /**
383    * @brief Enable or disable the text elide.
384    *
385    * @param[in] enabled Whether to enable the text elide.
386    */
387   void SetTextElideEnabled( bool enabled );
388
389   /**
390    * @copydoc ModelInterface::IsTextElideEnabled()
391    */
392   bool IsTextElideEnabled() const;
393
394   /**
395    * @brief Enable or disable the text fit.
396    *
397    * @param[in] enabled Whether to enable the text fit.
398    */
399   void SetTextFitEnabled(bool enabled);
400
401   /**
402    * @brief Whether the text fit is enabled or not.
403    *
404    * @return True if the text fit is enabled
405    */
406   bool IsTextFitEnabled() const;
407
408   /**
409    * @brief Sets minimum size valid for text fit.
410    *
411    * @param[in] minimum size value.
412    * @param[in] type The font size type is point size or pixel size
413    */
414   void SetTextFitMinSize( float pointSize, FontSizeType type );
415
416   /**
417    * @brief Retrieves the minimum point size valid for text fit.
418    *
419    * @return The minimum point size valid for text fit
420    */
421   float GetTextFitMinSize() const;
422
423   /**
424    * @brief Sets maximum size valid for text fit.
425    *
426    * @param[in] maximum size value.
427    * @param[in] type The font size type is point size or pixel size
428    */
429   void SetTextFitMaxSize( float pointSize, FontSizeType type );
430
431   /**
432    * @brief Retrieves the maximum point size valid for text fit.
433    *
434    * @return The maximum point size valid for text fit
435    */
436   float GetTextFitMaxSize() const;
437
438   /**
439    * @brief Sets step size for font increase valid for text fit.
440    *
441    * @param[in] step size value.
442    * @param[in] type The font size type is point size or pixel size
443    */
444   void SetTextFitStepSize( float step, FontSizeType type );
445
446   /**
447    * @brief Retrieves the step point size valid for text fit.
448    *
449    * @return The step point size valid for text fit
450    */
451   float GetTextFitStepSize() const;
452
453   /**
454    * @brief Sets content size valid for text fit.
455    *
456    * @param[in] Content size value.
457    */
458   void SetTextFitContentSize(Vector2 size);
459
460   /**
461    * @brief Retrieves the content size valid for text fit.
462    *
463    * @return The content size valid for text fit
464    */
465   Vector2 GetTextFitContentSize() const;
466
467   /**
468    * @brief Enable or disable the placeholder text elide.
469    * @param enabled Whether to enable the placeholder text elide.
470    */
471   void SetPlaceholderTextElideEnabled( bool enabled );
472
473   /**
474    * @brief Whether the placeholder text elide property is enabled.
475    * @return True if the placeholder text elide property is enabled, false otherwise.
476    */
477   bool IsPlaceholderTextElideEnabled() const;
478
479   /**
480    * @brief Enable or disable the text selection.
481    * @param[in] enabled Whether to enable the text selection.
482    */
483   void SetSelectionEnabled( bool enabled );
484
485   /**
486    * @brief Whether the text selection is enabled or not.
487    * @return True if the text selection is enabled
488    */
489   bool IsSelectionEnabled() const;
490
491   /**
492    * @brief Enable or disable the text selection using Shift key.
493    * @param enabled Whether to enable the text selection using Shift key
494    */
495   void SetShiftSelectionEnabled( bool enabled );
496
497   /**
498    * @brief Whether the text selection using Shift key is enabled or not.
499    * @return True if the text selection using Shift key is enabled
500    */
501   bool IsShiftSelectionEnabled() const;
502
503   /**
504    * @brief Enable or disable the grab handles for text selection.
505    *
506    * @param[in] enabled Whether to enable the grab handles
507    */
508   void SetGrabHandleEnabled( bool enabled );
509
510   /**
511    * @brief Returns whether the grab handles are enabled.
512    *
513    * @return True if the grab handles are enabled
514    */
515   bool IsGrabHandleEnabled() const;
516
517   /**
518    * @brief Enable or disable the grab handles for text selection.
519    *
520    * @param[in] enabled Whether to enable the grab handles
521    */
522   void SetGrabHandlePopupEnabled( bool enabled );
523
524   /**
525    * @brief Returns whether the grab handles are enabled.
526    *
527    * @return True if the grab handles are enabled
528    */
529   bool IsGrabHandlePopupEnabled() const;
530
531   /**
532    * @brief Sets input type to password
533    *
534    * @note The string is displayed hidden character
535    *
536    * @param[in] passwordInput True if password input is enabled.
537    */
538   void SetInputModePassword( bool passwordInput );
539
540   /**
541    * @brief Returns whether the input mode type is set as password.
542    *
543    * @return True if input mode type is password
544    */
545   bool IsInputModePassword();
546
547   /**
548    * @brief Sets the action when there is a double tap event on top of a text area with no text.
549    *
550    * @param[in] action The action to do.
551    */
552   void SetNoTextDoubleTapAction( NoTextTap::Action action );
553
554   /**
555    * @brief Retrieves the action when there is a double tap event on top of a text area with no text.
556    *
557    * @return The action to do.
558    */
559   NoTextTap::Action GetNoTextDoubleTapAction() const;
560
561   /**
562    * @briefSets the action when there is a long press event on top of a text area with no text.
563    *
564    * @param[in] action The action to do.
565    */
566   void SetNoTextLongPressAction( NoTextTap::Action action );
567
568   /**
569    * @brief Retrieves the action when there is a long press event on top of a text area with no text.
570    *
571    * @return The action to do.
572    */
573   NoTextTap::Action GetNoTextLongPressAction() const;
574
575   /**
576    * @brief Query if Underline settings were provided by string or map
577    * @return bool true if set by string
578    */
579   bool IsUnderlineSetByString();
580
581   /**
582    * Set method underline setting were set by
583    * @param[in] bool, true if set by string
584    */
585   void UnderlineSetByString( bool setByString );
586
587   /**
588    * @brief Query if shadow settings were provided by string or map
589    * @return bool true if set by string
590    */
591   bool IsShadowSetByString();
592
593   /**
594    * Set method shadow setting were set by
595    * @param[in] bool, true if set by string
596    */
597   void ShadowSetByString( bool setByString );
598
599   /**
600    * @brief Query if outline settings were provided by string or map
601    * @return bool true if set by string
602    */
603   bool IsOutlineSetByString();
604
605   /**
606    * Set method outline setting were set by
607    * @param[in] bool, true if set by string
608    */
609   void OutlineSetByString( bool setByString );
610
611   /**
612    * @brief Query if font style settings were provided by string or map
613    * @return bool true if set by string
614    */
615   bool IsFontStyleSetByString();
616
617   /**
618    * Set method font style setting were set by
619    * @param[in] bool, true if set by string
620    */
621   void FontStyleSetByString( bool setByString );
622
623 public: // Update.
624
625   /**
626    * @brief Replaces any text previously set.
627    *
628    * @note This will be converted into UTF-32 when stored in the text model.
629    * @param[in] text A string of UTF-8 characters.
630    */
631   void SetText( const std::string& text );
632
633   /**
634    * @brief Retrieve any text previously set.
635    *
636    * @param[out] text A string of UTF-8 characters.
637    */
638   void GetText( std::string& text ) const;
639
640   /**
641    * @brief Replaces any placeholder text previously set.
642    *
643    * @param[in] type Different placeholder-text can be shown when the control is active/inactive.
644    * @param[in] text A string of UTF-8 characters.
645    */
646   void SetPlaceholderText( PlaceholderType type, const std::string& text );
647
648   /**
649    * @brief Retrieve any placeholder text previously set.
650    *
651    * @param[in] type Different placeholder-text can be shown when the control is active/inactive.
652    * @param[out] A string of UTF-8 characters.
653    */
654   void GetPlaceholderText( PlaceholderType type, std::string& text ) const;
655
656   /**
657    * @ brief Update the text after a font change
658    * @param[in] newDefaultFont The new font to change to
659    */
660   void UpdateAfterFontChange( const std::string& newDefaultFont );
661
662 public: // Default style & Input style
663
664   /**
665    * @brief Set the default font family.
666    *
667    * @param[in] defaultFontFamily The default font family.
668    */
669   void SetDefaultFontFamily( const std::string& defaultFontFamily );
670
671   /**
672    * @brief Retrieve the default font family.
673    *
674    * @return The default font family.
675    */
676   const std::string& GetDefaultFontFamily() const;
677
678   /**
679    * @brief Sets the placeholder text font family.
680    * @param[in] placeholderTextFontFamily The placeholder text font family.
681    */
682   void SetPlaceholderFontFamily( const std::string& placeholderTextFontFamily );
683
684   /**
685    * @brief Retrieves the placeholder text font family.
686    *
687    * @return The placeholder text font family
688    */
689   const std::string& GetPlaceholderFontFamily() const;
690
691   /**
692    * @brief Sets the default font weight.
693    *
694    * @param[in] weight The font weight.
695    */
696   void SetDefaultFontWeight( FontWeight weight );
697
698   /**
699    * @brief Whether the font's weight has been defined.
700    */
701   bool IsDefaultFontWeightDefined() const;
702
703   /**
704    * @brief Retrieves the default font weight.
705    *
706    * @return The default font weight.
707    */
708   FontWeight GetDefaultFontWeight() const;
709
710   /**
711    * @brief Sets the placeholder text font weight.
712    *
713    * @param[in] weight The font weight
714    */
715   void SetPlaceholderTextFontWeight( FontWeight weight );
716
717   /**
718    * @brief Whether the font's weight has been defined.
719    *
720    * @return True if the placeholder text font weight is defined
721    */
722   bool IsPlaceholderTextFontWeightDefined() const;
723
724   /**
725    * @brief Retrieves the placeholder text font weight.
726    *
727    * @return The placeholder text font weight
728    */
729   FontWeight GetPlaceholderTextFontWeight() const;
730
731   /**
732    * @brief Sets the default font width.
733    *
734    * @param[in] width The font width.
735    */
736   void SetDefaultFontWidth( FontWidth width );
737
738   /**
739    * @brief Whether the font's width has been defined.
740    */
741   bool IsDefaultFontWidthDefined() const;
742
743   /**
744    * @brief Retrieves the default font width.
745    *
746    * @return The default font width.
747    */
748   FontWidth GetDefaultFontWidth() const;
749
750   /**
751    * @brief Sets the placeholder text font width.
752    *
753    * @param[in] width The font width
754    */
755   void SetPlaceholderTextFontWidth( FontWidth width );
756
757   /**
758    * @brief Whether the font's width has been defined.
759    *
760    * @return True if the placeholder text font width is defined
761    */
762   bool IsPlaceholderTextFontWidthDefined() const;
763
764   /**
765    * @brief Retrieves the placeholder text font width.
766    *
767    * @return The placeholder text font width
768    */
769   FontWidth GetPlaceholderTextFontWidth() const;
770
771   /**
772    * @brief Sets the default font slant.
773    *
774    * @param[in] slant The font slant.
775    */
776   void SetDefaultFontSlant( FontSlant slant );
777
778   /**
779    * @brief Whether the font's slant has been defined.
780    */
781   bool IsDefaultFontSlantDefined() const;
782
783   /**
784    * @brief Retrieves the default font slant.
785    *
786    * @return The default font slant.
787    */
788   FontSlant GetDefaultFontSlant() const;
789
790   /**
791    * @brief Sets the placeholder text font slant.
792    *
793    * @param[in] slant The font slant
794    */
795   void SetPlaceholderTextFontSlant( FontSlant slant );
796
797   /**
798    * @brief Whether the font's slant has been defined.
799    *
800    * @return True if the placeholder text font slant is defined
801    */
802   bool IsPlaceholderTextFontSlantDefined() const;
803
804   /**
805    * @brief Retrieves the placeholder text font slant.
806    *
807    * @return The placeholder text font slant
808    */
809   FontSlant GetPlaceholderTextFontSlant() const;
810
811   /**
812    * @brief Set the default font size.
813    *
814    * @param[in] fontSize The default font size
815    * @param[in] type The font size type is point size or pixel size
816    */
817   void SetDefaultFontSize( float fontSize, FontSizeType type );
818
819   /**
820    * @brief Retrieve the default point size.
821    *
822    * @param[in] type The font size type
823    * @return The default point size.
824    */
825   float GetDefaultFontSize( FontSizeType type ) const;
826
827   /**
828    * @brief Sets the Placeholder text font size.
829    * @param[in] fontSize The placeholder text font size
830    * @param[in] type The font size type is point size or pixel size
831    */
832   void SetPlaceholderTextFontSize( float fontSize, FontSizeType type );
833
834   /**
835    * @brief Retrieves the Placeholder text font size.
836    * @param[in] type The font size type
837    * @return The placeholder font size
838    */
839   float GetPlaceholderTextFontSize( FontSizeType type ) const;
840
841   /**
842    * @brief Sets the text's default color.
843    *
844    * @param color The default color.
845    */
846   void SetDefaultColor( const Vector4& color );
847
848   /**
849    * @brief Retrieves the text's default color.
850    *
851    * @return The default color.
852    */
853   const Vector4& GetDefaultColor() const;
854
855   /**
856    * @brief Set the text color
857    *
858    * @param textColor The text color
859    */
860   void SetPlaceholderTextColor( const Vector4& textColor );
861
862   /**
863    * @brief Retrieve the text color
864    *
865    * @return The text color
866    */
867   const Vector4& GetPlaceholderTextColor() const;
868
869   /**
870    * @brief Set the shadow offset.
871    *
872    * @param[in] shadowOffset The shadow offset, 0,0 indicates no shadow.
873    */
874   void SetShadowOffset( const Vector2& shadowOffset );
875
876   /**
877    * @brief Retrieve the shadow offset.
878    *
879    * @return The shadow offset.
880    */
881   const Vector2& GetShadowOffset() const;
882
883   /**
884    * @brief Set the shadow color.
885    *
886    * @param[in] shadowColor The shadow color.
887    */
888   void SetShadowColor( const Vector4& shadowColor );
889
890   /**
891    * @brief Retrieve the shadow color.
892    *
893    * @return The shadow color.
894    */
895   const Vector4& GetShadowColor() const;
896
897   /**
898    * @brief Set the shadow blur radius.
899    *
900    * @param[in] shadowBlurRadius The shadow blur radius, 0,0 indicates no blur.
901    */
902   void SetShadowBlurRadius( const float& shadowBlurRadius );
903
904   /**
905    * @brief Retrieve the shadow blur radius.
906    *
907    * @return The shadow blur radius.
908    */
909   const float& GetShadowBlurRadius() const;
910
911   /**
912    * @brief Set the underline color.
913    *
914    * @param[in] color color of underline.
915    */
916   void SetUnderlineColor( const Vector4& color );
917
918   /**
919    * @brief Retrieve the underline color.
920    *
921    * @return The underline color.
922    */
923   const Vector4& GetUnderlineColor() const;
924
925   /**
926    * @brief Set the underline enabled flag.
927    *
928    * @param[in] enabled The underline enabled flag.
929    */
930   void SetUnderlineEnabled( bool enabled );
931
932   /**
933    * @brief Returns whether the text is underlined or not.
934    *
935    * @return The underline state.
936    */
937   bool IsUnderlineEnabled() const;
938
939   /**
940    * @brief Set the override used for underline height, 0 indicates height will be supplied by font metrics
941    *
942    * @param[in] height The height in pixels of the underline
943    */
944   void SetUnderlineHeight( float height );
945
946   /**
947    * @brief Retrieves the override height of an underline, 0 indicates height is supplied by font metrics
948    *
949    * @return The height of the underline, or 0 if height is not overrided.
950    */
951   float GetUnderlineHeight() const;
952
953   /**
954    * @brief Set the outline color.
955    *
956    * @param[in] color color of outline.
957    */
958   void SetOutlineColor( const Vector4& color );
959
960   /**
961    * @brief Retrieve the outline color.
962    *
963    * @return The outline color.
964    */
965   const Vector4& GetOutlineColor() const;
966
967   /**
968    * @brief Set the outline width
969    *
970    * @param[in] width The width in pixels of the outline, 0 indicates no outline
971    */
972   void SetOutlineWidth( uint16_t width );
973
974   /**
975    * @brief Retrieves the width of an outline
976    *
977    * @return The width of the outline.
978    */
979   uint16_t GetOutlineWidth() const;
980
981   /**
982    * @brief Set the background color.
983    *
984    * @param[in] color color of background.
985    */
986   void SetBackgroundColor( const Vector4& color );
987
988   /**
989    * @brief Retrieve the background color.
990    *
991    * @return The background color.
992    */
993   const Vector4& GetBackgroundColor() const;
994
995   /**
996    * @brief Set the background enabled flag.
997    *
998    * @param[in] enabled The background enabled flag.
999    */
1000   void SetBackgroundEnabled( bool enabled );
1001
1002   /**
1003    * @brief Returns whether to enable text background or not.
1004    *
1005    * @return Whether text background is enabled.
1006    */
1007   bool IsBackgroundEnabled() const;
1008
1009   /**
1010    * @brief Sets the emboss's properties string.
1011    *
1012    * @note The string is stored to be recovered.
1013    *
1014    * @param[in] embossProperties The emboss's properties string.
1015    */
1016   void SetDefaultEmbossProperties( const std::string& embossProperties );
1017
1018   /**
1019    * @brief Retrieves the emboss's properties string.
1020    *
1021    * @return The emboss's properties string.
1022    */
1023   const std::string& GetDefaultEmbossProperties() const;
1024
1025   /**
1026    * @brief Sets the outline's properties string.
1027    *
1028    * @note The string is stored to be recovered.
1029    *
1030    * @param[in] outlineProperties The outline's properties string.
1031    */
1032   void SetDefaultOutlineProperties( const std::string& outlineProperties );
1033
1034   /**
1035    * @brief Retrieves the outline's properties string.
1036    *
1037    * @return The outline's properties string.
1038    */
1039   const std::string& GetDefaultOutlineProperties() const;
1040
1041   /**
1042    * @brief Sets the default line spacing.
1043    *
1044    * @param[in] lineSpacing The line spacing.
1045    *
1046    * @return True if lineSpacing has been updated, false otherwise
1047    */
1048   bool SetDefaultLineSpacing( float lineSpacing );
1049
1050   /**
1051    * @brief Retrieves the default line spacing.
1052    *
1053    * @return The line spacing.
1054    */
1055   float GetDefaultLineSpacing() const;
1056
1057   /**
1058    * @brief Sets the input text's color.
1059    *
1060    * @param[in] color The input text's color.
1061    */
1062   void SetInputColor( const Vector4& color );
1063
1064   /**
1065    * @brief Retrieves the input text's color.
1066    *
1067    * @return The input text's color.
1068    */
1069   const Vector4& GetInputColor() const;
1070
1071   /**
1072    * @brief Sets the input text's font family name.
1073    *
1074    * @param[in] fontFamily The text's font family name.
1075    */
1076   void SetInputFontFamily( const std::string& fontFamily );
1077
1078   /**
1079    * @brief Retrieves the input text's font family name.
1080    *
1081    * @return The input text's font family name.
1082    */
1083   const std::string& GetInputFontFamily() const;
1084
1085   /**
1086    * @brief Sets the input font's weight.
1087    *
1088    * @param[in] weight The input font's weight.
1089    */
1090   void SetInputFontWeight( FontWeight weight );
1091
1092   /**
1093    * @return Whether the font's weight has been defined.
1094    */
1095   bool IsInputFontWeightDefined() const;
1096
1097   /**
1098    * @brief Retrieves the input font's weight.
1099    *
1100    * @return The input font's weight.
1101    */
1102   FontWeight GetInputFontWeight() const;
1103
1104   /**
1105    * @brief Sets the input font's width.
1106    *
1107    * @param[in] width The input font's width.
1108    */
1109   void SetInputFontWidth( FontWidth width );
1110
1111   /**
1112    * @return Whether the font's width has been defined.
1113    */
1114   bool IsInputFontWidthDefined() const;
1115
1116   /**
1117    * @brief Retrieves the input font's width.
1118    *
1119    * @return The input font's width.
1120    */
1121   FontWidth GetInputFontWidth() const;
1122
1123   /**
1124    * @brief Sets the input font's slant.
1125    *
1126    * @param[in] slant The input font's slant.
1127    */
1128   void SetInputFontSlant( FontSlant slant );
1129
1130   /**
1131    * @return Whether the font's slant has been defined.
1132    */
1133   bool IsInputFontSlantDefined() const;
1134
1135   /**
1136    * @brief Retrieves the input font's slant.
1137    *
1138    * @return The input font's slant.
1139    */
1140   FontSlant GetInputFontSlant() const;
1141
1142   /**
1143    * @brief Sets the input font's point size.
1144    *
1145    * @param[in] size The input font's point size.
1146    */
1147   void SetInputFontPointSize( float size );
1148
1149   /**
1150    * @brief Retrieves the input font's point size.
1151    *
1152    * @return The input font's point size.
1153    */
1154   float GetInputFontPointSize() const;
1155
1156   /**
1157    * @brief Sets the input line spacing.
1158    *
1159    * @param[in] lineSpacing The line spacing.
1160    */
1161   void SetInputLineSpacing( float lineSpacing );
1162
1163   /**
1164    * @brief Retrieves the input line spacing.
1165    *
1166    * @return The line spacing.
1167    */
1168   float GetInputLineSpacing() const;
1169
1170   /**
1171    * @brief Sets the input shadow's properties string.
1172    *
1173    * @note The string is stored to be recovered.
1174    *
1175    * @param[in] shadowProperties The shadow's properties string.
1176    */
1177   void SetInputShadowProperties( const std::string& shadowProperties );
1178
1179   /**
1180    * @brief Retrieves the input shadow's properties string.
1181    *
1182    * @return The shadow's properties string.
1183    */
1184   const std::string& GetInputShadowProperties() const;
1185
1186   /**
1187    * @brief Sets the input underline's properties string.
1188    *
1189    * @note The string is stored to be recovered.
1190    *
1191    * @param[in] underlineProperties The underline's properties string.
1192    */
1193   void SetInputUnderlineProperties( const std::string& underlineProperties );
1194
1195   /**
1196    * @brief Retrieves the input underline's properties string.
1197    *
1198    * @return The underline's properties string.
1199    */
1200   const std::string& GetInputUnderlineProperties() const;
1201
1202   /**
1203    * @brief Sets the input emboss's properties string.
1204    *
1205    * @note The string is stored to be recovered.
1206    *
1207    * @param[in] embossProperties The emboss's properties string.
1208    */
1209   void SetInputEmbossProperties( const std::string& embossProperties );
1210
1211   /**
1212    * @brief Retrieves the input emboss's properties string.
1213    *
1214    * @return The emboss's properties string.
1215    */
1216   const std::string& GetInputEmbossProperties() const;
1217
1218   /**
1219    * @brief Sets input the outline's properties string.
1220    *
1221    * @note The string is stored to be recovered.
1222    *
1223    * @param[in] outlineProperties The outline's properties string.
1224    */
1225   void SetInputOutlineProperties( const std::string& outlineProperties );
1226
1227   /**
1228    * @brief Retrieves the input outline's properties string.
1229    *
1230    * @return The outline's properties string.
1231    */
1232   const std::string& GetInputOutlineProperties() const;
1233
1234   /**
1235    * @brief Set the control's interface.
1236    *
1237    * @param[in] controlInterface The control's interface.
1238    */
1239   void SetControlInterface( ControlInterface* controlInterface );
1240
1241 public: // Queries & retrieves.
1242
1243   /**
1244    * @brief Return the layout engine.
1245    *
1246    * @return A reference to the layout engine.
1247    */
1248   Layout::Engine& GetLayoutEngine();
1249
1250   /**
1251    * @brief Return a view of the text.
1252    *
1253    * @return A reference to the view.
1254    */
1255   View& GetView();
1256
1257   /**
1258    * @copydoc Control::GetNaturalSize()
1259    */
1260   Vector3 GetNaturalSize();
1261
1262   /**
1263    * @copydoc Control::GetHeightForWidth()
1264    */
1265   float GetHeightForWidth( float width );
1266
1267   /**
1268    * @brief Calculates the point size for text for given layout()
1269    */
1270   void FitPointSizeforLayout( Size layoutSize );
1271
1272   /**
1273    * @brief Checks if the point size fits within the layout size.
1274    *
1275    * @return Whether the point size fits within the layout size.
1276    */
1277   bool CheckForTextFit( float pointSize, Size& layoutSize );
1278
1279   /**
1280    * @brief Retrieves the text's number of lines for a given width.
1281    * @param[in] width The width of the text's area.
1282    * @ return The number of lines.
1283    */
1284   int GetLineCount( float width );
1285
1286   /**
1287    * @brief Retrieves the text's model.
1288    *
1289    * @return A pointer to the text's model.
1290    */
1291   const ModelInterface* const GetTextModel() const;
1292
1293   /**
1294    * @brief Used to get scrolled distance by user input
1295    *
1296    * @return Distance from last scroll offset to new scroll offset
1297    */
1298   float GetScrollAmountByUserInput();
1299
1300   /**
1301    * @brief Get latest scroll amount, control size and layout size
1302    *
1303    * This method is used to get information of control's scroll
1304    * @param[out] scrollPosition The current scrolled position
1305    * @param[out] controlHeight The size of a UI control
1306    * @param[out] layoutHeight The size of a bounding box to layout text within.
1307    *
1308    * @return Whether the text scroll position is changed or not after last update.
1309    */
1310   bool GetTextScrollInfo( float& scrollPosition, float& controlHeight, float& layoutHeight );
1311
1312   /**
1313    * @brief Used to set the hidden input option
1314    */
1315   void SetHiddenInputOption( const Property::Map& options );
1316
1317   /**
1318    * @brief Used to get the hidden input option
1319    */
1320   void GetHiddenInputOption( Property::Map& options );
1321
1322   /**
1323    * @brief Sets the Placeholder Properties.
1324    *
1325    * @param[in] map The placeholder property map
1326    */
1327   void SetPlaceholderProperty( const Property::Map& map );
1328
1329   /**
1330    * @brief Retrieves the Placeholder Property map.
1331    *
1332    * @param[out] map The property map
1333    */
1334   void GetPlaceholderProperty( Property::Map& map );
1335
1336   /**
1337    * @brief Checks text direction.
1338    * @return The text direction.
1339    */
1340   Toolkit::DevelText::TextDirection::Type GetTextDirection();
1341
1342   /**
1343    * @brief Retrieves vertical line alignment
1344    * @return The vertical line alignment
1345    */
1346   Toolkit::DevelText::VerticalLineAlignment::Type GetVerticalLineAlignment() const;
1347
1348   /**
1349    * @brief Sets vertical line alignment
1350    * @param[in] alignment The vertical line alignment for the text
1351    */
1352   void SetVerticalLineAlignment( Toolkit::DevelText::VerticalLineAlignment::Type alignment );
1353
1354   /**
1355    * @brief Retrieves ignoreSpaceAfterText value from model
1356    * @return The value of ignoreSpaceAfterText
1357    */
1358   bool IsIgnoreSpacesAfterText() const;
1359
1360   /**
1361    * @brief Sets ignoreSpaceAfterText value to model
1362    * @param[in] ignore The value of ignoreSpacesAfterText for the text
1363    */
1364   void SetIgnoreSpacesAfterText( bool ignore );
1365
1366   /**
1367    * @brief Retrieves matchSystemLanguageDirection value from model
1368    * @return The value of matchSystemLanguageDirection
1369    */
1370   bool IsMatchSystemLanguageDirection() const;
1371
1372   /**
1373    * @brief Sets matchSystemLanguageDirection value to model
1374    * @param[in] match The value of matchSystemLanguageDirection for the text
1375    */
1376   void SetMatchSystemLanguageDirection( bool match );
1377
1378   /**
1379    * @brief Sets layoutDirection value
1380    * @param[in] layoutDirection The value of system language direction
1381    */
1382   void SetLayoutDirection( Dali::LayoutDirection::Type layoutDirection );
1383
1384   /**
1385    * @brief Retrieves if showing real text or not.
1386    * @return The value of showing real text.
1387    */
1388   bool IsShowingRealText() const;
1389
1390 public: // Relayout.
1391
1392   /**
1393    * @brief Triggers a relayout which updates View (if necessary).
1394    *
1395    * @note UI Controls are expected to minimize calls to this method e.g. call once after size negotiation.
1396    * @param[in] size A the size of a bounding box to layout text within.
1397    * @param[in] layoutDirection The direction of the system language.
1398    *
1399    * @return Whether the text model or decorations were updated.
1400    */
1401   UpdateTextType Relayout( const Size& size, Dali::LayoutDirection::Type layoutDirection = Dali::LayoutDirection::LEFT_TO_RIGHT );
1402
1403   /**
1404    * @brief Request a relayout using the ControlInterface.
1405    */
1406   void RequestRelayout();
1407
1408 public: // Input style change signals.
1409
1410   /**
1411    * @return Whether the queue of input style changed signals is empty.
1412    */
1413   bool IsInputStyleChangedSignalsQueueEmpty();
1414
1415   /**
1416    * @brief Process all pending input style changed signals.
1417    *
1418    * Calls the Text::ControlInterface::InputStyleChanged() method which is overriden by the
1419    * text controls. Text controls may send signals to state the input style has changed.
1420    */
1421   void ProcessInputStyleChangedSignals();
1422
1423 public: // Text-input Event Queuing.
1424
1425   /**
1426    * @brief Called by editable UI controls when keyboard focus is gained.
1427    */
1428   void KeyboardFocusGainEvent();
1429
1430   /**
1431    * @brief Called by editable UI controls when focus is lost.
1432    */
1433   void KeyboardFocusLostEvent();
1434
1435   /**
1436    * @brief Called by editable UI controls when key events are received.
1437    *
1438    * @param[in] event The key event.
1439    * @param[in] type Used to distinguish between regular key events and InputMethodContext events.
1440    */
1441   bool KeyEvent( const Dali::KeyEvent& event );
1442
1443   /**
1444    * @brief Called by editable UI controls when a tap gesture occurs.
1445    * @param[in] tapCount The number of taps.
1446    * @param[in] x The x position relative to the top-left of the parent control.
1447    * @param[in] y The y position relative to the top-left of the parent control.
1448    */
1449   void TapEvent( unsigned int tapCount, float x, float y );
1450
1451   /**
1452    * @brief Called by editable UI controls when a pan gesture occurs.
1453    *
1454    * @param[in] state The state of the gesture.
1455    * @param[in] displacement This distance panned since the last pan gesture.
1456    */
1457   void PanEvent( Gesture::State state, const Vector2& displacement );
1458
1459   /**
1460    * @brief Called by editable UI controls when a long press gesture occurs.
1461    *
1462    * @param[in] state The state of the gesture.
1463    * @param[in] x The x position relative to the top-left of the parent control.
1464    * @param[in] y The y position relative to the top-left of the parent control.
1465    */
1466   void LongPressEvent( Gesture::State state, float x, float y );
1467
1468   /**
1469    * @brief Creates a selection event.
1470    *
1471    * It could be called from the TapEvent (double tap) or when the text selection popup's sellect all button is pressed.
1472    *
1473    * @param[in] x The x position relative to the top-left of the parent control.
1474    * @param[in] y The y position relative to the top-left of the parent control.
1475    * @param[in] selection type like the whole text is selected or unselected.
1476    */
1477   void SelectEvent( float x, float y, SelectionType selection );
1478
1479   /**
1480    * @brief Event received from input method context
1481    *
1482    * @param[in] inputMethodContext The input method context.
1483    * @param[in] inputMethodContextEvent The event received.
1484    * @return A data struture indicating if update is needed, cursor position and current text.
1485    */
1486   InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent );
1487
1488   /**
1489    * @brief Event from Clipboard notifying an Item has been selected for pasting
1490    */
1491   void PasteClipboardItemEvent();
1492
1493   /**
1494    * @brief Return true when text control should clear key input focus when escape key is pressed.
1495    *
1496    * @return Whether text control should clear key input focus or not when escape key is pressed.
1497    */
1498   bool ShouldClearFocusOnEscape() const;
1499
1500   /**
1501    * @brief Create an actor that renders the text background color
1502    *
1503    * @return the created actor or an empty handle if no background color needs to be rendered.
1504    */
1505   Actor CreateBackgroundActor();
1506
1507   /**
1508    * @brief Retrive Selected text.
1509    *
1510    * @return The seleced text.
1511    */
1512   std::string GetSelectedText();
1513
1514 protected: // Inherit from Text::Decorator::ControllerInterface.
1515
1516   /**
1517    * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::GetTargetSize()
1518    */
1519   virtual void GetTargetSize( Vector2& targetSize );
1520
1521   /**
1522    * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::AddDecoration()
1523    */
1524   virtual void AddDecoration( Actor& actor, bool needsClipping );
1525
1526   /**
1527    * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::DecorationEvent()
1528    */
1529   virtual void DecorationEvent( HandleType handle, HandleState state, float x, float y );
1530
1531 protected: // Inherit from TextSelectionPopup::TextPopupButtonCallbackInterface.
1532
1533   /**
1534    * @copydoc Dali::Toolkit::TextSelectionPopup::TextPopupButtonCallbackInterface::TextPopupButtonTouched()
1535    */
1536   virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button );
1537
1538 protected: // Inherit from HiddenText.
1539
1540   /**
1541    * @brief Invoked from HiddenText when showing time of the last character was expired
1542    */
1543   virtual void DisplayTimeExpired();
1544
1545 private: // Update.
1546
1547   /**
1548    * @brief Called by editable UI controls when key events are received.
1549    *
1550    * @param[in] text The text to insert.
1551    * @param[in] type Used to distinguish between regular key events and InputMethodContext events.
1552    */
1553   void InsertText( const std::string& text, InsertType type );
1554
1555   /**
1556    * @brief Paste given string into Text model
1557    * @param[in] stringToPaste this string will be inserted into the text model
1558    */
1559   void PasteText( const std::string& stringToPaste );
1560
1561   /**
1562    * @brief Remove a given number of characters
1563    *
1564    * When predictve text is used the pre-edit text is removed and inserted again with the new characters.
1565    * The UpdateInputStyleType @type parameter if set to DONT_UPDATE_INPUT_STYLE avoids to update the input
1566    * style when pre-edit text is removed.
1567    *
1568    * @param[in] cursorOffset Start position from the current cursor position to start deleting characters.
1569    * @param[in] numberOfCharacters The number of characters to delete from the cursorOffset.
1570    * @param[in] type Whether to update the input style.
1571    * @return True if the remove was successful.
1572    */
1573   bool RemoveText( int cursorOffset,
1574                    int numberOfCharacters,
1575                    UpdateInputStyleType type  );
1576
1577   /**
1578    * @brief Checks if text is selected and if so removes it.
1579    * @return true if text was removed
1580    */
1581   bool RemoveSelectedText();
1582
1583 private: // Relayout.
1584
1585   /**
1586    * @brief Lays-out the text.
1587    *
1588    * GetNaturalSize(), GetHeightForWidth() and Relayout() calls this method.
1589    *
1590    * @param[in] size A the size of a bounding box to layout text within.
1591    * @param[in] operations The layout operations which need to be done.
1592    * @param[out] layoutSize The size of the laid-out text.
1593    */
1594   bool DoRelayout( const Size& size,
1595                    OperationsMask operations,
1596                    Size& layoutSize );
1597
1598   /**
1599    * @brief Calulates the vertical offset to align the text inside the bounding box.
1600    *
1601    * @param[in] size The size of the bounding box.
1602    */
1603   void CalculateVerticalOffset( const Size& size );
1604
1605 private: // Events.
1606
1607   /**
1608    * @brief Process queued events which modify the model.
1609    */
1610   void ProcessModifyEvents();
1611
1612   /**
1613    * @brief Used to process an event queued from SetText()
1614    */
1615   void TextReplacedEvent();
1616
1617   /**
1618    * @brief Used to process an event queued from key events etc.
1619    */
1620   void TextInsertedEvent();
1621
1622   /**
1623    * @brief Used to process an event queued from backspace key etc.
1624    */
1625   void TextDeletedEvent();
1626
1627   /**
1628    * @brief Helper to KeyEvent() to handle the backspace or delete key case.
1629    *
1630    * @param[in] keyCode The keycode for the key pressed
1631    * @return True if a character was deleted.
1632    */
1633   bool DeleteEvent( int keyCode );
1634
1635 private: // Helpers.
1636
1637   /**
1638    * @brief Used to remove the text included the placeholder text.
1639    */
1640   void ResetText();
1641
1642   /**
1643    * @brief Helper to show the place holder text..
1644    */
1645   void ShowPlaceholderText();
1646
1647   /**
1648    * @brief Helper to clear font-specific data (only).
1649    */
1650   void ClearFontData();
1651
1652   /**
1653    * @brief Helper to clear text's style data.
1654    */
1655   void ClearStyleData();
1656
1657   /**
1658    * @brief Used to reset the cursor position after setting a new text.
1659    *
1660    * @param[in] cursorIndex Where to place the cursor.
1661    */
1662   void ResetCursorPosition( CharacterIndex cursorIndex );
1663
1664   /**
1665    * @brief Used to reset the scroll position after setting a new text.
1666    */
1667   void ResetScrollPosition();
1668
1669 private: // Private contructors & copy operator.
1670
1671   /**
1672    * @brief Private constructor.
1673    */
1674   Controller();
1675
1676   /**
1677    * @brief Private constructor.
1678    */
1679   Controller( ControlInterface* controlInterface );
1680
1681   /**
1682    * @brief Private constructor.
1683    */
1684   Controller( ControlInterface* controlInterface,
1685               EditableControlInterface* editableControlInterface );
1686
1687   // Undefined
1688   Controller( const Controller& handle );
1689
1690   // Undefined
1691   Controller& operator=( const Controller& handle );
1692
1693 protected: // Destructor.
1694
1695   /**
1696    * @brief A reference counted object may only be deleted by calling Unreference().
1697    */
1698   virtual ~Controller();
1699
1700 public:
1701
1702   struct Impl; ///< Made public for testing purposes
1703
1704 private:
1705
1706   Impl* mImpl;
1707 };
1708
1709 } // namespace Text
1710
1711 } // namespace Toolkit
1712
1713 } // namespace Dali
1714
1715 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_H