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