Changed 'virtual' function override declarations to 'override' in dali-toolkit.
[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 default line size.
1059    *
1060    * @param[in] lineSize The line size.
1061    *
1062    * @return True if lineSize has been updated, false otherwise
1063    */
1064   bool SetDefaultLineSize( float lineSize );
1065
1066   /**
1067    * @brief Retrieves the default line size.
1068    *
1069    * @return The line size.
1070    */
1071   float GetDefaultLineSize() const;
1072
1073   /**
1074    * @brief Sets the input text's color.
1075    *
1076    * @param[in] color The input text's color.
1077    */
1078   void SetInputColor( const Vector4& color );
1079
1080   /**
1081    * @brief Retrieves the input text's color.
1082    *
1083    * @return The input text's color.
1084    */
1085   const Vector4& GetInputColor() const;
1086
1087   /**
1088    * @brief Sets the input text's font family name.
1089    *
1090    * @param[in] fontFamily The text's font family name.
1091    */
1092   void SetInputFontFamily( const std::string& fontFamily );
1093
1094   /**
1095    * @brief Retrieves the input text's font family name.
1096    *
1097    * @return The input text's font family name.
1098    */
1099   const std::string& GetInputFontFamily() const;
1100
1101   /**
1102    * @brief Sets the input font's weight.
1103    *
1104    * @param[in] weight The input font's weight.
1105    */
1106   void SetInputFontWeight( FontWeight weight );
1107
1108   /**
1109    * @return Whether the font's weight has been defined.
1110    */
1111   bool IsInputFontWeightDefined() const;
1112
1113   /**
1114    * @brief Retrieves the input font's weight.
1115    *
1116    * @return The input font's weight.
1117    */
1118   FontWeight GetInputFontWeight() const;
1119
1120   /**
1121    * @brief Sets the input font's width.
1122    *
1123    * @param[in] width The input font's width.
1124    */
1125   void SetInputFontWidth( FontWidth width );
1126
1127   /**
1128    * @return Whether the font's width has been defined.
1129    */
1130   bool IsInputFontWidthDefined() const;
1131
1132   /**
1133    * @brief Retrieves the input font's width.
1134    *
1135    * @return The input font's width.
1136    */
1137   FontWidth GetInputFontWidth() const;
1138
1139   /**
1140    * @brief Sets the input font's slant.
1141    *
1142    * @param[in] slant The input font's slant.
1143    */
1144   void SetInputFontSlant( FontSlant slant );
1145
1146   /**
1147    * @return Whether the font's slant has been defined.
1148    */
1149   bool IsInputFontSlantDefined() const;
1150
1151   /**
1152    * @brief Retrieves the input font's slant.
1153    *
1154    * @return The input font's slant.
1155    */
1156   FontSlant GetInputFontSlant() const;
1157
1158   /**
1159    * @brief Sets the input font's point size.
1160    *
1161    * @param[in] size The input font's point size.
1162    */
1163   void SetInputFontPointSize( float size );
1164
1165   /**
1166    * @brief Retrieves the input font's point size.
1167    *
1168    * @return The input font's point size.
1169    */
1170   float GetInputFontPointSize() const;
1171
1172   /**
1173    * @brief Sets the input line spacing.
1174    *
1175    * @param[in] lineSpacing The line spacing.
1176    */
1177   void SetInputLineSpacing( float lineSpacing );
1178
1179   /**
1180    * @brief Retrieves the input line spacing.
1181    *
1182    * @return The line spacing.
1183    */
1184   float GetInputLineSpacing() const;
1185
1186   /**
1187    * @brief Sets the input shadow's properties string.
1188    *
1189    * @note The string is stored to be recovered.
1190    *
1191    * @param[in] shadowProperties The shadow's properties string.
1192    */
1193   void SetInputShadowProperties( const std::string& shadowProperties );
1194
1195   /**
1196    * @brief Retrieves the input shadow's properties string.
1197    *
1198    * @return The shadow's properties string.
1199    */
1200   const std::string& GetInputShadowProperties() const;
1201
1202   /**
1203    * @brief Sets the input underline's properties string.
1204    *
1205    * @note The string is stored to be recovered.
1206    *
1207    * @param[in] underlineProperties The underline's properties string.
1208    */
1209   void SetInputUnderlineProperties( const std::string& underlineProperties );
1210
1211   /**
1212    * @brief Retrieves the input underline's properties string.
1213    *
1214    * @return The underline's properties string.
1215    */
1216   const std::string& GetInputUnderlineProperties() const;
1217
1218   /**
1219    * @brief Sets the input emboss's properties string.
1220    *
1221    * @note The string is stored to be recovered.
1222    *
1223    * @param[in] embossProperties The emboss's properties string.
1224    */
1225   void SetInputEmbossProperties( const std::string& embossProperties );
1226
1227   /**
1228    * @brief Retrieves the input emboss's properties string.
1229    *
1230    * @return The emboss's properties string.
1231    */
1232   const std::string& GetInputEmbossProperties() const;
1233
1234   /**
1235    * @brief Sets input the outline's properties string.
1236    *
1237    * @note The string is stored to be recovered.
1238    *
1239    * @param[in] outlineProperties The outline's properties string.
1240    */
1241   void SetInputOutlineProperties( const std::string& outlineProperties );
1242
1243   /**
1244    * @brief Retrieves the input outline's properties string.
1245    *
1246    * @return The outline's properties string.
1247    */
1248   const std::string& GetInputOutlineProperties() const;
1249
1250   /**
1251    * @brief Set the control's interface.
1252    *
1253    * @param[in] controlInterface The control's interface.
1254    */
1255   void SetControlInterface( ControlInterface* controlInterface );
1256
1257 public: // Queries & retrieves.
1258
1259   /**
1260    * @brief Return the layout engine.
1261    *
1262    * @return A reference to the layout engine.
1263    */
1264   Layout::Engine& GetLayoutEngine();
1265
1266   /**
1267    * @brief Return a view of the text.
1268    *
1269    * @return A reference to the view.
1270    */
1271   View& GetView();
1272
1273   /**
1274    * @copydoc Control::GetNaturalSize()
1275    */
1276   Vector3 GetNaturalSize();
1277
1278   /**
1279    * @copydoc Control::GetHeightForWidth()
1280    */
1281   float GetHeightForWidth( float width );
1282
1283   /**
1284    * @brief Calculates the point size for text for given layout()
1285    */
1286   void FitPointSizeforLayout( Size layoutSize );
1287
1288   /**
1289    * @brief Checks if the point size fits within the layout size.
1290    *
1291    * @return Whether the point size fits within the layout size.
1292    */
1293   bool CheckForTextFit( float pointSize, Size& layoutSize );
1294
1295   /**
1296    * @brief Retrieves the text's number of lines for a given width.
1297    * @param[in] width The width of the text's area.
1298    * @ return The number of lines.
1299    */
1300   int GetLineCount( float width );
1301
1302   /**
1303    * @brief Retrieves the text's model.
1304    *
1305    * @return A pointer to the text's model.
1306    */
1307   const ModelInterface* const GetTextModel() const;
1308
1309   /**
1310    * @brief Used to get scrolled distance by user input
1311    *
1312    * @return Distance from last scroll offset to new scroll offset
1313    */
1314   float GetScrollAmountByUserInput();
1315
1316   /**
1317    * @brief Get latest scroll amount, control size and layout size
1318    *
1319    * This method is used to get information of control's scroll
1320    * @param[out] scrollPosition The current scrolled position
1321    * @param[out] controlHeight The size of a UI control
1322    * @param[out] layoutHeight The size of a bounding box to layout text within.
1323    *
1324    * @return Whether the text scroll position is changed or not after last update.
1325    */
1326   bool GetTextScrollInfo( float& scrollPosition, float& controlHeight, float& layoutHeight );
1327
1328   /**
1329    * @brief Used to set the hidden input option
1330    */
1331   void SetHiddenInputOption( const Property::Map& options );
1332
1333   /**
1334    * @brief Used to get the hidden input option
1335    */
1336   void GetHiddenInputOption( Property::Map& options );
1337
1338   /**
1339    * @brief Sets the Placeholder Properties.
1340    *
1341    * @param[in] map The placeholder property map
1342    */
1343   void SetPlaceholderProperty( const Property::Map& map );
1344
1345   /**
1346    * @brief Retrieves the Placeholder Property map.
1347    *
1348    * @param[out] map The property map
1349    */
1350   void GetPlaceholderProperty( Property::Map& map );
1351
1352   /**
1353    * @brief Checks text direction.
1354    * @return The text direction.
1355    */
1356   Toolkit::DevelText::TextDirection::Type GetTextDirection();
1357
1358   /**
1359    * @brief Retrieves vertical line alignment
1360    * @return The vertical line alignment
1361    */
1362   Toolkit::DevelText::VerticalLineAlignment::Type GetVerticalLineAlignment() const;
1363
1364   /**
1365    * @brief Sets vertical line alignment
1366    * @param[in] alignment The vertical line alignment for the text
1367    */
1368   void SetVerticalLineAlignment( Toolkit::DevelText::VerticalLineAlignment::Type alignment );
1369
1370   /**
1371    * @brief Retrieves ignoreSpaceAfterText value from model
1372    * @return The value of ignoreSpaceAfterText
1373    */
1374   bool IsIgnoreSpacesAfterText() const;
1375
1376   /**
1377    * @brief Sets ignoreSpaceAfterText value to model
1378    * @param[in] ignore The value of ignoreSpacesAfterText for the text
1379    */
1380   void SetIgnoreSpacesAfterText( bool ignore );
1381
1382   /**
1383    * @brief Retrieves matchSystemLanguageDirection value from model
1384    * @return The value of matchSystemLanguageDirection
1385    */
1386   bool IsMatchSystemLanguageDirection() const;
1387
1388   /**
1389    * @brief Sets matchSystemLanguageDirection value to model
1390    * @param[in] match The value of matchSystemLanguageDirection for the text
1391    */
1392   void SetMatchSystemLanguageDirection( bool match );
1393
1394   /**
1395    * @brief Sets layoutDirection value
1396    * @param[in] layoutDirection The value of system language direction
1397    */
1398   void SetLayoutDirection( Dali::LayoutDirection::Type layoutDirection );
1399
1400   /**
1401    * @brief Retrieves if showing real text or not.
1402    * @return The value of showing real text.
1403    */
1404   bool IsShowingRealText() const;
1405
1406 public: // Relayout.
1407
1408   /**
1409    * @brief Triggers a relayout which updates View (if necessary).
1410    *
1411    * @note UI Controls are expected to minimize calls to this method e.g. call once after size negotiation.
1412    * @param[in] size A the size of a bounding box to layout text within.
1413    * @param[in] layoutDirection The direction of the system language.
1414    *
1415    * @return Whether the text model or decorations were updated.
1416    */
1417   UpdateTextType Relayout( const Size& size, Dali::LayoutDirection::Type layoutDirection = Dali::LayoutDirection::LEFT_TO_RIGHT );
1418
1419   /**
1420    * @brief Request a relayout using the ControlInterface.
1421    */
1422   void RequestRelayout();
1423
1424 public: // Input style change signals.
1425
1426   /**
1427    * @return Whether the queue of input style changed signals is empty.
1428    */
1429   bool IsInputStyleChangedSignalsQueueEmpty();
1430
1431   /**
1432    * @brief Process all pending input style changed signals.
1433    *
1434    * Calls the Text::ControlInterface::InputStyleChanged() method which is overriden by the
1435    * text controls. Text controls may send signals to state the input style has changed.
1436    */
1437   void ProcessInputStyleChangedSignals();
1438
1439 public: // Text-input Event Queuing.
1440
1441   /**
1442    * @brief Called by editable UI controls when keyboard focus is gained.
1443    */
1444   void KeyboardFocusGainEvent();
1445
1446   /**
1447    * @brief Called by editable UI controls when focus is lost.
1448    */
1449   void KeyboardFocusLostEvent();
1450
1451   /**
1452    * @brief Called by editable UI controls when key events are received.
1453    *
1454    * @param[in] event The key event.
1455    * @param[in] type Used to distinguish between regular key events and InputMethodContext events.
1456    */
1457   bool KeyEvent( const Dali::KeyEvent& event );
1458
1459   /**
1460    * @brief Called by editable UI controls when a tap gesture occurs.
1461    * @param[in] tapCount The number of taps.
1462    * @param[in] x The x position relative to the top-left of the parent control.
1463    * @param[in] y The y position relative to the top-left of the parent control.
1464    */
1465   void TapEvent( unsigned int tapCount, float x, float y );
1466
1467   /**
1468    * @brief Called by editable UI controls when a pan gesture occurs.
1469    *
1470    * @param[in] state The state of the gesture.
1471    * @param[in] displacement This distance panned since the last pan gesture.
1472    */
1473   void PanEvent( GestureState state, const Vector2& displacement );
1474
1475   /**
1476    * @brief Called by editable UI controls when a long press gesture occurs.
1477    *
1478    * @param[in] state The state of the gesture.
1479    * @param[in] x The x position relative to the top-left of the parent control.
1480    * @param[in] y The y position relative to the top-left of the parent control.
1481    */
1482   void LongPressEvent( GestureState state, float x, float y );
1483
1484   /**
1485    * @brief Creates a selection event.
1486    *
1487    * It could be called from the TapEvent (double tap) or when the text selection popup's sellect all button is pressed.
1488    *
1489    * @param[in] x The x position relative to the top-left of the parent control.
1490    * @param[in] y The y position relative to the top-left of the parent control.
1491    * @param[in] selection type like the whole text is selected or unselected.
1492    */
1493   void SelectEvent( float x, float y, SelectionType selection );
1494
1495   /**
1496    * @brief Event received from input method context
1497    *
1498    * @param[in] inputMethodContext The input method context.
1499    * @param[in] inputMethodContextEvent The event received.
1500    * @return A data struture indicating if update is needed, cursor position and current text.
1501    */
1502   InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent );
1503
1504   /**
1505    * @brief Event from Clipboard notifying an Item has been selected for pasting
1506    */
1507   void PasteClipboardItemEvent();
1508
1509   /**
1510    * @brief Return true when text control should clear key input focus when escape key is pressed.
1511    *
1512    * @return Whether text control should clear key input focus or not when escape key is pressed.
1513    */
1514   bool ShouldClearFocusOnEscape() const;
1515
1516   /**
1517    * @brief Create an actor that renders the text background color
1518    *
1519    * @return the created actor or an empty handle if no background color needs to be rendered.
1520    */
1521   Actor CreateBackgroundActor();
1522
1523   /**
1524    * @brief Retrive Selected text.
1525    *
1526    * @return The seleced text.
1527    */
1528   std::string GetSelectedText();
1529
1530 protected: // Inherit from Text::Decorator::ControllerInterface.
1531
1532   /**
1533    * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::GetTargetSize()
1534    */
1535   void GetTargetSize( Vector2& targetSize ) override;
1536
1537   /**
1538    * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::AddDecoration()
1539    */
1540   void AddDecoration( Actor& actor, bool needsClipping ) override;
1541
1542   /**
1543    * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::DecorationEvent()
1544    */
1545   void DecorationEvent( HandleType handle, HandleState state, float x, float y ) override;
1546
1547 protected: // Inherit from TextSelectionPopup::TextPopupButtonCallbackInterface.
1548
1549   /**
1550    * @copydoc Dali::Toolkit::TextSelectionPopup::TextPopupButtonCallbackInterface::TextPopupButtonTouched()
1551    */
1552   void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button ) override;
1553
1554 protected: // Inherit from HiddenText.
1555
1556   /**
1557    * @brief Invoked from HiddenText when showing time of the last character was expired
1558    */
1559   void DisplayTimeExpired() override;
1560
1561 private: // Update.
1562
1563   /**
1564    * @brief Called by editable UI controls when key events are received.
1565    *
1566    * @param[in] text The text to insert.
1567    * @param[in] type Used to distinguish between regular key events and InputMethodContext events.
1568    */
1569   void InsertText( const std::string& text, InsertType type );
1570
1571   /**
1572    * @brief Paste given string into Text model
1573    * @param[in] stringToPaste this string will be inserted into the text model
1574    */
1575   void PasteText( const std::string& stringToPaste );
1576
1577   /**
1578    * @brief Remove a given number of characters
1579    *
1580    * When predictve text is used the pre-edit text is removed and inserted again with the new characters.
1581    * The UpdateInputStyleType @type parameter if set to DONT_UPDATE_INPUT_STYLE avoids to update the input
1582    * style when pre-edit text is removed.
1583    *
1584    * @param[in] cursorOffset Start position from the current cursor position to start deleting characters.
1585    * @param[in] numberOfCharacters The number of characters to delete from the cursorOffset.
1586    * @param[in] type Whether to update the input style.
1587    * @return True if the remove was successful.
1588    */
1589   bool RemoveText( int cursorOffset,
1590                    int numberOfCharacters,
1591                    UpdateInputStyleType type  );
1592
1593   /**
1594    * @brief Checks if text is selected and if so removes it.
1595    * @return true if text was removed
1596    */
1597   bool RemoveSelectedText();
1598
1599 private: // Relayout.
1600
1601   /**
1602    * @brief Lays-out the text.
1603    *
1604    * GetNaturalSize(), GetHeightForWidth() and Relayout() calls this method.
1605    *
1606    * @param[in] size A the size of a bounding box to layout text within.
1607    * @param[in] operations The layout operations which need to be done.
1608    * @param[out] layoutSize The size of the laid-out text.
1609    */
1610   bool DoRelayout( const Size& size,
1611                    OperationsMask operations,
1612                    Size& layoutSize );
1613
1614   /**
1615    * @brief Calulates the vertical offset to align the text inside the bounding box.
1616    *
1617    * @param[in] size The size of the bounding box.
1618    */
1619   void CalculateVerticalOffset( const Size& size );
1620
1621 private: // Events.
1622
1623   /**
1624    * @brief Process queued events which modify the model.
1625    */
1626   void ProcessModifyEvents();
1627
1628   /**
1629    * @brief Used to process an event queued from SetText()
1630    */
1631   void TextReplacedEvent();
1632
1633   /**
1634    * @brief Used to process an event queued from key events etc.
1635    */
1636   void TextInsertedEvent();
1637
1638   /**
1639    * @brief Used to process an event queued from backspace key etc.
1640    */
1641   void TextDeletedEvent();
1642
1643   /**
1644    * @brief Helper to KeyEvent() to handle the backspace or delete key case.
1645    *
1646    * @param[in] keyCode The keycode for the key pressed
1647    * @return True if a character was deleted.
1648    */
1649   bool DeleteEvent( int keyCode );
1650
1651 private: // Helpers.
1652
1653   /**
1654    * @brief Used to remove the text included the placeholder text.
1655    */
1656   void ResetText();
1657
1658   /**
1659    * @brief Helper to show the place holder text..
1660    */
1661   void ShowPlaceholderText();
1662
1663   /**
1664    * @brief Helper to clear font-specific data (only).
1665    */
1666   void ClearFontData();
1667
1668   /**
1669    * @brief Helper to clear text's style data.
1670    */
1671   void ClearStyleData();
1672
1673   /**
1674    * @brief Used to reset the cursor position after setting a new text.
1675    *
1676    * @param[in] cursorIndex Where to place the cursor.
1677    */
1678   void ResetCursorPosition( CharacterIndex cursorIndex );
1679
1680   /**
1681    * @brief Used to reset the scroll position after setting a new text.
1682    */
1683   void ResetScrollPosition();
1684
1685 private: // Private contructors & copy operator.
1686
1687   /**
1688    * @brief Private constructor.
1689    */
1690   Controller();
1691
1692   /**
1693    * @brief Private constructor.
1694    */
1695   Controller( ControlInterface* controlInterface );
1696
1697   /**
1698    * @brief Private constructor.
1699    */
1700   Controller( ControlInterface* controlInterface,
1701               EditableControlInterface* editableControlInterface );
1702
1703   // Undefined
1704   Controller( const Controller& handle );
1705
1706   // Undefined
1707   Controller& operator=( const Controller& handle );
1708
1709 protected: // Destructor.
1710
1711   /**
1712    * @brief A reference counted object may only be deleted by calling Unreference().
1713    */
1714   virtual ~Controller();
1715
1716 public:
1717
1718   struct Impl; ///< Made public for testing purposes
1719
1720 private:
1721
1722   Impl* mImpl;
1723 };
1724
1725 } // namespace Text
1726
1727 } // namespace Toolkit
1728
1729 } // namespace Dali
1730
1731 #endif // DALI_TOOLKIT_TEXT_CONTROLLER_H