Merge base & optional
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-view / text-view-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_H__
2 #define __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_H__
3
4 /*
5  * Copyright (c) 2014 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/public-api/actors/camera-actor.h>
23 #include <dali/public-api/actors/image-actor.h>
24 #include <dali/public-api/actors/layer.h>
25 #include <dali/public-api/images/glyph-image.h>
26 #include <dali/public-api/render-tasks/render-task.h>
27
28 // INTERNAL INCLUDES
29 #include <dali-toolkit/public-api/controls/control-impl.h>
30 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
31 #include <dali-toolkit/internal/controls/text-view/text-actor-cache.h>
32 #include <dali-toolkit/internal/controls/text-view/text-view-processor-types.h>
33
34 namespace Dali
35 {
36
37 namespace Toolkit
38 {
39
40 namespace Internal
41 {
42
43 /**
44  * TextView is a custom control for text aligning and multiline support
45  */
46 class TextView : public Control
47 {
48 public:
49
50   // Properties
51   enum
52   {
53     TEXTVIEW_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
54     TEXTVIEW_PROPERTY_END_INDEX = TEXTVIEW_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
55   };
56
57   /**
58    * Internal exceed policy with the valid combinations.
59    */
60   enum ExceedPolicy
61   {
62     Original,             ///< Original size (even if it exceeds the witdh or the height).
63     OriginalFade,         ///< Original size if it exceeds the width but faded if it exceeds the height.
64     OriginalShrink,       ///< Shrunk if it exceeds the height.
65     SplitOriginal,        ///< Split if it exceeds the width but no action if it exceeds the height.
66     SplitFade,            ///< Split if it exceeds the width and faded if it exceeds the height.
67     SplitShrink,          ///< Split if it exceeds the width and shrunk if it exceeds the height.
68     SplitEllipsizeEnd,    ///< Split if it exceeds the width and ellipsize if it exceeds the height.
69     Fade,                 ///< Faded if it exceeds any boundary.
70     FadeOriginal,         ///< Faded if it exceeds the width but no action if it exceeds the height.
71     ShrinkOriginal,       ///< Shrunk if it exceeds the width but no action if it exceeds the height.
72     ShrinkFade,           ///< Shrunk if it exceeds the width and faded if it exceeds the height.
73     Shrink,               ///< Shrunk if it exceeds any boundary.
74     EllipsizeEndOriginal, ///< Ellipsized by the end if it exceeds the width but no action if it exceeds the height.
75     EllipsizeEnd          ///< Ellipsized by the end if it exceeds the width and/or the height.
76   };
77
78   // Between two OnRelayout methods, several calls to InsertTextAt, RemoveTextFrom or SetText can happen.
79   // TextViewProcessorMetadata stores the type of operation. A vector stores all operations between two OnRelayout calls.
80
81   enum TextViewProcessorMetadataType
82   {
83     TextSet,             ///< Sets new text.
84     TextInserted,        ///< Inserts text into current text.
85     TextReplaced,        ///< Replaces some text from current text.
86     TextRemoved,         ///< Removes some text from current text.
87     NewLineHeight,       ///< Sets a new line height offset.
88     NewStyle             ///< Sets a new style to the whole text.
89   };
90
91   /**
92    * Stores info about which data structures need to be modified when the OnRelayout() method is called
93    */
94   struct TextViewProcessorMetadata
95   {
96     TextViewProcessorMetadata();
97
98     TextViewProcessorMetadataType    mType;               ///< Stores the type of operation.
99     std::size_t                      mPosition;           ///< Character position within the text.
100     std::size_t                      mNumberOfCharacters; ///< Number of characters to be removed/replaced.
101     MarkupProcessor::StyledTextArray mText;               ///< The new text.
102     TextStyle::Mask                  mStyleMask;          ///< The style mask.
103   };
104
105   /**
106    * Defines which operations have to be done in the relayout process.
107    */
108   enum RelayoutOperationMask
109   {
110     NO_RELAYOUT = 0x0,                         ///< Does nothing.
111     RELAYOUT_REMOVE_TEXT_ACTORS = 0x1,         ///< Removes current text-actors from the text-view.
112     RELAYOUT_SIZE_POSITION = 0x2,              ///< Calculates size and position of the text but it doesn't calculate alignment.
113     RELAYOUT_ALIGNMENT = 0x4,                  ///< Aligns the whole text.
114     RELAYOUT_VISIBILITY = 0x8,                 ///< Calculates the visibility.
115     RELAYOUT_INITIALIZE_TEXT_ACTORS = 0x10,    ///< Initialize text-actors (create handles).
116     RELAYOUT_TEXT_ACTOR_UPDATE = 0x20,         ///< Updates text-actors (set size, position, style, ...)
117     RELAYOUT_INSERT_TO_TEXT_VIEW = 0x40,       ///< Adds the text-actors to the text-view.
118     RELAYOUT_ALL = 0xFF                        ///< Does all operations.
119   };
120
121   //////////////////////////////////////////////
122
123   /**
124    * Create a new TextView.
125    * @return A smart-pointer to the newly allocated TextView.
126    */
127   static Toolkit::TextView New();
128
129   /**
130    * @copydoc SetText( const std::string& text )
131    */
132   void SetText( const std::string& text );
133
134   /**
135    * @copydoc SetText( const StyledTextArray& text )
136    */
137   void SetText( const MarkupProcessor::StyledTextArray& text );
138
139   /**
140    * @copydoc InsertTextAt( std::size_t position, const std::string& text )
141    */
142   void InsertTextAt( std::size_t position, const std::string& text );
143
144   /**
145    * @copydoc InsertTextAt( std::size_t position, const std::string& text )
146    */
147   void InsertTextAt( std::size_t position, const MarkupProcessor::StyledTextArray& text );
148
149   /**
150    * @copydoc RemoveTextFrom( std::size_t position, std::size_t numberOfCharacters )
151    */
152   void RemoveTextFrom( std::size_t position, std::size_t numberOfCharacters );
153
154   /**
155    * @copydoc ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const std::string& text )
156    */
157   void ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const std::string& text );
158
159   /**
160    * @copydoc ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const std::string& text )
161    */
162   void ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const MarkupProcessor::StyledTextArray& text );
163
164   /**
165    * @copydoc GetText()
166    */
167   std::string GetText() const;
168
169   /**
170    * @copydoc SetLineHeightOffset()
171    */
172   void SetLineHeightOffset( PointSize offset );
173
174   /**
175    * @copydoc GetLineHeightOffset()
176    */
177   PointSize GetLineHeightOffset() const;
178
179   /**
180    * @copydoc SetStyleToCurrentText()
181    */
182   void SetStyleToCurrentText( const TextStyle& style, TextStyle::Mask mask );
183
184   /**
185    * @copydoc SetTextAlignment( Toolkit::Alignment::Type align )
186    */
187   void SetTextAlignment( Toolkit::Alignment::Type align );
188
189   /**
190    * @copydoc GetTextAlignment()
191    */
192   Toolkit::Alignment::Type GetTextAlignment() const;
193
194   /**
195    * @copydoc SetMultilinePolicy()
196    */
197   void SetMultilinePolicy( Toolkit::TextView::MultilinePolicy policy );
198
199   /**
200    * @copydoc GetMultilinePolicy()
201    */
202   Toolkit::TextView::MultilinePolicy GetMultilinePolicy() const;
203
204   /**
205    * @copydoc SetWidthExceedPolicy()
206    */
207   void SetWidthExceedPolicy( Toolkit::TextView::ExceedPolicy policy );
208
209   /**
210    * @copydoc GetWidthExceedPolicy()
211    */
212   Toolkit::TextView::ExceedPolicy GetWidthExceedPolicy() const;
213
214   /**
215    * @copydoc SetHeightExceedPolicy()
216    */
217   void SetHeightExceedPolicy( Toolkit::TextView::ExceedPolicy policy );
218
219   /**
220    * @copydoc GetHeightExceedPolicy()
221    */
222   Toolkit::TextView::ExceedPolicy GetHeightExceedPolicy() const;
223
224   /**
225    * @copydoc SetLineJustification()
226    */
227   void SetLineJustification( Toolkit::TextView::LineJustification justification );
228
229   /**
230    * @copydoc GetLineJustification()
231    */
232   Toolkit::TextView::LineJustification GetLineJustification() const;
233
234   /**
235    * @copydoc SetFadeBoundary()
236    */
237   void SetFadeBoundary( const Toolkit::TextView::FadeBoundary& fadeBoundary );
238
239   /**
240    * @copydoc GetFadeBoundary()
241    */
242   const Toolkit::TextView::FadeBoundary& GetFadeBoundary() const;
243
244   /**
245    * @copydoc SetEllipsizeText()
246    */
247   void SetEllipsizeText( const std::string& ellipsizeText );
248
249   /**
250    * @copydoc SetEllipsizeText()
251    */
252   void SetEllipsizeText( const MarkupProcessor::StyledTextArray& ellipsizeText );
253
254   /**
255    * @copydoc SetEllipsizeText()
256    */
257   void SetEllipsizeText( const Text& ellipsizeText, const Vector<TextStyle*>& ellipsizeStyles );
258
259   /**
260    * @copydoc GetEllipsizeText()
261    */
262   std::string GetEllipsizeText() const;
263
264   /**
265    * Checks if relayout the text is needed. If it is, it relais out the text
266    * by calling DoRelayOut().
267    */
268   void GetTextLayoutInfo();
269
270   /**
271    * Calls GetTextLayoutInfo() and fills the given data structure.
272    *
273    * @see GetTextLayoutInfo()
274    */
275   void GetTextLayoutInfo( Toolkit::TextView::TextLayoutInfo& textLayoutInfo );
276
277   /**
278    * @copydoc SetSortModifier()
279    */
280   void SetSortModifier( float depthOffset );
281
282   /**
283    * @copydoc SetSnapshotModeEnabled()
284    */
285   void SetSnapshotModeEnabled( bool enable );
286
287   /**
288    * @copydoc IsSnapshotModeEnabled()
289    */
290   bool IsSnapshotModeEnabled() const;
291
292   /**
293    * @brief Sets whether markup processing should be carried out.
294    *
295    * @param[in] enable whether markup processing is carried out or not.
296    */
297   void SetMarkupProcessingEnabled( bool enable );
298
299   /**
300    * @brief Returns whether markup processing is enabled or not
301    *
302    * @return true is markup processing is enabled
303    */
304   bool IsMarkupProcessingEnabled() const;
305
306   /**
307    * @copydoc SetScrollEnabled()
308    */
309   void SetScrollEnabled( bool enable );
310
311   /**
312    * @copydoc IsScrollEnabled()
313    */
314   bool IsScrollEnabled() const;
315
316   /**
317    * @copydoc SetScrollPosition()
318    * @see DoSetScrollPosition()
319    */
320   void SetScrollPosition( const Vector2& position );
321
322   /**
323    * @copydoc GetScrollPosition()
324    */
325   const Vector2& GetScrollPosition() const;
326
327   /**
328    * @copydoc IsScrollPositionTrimmed()
329    */
330   bool IsScrollPositionTrimmed() const;
331
332   /**
333    * @copydoc ScrolledSignal()
334    */
335   Toolkit::TextView::ScrolledSignalType& ScrolledSignal();
336
337   /**
338    * Connects a callback function with the object's signals.
339    * @param[in] object The object providing the signal.
340    * @param[in] tracker Used to disconnect the signal.
341    * @param[in] signalName The signal to connect to.
342    * @param[in] functor A newly allocated FunctorDelegate.
343    * @return True if the signal was connected.
344    * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
345    */
346   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
347
348   // Properties
349
350   /**
351    * Called when a property of an object of this type is set.
352    * @param[in] object The object whose property is set.
353    * @param[in] index The property index.
354    * @param[in] value The new property value.
355    */
356   static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
357
358   /**
359    * Called to retrieve a property of an object of this type.
360    * @param[in] object The object whose property is to be retrieved.
361    * @param[in] index The property index.
362    * @return The current value of the property.
363    */
364   static Property::Value GetProperty( BaseObject* object, Property::Index index );
365
366
367 private: // From Control
368
369   /**
370    * @copydoc Toolkit::Control::OnInitialize()
371    */
372   virtual void OnInitialize();
373
374   /**
375    * @copydoc Toolkit::Control::OnFontChange( )
376    */
377   virtual void OnFontChange( bool defaultFontChange, bool defaultFontSizeChange );
378
379   /**
380    * @copydoc Toolkit::Control::OnControlSizeSet()
381    */
382   virtual void OnControlSizeSet( const Vector3& size );
383
384   /**
385    * @copydoc Toolkit::Control::OnRelayout()
386    */
387   virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
388
389   /**
390    * Retrieves the text-view's natural size.
391    *
392    * @return The natural size.
393    */
394   virtual Vector3 GetNaturalSize();
395
396   /**
397    * Retrieves the text-view's \e height for a given \e width.
398    *
399    * @param[in] width The given \e width.
400    *
401    * @return The \e height for the given \e width.
402    */
403   virtual float GetHeightForWidth( float width );
404
405   /**
406    * Retrieves the text-view's \e width for a given \e height.
407    *
408    * @param[in] height The given \e height.
409    *
410    * @return The \e width for the given \e height.
411    */
412   virtual float GetWidthForHeight( float height );
413
414 protected:
415
416   /**
417    * Construct a new TextView.
418    */
419   TextView();
420
421   /**
422    * A reference counted object may only be deleted by calling Unreference()
423    */
424   virtual ~TextView();
425
426 private:
427
428   // Undefined
429   TextView( const TextView& );
430
431   // Undefined
432   TextView& operator=( const TextView& rhs );
433
434   /**
435    * Executes synchronously relayout operations such as set, insert, remove or replace text, etc.
436    */
437   void PerformTextViewProcessorOperations();
438
439   /**
440    * Optimizes some text-view processor operations.
441    */
442   void OptimizeTextViewProcessorOperations();
443
444   /**
445    * Synchronously relays-out all text-actors.
446    *
447    * Perform text-view-processor operations, sets the new size and position of text-actors and adds them to the text-view.
448    *
449    * @param[in] textViewSize The new text-view's size.
450    * @param[in] relayoutOperationMask Defines which operations need to be done in the relayout process.
451    */
452   void DoRelayOut( const Size& textViewSize, RelayoutOperationMask relayoutOperationMask );
453
454   /**
455    * Process Snapshot. It refresh the render-task in order to generate a new snapshot image.
456    *
457    * ProcessSnapshot is called from OnRelayout() only if text has been relaid out.
458    * It creates a new image buffer only if the size of the text has changed.
459    *
460    * @param[in] textViewSize The new text-view's size.
461    */
462   void ProcessSnapshot( const Size& textViewSize );
463
464   /**
465    * Aligns the offscreen rendering camera actor to cover the whole text and the resulting image actor accordingly with the text view's alignment.
466    *
467    * @param[in] textViewSize The text view's size.
468    * @param[in] offscreenSize The offscreen's frame buffer's size.
469    */
470   void AlignOffscreenCameraActor( const Size& textViewSize, const Size& offscreenSize );
471
472   /**
473    * Callback called when the render task has processed.
474    *
475    * It makes the root actor invisible.
476    *
477    * @param[in] renderTask The processed render task.
478    */
479   void RenderTaskFinished( Dali::RenderTask& renderTask );
480
481   /**
482    * Destroys offscreen rendering resources.
483    *
484    * It disconects the render task finished signal from the TextView::RenderTaskFinished() method,
485    * removes the render task from the render task list and resets the offscreen camera actor, root actor,
486    * image actor and the frame buffer.
487    */
488   void DestroyOffscreenRenderingResources();
489
490   /**
491    * Called when text-view is scrolled.
492    *
493    * Sets the new scroll position. @see DoSetScrollPosition()
494    *
495    * @param[in] actor Handle of the text-view.
496    * @param[in] gesture Data structure with the parameters of the gesture.
497    */
498   void OnTextPan( Actor actor, const PanGesture& gesture );
499
500   /**
501    * Ensures the text-view's boundaries are fully covered of text.
502    *
503    * i.e. if the text-view's size is 100x100 and the text's size is 150x100, the scroll position
504    * can be in the range -50,0 and 50,0.
505    */
506   void TrimScrollPosition();
507
508   /**
509    * Called from SetScrollPosition() and OnTextPan()
510    *
511    * Updates the stored scroll position ensuring the text-view is always covered with text by calling
512    * TrimScrollPosition(), calculates the difference with the previous one and emits the Toolkit::TextView::SignalScrolled() signal.
513    *
514    * @param[in] position The new scroll position.
515    */
516   void DoSetScrollPosition( const Vector2& position );
517
518   /**
519    * Combines width and height exceed policies.
520    *
521    * This method is a big switch() which combines two exceed policies into one.
522    * The aim is avoid this switch inside the relayout code.
523    *
524    * i.e.  Width policy = Split. Height policy = Original. Internally the policy is SplitOriginal.
525    */
526   void CombineExceedPolicies();
527
528   /**
529    * Retrieves the text-view's root actor which stores all text-actors.
530    * It could be the text-view itself or an actor used in the snapshot mode.
531    *
532    * @return the root actor.
533    */
534   Actor GetRootActor() const;
535
536   /**
537    * Creates the ellipsize text layout.
538    */
539   void CreateEllipsizeLayout();
540
541   /**
542    * Handle SetProperty for markup processing.
543    * @param[in] propertyValue The new property value.
544    */
545   void OnMarkupEnabledPeopertySet( Property::Value propertyValue );
546
547   /**
548    * Handles SetProperty for multiline policy.
549    * @param[in] propertyValue The new property value.
550    */
551   void OnMultilinePolicyPropertySet( Property::Value propertyValue );
552
553   /**
554    * Handles SetProperty for width exceed policy.
555    * @param[in] propertyValue The new property value.
556    */
557   void OnWidthExceedPolicyPropertySet( Property::Value propertyValue );
558
559   /**
560    * Handles SetProperty for height exceed policy.
561    * @param[in] propertyValue The new property value.
562    */
563   void OnHeightExceedPolicyPropertySet( Property::Value propertyValue );
564
565   /**
566    * Handles SetProperty for line justification.
567    * @param[in] propertyValue The new property value.
568    */
569   void OnLineJustificationPropertySet( Property::Value propertyValue );
570
571   /**
572    * Handles SetProperty for fade boundary.
573    * @param[in] propertyValue The new property value.
574    */
575   void OnFadeBoundaryPropertySet( Property::Value propertyValue );
576
577   /**
578    * Handles SetProperty for alignment property.
579    * @param[in] propertyIndex The property index.
580    * @param[in] propertyValue The new property value.
581    */
582   void OnAlignmentPropertySet( Property::Index propertyIndex, Property::Value propertyValue );
583
584   /**
585    * Handles GetProperty for horizontal alignment property.
586    * @return The property value of horizontal alignment.
587    */
588   std::string OnHorizontalAlignmentPropertyGet();
589
590   /**
591    * Handles GetProperty for vertical alignment property.
592    * @return The property value of vertical alignment.
593    */
594   std::string OnVerticalAlignmentPropertyGet();
595
596 public:
597
598   /**
599    * The parameters which affects the layout of the text.
600    */
601   struct LayoutParameters
602   {
603     /**
604      * Default constructor.
605      */
606     LayoutParameters();
607
608     /**
609      * Default destructor.
610      */
611     ~LayoutParameters();
612
613     /**
614      * Constructor
615      */
616     LayoutParameters( Toolkit::TextView::MultilinePolicy     multilinePolicy,
617                       Toolkit::TextView::ExceedPolicy        widthExceedPolicy,
618                       Toolkit::TextView::ExceedPolicy        heightExceedPolicy,
619                       Toolkit::Alignment::Type               alignment,
620                       Toolkit::TextView::LineJustification   lineJustification,
621                       float                                  lineHeightOffset,
622                       bool                                   markUpEnabled );
623
624     /**
625      * Copy constructor
626      */
627     LayoutParameters( const LayoutParameters& layoutParameters );
628
629     /**
630      * Assignment operator.
631      */
632     LayoutParameters& operator=( const LayoutParameters& layoutParameters );
633
634     Toolkit::TextView::MultilinePolicy   mMultilinePolicy;     ///< Stores the multiline policy.
635     TextView::ExceedPolicy               mExceedPolicy;        ///< Stores a combination of both policies.
636     Toolkit::TextView::ExceedPolicy      mWidthExceedPolicy;   ///< Stores the text width exceed policy.
637     Toolkit::TextView::ExceedPolicy      mHeightExceedPolicy;  ///< Stores the text height exceed policy.
638     Toolkit::Alignment::Type             mHorizontalAlignment; ///< Stores the horizontal alignment for the whole text.
639     Toolkit::Alignment::Type             mVerticalAlignment;   ///< Stores the vertical alignment for the whole text.
640     Toolkit::TextView::LineJustification mLineJustification;   ///< Stores the line justification.
641     float                                mLineHeightOffset;    ///< Line height offset to be addded to the font line height (measured in PointSize).
642     bool                                 mMarkUpEnabled:1;     ///< Is markup string scanning enabled.
643   };
644
645   /**
646    * Some parameters which affects the text view visualization.
647    */
648   struct VisualParameters
649   {
650     /**
651      * Default constructor.
652      */
653     VisualParameters();
654
655     /**
656      * Copy constructor.
657      */
658     VisualParameters( const VisualParameters& visualParameters );
659
660     /**
661      * Assignment operator.
662      */
663     VisualParameters& operator=( const VisualParameters& visualParameters );
664
665     Toolkit::TextView::FadeBoundary mFadeBoundary;            ///< Fade boundary used in fade mode.
666     float                           mSortModifier;            ///< Stores the sort modifier for all text-actors.
667     Vector2                         mCameraScrollPosition;    ///< The scroll offset.
668     bool                            mSnapshotModeEnabled:1;   ///< Whether text-view is rendered offscreen.
669     bool                            mScrollEnabled:1;         ///< Whether the text scroll is enabled.
670     bool                            mScrollPositionTrimmed:1; ///< Whether the last scroll position set was trimmed.
671   };
672
673   /**
674    * The results of the relayout process.
675    */
676   struct RelayoutData
677   {
678     /**
679      * Default constructor.
680      */
681     RelayoutData();
682
683     /**
684      * Copy constructor
685      */
686     RelayoutData( const RelayoutData& relayoutData );
687
688     /**
689      * Assignment operator.
690      */
691     RelayoutData& operator=( const RelayoutData& relayoutData );
692
693     Size                                            mTextViewSize;                ///< The text-view's size used to relaid-out the text.
694     float                                           mShrinkFactor;                ///< Shrink factor used when the exceed policy contains ShrinkToFit.
695     TextViewProcessor::TextLayoutInfo               mTextLayoutInfo;              ///< Stores metrics, layout info (size, direction, type of word) and text-actor info for the whole text.
696     std::vector<int>                                mCharacterLogicalToVisualMap; ///< Reorder map that stores each character's visual (output) index according to its logical (input) index
697     std::vector<int>                                mCharacterVisualToLogicalMap; ///< Reorder map that stores each character's logical (input) index according to its visual (output) index
698     std::vector<RenderableActor>                    mGlyphActors;                 ///< Stores handles of those text-actors which are currently added to the text-view.
699     std::vector<RenderableActor>                    mEllipsizedGlyphActors;       ///< Stores handles of those text-actors which are used to ellipsize the text.
700     Toolkit::TextView::CharacterLayoutInfoContainer mCharacterLayoutInfoTable;    ///< Stores layout info per character sorted by the character's visual index.
701     Toolkit::TextView::LineLayoutInfoContainer      mLines;                       ///< Stores an index to the first character of each line.
702     Size                                            mTextSizeForRelayoutOption;   ///< Stores the text size after relayout.
703     TextActorCache                                  mTextActorCache;              ///< Stores previously created text-actors to be reused.
704   };
705
706 private:
707
708   MarkupProcessor::StyledTextArray       mCurrentStyledText;           ///< text currently displayed by the view
709   std::vector<TextViewProcessorMetadata> mTextViewProcessorOperations; ///< Stores all relayout operations which arrive between two consecutive OnRelayout() calls.
710
711   LayoutParameters                       mLayoutParameters;            ///< Stores some layout parameters in a struct. To be passed in layout functions.
712   VisualParameters                       mVisualParameters;            ///< Some parameters which afects text-view visualization.
713   RelayoutData                           mRelayoutData;                ///< struct with text-view's data structures used to pass all of them in one parameter.
714   RelayoutOperationMask                  mRelayoutOperations;          ///< Which relayout operations have to be done.
715
716   Layer                                  mOffscreenRootActor;          ///< Root actor for offscreen rendering.
717   ImageActor                             mOffscreenImageActor;         ///< Image actor for offscreen rendering.
718   CameraActor                            mOffscreenCameraActor;        ///< Camera actor for offscreen rendering.
719   Size                                   mCurrentOffscreenSize;        ///< Current used ofscreen size.
720   FrameBufferImage                       mFrameBufferImage;            ///< Frame buffer used for offscreen rendering.
721   RenderTask                             mRenderTask;                  ///< Used to generate an offscreen rendering.
722
723   PanGestureDetector                     mPanGestureDetector;          ///< Pan gesture for text scrolling.
724
725   /**
726    * Helper class used to prevent the modification of some members.
727    */
728   struct Lock
729   {
730     Lock( bool& lock )
731     : mLock( lock )
732     {
733       mLock = true;
734     }
735
736     ~Lock()
737     {
738       mLock = false;
739     }
740
741     bool& mLock;
742   };
743
744   bool                                            mLockPreviousSnapshotMode;      ///< Whether previous stored snapshot mode should be modified.
745   bool                                            mPreviousSnapshotModeEnabled:1; ///< Stores the previous snapshot mode value.
746   bool                                            mMarkUpEnabled:1;               ///< enable to scan for mark-up
747
748   Toolkit::TextView::ScrolledSignalType             mScrolledSignal;              ///< Signal emitted when text is scrolled.
749 };
750
751 } // namespace Internal
752
753 // Helpers for public-api forwarding methods
754
755 inline Internal::TextView& GetImpl( TextView& textView )
756 {
757   DALI_ASSERT_ALWAYS( textView );
758
759   RefObject& handle = textView.GetImplementation();
760
761   return static_cast< Internal::TextView& >( handle );
762 }
763
764 inline const Internal::TextView& GetImpl( const TextView& textView )
765 {
766   DALI_ASSERT_ALWAYS( textView );
767
768   const RefObject& handle = textView.GetImplementation();
769
770   return static_cast< const Internal::TextView& >( handle );
771 }
772
773 } // namespace Toolkit
774
775 } // namespace Dali
776
777 #endif // __DALI_TOOLKIT_INTERNAL_ITEM_VIEW_H__