Remove Geometry::QUAD() usage in Toolkit
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller-impl.h
1 #ifndef __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
2 #define __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
3
4 /*
5  * Copyright (c) 2015 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/clipboard.h>
23 #include <dali/devel-api/text-abstraction/font-client.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/internal/text/input-style.h>
27 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
28 #include <dali-toolkit/internal/text/logical-model-impl.h>
29 #include <dali-toolkit/internal/text/text-controller.h>
30 #include <dali-toolkit/internal/text/text-view.h>
31 #include <dali-toolkit/internal/text/visual-model-impl.h>
32
33 namespace Dali
34 {
35
36 namespace Toolkit
37 {
38
39 namespace Text
40 {
41
42 //Forward declarations
43 struct CursorInfo;
44
45 struct Event
46 {
47   // Used to queue input events until DoRelayout()
48   enum Type
49   {
50     CURSOR_KEY_EVENT,
51     TAP_EVENT,
52     PAN_EVENT,
53     LONG_PRESS_EVENT,
54     GRAB_HANDLE_EVENT,
55     LEFT_SELECTION_HANDLE_EVENT,
56     RIGHT_SELECTION_HANDLE_EVENT,
57     SELECT,
58     SELECT_ALL
59   };
60
61   union Param
62   {
63     int mInt;
64     unsigned int mUint;
65     float mFloat;
66   };
67
68   Event( Type eventType )
69   : type( eventType )
70   {
71     p1.mInt = 0;
72     p2.mInt = 0;
73     p3.mInt = 0;
74   }
75
76   Type type;
77   Param p1;
78   Param p2;
79   Param p3;
80 };
81
82 struct EventData
83 {
84   enum State
85   {
86     INACTIVE,
87     INTERRUPTED,
88     SELECTING,
89     EDITING,
90     EDITING_WITH_POPUP,
91     EDITING_WITH_GRAB_HANDLE,
92     EDITING_WITH_PASTE_POPUP,
93     GRAB_HANDLE_PANNING,
94     SELECTION_HANDLE_PANNING
95   };
96
97   EventData( DecoratorPtr decorator );
98
99   ~EventData();
100
101   static bool IsEditingState( State stateToCheck )
102   {
103     return ( stateToCheck == EDITING || stateToCheck == EDITING_WITH_POPUP || stateToCheck == EDITING_WITH_GRAB_HANDLE || stateToCheck == EDITING_WITH_PASTE_POPUP );
104   }
105
106   DecoratorPtr       mDecorator;               ///< Pointer to the decorator.
107   ImfManager         mImfManager;              ///< The Input Method Framework Manager.
108   std::string        mPlaceholderTextActive;   ///< The text to display when the TextField is empty with key-input focus.
109   std::string        mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive.
110   Vector4            mPlaceholderTextColor;    ///< The in/active placeholder text color.
111
112   /**
113    * This is used to delay handling events until after the model has been updated.
114    * The number of updates to the model is minimized to improve performance.
115    */
116   std::vector<Event> mEventQueue;              ///< The queue of touch events etc.
117
118   InputStyle         mInputStyle;              ///< The style to be set to the new inputed text.
119
120   State              mState;                   ///< Selection mode, edit mode etc.
121
122   CharacterIndex     mPrimaryCursorPosition;   ///< Index into logical model for primary cursor.
123   CharacterIndex     mLeftSelectionPosition;   ///< Index into logical model for left selection handle.
124   CharacterIndex     mRightSelectionPosition;  ///< Index into logical model for right selection handle.
125
126   CharacterIndex     mPreEditStartPosition;    ///< Used to remove the pre-edit text if necessary.
127   Length             mPreEditLength;           ///< Used to remove the pre-edit text if necessary.
128
129   bool mIsShowingPlaceholderText        : 1;   ///< True if the place-holder text is being displayed.
130   bool mPreEditFlag                     : 1;   ///< True if the model contains text in pre-edit state.
131   bool mDecoratorUpdated                : 1;   ///< True if the decorator was updated during event processing.
132   bool mCursorBlinkEnabled              : 1;   ///< True if cursor should blink when active.
133   bool mGrabHandleEnabled               : 1;   ///< True if grab handle is enabled.
134   bool mGrabHandlePopupEnabled          : 1;   ///< True if the grab handle popu-up should be shown.
135   bool mSelectionEnabled                : 1;   ///< True if selection handles, highlight etc. are enabled.
136   bool mHorizontalScrollingEnabled      : 1;   ///< True if horizontal scrolling is enabled.
137   bool mVerticalScrollingEnabled        : 1;   ///< True if vertical scrolling is enabled.
138   bool mUpdateCursorPosition            : 1;   ///< True if the visual position of the cursor must be recalculated.
139   bool mUpdateLeftSelectionPosition     : 1;   ///< True if the visual position of the left selection handle must be recalculated.
140   bool mUpdateRightSelectionPosition    : 1;   ///< True if the visual position of the right selection handle must be recalculated.
141   bool mScrollAfterUpdatePosition       : 1;   ///< Whether to scroll after the cursor position is updated.
142   bool mScrollAfterDelete               : 1;   ///< Whether to scroll after delete characters.
143   bool mAllTextSelected                 : 1;   ///< True if the selection handles are selecting all the text.
144   bool mUpdateInputStyle                : 1;   ///< Whether to update the input style after moving the cursor.
145 };
146
147 struct ModifyEvent
148 {
149   enum Type
150   {
151     TEXT_REPLACED,    ///< The entire text was replaced
152     TEXT_INSERTED,    ///< Insert characters at the current cursor position
153     TEXT_DELETED      ///< Characters were deleted
154   };
155
156   Type type;
157 };
158
159 struct FontDefaults
160 {
161   FontDefaults()
162   : mFontDescription(),
163     mFontStyle(),
164     mDefaultPointSize( 0.f ),
165     mFontId( 0u ),
166     familyDefined( false ),
167     weightDefined( false ),
168     widthDefined( false ),
169     slantDefined( false ),
170     sizeDefined( false )
171   {
172     // Initially use the default platform font
173     TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
174     fontClient.GetDefaultPlatformFontDescription( mFontDescription );
175   }
176
177   FontId GetFontId( TextAbstraction::FontClient& fontClient )
178   {
179     if( !mFontId )
180     {
181       const PointSize26Dot6 pointSize = static_cast<PointSize26Dot6>( mDefaultPointSize * 64.f );
182       mFontId = fontClient.GetFontId( mFontDescription, pointSize );
183     }
184
185     return mFontId;
186   }
187
188   TextAbstraction::FontDescription mFontDescription;  ///< The default font's description.
189   std::string                      mFontStyle;        ///< The font's style string set through the property system.
190   float                            mDefaultPointSize; ///< The default font's point size.
191   FontId                           mFontId;           ///< The font's id of the default font.
192   bool familyDefined:1; ///< Whether the default font's family name is defined.
193   bool weightDefined:1; ///< Whether the default font's weight is defined.
194   bool  widthDefined:1; ///< Whether the default font's width is defined.
195   bool  slantDefined:1; ///< Whether the default font's slant is defined.
196   bool   sizeDefined:1; ///< Whether the default font's point size is defined.
197 };
198
199 /**
200  * @brief Stores indices used to update the text.
201  * Stores the character index where the text is updated and the number of characters removed and added.
202  * Stores as well indices to the first and the last paragraphs to be updated.
203  */
204 struct TextUpdateInfo
205 {
206   TextUpdateInfo()
207   : mCharacterIndex( 0u ),
208     mNumberOfCharactersToRemove( 0u ),
209     mNumberOfCharactersToAdd( 0u ),
210     mPreviousNumberOfCharacters( 0u ),
211     mParagraphCharacterIndex( 0u ),
212     mRequestedNumberOfCharacters( 0u ),
213     mStartGlyphIndex( 0u ),
214     mStartLineIndex( 0u ),
215     mEstimatedNumberOfLines( 0u ),
216     mClearAll( true ),
217     mFullRelayoutNeeded( true ),
218     mIsLastCharacterNewParagraph( false )
219   {}
220
221   ~TextUpdateInfo()
222   {}
223
224   CharacterIndex    mCharacterIndex;                ///< Index to the first character to be updated.
225   Length            mNumberOfCharactersToRemove;    ///< The number of characters to be removed.
226   Length            mNumberOfCharactersToAdd;       ///< The number of characters to be added.
227   Length            mPreviousNumberOfCharacters;    ///< The number of characters before the text update.
228
229   CharacterIndex    mParagraphCharacterIndex;       ///< Index of the first character of the first paragraph to be updated.
230   Length            mRequestedNumberOfCharacters;   ///< The requested number of characters.
231   GlyphIndex        mStartGlyphIndex;
232   LineIndex         mStartLineIndex;
233   Length            mEstimatedNumberOfLines;         ///< The estimated number of lines. Used to avoid reallocations when layouting.
234
235   bool              mClearAll:1;                    ///< Whether the whole text is cleared. i.e. when the text is reset.
236   bool              mFullRelayoutNeeded:1;          ///< Whether a full re-layout is needed. i.e. when a new size is set to the text control.
237   bool              mIsLastCharacterNewParagraph:1; ///< Whether the last character is a new paragraph character.
238
239   void Clear()
240   {
241     // Clear all info except the mPreviousNumberOfCharacters member.
242     mCharacterIndex = static_cast<CharacterIndex>( -1 );
243     mNumberOfCharactersToRemove = 0u;
244     mNumberOfCharactersToAdd = 0u;
245     mParagraphCharacterIndex = 0u;
246     mRequestedNumberOfCharacters = 0u;
247     mStartGlyphIndex = 0u;
248     mStartLineIndex = 0u;
249     mEstimatedNumberOfLines = 0u;
250     mClearAll = false;
251     mFullRelayoutNeeded = false;
252     mIsLastCharacterNewParagraph = false;
253   }
254 };
255
256 struct UnderlineDefaults
257 {
258   std::string properties;
259   // TODO: complete with underline parameters.
260 };
261
262 struct ShadowDefaults
263 {
264   std::string properties;
265   // TODO: complete with shadow parameters.
266 };
267
268 struct EmbossDefaults
269 {
270   std::string properties;
271   // TODO: complete with emboss parameters.
272 };
273
274 struct OutlineDefaults
275 {
276   std::string properties;
277   // TODO: complete with outline parameters.
278 };
279
280 struct Controller::Impl
281 {
282   Impl( ControlInterface& controlInterface )
283   : mControlInterface( controlInterface ),
284     mLogicalModel(),
285     mVisualModel(),
286     mFontDefaults( NULL ),
287     mUnderlineDefaults( NULL ),
288     mShadowDefaults( NULL ),
289     mEmbossDefaults( NULL ),
290     mOutlineDefaults( NULL ),
291     mEventData( NULL ),
292     mFontClient(),
293     mClipboard(),
294     mView(),
295     mMetrics(),
296     mLayoutEngine(),
297     mModifyEvents(),
298     mTextColor( Color::BLACK ),
299     mTextUpdateInfo(),
300     mOperationsPending( NO_OPERATION ),
301     mMaximumNumberOfCharacters( 50u ),
302     mRecalculateNaturalSize( true ),
303     mMarkupProcessorEnabled( false ),
304     mClipboardHideEnabled( true ),
305     mAutoScrollEnabled( false ),
306     mAutoScrollDirectionRTL( false )
307   {
308     mLogicalModel = LogicalModel::New();
309     mVisualModel  = VisualModel::New();
310
311     mFontClient = TextAbstraction::FontClient::Get();
312     mClipboard = Clipboard::Get();
313
314     mView.SetVisualModel( mVisualModel );
315
316     // Use this to access FontClient i.e. to get down-scaled Emoji metrics.
317     mMetrics = Metrics::New( mFontClient );
318     mLayoutEngine.SetMetrics( mMetrics );
319
320     // Set the text properties to default
321     mVisualModel->SetUnderlineEnabled( false );
322     mVisualModel->SetUnderlineHeight( 0.0f );
323   }
324
325   ~Impl()
326   {
327     delete mFontDefaults;
328     delete mUnderlineDefaults;
329     delete mShadowDefaults;
330     delete mEmbossDefaults;
331     delete mOutlineDefaults;
332     delete mEventData;
333   }
334
335   /**
336    * @brief Request a relayout using the ControlInterface.
337    */
338   void RequestRelayout();
339
340   /**
341    * @brief Request a relayout using the ControlInterface.
342    */
343   void QueueModifyEvent( ModifyEvent::Type type )
344   {
345     if( ModifyEvent::TEXT_REPLACED == type)
346     {
347       // Cancel previously queued inserts etc.
348       mModifyEvents.Clear();
349     }
350
351     ModifyEvent event;
352     event.type = type;
353     mModifyEvents.PushBack( event );
354
355     // The event will be processed during relayout
356     RequestRelayout();
357   }
358
359   /**
360    * @brief Helper to move the cursor, grab handle etc.
361    */
362   bool ProcessInputEvents();
363
364   /**
365    * @brief Helper to check whether any place-holder text is available.
366    */
367   bool IsPlaceholderAvailable() const
368   {
369     return ( mEventData &&
370              ( !mEventData->mPlaceholderTextInactive.empty() ||
371                !mEventData->mPlaceholderTextActive.empty() )
372            );
373   }
374
375   bool IsShowingPlaceholderText() const
376   {
377     return ( mEventData && mEventData->mIsShowingPlaceholderText );
378   }
379
380   /**
381    * @brief Helper to check whether active place-holder text is available.
382    */
383   bool IsFocusedPlaceholderAvailable() const
384   {
385     return ( mEventData && !mEventData->mPlaceholderTextActive.empty() );
386   }
387
388   bool IsShowingRealText() const
389   {
390     return ( !IsShowingPlaceholderText() &&
391              0u != mLogicalModel->mText.Count() );
392   }
393
394   /**
395    * @brief Called when placeholder-text is hidden
396    */
397   void PlaceholderCleared()
398   {
399     if( mEventData )
400     {
401       mEventData->mIsShowingPlaceholderText = false;
402
403       // Remove mPlaceholderTextColor
404       mVisualModel->SetTextColor( mTextColor );
405     }
406   }
407
408   void ClearPreEditFlag()
409   {
410     if( mEventData )
411     {
412       mEventData->mPreEditFlag = false;
413       mEventData->mPreEditStartPosition = 0;
414       mEventData->mPreEditLength = 0;
415     }
416   }
417
418   void ResetImfManager()
419   {
420     if( mEventData )
421     {
422       // Reset incase we are in a pre-edit state.
423       if( mEventData->mImfManager )
424       {
425         mEventData->mImfManager.Reset(); // Will trigger a message ( commit, get surrounding )
426       }
427
428       ClearPreEditFlag();
429     }
430   }
431
432   /**
433    * @brief Helper to notify IMF manager with surrounding text & cursor changes.
434    */
435   void NotifyImfManager();
436
437   /**
438    * @brief Retrieve the current cursor position.
439    *
440    * @return The cursor position.
441    */
442   CharacterIndex GetLogicalCursorPosition() const;
443
444   /**
445    * @brief Retrieves the number of consecutive white spaces starting from the given @p index.
446    *
447    * @param[in] index The character index from where to count the number of consecutive white spaces.
448    *
449    * @return The number of consecutive white spaces.
450    */
451   Length GetNumberOfWhiteSpaces( CharacterIndex index ) const;
452
453   /**
454    * @brief Retrieve any text previously set starting from the given @p index.
455    *
456    * @param[in] index The character index from where to retrieve the text.
457    * @param[out] text A string of UTF-8 characters.
458    *
459    * @see Dali::Toolkit::Text::Controller::GetText()
460    */
461   void GetText( CharacterIndex index, std::string& text ) const;
462
463   bool IsClipboardEmpty()
464   {
465     bool result( mClipboard && mClipboard.NumberOfItems() );
466     return !result; // If NumberOfItems greater than 0, return false
467   }
468
469   /**
470    * @brief Calculates the start character index of the first paragraph to be updated and
471    * the end character index of the last paragraph to be updated.
472    *
473    * @param[out] numberOfCharacters The number of characters to be updated.
474    */
475   void CalculateTextUpdateIndices( Length& numberOfCharacters );
476
477   /**
478    * @brief Helper to clear completely the parts of the model specified by the given @p operations.
479    *
480    * @note It never clears the text stored in utf32.
481    */
482   void ClearFullModelData( OperationsMask operations );
483
484   /**
485    * @brief Helper to clear completely the parts of the model related with the characters specified by the given @p operations.
486    *
487    * @note It never clears the text stored in utf32.
488    *
489    * @param[in] startIndex Index to the first character to be cleared.
490    * @param[in] endIndex Index to the last character to be cleared.
491    * @param[in] operations The operations required.
492    */
493   void ClearCharacterModelData( CharacterIndex startIndex, CharacterIndex endIndex, OperationsMask operations );
494
495   /**
496    * @brief Helper to clear completely the parts of the model related with the glyphs specified by the given @p operations.
497    *
498    * @note It never clears the text stored in utf32.
499    * @note Character indices are transformed to glyph indices.
500    *
501    * @param[in] startIndex Index to the first character to be cleared.
502    * @param[in] endIndex Index to the last character to be cleared.
503    * @param[in] operations The operations required.
504    */
505   void ClearGlyphModelData( CharacterIndex startIndex, CharacterIndex endIndex, OperationsMask operations );
506
507   /**
508    * @brief Helper to clear the parts of the model specified by the given @p operations and from @p startIndex to @p endIndex.
509    *
510    * @note It never clears the text stored in utf32.
511    *
512    * @param[in] startIndex Index to the first character to be cleared.
513    * @param[in] endIndex Index to the last character to be cleared.
514    * @param[in] operations The operations required.
515    */
516   void ClearModelData( CharacterIndex startIndex, CharacterIndex endIndex, OperationsMask operations );
517
518   /**
519    * @brief Updates the logical and visual models. Updates the style runs in the visual model when the text's styles changes.
520    *
521    * When text or style changes the model is set with some operations pending.
522    * When i.e. the text's size or a relayout is required this method is called
523    * with a given @p operationsRequired parameter. The operations required are
524    * matched with the operations pending to perform the minimum number of operations.
525    *
526    * @param[in] operationsRequired The operations required.
527    *
528    * @return @e true if the model has been modified.
529    */
530   bool UpdateModel( OperationsMask operationsRequired );
531
532   /**
533    * @brief Retreieves the default style.
534    *
535    * @param[out] inputStyle The default style.
536    */
537   void RetrieveDefaultInputStyle( InputStyle& inputStyle );
538
539   /**
540    * @brief Retrieve the line height of the default font.
541    */
542   float GetDefaultFontLineHeight();
543
544   void OnCursorKeyEvent( const Event& event );
545
546   void OnTapEvent( const Event& event );
547
548   void OnPanEvent( const Event& event );
549
550   void OnLongPressEvent( const Event& event );
551
552   void OnHandleEvent( const Event& event );
553
554   void OnSelectEvent( const Event& event );
555
556   void OnSelectAllEvent();
557
558   /**
559    * @brief Retrieves the selected text. It removes the text if the @p deleteAfterRetrieval parameter is @e true.
560    *
561    * @param[out] selectedText The selected text encoded in utf8.
562    * @param[in] deleteAfterRetrieval Whether the text should be deleted after retrieval.
563    */
564   void RetrieveSelection( std::string& selectedText, bool deleteAfterRetrieval );
565
566   void ShowClipboard();
567
568   void HideClipboard();
569
570   void SetClipboardHideEnable(bool enable);
571
572   bool CopyStringToClipboard( std::string& source );
573
574   void SendSelectionToClipboard( bool deleteAfterSending );
575
576   void GetTextFromClipboard( unsigned int itemIndex, std::string& retrievedString );
577
578   void RepositionSelectionHandles();
579   void RepositionSelectionHandles( float visualX, float visualY );
580
581   void SetPopupButtons();
582
583   void ChangeState( EventData::State newState );
584
585   /**
586    * @brief Calculates the cursor's position for a given character index in the logical order.
587    *
588    * It retrieves as well the line's height and the cursor's height and
589    * if there is a valid alternative cursor, its position and height.
590    *
591    * @param[in] logical The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character.
592    * @param[out] cursorInfo The line's height, the cursor's height, the cursor's position and whether there is an alternative cursor.
593    */
594   void GetCursorPosition( CharacterIndex logical,
595                           CursorInfo& cursorInfo );
596
597   /**
598    * @brief Calculates the new cursor index.
599    *
600    * It takes into account that in some scripts multiple characters can form a glyph and all of them
601    * need to be jumped with one key event.
602    *
603    * @param[in] index The initial new index.
604    *
605    * @return The new cursor index.
606    */
607   CharacterIndex CalculateNewCursorIndex( CharacterIndex index ) const;
608
609   /**
610    * @brief Updates the cursor position.
611    *
612    * Sets the cursor's position into the decorator. It transforms the cursor's position into decorator's coords.
613    * It sets the position of the secondary cursor if it's a valid one.
614    * Sets which cursors are active.
615    *
616    * @param[in] cursorInfo Contains the selection handle position in Actor's coords.
617    *
618    */
619   void UpdateCursorPosition( const CursorInfo& cursorInfo );
620
621   /**
622    * @brief Updates the position of the given selection handle. It transforms the handle's position into decorator's coords.
623    *
624    * @param[in] handleType One of the selection handles.
625    * @param[in] cursorInfo Contains the selection handle position in Actor's coords.
626    */
627   void UpdateSelectionHandle( HandleType handleType,
628                               const CursorInfo& cursorInfo );
629
630   /**
631    * @biref Clamps the horizontal scrolling to get the control always filled with text.
632    *
633    * @param[in] actualSize The size of the laid out text.
634    */
635   void ClampHorizontalScroll( const Vector2& actualSize );
636
637   /**
638    * @biref Clamps the vertical scrolling to get the control always filled with text.
639    *
640    * @param[in] actualSize The size of the laid out text.
641    */
642   void ClampVerticalScroll( const Vector2& actualSize );
643
644   /**
645    * @brief Scrolls the text to make a position visible.
646    *
647    * @pre mEventData must not be NULL. (there is a text-input or selection capabilities).
648    *
649    * @param[in] position A position in text coords.
650    *
651    * This method is called after inserting text, moving the cursor with the grab handle or the keypad,
652    * or moving the selection handles.
653    */
654   void ScrollToMakePositionVisible( const Vector2& position );
655
656   /**
657    * @brief Scrolls the text to make the cursor visible.
658    *
659    * This method is called after deleting text.
660    */
661   void ScrollTextToMatchCursor( const CursorInfo& cursorInfo );
662
663 private:
664   // Declared private and left undefined to avoid copies.
665   Impl( const Impl& );
666   // Declared private and left undefined to avoid copies.
667   Impl& operator=( const Impl& );
668
669 public:
670
671   ControlInterface& mControlInterface;     ///< Reference to the text controller.
672   LogicalModelPtr mLogicalModel;           ///< Pointer to the logical model.
673   VisualModelPtr  mVisualModel;            ///< Pointer to the visual model.
674   FontDefaults* mFontDefaults;             ///< Avoid allocating this when the user does not specify a font.
675   UnderlineDefaults* mUnderlineDefaults;   ///< Avoid allocating this when the user does not specify underline parameters.
676   ShadowDefaults* mShadowDefaults;         ///< Avoid allocating this when the user does not specify shadow parameters.
677   EmbossDefaults* mEmbossDefaults;         ///< Avoid allocating this when the user does not specify emboss parameters.
678   OutlineDefaults* mOutlineDefaults;       ///< Avoid allocating this when the user does not specify outline parameters.
679   EventData* mEventData;                   ///< Avoid allocating everything for text input until EnableTextInput().
680   TextAbstraction::FontClient mFontClient; ///< Handle to the font client.
681   Clipboard mClipboard;                    ///< Handle to the system clipboard
682   View mView;                              ///< The view interface to the rendering back-end.
683   MetricsPtr mMetrics;                     ///< A wrapper around FontClient used to get metrics & potentially down-scaled Emoji metrics.
684   LayoutEngine mLayoutEngine;              ///< The layout engine.
685   Vector<ModifyEvent> mModifyEvents;       ///< Temporary stores the text set until the next relayout.
686   Vector4 mTextColor;                      ///< The regular text color
687   /**
688    * 0,0 means that the top-left corner of the layout matches the top-left corner of the UI control.
689    * Typically this will have a negative value with scrolling occurs.
690    */
691   Vector2 mScrollPosition;                 ///< The text is offset by this position when scrolling.
692   TextUpdateInfo mTextUpdateInfo;          ///< Info of the characters updated.
693   OperationsMask mOperationsPending;       ///< Operations pending to be done to layout the text.
694   Length mMaximumNumberOfCharacters;       ///< Maximum number of characters that can be inserted.
695
696   bool mRecalculateNaturalSize:1;          ///< Whether the natural size needs to be recalculated.
697   bool mMarkupProcessorEnabled:1;          ///< Whether the mark-up procesor is enabled.
698   bool mClipboardHideEnabled:1;            ///< Whether the ClipboardHide function work or not
699   bool mAutoScrollEnabled:1;               ///< Whether auto text scrolling is enabled.
700   CharacterDirection mAutoScrollDirectionRTL:1;  ///< Direction of auto scrolling, true if rtl
701
702 };
703
704 } // namespace Text
705
706 } // namespace Toolkit
707
708 } // namespace Dali
709
710 #endif // __DALI_TOOLKIT_TEXT_CONTROLLER_H__