[dali_1.9.14] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-label-impl.cpp
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/type-registry-helper.h>
23 #include <dali/public-api/common/stage.h>
24 #include <dali/devel-api/object/property-helper-devel.h>
25 #include <dali/devel-api/adaptor-framework/image-loading.h>
26 #include <dali/integration-api/debug.h>
27
28 // INTERNAL INCLUDES
29 #include <dali-toolkit/public-api/text/rendering-backend.h>
30 #include <dali-toolkit/public-api/text/text-enumerations.h>
31 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
32 #include <dali-toolkit/internal/text/property-string-parser.h>
33 #include <dali-toolkit/internal/text/rendering/text-backend.h>
34 #include <dali-toolkit/internal/text/text-effects-style.h>
35 #include <dali-toolkit/internal/text/text-font-style.h>
36 #include <dali-toolkit/internal/text/text-view.h>
37 #include <dali-toolkit/internal/text/text-definitions.h>
38 #include <dali-toolkit/internal/styling/style-manager-impl.h>
39
40 #include <dali-toolkit/public-api/align-enumerations.h>
41 #include <dali-toolkit/internal/text/text-enumerations-impl.h>
42 #include <dali-toolkit/devel-api/controls/control-devel.h>
43 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
44 #include <dali-toolkit/public-api/visuals/text-visual-properties.h>
45 #include <dali-toolkit/public-api/visuals/visual-properties.h>
46 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
47
48 #include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
49
50 using namespace Dali::Toolkit::Text;
51
52 namespace Dali
53 {
54
55 namespace Toolkit
56 {
57
58 namespace Internal
59 {
60
61 namespace
62 {
63   const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
64
65   /**
66    * @brief How the text visual should be aligned vertically inside the control.
67    *
68    * 0.0f aligns the text to the top, 0.5f aligns the text to the center, 1.0f aligns the text to the bottom.
69    * The alignment depends on the alignment value of the text label (Use Text::VerticalAlignment enumerations).
70    */
71   const float VERTICAL_ALIGNMENT_TABLE[ Text::VerticalAlignment::BOTTOM + 1 ] =
72   {
73     0.0f,  // VerticalAlignment::TOP
74     0.5f,  // VerticalAlignment::CENTER
75     1.0f   // VerticalAlignment::BOTTOM
76   };
77
78   const std::string TEXT_FIT_ENABLE_KEY( "enable" );
79   const std::string TEXT_FIT_MIN_SIZE_KEY( "minSize" );
80   const std::string TEXT_FIT_MAX_SIZE_KEY( "maxSize" );
81   const std::string TEXT_FIT_STEP_SIZE_KEY( "stepSize" );
82   const std::string TEXT_FIT_FONT_SIZE_TYPE_KEY( "fontSizeType" );
83 }
84
85 namespace
86 {
87
88 #if defined ( DEBUG_ENABLED )
89   Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_CONTROLS");
90 #endif
91
92 const Scripting::StringEnum AUTO_SCROLL_STOP_MODE_TABLE[] =
93 {
94   { "IMMEDIATE", Toolkit::TextLabel::AutoScrollStopMode::IMMEDIATE },
95   { "FINISH_LOOP",  Toolkit::TextLabel::AutoScrollStopMode::FINISH_LOOP  },
96 };
97 const unsigned int AUTO_SCROLL_STOP_MODE_TABLE_COUNT = sizeof( AUTO_SCROLL_STOP_MODE_TABLE ) / sizeof( AUTO_SCROLL_STOP_MODE_TABLE[0] );
98
99 // Type registration
100 BaseHandle Create()
101 {
102   return Toolkit::TextLabel::New();
103 }
104
105 // Setup properties, signals and actions using the type-registry.
106 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create );
107
108 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "renderingBackend",          INTEGER, RENDERING_BACKEND          )
109 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "text",                      STRING,  TEXT                       )
110 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "fontFamily",                STRING,  FONT_FAMILY                )
111 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "fontStyle",                 MAP,     FONT_STYLE                 )
112 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "pointSize",                 FLOAT,   POINT_SIZE                 )
113 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "multiLine",                 BOOLEAN, MULTI_LINE                 )
114 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "horizontalAlignment",       STRING,  HORIZONTAL_ALIGNMENT       )
115 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "verticalAlignment",         STRING,  VERTICAL_ALIGNMENT         )
116 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "unusedPropertyTextColor",   VECTOR4, UNUSED_PROPERTY_TEXT_COLOR )
117 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "reservedProperty01",        STRING,  RESERVED_PROPERTY_01       )
118 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "reservedProperty02",        STRING,  RESERVED_PROPERTY_02       )
119 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "reservedProperty03",        STRING,  RESERVED_PROPERTY_03       )
120 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "reservedProperty04",        STRING,  RESERVED_PROPERTY_04       )
121 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "reservedProperty05",        STRING,  RESERVED_PROPERTY_05       )
122 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "enableMarkup",              BOOLEAN, ENABLE_MARKUP              )
123 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "enableAutoScroll",          BOOLEAN, ENABLE_AUTO_SCROLL         )
124 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "autoScrollSpeed",           INTEGER, AUTO_SCROLL_SPEED          )
125 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "autoScrollLoopCount",       INTEGER, AUTO_SCROLL_LOOP_COUNT     )
126 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "autoScrollGap",             FLOAT,   AUTO_SCROLL_GAP            )
127 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "lineSpacing",               FLOAT,   LINE_SPACING               )
128 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "underline",                 MAP,     UNDERLINE                  )
129 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "shadow",                    MAP,     SHADOW                     )
130 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "emboss",                    MAP,     EMBOSS                     )
131 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "outline",                   MAP,     OUTLINE                    )
132 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "pixelSize",                 FLOAT,   PIXEL_SIZE                 )
133 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "ellipsis",                  BOOLEAN, ELLIPSIS                   )
134 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "autoScrollLoopDelay",       FLOAT,   AUTO_SCROLL_LOOP_DELAY     )
135 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "autoScrollStopMode",        STRING,  AUTO_SCROLL_STOP_MODE      )
136 DALI_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "lineCount",                 INTEGER, LINE_COUNT                 )
137 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "lineWrapMode",              INTEGER, LINE_WRAP_MODE             )
138 DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "textDirection",       INTEGER, TEXT_DIRECTION             )
139 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit,     TextLabel, "verticalLineAlignment",     INTEGER, VERTICAL_LINE_ALIGNMENT    )
140 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit,     TextLabel, "textBackground",            MAP,     BACKGROUND                 )
141 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit,     TextLabel, "ignoreSpacesAfterText",     BOOLEAN, IGNORE_SPACES_AFTER_TEXT   )
142 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit,     TextLabel, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION )
143 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit,     TextLabel, "textFit",                   MAP,     TEXT_FIT                   )
144 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit,     TextLabel, "minLineSize",               FLOAT,   MIN_LINE_SIZE              )
145 DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT( Toolkit, TextLabel, "textColor",      Color::BLACK,     TEXT_COLOR     )
146 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit,    TextLabel, "textColorRed",   TEXT_COLOR_RED,   TEXT_COLOR, 0  )
147 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit,    TextLabel, "textColorGreen", TEXT_COLOR_GREEN, TEXT_COLOR, 1  )
148 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit,    TextLabel, "textColorBlue",  TEXT_COLOR_BLUE,  TEXT_COLOR, 2  )
149 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit,    TextLabel, "textColorAlpha", TEXT_COLOR_ALPHA, TEXT_COLOR, 3  )
150 DALI_TYPE_REGISTRATION_END()
151
152 } // namespace
153
154 Toolkit::TextLabel TextLabel::New()
155 {
156   // Create the implementation, temporarily owned by this handle on stack
157   IntrusivePtr< TextLabel > impl = new TextLabel();
158
159   // Pass ownership to CustomActor handle
160   Toolkit::TextLabel handle( *impl );
161
162   // Second-phase init of the implementation
163   // This can only be done after the CustomActor connection has been made...
164   impl->Initialize();
165
166   return handle;
167 }
168
169 void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
170 {
171   Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( Dali::BaseHandle( object ) );
172
173   if( label )
174   {
175     TextLabel& impl( GetImpl( label ) );
176     switch( index )
177     {
178       case Toolkit::TextLabel::Property::RENDERING_BACKEND:
179       {
180         DALI_LOG_WARNING("[%s] Using deprecated Property TextLabel::Property::RENDERING_BACKEND which is no longer supported and will be ignored\n", __FUNCTION__);
181
182         int backend = value.Get< int >();
183
184 #ifndef ENABLE_VECTOR_BASED_TEXT_RENDERING
185         if( Text::RENDERING_VECTOR_BASED == backend )
186         {
187           backend = TextAbstraction::BITMAP_GLYPH; // Fallback to bitmap-based rendering
188         }
189 #endif
190         if( impl.mRenderingBackend != backend )
191         {
192           impl.mRenderingBackend = backend;
193           impl.mTextUpdateNeeded = true;
194
195           if( impl.mController )
196           {
197             // When using the vector-based rendering, the size of the GLyphs are different
198             TextAbstraction::GlyphType glyphType = (Text::RENDERING_VECTOR_BASED == impl.mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
199             impl.mController->SetGlyphType( glyphType );
200           }
201         }
202         break;
203       }
204       case Toolkit::TextLabel::Property::TEXT:
205       {
206         if( impl.mController )
207         {
208           impl.mController->SetText( value.Get< std::string >() );
209         }
210         break;
211       }
212       case Toolkit::TextLabel::Property::FONT_FAMILY:
213       {
214         if( impl.mController )
215         {
216           const std::string& fontFamily = value.Get< std::string >();
217
218           DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::SetProperty Property::FONT_FAMILY newFont(%s)\n", fontFamily.c_str() );
219           impl.mController->SetDefaultFontFamily( fontFamily );
220         }
221         break;
222       }
223       case Toolkit::TextLabel::Property::FONT_STYLE:
224       {
225         SetFontStyleProperty( impl.mController, value, Text::FontStyle::DEFAULT );
226         break;
227       }
228       case Toolkit::TextLabel::Property::POINT_SIZE:
229       {
230         if( impl.mController )
231         {
232           const float pointSize = value.Get< float >();
233
234           if( !Equals( impl.mController->GetDefaultFontSize( Text::Controller::POINT_SIZE ), pointSize ) )
235           {
236             impl.mController->SetDefaultFontSize( pointSize, Text::Controller::POINT_SIZE );
237           }
238         }
239         break;
240       }
241       case Toolkit::TextLabel::Property::MULTI_LINE:
242       {
243         if( impl.mController )
244         {
245           impl.mController->SetMultiLineEnabled( value.Get< bool >() );
246         }
247         break;
248       }
249       case Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT:
250       {
251         if( impl.mController )
252         {
253           Text::HorizontalAlignment::Type alignment( static_cast< Text::HorizontalAlignment::Type >( -1 ) ); // Set to invalid value to ensure a valid mode does get set
254           if( Text::GetHorizontalAlignmentEnumeration( value, alignment ) )
255           {
256             impl.mController->SetHorizontalAlignment( alignment );
257           }
258         }
259         break;
260       }
261       case Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT:
262       {
263         if( impl.mController )
264         {
265           Toolkit::Text::VerticalAlignment::Type alignment( static_cast< Text::VerticalAlignment::Type >( -1 ) ); // Set to invalid value to ensure a valid mode does get set
266           if( Text::GetVerticalAlignmentEnumeration( value, alignment ) )
267           {
268             impl.mController->SetVerticalAlignment( alignment );
269           }
270         }
271         break;
272       }
273
274       case Toolkit::TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR:
275       {
276         label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, value );
277         impl.mTextUpdateNeeded = true;
278         break;
279       }
280       case Toolkit::TextLabel::Property::ENABLE_MARKUP:
281       {
282         if( impl.mController )
283         {
284           const bool enableMarkup = value.Get<bool>();
285           impl.mController->SetMarkupProcessorEnabled( enableMarkup );
286         }
287         break;
288       }
289       case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL:
290       {
291         if( impl.mController )
292         {
293           const bool enableAutoScroll = value.Get<bool>();
294           // If request to auto scroll is the same as current state then do nothing.
295           if ( enableAutoScroll != impl.mController->IsAutoScrollEnabled() )
296           {
297              // If request is disable (false) and auto scrolling is enabled then need to stop it
298              if ( enableAutoScroll == false )
299              {
300                if( impl.mTextScroller )
301                {
302                  impl.mTextScroller->StopScrolling();
303                }
304              }
305              // If request is enable (true) then start autoscroll as not already running
306              else
307              {
308                impl.mController->SetAutoScrollEnabled( enableAutoScroll );
309              }
310           }
311         }
312         break;
313       }
314       case Toolkit::TextLabel::Property::AUTO_SCROLL_STOP_MODE:
315       {
316         if( !impl.mTextScroller )
317         {
318           impl.mTextScroller = Text::TextScroller::New( impl );
319         }
320         Toolkit::TextLabel::AutoScrollStopMode::Type stopMode = impl.mTextScroller->GetStopMode();
321         if( Scripting::GetEnumerationProperty< Toolkit::TextLabel::AutoScrollStopMode::Type >( value,
322                                                                                                     AUTO_SCROLL_STOP_MODE_TABLE,
323                                                                                                     AUTO_SCROLL_STOP_MODE_TABLE_COUNT,
324                                                                                                     stopMode ) )
325         {
326             impl.mTextScroller->SetStopMode( stopMode );
327         }
328         break;
329       }
330       case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
331       {
332         if( !impl.mTextScroller )
333         {
334           impl.mTextScroller = Text::TextScroller::New( impl );
335         }
336         impl.mTextScroller->SetSpeed( value.Get<int>() );
337         break;
338       }
339       case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT:
340       {
341         if( !impl.mTextScroller )
342         {
343           impl.mTextScroller = Text::TextScroller::New( impl );
344         }
345         impl.mTextScroller->SetLoopCount( value.Get<int>() );
346         break;
347       }
348       case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_DELAY:
349       {
350          if( !impl.mTextScroller )
351         {
352           impl.mTextScroller = Text::TextScroller::New( impl );
353         }
354         impl.mTextScroller->SetLoopDelay( value.Get<float>() );
355         break;
356       }
357       case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
358       {
359         if( !impl.mTextScroller )
360         {
361           impl.mTextScroller = Text::TextScroller::New( impl );
362         }
363         impl.mTextScroller->SetGap( value.Get<float>() );
364         break;
365       }
366       case Toolkit::TextLabel::Property::LINE_SPACING:
367       {
368         if( impl.mController )
369         {
370           const float lineSpacing = value.Get<float>();
371
372           // Don't trigger anything if the line spacing didn't change
373           if( impl.mController->SetDefaultLineSpacing( lineSpacing ) )
374           {
375             impl.mTextUpdateNeeded = true;
376           }
377         }
378         break;
379       }
380       case Toolkit::TextLabel::Property::UNDERLINE:
381       {
382         const bool update = SetUnderlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
383         if( update )
384         {
385           impl.mTextUpdateNeeded = true;
386         }
387         break;
388       }
389       case Toolkit::TextLabel::Property::SHADOW:
390       {
391         const bool update = SetShadowProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
392         if( update )
393         {
394           impl.mTextUpdateNeeded = true;
395         }
396         break;
397       }
398       case Toolkit::TextLabel::Property::EMBOSS:
399       {
400         const bool update = SetEmbossProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
401         if( update )
402         {
403           impl.mTextUpdateNeeded = true;
404         }
405         break;
406       }
407       case Toolkit::TextLabel::Property::OUTLINE:
408       {
409         const bool update = SetOutlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
410         if( update )
411         {
412           impl.mTextUpdateNeeded = true;
413         }
414         break;
415       }
416       case Toolkit::TextLabel::Property::PIXEL_SIZE:
417       {
418         if( impl.mController )
419         {
420           const float pixelSize = value.Get< float >();
421           DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel %p PIXEL_SIZE %f\n", impl.mController.Get(), pixelSize );
422
423           if( !Equals( impl.mController->GetDefaultFontSize( Text::Controller::PIXEL_SIZE ), pixelSize ) )
424           {
425             impl.mController->SetDefaultFontSize( pixelSize, Text::Controller::PIXEL_SIZE );
426           }
427         }
428         break;
429       }
430       case Toolkit::TextLabel::Property::ELLIPSIS:
431       {
432         if( impl.mController )
433         {
434           const bool ellipsis = value.Get<bool>();
435           DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel %p ELLIPSIS %d\n", impl.mController.Get(), ellipsis );
436
437           impl.mController->SetTextElideEnabled( ellipsis );
438         }
439         break;
440       }
441       case Toolkit::TextLabel::Property::LINE_WRAP_MODE:
442       {
443         if( impl.mController )
444         {
445           Text::LineWrap::Mode lineWrapMode( static_cast< Text::LineWrap::Mode >( -1 ) ); // Set to invalid value to ensure a valid mode does get set
446           if( GetLineWrapModeEnumeration( value, lineWrapMode ) )
447           {
448             DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel %p LineWrap::MODE %d\n", impl.mController.Get(), lineWrapMode );
449             impl.mController->SetLineWrapMode( lineWrapMode );
450           }
451         }
452         break;
453       }
454       case Toolkit::DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT:
455       {
456         if( impl.mController && impl.mController->GetTextModel() )
457         {
458           DevelText::VerticalLineAlignment::Type alignment = static_cast<DevelText::VerticalLineAlignment::Type>( value.Get<int>() );
459
460           impl.mController->SetVerticalLineAlignment( alignment );
461
462           // Property doesn't affect the layout, only Visual must be updated
463           TextVisual::EnableRendererUpdate( impl.mVisual );
464
465           // No need to trigger full re-layout. Instead call UpdateRenderer() directly
466           TextVisual::UpdateRenderer( impl.mVisual );
467         }
468         break;
469       }
470       case Toolkit::DevelTextLabel::Property::BACKGROUND:
471       {
472         const bool update = SetBackgroundProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
473         if( update )
474         {
475           impl.mTextUpdateNeeded = true;
476         }
477         break;
478       }
479       case Toolkit::DevelTextLabel::Property::IGNORE_SPACES_AFTER_TEXT:
480       {
481         impl.mController->SetIgnoreSpacesAfterText(value.Get< bool >());
482         break;
483       }
484       case Toolkit::DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
485       {
486         impl.mController->SetMatchSystemLanguageDirection(value.Get< bool >());
487         break;
488       }
489       case Toolkit::DevelTextLabel::Property::TEXT_FIT:
490       {
491         const Property::Map& propertiesMap = value.Get<Property::Map>();
492
493         bool enabled = false;
494         float minSize = 0.f;
495         float maxSize = 0.f;
496         float stepSize = 0.f;
497         bool isMinSizeSet = false, isMaxSizeSet = false, isStepSizeSet = false;
498         Controller::FontSizeType type = Controller::FontSizeType::POINT_SIZE;
499
500         if ( !propertiesMap.Empty() )
501         {
502           const unsigned int numberOfItems = propertiesMap.Count();
503
504           // Parses and applies
505           for( unsigned int index = 0u; index < numberOfItems; ++index )
506           {
507             const KeyValuePair& valueGet = propertiesMap.GetKeyValue( index );
508
509             if( ( Controller::TextFitInfo::Property::TEXT_FIT_ENABLE == valueGet.first.indexKey ) || ( TEXT_FIT_ENABLE_KEY == valueGet.first.stringKey ) )
510             {
511               /// Enable key.
512               enabled = valueGet.second.Get< bool >();
513             }
514             else if( ( Controller::TextFitInfo::Property::TEXT_FIT_MIN_SIZE == valueGet.first.indexKey ) || ( TEXT_FIT_MIN_SIZE_KEY == valueGet.first.stringKey ) )
515             {
516               /// min size.
517               minSize = valueGet.second.Get< float >();
518               isMinSizeSet = true;
519             }
520             else if( ( Controller::TextFitInfo::Property::TEXT_FIT_MAX_SIZE == valueGet.first.indexKey ) || ( TEXT_FIT_MAX_SIZE_KEY == valueGet.first.stringKey ) )
521             {
522               /// max size.
523               maxSize = valueGet.second.Get< float >();
524               isMaxSizeSet = true;
525             }
526             else if( ( Controller::TextFitInfo::Property::TEXT_FIT_STEP_SIZE == valueGet.first.indexKey ) || ( TEXT_FIT_STEP_SIZE_KEY == valueGet.first.stringKey ) )
527             {
528               /// step size.
529               stepSize = valueGet.second.Get< float >();
530               isStepSizeSet = true;
531             }
532             else if( ( Controller::TextFitInfo::Property::TEXT_FIT_FONT_SIZE_TYPE == valueGet.first.indexKey ) || ( TEXT_FIT_FONT_SIZE_TYPE_KEY == valueGet.first.stringKey ) )
533             {
534               if( "pixelSize" == valueGet.second.Get< std::string >() )
535               {
536                 type = Controller::FontSizeType::PIXEL_SIZE;
537               }
538             }
539           }
540
541           impl.mController->SetTextFitEnabled( enabled );
542           if( isMinSizeSet )
543           {
544             impl.mController->SetTextFitMinSize( minSize, type );
545           }
546           if( isMaxSizeSet )
547           {
548             impl.mController->SetTextFitMaxSize( maxSize, type );
549           }
550           if( isStepSizeSet )
551           {
552             impl.mController->SetTextFitStepSize( stepSize, type );
553           }
554         }
555         break;
556       }
557       case Toolkit::DevelTextLabel::Property::MIN_LINE_SIZE:
558       {
559         if( impl.mController )
560         {
561           const float lineSize = value.Get<float>();
562
563           if( impl.mController->SetDefaultLineSize( lineSize ) )
564           {
565             impl.mTextUpdateNeeded = true;
566           }
567         }
568         break;
569       }
570     }
571
572     // Request relayout when text update is needed. It's necessary to call it
573     // as changing the property not via UI interaction brings no effect if only
574     // the mTextUpdateNeeded is changed.
575     if( impl.mTextUpdateNeeded )
576     {
577       // need to request relayout as size of text may have changed
578       impl.RequestTextRelayout();
579     }
580   }
581 }
582
583 Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index index )
584 {
585   Property::Value value;
586
587   Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( Dali::BaseHandle( object ) );
588
589   if( label )
590   {
591     TextLabel& impl( GetImpl( label ) );
592     switch( index )
593     {
594       case Toolkit::TextLabel::Property::RENDERING_BACKEND:
595       {
596         DALI_LOG_WARNING("[%s] Using deprecated Property TextLabel::Property::RENDERING_BACKEND which is no longer supported and will be ignored\n", __FUNCTION__);
597
598         value = impl.mRenderingBackend;
599         break;
600       }
601       case Toolkit::TextLabel::Property::TEXT:
602       {
603         if( impl.mController )
604         {
605           std::string text;
606           impl.mController->GetText( text );
607           value = text;
608         }
609         break;
610       }
611       case Toolkit::TextLabel::Property::FONT_FAMILY:
612       {
613         if( impl.mController )
614         {
615           value = impl.mController->GetDefaultFontFamily();
616         }
617         break;
618       }
619       case Toolkit::TextLabel::Property::FONT_STYLE:
620       {
621         GetFontStyleProperty( impl.mController, value, Text::FontStyle::DEFAULT );
622         break;
623       }
624       case Toolkit::TextLabel::Property::POINT_SIZE:
625       {
626         if( impl.mController )
627         {
628           value = impl.mController->GetDefaultFontSize( Text::Controller::POINT_SIZE );
629         }
630         break;
631       }
632       case Toolkit::TextLabel::Property::MULTI_LINE:
633       {
634         if( impl.mController )
635         {
636           value = impl.mController->IsMultiLineEnabled();
637         }
638         break;
639       }
640       case Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT:
641       {
642         if( impl.mController )
643         {
644           const char* name = Text::GetHorizontalAlignmentString( impl.mController->GetHorizontalAlignment() );
645
646            if ( name )
647            {
648              value = std::string( name );
649            }
650         }
651         break;
652       }
653       case Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT:
654       {
655         if( impl.mController )
656         {
657           const char* name = Text::GetVerticalAlignmentString( impl.mController->GetVerticalAlignment() );
658           if( name )
659           {
660             value = std::string( name );
661           }
662         }
663         break;
664       }
665       case Toolkit::TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR:
666       {
667         value = label.GetProperty( Toolkit::TextLabel::Property::TEXT_COLOR );
668         break;
669       }
670       case Toolkit::TextLabel::Property::ENABLE_MARKUP:
671       {
672         if( impl.mController )
673         {
674           value = impl.mController->IsMarkupProcessorEnabled();
675         }
676         break;
677       }
678       case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL:
679       {
680         if( impl.mController )
681         {
682           value = impl.mController->IsAutoScrollEnabled();
683         }
684         break;
685       }
686       case Toolkit::TextLabel::Property::AUTO_SCROLL_STOP_MODE:
687       {
688         if( impl.mTextScroller )
689         {
690           const char* mode = Scripting::GetEnumerationName< Toolkit::TextLabel::AutoScrollStopMode::Type >( impl.mTextScroller->GetStopMode(),
691                                                                                                                  AUTO_SCROLL_STOP_MODE_TABLE,
692                                                                                                                  AUTO_SCROLL_STOP_MODE_TABLE_COUNT );
693           if( mode )
694           {
695             value = std::string( mode );
696           }
697         }
698         break;
699       }
700       case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
701       {
702         TextLabel& impl( GetImpl( label ) );
703         if ( impl.mTextScroller )
704         {
705           value = impl.mTextScroller->GetSpeed();
706         }
707         break;
708       }
709       case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT:
710       {
711         if( impl.mController )
712         {
713           TextLabel& impl( GetImpl( label ) );
714           if ( impl.mTextScroller )
715           {
716             value = impl.mTextScroller->GetLoopCount();
717           }
718         }
719         break;
720       }
721       case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_DELAY:
722       {
723         if( impl.mController )
724         {
725           TextLabel& impl( GetImpl( label ) );
726           if ( impl.mTextScroller )
727           {
728             value = impl.mTextScroller->GetLoopDelay();
729           }
730         }
731         break;
732       }
733       case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
734       {
735         TextLabel& impl( GetImpl( label ) );
736         if ( impl.mTextScroller )
737         {
738           value = impl.mTextScroller->GetGap();
739         }
740         break;
741       }
742       case Toolkit::TextLabel::Property::LINE_SPACING:
743       {
744         if( impl.mController )
745         {
746           value = impl.mController->GetDefaultLineSpacing();
747         }
748         break;
749       }
750       case Toolkit::TextLabel::Property::UNDERLINE:
751       {
752         GetUnderlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
753         break;
754       }
755       case Toolkit::TextLabel::Property::SHADOW:
756       {
757         GetShadowProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
758         break;
759       }
760       case Toolkit::TextLabel::Property::EMBOSS:
761       {
762         GetEmbossProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
763         break;
764       }
765       case Toolkit::TextLabel::Property::OUTLINE:
766       {
767         GetOutlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
768         break;
769       }
770       case Toolkit::TextLabel::Property::PIXEL_SIZE:
771       {
772         if( impl.mController )
773         {
774           value = impl.mController->GetDefaultFontSize( Text::Controller::PIXEL_SIZE );
775         }
776         break;
777       }
778       case Toolkit::TextLabel::Property::ELLIPSIS:
779       {
780         if( impl.mController )
781         {
782           value = impl.mController->IsTextElideEnabled();
783         }
784         break;
785       }
786       case Toolkit::TextLabel::Property::LINE_WRAP_MODE:
787       {
788         if( impl.mController )
789         {
790           value = impl.mController->GetLineWrapMode();
791         }
792         break;
793       }
794       case Toolkit::TextLabel::Property::LINE_COUNT:
795       {
796         if( impl.mController )
797         {
798           float width = label.GetProperty( Actor::Property::SIZE_WIDTH ).Get<float>();
799           value = impl.mController->GetLineCount( width );
800         }
801         break;
802       }
803       case Toolkit::DevelTextLabel::Property::TEXT_DIRECTION:
804       {
805         if( impl.mController )
806         {
807           value = impl.mController->GetTextDirection();
808         }
809         break;
810       }
811       case Toolkit::DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT:
812       {
813         if( impl.mController )
814         {
815           value = impl.mController->GetVerticalLineAlignment();
816         }
817         break;
818       }
819       case Toolkit::DevelTextLabel::Property::BACKGROUND:
820       {
821         GetBackgroundProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
822         break;
823       }
824       case Toolkit::DevelTextLabel::Property::IGNORE_SPACES_AFTER_TEXT:
825       {
826         value = impl.mController->IsIgnoreSpacesAfterText();
827         break;
828       }
829       case Toolkit::DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
830       {
831         value = impl.mController->IsMatchSystemLanguageDirection();
832         break;
833       }
834       case Toolkit::DevelTextLabel::Property::TEXT_FIT:
835       {
836         const bool enabled = impl.mController->IsTextFitEnabled();
837         const float minSize = impl.mController->GetTextFitMinSize();
838         const float maxSize = impl.mController->GetTextFitMaxSize();
839         const float stepSize = impl.mController->GetTextFitStepSize();
840
841         Property::Map map;
842         map.Insert( TEXT_FIT_ENABLE_KEY, enabled );
843         map.Insert( TEXT_FIT_MIN_SIZE_KEY, minSize );
844         map.Insert( TEXT_FIT_MAX_SIZE_KEY, maxSize );
845         map.Insert( TEXT_FIT_STEP_SIZE_KEY, stepSize );
846         map.Insert( TEXT_FIT_FONT_SIZE_TYPE_KEY, "pointSize" );
847
848         value = map;
849         break;
850       }
851       case Toolkit::DevelTextLabel::Property::MIN_LINE_SIZE:
852       {
853         if( impl.mController )
854         {
855           value = impl.mController->GetDefaultLineSize();
856         }
857         break;
858       }
859     }
860   }
861
862   return value;
863 }
864
865 void TextLabel::OnInitialize()
866 {
867   Actor self = Self();
868
869   Property::Map propertyMap;
870   propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT );
871
872   mVisual =  Toolkit::VisualFactory::Get().CreateVisual( propertyMap );
873   DevelControl::RegisterVisual( *this, Toolkit::TextLabel::Property::TEXT, mVisual  );
874
875   TextVisual::SetAnimatableTextColorProperty( mVisual, Toolkit::TextLabel::Property::TEXT_COLOR );
876
877   mController = TextVisual::GetController(mVisual);
878   if( mController )
879   {
880     mController->SetControlInterface(this);
881   }
882
883   // Use height-for-width negotiation by default
884   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
885   self.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
886
887   // Enable the text ellipsis.
888   mController->SetTextElideEnabled( true );   // If false then text larger than control will overflow
889
890   // Sets layoutDirection value
891   Dali::Stage stage = Dali::Stage::GetCurrent();
892   Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( stage.GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
893   mController->SetLayoutDirection( layoutDirection );
894
895   Layout::Engine& engine = mController->GetLayoutEngine();
896   engine.SetCursorWidth( 0u ); // Do not layout space for the cursor.
897 }
898
899 void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
900 {
901   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::OnStyleChange\n");
902
903   switch ( change )
904   {
905     case StyleChange::DEFAULT_FONT_CHANGE:
906     {
907       // Property system did not set the font so should update it.
908       const std::string& newFont = GetImpl( styleManager ).GetDefaultFontFamily();
909       DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnStyleChange StyleChange::DEFAULT_FONT_CHANGE newFont(%s)\n", newFont.c_str() );
910       mController->UpdateAfterFontChange( newFont );
911       RelayoutRequest();
912       break;
913     }
914     case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
915     {
916       GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
917       RelayoutRequest();
918       break;
919     }
920     case StyleChange::THEME_CHANGE:
921     {
922       // Nothing to do, let control base class handle this
923       break;
924     }
925   }
926
927   // Up call to Control
928   Control::OnStyleChange( styleManager, change );
929 }
930
931 Vector3 TextLabel::GetNaturalSize()
932 {
933   Extents padding;
934   padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
935
936   Vector3 naturalSize = mController->GetNaturalSize();
937   naturalSize.width += ( padding.start + padding.end );
938   naturalSize.height += ( padding.top + padding.bottom );
939
940   return naturalSize;
941 }
942
943 float TextLabel::GetHeightForWidth( float width )
944 {
945   Extents padding;
946   padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
947
948   return mController->GetHeightForWidth( width ) + padding.top + padding.bottom;
949 }
950
951 void TextLabel::OnPropertySet( Property::Index index, Property::Value propertyValue )
952 {
953   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::OnPropertySet index[%d]\n", index );
954
955   switch ( index )
956   {
957     case Toolkit::TextLabel::Property::TEXT_COLOR:
958     {
959       const Vector4& textColor = propertyValue.Get< Vector4 >();
960       if( mController->GetDefaultColor() != textColor )
961       {
962          mController->SetDefaultColor( textColor );
963          mTextUpdateNeeded = true;
964       }
965       break;
966     }
967     default:
968     {
969       Control::OnPropertySet( index, propertyValue ); // up call to control for non-handled properties
970       break;
971     }
972   }
973 }
974
975 void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container )
976 {
977   DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnRelayout\n" );
978
979   Extents padding;
980   padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
981
982   Vector2 contentSize( size.x - ( padding.start + padding.end ), size.y - ( padding.top + padding.bottom ) );
983
984   if( mController->IsTextFitEnabled() )
985   {
986     mController->FitPointSizeforLayout( contentSize );
987     mController->SetTextFitContentSize( contentSize );
988   }
989
990   // Support Right-To-Left
991   Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( Self().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
992
993   const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize, layoutDirection );
994
995   if( ( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) )
996      || mTextUpdateNeeded )
997   {
998     DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnRelayout IsAutoScrollEnabled[%s] [%p]\n", ( mController->IsAutoScrollEnabled())?"true":"false", this );
999
1000     // Update the visual
1001     TextVisual::EnableRendererUpdate( mVisual );
1002
1003     // Support Right-To-Left of padding
1004     if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
1005     {
1006       std::swap( padding.start, padding.end );
1007     }
1008
1009     // Calculate the size of the visual that can fit the text
1010     Size layoutSize = mController->GetTextModel()->GetLayoutSize();
1011     layoutSize.x = contentSize.x;
1012
1013     const Vector2& shadowOffset = mController->GetTextModel()->GetShadowOffset();
1014     if ( shadowOffset.y > Math::MACHINE_EPSILON_1 )
1015     {
1016       layoutSize.y += shadowOffset.y;
1017     }
1018
1019     float outlineWidth = mController->GetTextModel()->GetOutlineWidth();
1020     layoutSize.y += outlineWidth * 2.0f;
1021     layoutSize.y = std::min( layoutSize.y, contentSize.y );
1022
1023     // Calculate the offset for vertical alignment only, as the layout engine will do the horizontal alignment.
1024     Vector2 alignmentOffset;
1025     alignmentOffset.x = 0.0f;
1026     alignmentOffset.y = ( contentSize.y - layoutSize.y ) * VERTICAL_ALIGNMENT_TABLE[mController->GetVerticalAlignment()];
1027
1028     Property::Map visualTransform;
1029     visualTransform.Add( Toolkit::Visual::Transform::Property::SIZE, layoutSize )
1030                    .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
1031                    .Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2( padding.start, padding.top ) + alignmentOffset )
1032                    .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
1033                    .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
1034                    .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN );
1035     mVisual.SetTransformAndSize( visualTransform, size );
1036
1037     if ( mController->IsAutoScrollEnabled() )
1038     {
1039       SetUpAutoScrolling();
1040     }
1041
1042     mTextUpdateNeeded = false;
1043   }
1044 }
1045
1046 void TextLabel::RequestTextRelayout()
1047 {
1048   RelayoutRequest();
1049   // Signal that a Relayout may be needed
1050 }
1051
1052 void TextLabel::SetUpAutoScrolling()
1053 {
1054   const Size& controlSize = mController->GetView().GetControlSize();
1055   const Size textNaturalSize = GetNaturalSize().GetVectorXY(); // As relayout of text may not be done at this point natural size is used to get size. Single line scrolling only.
1056   const Text::CharacterDirection direction = mController->GetAutoScrollDirection();
1057
1058   DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetUpAutoScrolling textNaturalSize[%f,%f] controlSize[%f,%f]\n",
1059                  textNaturalSize.x,textNaturalSize.y , controlSize.x,controlSize.y );
1060
1061   if ( !mTextScroller )
1062   {
1063     DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetUpAutoScrolling Creating default TextScoller\n" );
1064
1065     // If speed, loopCount or gap not set via property system then will need to create a TextScroller with defaults
1066     mTextScroller = Text::TextScroller::New( *this );
1067   }
1068
1069   // Calculate the actual gap before scrolling wraps.
1070   int textPadding = std::max( controlSize.x - textNaturalSize.x, 0.0f );
1071   float wrapGap = std::max( mTextScroller->GetGap(), textPadding );
1072   Vector2 textureSize = textNaturalSize + Vector2(wrapGap, 0.0f); // Add the gap as a part of the texture
1073
1074   // Create a texture of the text for scrolling
1075   Size verifiedSize = textureSize;
1076   const int maxTextureSize = Dali::GetMaxTextureSize();
1077
1078   //if the texture size width exceed maxTextureSize, modify the visual model size and enabled the ellipsis
1079   bool actualellipsis = mController->IsTextElideEnabled();
1080   if( verifiedSize.width > maxTextureSize )
1081   {
1082     verifiedSize.width = maxTextureSize;
1083     if( textNaturalSize.width > maxTextureSize )
1084     {
1085       mController->SetTextElideEnabled( true );
1086     }
1087     GetHeightForWidth( maxTextureSize );
1088     wrapGap = std::max( maxTextureSize - textNaturalSize.width, 0.0f );
1089   }
1090
1091   Text::TypesetterPtr typesetter = Text::Typesetter::New( mController->GetTextModel() );
1092
1093   PixelData data = typesetter->Render( verifiedSize, mController->GetTextDirection(), Text::Typesetter::RENDER_TEXT_AND_STYLES, true, Pixel::RGBA8888 ); // ignore the horizontal alignment
1094   Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D,
1095                                   data.GetPixelFormat(),
1096                                   data.GetWidth(),
1097                                   data.GetHeight() );
1098   texture.Upload( data );
1099
1100   TextureSet textureSet = TextureSet::New();
1101   textureSet.SetTexture( 0u, texture );
1102
1103   // Filter mode needs to be set to linear to produce better quality while scaling.
1104   Sampler sampler = Sampler::New();
1105   sampler.SetFilterMode( FilterMode::LINEAR, FilterMode::LINEAR );
1106   sampler.SetWrapMode( Dali::WrapMode::DEFAULT, Dali::WrapMode::REPEAT, Dali::WrapMode::DEFAULT ); // Wrap the texture in the x direction
1107   textureSet.SetSampler( 0u, sampler );
1108
1109   // Set parameters for scrolling
1110   Renderer renderer = static_cast<Internal::Visual::Base&>( GetImplementation( mVisual ) ).GetRenderer();
1111   mTextScroller->SetParameters( Self(), renderer, textureSet, controlSize, verifiedSize, wrapGap, direction, mController->GetHorizontalAlignment(), mController->GetVerticalAlignment() );
1112   mController->SetTextElideEnabled( actualellipsis );
1113 }
1114
1115 void TextLabel::ScrollingFinished()
1116 {
1117   // Pure Virtual from TextScroller Interface
1118   DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::ScrollingFinished\n");
1119   mController->SetAutoScrollEnabled( false );
1120   RequestTextRelayout();
1121 }
1122
1123 TextLabel::TextLabel()
1124 : Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
1125   mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
1126   mTextUpdateNeeded( false )
1127 {
1128 }
1129
1130 TextLabel::~TextLabel()
1131 {
1132 }
1133
1134 } // namespace Internal
1135
1136 } // namespace Toolkit
1137
1138 } // namespace Dali