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