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