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