Stop doing unparent and reset in text decorator.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-field-impl.cpp
1 /*
2  * Copyright (c) 2015 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-field-impl.h>
20
21 // EXTERNAL INCLUDES
22 #include <string>
23 #include <iostream>
24 #include <cstring>
25 #include <dali/public-api/adaptor-framework/key.h>
26 #include <dali/public-api/common/stage.h>
27 #include <dali/public-api/images/resource-image.h>
28 #include <dali/public-api/object/type-registry.h>
29 #include <dali/devel-api/object/type-registry-helper.h>
30 #include <dali/devel-api/scripting/scripting.h>
31 #include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
32 #include <dali/integration-api/debug.h>
33
34 // INTERNAL INCLUDES
35 #include <dali-toolkit/public-api/text/rendering-backend.h>
36 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
37 #include <dali-toolkit/internal/text/rendering/text-backend.h>
38 #include <dali-toolkit/internal/styling/style-manager-impl.h>
39
40 using namespace Dali::Toolkit::Text;
41
42 namespace Dali
43 {
44
45 namespace Toolkit
46 {
47
48 namespace Internal
49 {
50
51 namespace // unnamed namespace
52 {
53
54 #if defined(DEBUG_ENABLED)
55   Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS");
56 #endif
57
58   const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
59
60 } // unnamed namespace
61
62 namespace
63 {
64
65 const Scripting::StringEnum HORIZONTAL_ALIGNMENT_STRING_TABLE[] =
66 {
67   { "BEGIN",  Toolkit::Text::LayoutEngine::HORIZONTAL_ALIGN_BEGIN  },
68   { "CENTER", Toolkit::Text::LayoutEngine::HORIZONTAL_ALIGN_CENTER },
69   { "END",    Toolkit::Text::LayoutEngine::HORIZONTAL_ALIGN_END    },
70 };
71 const unsigned int HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT = sizeof( HORIZONTAL_ALIGNMENT_STRING_TABLE ) / sizeof( HORIZONTAL_ALIGNMENT_STRING_TABLE[0] );
72
73 const Scripting::StringEnum VERTICAL_ALIGNMENT_STRING_TABLE[] =
74 {
75   { "TOP",    Toolkit::Text::LayoutEngine::VERTICAL_ALIGN_TOP    },
76   { "CENTER", Toolkit::Text::LayoutEngine::VERTICAL_ALIGN_CENTER },
77   { "BOTTOM", Toolkit::Text::LayoutEngine::VERTICAL_ALIGN_BOTTOM },
78 };
79 const unsigned int VERTICAL_ALIGNMENT_STRING_TABLE_COUNT = sizeof( VERTICAL_ALIGNMENT_STRING_TABLE ) / sizeof( VERTICAL_ALIGNMENT_STRING_TABLE[0] );
80
81 // Type registration
82 BaseHandle Create()
83 {
84   return Toolkit::TextField::New();
85 }
86
87 // Setup properties, signals and actions using the type-registry.
88 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextField, Toolkit::Control, Create );
89
90 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "rendering-backend",                    INTEGER,   RENDERING_BACKEND                    )
91 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text",                                 STRING,    TEXT                                 )
92 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text",                     STRING,    PLACEHOLDER_TEXT                     )
93 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text-focused",             STRING,    PLACEHOLDER_TEXT_FOCUSED             )
94 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-family",                          STRING,    FONT_FAMILY                          )
95 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-style",                           STRING,    FONT_STYLE                           )
96 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "point-size",                           FLOAT,     POINT_SIZE                           )
97 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "max-length",                           INTEGER,   MAX_LENGTH                           )
98 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "exceed-policy",                        INTEGER,   EXCEED_POLICY                        )
99 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "horizontal-alignment",                 STRING,    HORIZONTAL_ALIGNMENT                 )
100 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "vertical-alignment",                   STRING,    VERTICAL_ALIGNMENT                   )
101 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text-color",                           VECTOR4,   TEXT_COLOR                           )
102 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text-color",               VECTOR4,   PLACEHOLDER_TEXT_COLOR               )
103 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow-offset",                        VECTOR2,   SHADOW_OFFSET                        )
104 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow-color",                         VECTOR4,   SHADOW_COLOR                         )
105 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "primary-cursor-color",                 VECTOR4,   PRIMARY_CURSOR_COLOR                 )
106 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "secondary-cursor-color",               VECTOR4,   SECONDARY_CURSOR_COLOR               )
107 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "enable-cursor-blink",                  BOOLEAN,   ENABLE_CURSOR_BLINK                  )
108 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-interval",                FLOAT,     CURSOR_BLINK_INTERVAL                )
109 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-duration",                FLOAT,     CURSOR_BLINK_DURATION                )
110 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-image",                    STRING,    GRAB_HANDLE_IMAGE                    )
111 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-pressed-image",            STRING,    GRAB_HANDLE_PRESSED_IMAGE            )
112 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-threshold",                     FLOAT,     SCROLL_THRESHOLD                     )
113 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-speed",                         FLOAT,     SCROLL_SPEED                         )
114 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-left",          STRING,    SELECTION_HANDLE_IMAGE_LEFT          )
115 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right",         STRING,    SELECTION_HANDLE_IMAGE_RIGHT         )
116 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left",  STRING,    SELECTION_HANDLE_PRESSED_IMAGE_LEFT  )
117 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING,    SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
118 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color",            STRING,    SELECTION_HIGHLIGHT_COLOR            )
119 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box",              RECTANGLE, DECORATION_BOUNDING_BOX              )
120 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "input-method-settings",                MAP,       INPUT_METHOD_SETTINGS                )
121
122 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "text-changed",       SIGNAL_TEXT_CHANGED )
123 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "max-length-reached", SIGNAL_MAX_LENGTH_REACHED )
124
125 DALI_TYPE_REGISTRATION_END()
126
127 } // namespace
128
129 Toolkit::TextField TextField::New()
130 {
131   // Create the implementation, temporarily owned by this handle on stack
132   IntrusivePtr< TextField > impl = new TextField();
133
134   // Pass ownership to CustomActor handle
135   Toolkit::TextField handle( *impl );
136
137   // Second-phase init of the implementation
138   // This can only be done after the CustomActor connection has been made...
139   impl->Initialize();
140
141   return handle;
142 }
143
144 void TextField::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
145 {
146   Toolkit::TextField textField = Toolkit::TextField::DownCast( Dali::BaseHandle( object ) );
147
148   if( textField )
149   {
150     TextField& impl( GetImpl( textField ) );
151
152     switch( index )
153     {
154       case Toolkit::TextField::Property::RENDERING_BACKEND:
155       {
156         int backend = value.Get< int >();
157         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p RENDERING_BACKEND %d\n", impl.mController.Get(), backend );
158
159         if( impl.mRenderingBackend != backend )
160         {
161           impl.mRenderingBackend = backend;
162           impl.mRenderer.Reset();
163           impl.RequestTextRelayout();
164         }
165         break;
166       }
167       case Toolkit::TextField::Property::TEXT:
168       {
169         if( impl.mController )
170         {
171           const std::string text = value.Get< std::string >();
172           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p TEXT %s\n", impl.mController.Get(), text.c_str() );
173
174           impl.mController->SetText( text );
175         }
176         break;
177       }
178       case Toolkit::TextField::Property::PLACEHOLDER_TEXT:
179       {
180         if( impl.mController )
181         {
182           const std::string text = value.Get< std::string >();
183           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT %s\n", impl.mController.Get(), text.c_str() );
184
185           impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_INACTIVE, text );
186         }
187         break;
188       }
189       case Toolkit::TextField::Property::PLACEHOLDER_TEXT_FOCUSED:
190       {
191         if( impl.mController )
192         {
193           const std::string text = value.Get< std::string >();
194           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT_FOCUSED %s\n", impl.mController.Get(), text.c_str() );
195
196           impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_ACTIVE, text );
197         }
198         break;
199       }
200       case Toolkit::TextField::Property::FONT_FAMILY:
201       {
202         if( impl.mController )
203         {
204           const std::string fontFamily = value.Get< std::string >();
205           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_FAMILY %s\n", impl.mController.Get(), fontFamily.c_str() );
206
207           if( impl.mController->GetDefaultFontFamily() != fontFamily )
208           {
209             impl.mController->SetDefaultFontFamily( fontFamily );
210           }
211         }
212         break;
213       }
214       case Toolkit::TextField::Property::FONT_STYLE:
215       {
216         if( impl.mController )
217         {
218           const std::string fontStyle = value.Get< std::string >();
219           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_STYLE %s\n", impl.mController.Get(), fontStyle.c_str() );
220
221           if( impl.mController->GetDefaultFontStyle() != fontStyle )
222           {
223             impl.mController->SetDefaultFontStyle( fontStyle );
224           }
225         }
226         break;
227       }
228       case Toolkit::TextField::Property::POINT_SIZE:
229       {
230         if( impl.mController )
231         {
232           const float pointSize = value.Get< float >();
233           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_STYLE %f\n", impl.mController.Get(), pointSize );
234
235           if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) )
236           {
237             impl.mController->SetDefaultPointSize( pointSize );
238           }
239         }
240         break;
241       }
242       case Toolkit::TextField::Property::EXCEED_POLICY:
243       {
244         // TODO
245         break;
246       }
247       case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
248       {
249         if( impl.mController )
250         {
251           const std::string alignStr = value.Get< std::string >();
252           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p HORIZONTAL_ALIGNMENT %f\n", impl.mController.Get(), alignStr.c_str() );
253
254           LayoutEngine::HorizontalAlignment alignment( LayoutEngine::HORIZONTAL_ALIGN_BEGIN );
255           if( Scripting::GetEnumeration< LayoutEngine::HorizontalAlignment >( alignStr.c_str(),
256                                                                               HORIZONTAL_ALIGNMENT_STRING_TABLE,
257                                                                               HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
258                                                                               alignment ) )
259           {
260             impl.mController->SetHorizontalAlignment( alignment );
261           }
262         }
263         break;
264       }
265       case Toolkit::TextField::Property::VERTICAL_ALIGNMENT:
266       {
267         if( impl.mController )
268         {
269           const std::string alignStr = value.Get< std::string >();
270           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p VERTICAL_ALIGNMENT %f\n", impl.mController.Get(), alignStr.c_str() );
271
272           LayoutEngine::VerticalAlignment alignment( LayoutEngine::VERTICAL_ALIGN_BOTTOM );
273           if( Scripting::GetEnumeration< LayoutEngine::VerticalAlignment >( alignStr.c_str(),
274                                                                             VERTICAL_ALIGNMENT_STRING_TABLE,
275                                                                             VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
276                                                                             alignment ) )
277           {
278             impl.mController->SetVerticalAlignment( alignment );
279           }
280         }
281         break;
282       }
283       case Toolkit::TextField::Property::TEXT_COLOR:
284       {
285         if( impl.mController )
286         {
287           const Vector4 textColor = value.Get< Vector4 >();
288           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a );
289
290           if( impl.mController->GetTextColor() != textColor )
291           {
292             impl.mController->SetTextColor( textColor );
293             impl.mRenderer.Reset();
294           }
295         }
296         break;
297       }
298       case Toolkit::TextField::Property::PLACEHOLDER_TEXT_COLOR:
299       {
300         if( impl.mController )
301         {
302           const Vector4 textColor = value.Get< Vector4 >();
303           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a );
304
305           if( impl.mController->GetPlaceholderTextColor() != textColor )
306           {
307             impl.mController->SetPlaceholderTextColor( textColor );
308             impl.mRenderer.Reset();
309           }
310         }
311         break;
312       }
313       case Toolkit::TextField::Property::SHADOW_OFFSET:
314       {
315         if( impl.mController )
316         {
317           const Vector2 shadowOffset = value.Get< Vector2 >();
318           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SHADOW_OFFSET %f,%f\n", impl.mController.Get(), shadowOffset.x, shadowOffset.y );
319
320           if ( impl.mController->GetShadowOffset() != shadowOffset )
321           {
322             impl.mController->SetShadowOffset( shadowOffset );
323             impl.mRenderer.Reset();
324           }
325         }
326         break;
327       }
328       case Toolkit::TextField::Property::SHADOW_COLOR:
329       {
330         if( impl.mController )
331         {
332           const Vector4 shadowColor = value.Get< Vector4 >();
333           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SHADOW_COLOR %f,%f,%f,%f\n", impl.mController.Get(), shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a );
334
335           if ( impl.mController->GetShadowColor() != shadowColor )
336           {
337             impl.mController->SetShadowColor( shadowColor );
338             impl.mRenderer.Reset();
339           }
340         }
341         break;
342       }
343       case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
344       {
345         if( impl.mDecorator )
346         {
347           const Vector4 color = value.Get< Vector4 >();
348           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PRIMARY_CURSOR_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
349
350           impl.mDecorator->SetCursorColor( PRIMARY_CURSOR, color );
351           impl.RequestTextRelayout();
352         }
353         break;
354       }
355       case Toolkit::TextField::Property::SECONDARY_CURSOR_COLOR:
356       {
357         if( impl.mDecorator )
358         {
359           const Vector4 color = value.Get< Vector4 >();
360           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SECONDARY_CURSOR_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
361
362           impl.mDecorator->SetCursorColor( SECONDARY_CURSOR, color );
363           impl.RequestTextRelayout();
364         }
365         break;
366       }
367       case Toolkit::TextField::Property::ENABLE_CURSOR_BLINK:
368       {
369         if( impl.mController )
370         {
371           const bool enable = value.Get< bool >();
372           DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p ENABLE_CURSOR_BLINK %d\n", impl.mController.Get(), enable );
373
374           impl.mController->SetEnableCursorBlink( enable );
375           impl.RequestTextRelayout();
376         }
377         break;
378       }
379       case Toolkit::TextField::Property::CURSOR_BLINK_INTERVAL:
380       {
381         if( impl.mDecorator )
382         {
383           const float interval = value.Get< float >();
384           DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p CURSOR_BLINK_INTERVAL %f\n", impl.mController.Get(), interval );
385
386           impl.mDecorator->SetCursorBlinkInterval( interval );
387         }
388         break;
389       }
390       case Toolkit::TextField::Property::CURSOR_BLINK_DURATION:
391       {
392         if( impl.mDecorator )
393         {
394           const float duration = value.Get< float >();
395           DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p CURSOR_BLINK_INTERVAL %f\n", impl.mController.Get(), duration );
396
397           impl.mDecorator->SetCursorBlinkDuration( duration );
398         }
399         break;
400       }
401       case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
402       {
403         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
404         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
405
406         if( impl.mDecorator )
407         {
408           impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED, image );
409           impl.RequestTextRelayout();
410         }
411         break;
412       }
413       case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE:
414       {
415         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
416         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_PRESSED_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
417
418         if( impl.mDecorator )
419         {
420           impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED, image );
421           impl.RequestTextRelayout();
422         }
423         break;
424       }
425       case Toolkit::TextField::Property::SCROLL_THRESHOLD:
426       {
427         const float threshold = value.Get< float >();
428         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SCROLL_THRESHOLD %f\n", impl.mController.Get(), threshold );
429
430         if( impl.mDecorator )
431         {
432           impl.mDecorator->SetScrollThreshold( threshold );
433         }
434         break;
435       }
436       case Toolkit::TextField::Property::SCROLL_SPEED:
437       {
438         const float speed = value.Get< float >();
439         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SCROLL_SPEED %f\n", impl.mController.Get(), speed );
440
441         if( impl.mDecorator )
442         {
443           impl.mDecorator->SetScrollSpeed( speed );
444         }
445         break;
446       }
447       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
448       {
449         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
450         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_IMAGE_LEFT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
451
452         if( impl.mDecorator )
453         {
454           impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
455           impl.RequestTextRelayout();
456         }
457         break;
458       }
459       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
460       {
461         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
462         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_IMAGE_RIGHT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
463
464         if( impl.mDecorator )
465         {
466           impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
467           impl.RequestTextRelayout();
468         }
469         break;
470       }
471       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
472       {
473         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
474         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_PRESSED_IMAGE_LEFT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
475
476         if( impl.mDecorator )
477         {
478           impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
479           impl.RequestTextRelayout();
480         }
481         break;
482       }
483       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
484       {
485         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
486         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_PRESSED_IMAGE_RIGHT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
487
488         if( impl.mDecorator )
489         {
490           impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
491           impl.RequestTextRelayout();
492         }
493         break;
494       }
495       case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
496       {
497         const Vector4 color = value.Get< Vector4 >();
498         DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SELECTION_HIGHLIGHT_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
499
500         if( impl.mDecorator )
501         {
502           impl.mDecorator->SetHighlightColor( color );
503           impl.RequestTextRelayout();
504         }
505         break;
506       }
507       case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
508       {
509         if( impl.mDecorator )
510         {
511           const Rect<int> box = value.Get< Rect<int> >();
512           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p DECORATION_BOUNDING_BOX %d,%d %dx%d\n", impl.mController.Get(), box.x, box.y, box.width, box.height );
513
514           impl.mDecorator->SetBoundingBox( box );
515           impl.RequestTextRelayout();
516         }
517         break;
518       }
519       case Toolkit::TextField::Property::MAX_LENGTH:
520       {
521         if( impl.mController )
522         {
523           const int max = value.Get< int >();
524           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p MAX_LENGTH %d\n", impl.mController.Get(), max );
525
526           impl.mController->SetMaximumNumberOfCharacters( max );
527         }
528         break;
529       }
530       case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
531       {
532         const Property::Map map = value.Get<Property::Map>();
533         VirtualKeyboard::ApplySettings( map );
534         break;
535       }
536     } // switch
537   } // textfield
538 }
539
540 Property::Value TextField::GetProperty( BaseObject* object, Property::Index index )
541 {
542   Property::Value value;
543
544   Toolkit::TextField textField = Toolkit::TextField::DownCast( Dali::BaseHandle( object ) );
545
546   if( textField )
547   {
548     TextField& impl( GetImpl( textField ) );
549
550     switch( index )
551     {
552       case Toolkit::TextField::Property::RENDERING_BACKEND:
553       {
554         value = impl.mRenderingBackend;
555         break;
556       }
557       case Toolkit::TextField::Property::TEXT:
558       {
559         if( impl.mController )
560         {
561           std::string text;
562           impl.mController->GetText( text );
563           DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p returning text: %s\n", impl.mController.Get(), text.c_str() );
564           value = text;
565         }
566         break;
567       }
568       case Toolkit::TextField::Property::PLACEHOLDER_TEXT:
569       {
570         if( impl.mController )
571         {
572           std::string text;
573           impl.mController->GetPlaceholderText( PLACEHOLDER_TYPE_INACTIVE, text );
574           value = text;
575         }
576         break;
577       }
578       case Toolkit::TextField::Property::PLACEHOLDER_TEXT_FOCUSED:
579       {
580         if( impl.mController )
581         {
582           std::string text;
583           impl.mController->GetPlaceholderText( PLACEHOLDER_TYPE_ACTIVE, text );
584           value = text;
585         }
586         break;
587       }
588       case Toolkit::TextField::Property::FONT_FAMILY:
589       {
590         if( impl.mController )
591         {
592           value = impl.mController->GetDefaultFontFamily();
593         }
594         break;
595       }
596       case Toolkit::TextField::Property::FONT_STYLE:
597       {
598         if( impl.mController )
599         {
600           value = impl.mController->GetDefaultFontStyle();
601         }
602         break;
603       }
604       case Toolkit::TextField::Property::POINT_SIZE:
605       {
606         if( impl.mController )
607         {
608           value = impl.mController->GetDefaultPointSize();
609         }
610         break;
611       }
612       case Toolkit::TextField::Property::EXCEED_POLICY:
613       {
614         value = impl.mExceedPolicy;
615         break;
616       }
617       case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
618       {
619         if( impl.mController )
620         {
621           const char* name = Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::HorizontalAlignment >( impl.mController->GetLayoutEngine().GetHorizontalAlignment(),
622                                                                                                                 HORIZONTAL_ALIGNMENT_STRING_TABLE,
623                                                                                                                 HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT );
624           if( name )
625           {
626             value = std::string( name );
627           }
628         }
629         break;
630       }
631       case Toolkit::TextField::Property::VERTICAL_ALIGNMENT:
632       {
633         if( impl.mController )
634         {
635           const char* name = Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::VerticalAlignment >( impl.mController->GetLayoutEngine().GetVerticalAlignment(),
636                                                                                                               VERTICAL_ALIGNMENT_STRING_TABLE,
637                                                                                                               VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
638           if( name )
639           {
640             value = std::string( name );
641           }
642         }
643         break;
644       }
645       case Toolkit::TextField::Property::TEXT_COLOR:
646       {
647         if ( impl.mController )
648         {
649           value = impl.mController->GetTextColor();
650         }
651         break;
652       }
653       case Toolkit::TextField::Property::PLACEHOLDER_TEXT_COLOR:
654       {
655         if ( impl.mController )
656         {
657           value = impl.mController->GetPlaceholderTextColor();
658         }
659         break;
660       }
661       case Toolkit::TextField::Property::SHADOW_OFFSET:
662       {
663         if ( impl.mController )
664         {
665           value = impl.mController->GetShadowOffset();
666         }
667         break;
668       }
669       case Toolkit::TextField::Property::SHADOW_COLOR:
670       {
671         if ( impl.mController )
672         {
673           value = impl.mController->GetShadowColor();
674         }
675         break;
676       }
677       case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
678       {
679         if( impl.mDecorator )
680         {
681           value = impl.mDecorator->GetColor( PRIMARY_CURSOR );
682         }
683         break;
684       }
685       case Toolkit::TextField::Property::SECONDARY_CURSOR_COLOR:
686       {
687         if( impl.mDecorator )
688         {
689           value = impl.mDecorator->GetColor( SECONDARY_CURSOR );
690         }
691         break;
692       }
693       case Toolkit::TextField::Property::ENABLE_CURSOR_BLINK:
694       {
695         value = impl.mController->GetEnableCursorBlink();
696         break;
697       }
698       case Toolkit::TextField::Property::CURSOR_BLINK_INTERVAL:
699       {
700         if( impl.mDecorator )
701         {
702           value = impl.mDecorator->GetCursorBlinkInterval();
703         }
704         break;
705       }
706       case Toolkit::TextField::Property::CURSOR_BLINK_DURATION:
707       {
708         if( impl.mDecorator )
709         {
710           value = impl.mDecorator->GetCursorBlinkDuration();
711         }
712         break;
713       }
714       case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
715       {
716         if( impl.mDecorator )
717         {
718           ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED ) );
719           if( image )
720           {
721             value = image.GetUrl();
722           }
723         }
724         break;
725       }
726       case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE:
727       {
728         if( impl.mDecorator )
729         {
730           ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED ) );
731           if( image )
732           {
733             value = image.GetUrl();
734           }
735         }
736         break;
737       }
738       case Toolkit::TextField::Property::SCROLL_THRESHOLD:
739       {
740         if( impl.mDecorator )
741         {
742           value = impl.mDecorator->GetScrollThreshold();
743         }
744         break;
745       }
746       case Toolkit::TextField::Property::SCROLL_SPEED:
747       {
748         if( impl.mDecorator )
749         {
750           value = impl.mDecorator->GetScrollSpeed();
751         }
752         break;
753       }
754       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
755       {
756         if( impl.mDecorator )
757         {
758           ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED ) );
759           if( image )
760           {
761             value = image.GetUrl();
762           }
763         }
764         break;
765       }
766       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
767       {
768         if( impl.mDecorator )
769         {
770           ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED ) );
771           if( image )
772           {
773             value = image.GetUrl();
774           }
775         }
776         break;
777       }
778       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
779       {
780         if( impl.mDecorator )
781         {
782           ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED ) );
783           if( image )
784           {
785             value = image.GetUrl();
786           }
787         }
788         break;
789       }
790       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
791       {
792         if( impl.mDecorator )
793         {
794           ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED ) );
795           if( image )
796           {
797             value = image.GetUrl();
798           }
799         }
800         break;
801       }
802       case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
803       {
804         if( impl.mDecorator )
805         {
806           value = impl.mDecorator->GetHighlightColor();
807         }
808         break;
809       }
810       case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
811       {
812         if( impl.mDecorator )
813         {
814           value = impl.mDecorator->GetBoundingBox();
815         }
816         break;
817       }
818       case Toolkit::TextField::Property::MAX_LENGTH:
819       {
820         if( impl.mController )
821         {
822           value = impl.mController->GetMaximumNumberOfCharacters();
823         }
824         break;
825       }
826       case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
827       {
828         break;
829       }
830     } //switch
831   }
832
833   return value;
834 }
835
836 bool TextField::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
837 {
838   Dali::BaseHandle handle( object );
839
840   bool connected( true );
841   Toolkit::TextField field = Toolkit::TextField::DownCast( handle );
842
843   if( 0 == strcmp( signalName.c_str(), SIGNAL_TEXT_CHANGED ) )
844   {
845     field.TextChangedSignal().Connect( tracker, functor );
846   }
847   else if( 0 == strcmp( signalName.c_str(), SIGNAL_MAX_LENGTH_REACHED ) )
848   {
849     field.MaxLengthReachedSignal().Connect( tracker, functor );
850   }
851   else
852   {
853     // signalName does not match any signal
854     connected = false;
855   }
856
857   return connected;
858 }
859
860 Toolkit::TextField::TextChangedSignalType& TextField::TextChangedSignal()
861 {
862   return mTextChangedSignal;
863 }
864
865 Toolkit::TextField::MaxLengthReachedSignalType& TextField::MaxLengthReachedSignal()
866 {
867   return mMaxLengthReachedSignal;
868 }
869
870 void TextField::OnInitialize()
871 {
872   Actor self = Self();
873
874   mController = Text::Controller::New( *this );
875
876   mDecorator = Text::Decorator::New( *mController,
877                                      *mController );
878
879   mController->GetLayoutEngine().SetLayout( LayoutEngine::SINGLE_LINE_BOX );
880
881   mController->EnableTextInput( mDecorator );
882
883   // Forward input events to controller
884   EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan |Gesture::LongPress ) );
885   GetTapGestureDetector().SetMaximumTapsRequired( 2 );
886
887   self.TouchedSignal().Connect( this, &TextField::OnTouched );
888
889   // Set BoundingBox to stage size if not already set.
890   if ( mDecorator->GetBoundingBox().IsEmpty() )
891   {
892     Vector2 stageSize = Dali::Stage::GetCurrent().GetSize();
893     mDecorator->SetBoundingBox( Rect<int>( 0.0f, 0.0f, stageSize.width, stageSize.height ) );
894   }
895
896   // Fill-parent area by default
897   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
898   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
899   self.OnStageSignal().Connect( this, &TextField::OnStageConnect );
900 }
901
902 void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
903 {
904   GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
905 }
906
907 Vector3 TextField::GetNaturalSize()
908 {
909   return mController->GetNaturalSize();
910 }
911
912 float TextField::GetHeightForWidth( float width )
913 {
914   return mController->GetHeightForWidth( width );
915 }
916
917 void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
918 {
919   if( mController->Relayout( size ) ||
920       !mRenderer )
921   {
922     DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnRelayout %p Displaying new contents\n", mController.Get() );
923
924     if( mDecorator )
925     {
926       mDecorator->Relayout( size );
927     }
928
929     if( !mRenderer )
930     {
931       mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
932     }
933
934     RenderText();
935     EnableClipping( (Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy), size );
936   }
937 }
938
939 void TextField::RenderText()
940 {
941   Actor self = Self();
942   Actor renderableActor;
943   if( mRenderer )
944   {
945     renderableActor = mRenderer->Render( mController->GetView(), self.GetHierarchyDepth() );
946   }
947
948   if( renderableActor != mRenderableActor )
949   {
950     UnparentAndReset( mRenderableActor );
951     mRenderableActor = renderableActor;
952   }
953
954   if( mRenderableActor )
955   {
956     const Vector2 offset = mController->GetScrollPosition() + mController->GetAlignmentOffset();
957
958     mRenderableActor.SetPosition( offset.x, offset.y );
959
960     Actor clipRootActor;
961     if( mClipper )
962     {
963       clipRootActor = mClipper->GetRootActor();
964     }
965
966     for( std::vector<Actor>::const_iterator it = mClippingDecorationActors.begin(),
967            endIt = mClippingDecorationActors.end();
968          it != endIt;
969          ++it )
970     {
971       Actor actor = *it;
972
973       if( clipRootActor )
974       {
975         clipRootActor.Add( actor );
976       }
977       else
978       {
979         self.Add( actor );
980       }
981     }
982     mClippingDecorationActors.clear();
983
984     // Make sure the actor is parented correctly with/without clipping
985     if( clipRootActor )
986     {
987       clipRootActor.Add( mRenderableActor );
988     }
989     else
990     {
991       self.Add( mRenderableActor );
992     }
993   }
994 }
995
996 void TextField::OnKeyInputFocusGained()
997 {
998   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get() );
999
1000   VirtualKeyboard::StatusChangedSignal().Connect( this, &TextField::KeyboardStatusChanged );
1001
1002   ImfManager imfManager = ImfManager::Get();
1003
1004   if ( imfManager )
1005   {
1006     imfManager.EventReceivedSignal().Connect( this, &TextField::OnImfEvent );
1007
1008     // Notify that the text editing start.
1009     imfManager.Activate();
1010
1011     // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated.
1012     imfManager.SetRestoreAfterFocusLost( true );
1013   }
1014
1015    ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
1016
1017    if ( notifier )
1018    {
1019       notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected );
1020    }
1021
1022   mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event
1023
1024   EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last.
1025 }
1026
1027 void TextField::OnKeyInputFocusLost()
1028 {
1029   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField:OnKeyInputFocusLost %p\n", mController.Get() );
1030
1031   VirtualKeyboard::StatusChangedSignal().Disconnect( this, &TextField::KeyboardStatusChanged );
1032
1033   ImfManager imfManager = ImfManager::Get();
1034   if ( imfManager )
1035   {
1036     // The text editing is finished. Therefore the imf manager don't have restore activation.
1037     imfManager.SetRestoreAfterFocusLost( false );
1038
1039     // Notify that the text editing finish.
1040     imfManager.Deactivate();
1041
1042     imfManager.EventReceivedSignal().Disconnect( this, &TextField::OnImfEvent );
1043   }
1044
1045   ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
1046
1047   if ( notifier )
1048   {
1049     notifier.ContentSelectedSignal().Disconnect( this, &TextField::OnClipboardTextSelected );
1050   }
1051
1052   mController->KeyboardFocusLostEvent();
1053
1054   EmitKeyInputFocusSignal( false ); // Calls back into the Control hence done last.
1055 }
1056
1057 void TextField::OnTap( const TapGesture& gesture )
1058 {
1059   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnTap %p\n", mController.Get() );
1060
1061   // Show the keyboard if it was hidden.
1062   if (!VirtualKeyboard::IsVisible())
1063   {
1064     VirtualKeyboard::Show();
1065   }
1066
1067   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
1068   mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x, gesture.localPoint.y );
1069
1070   SetKeyInputFocus();
1071 }
1072
1073 void TextField::OnPan( const PanGesture& gesture )
1074 {
1075   mController->PanEvent( gesture.state, gesture.displacement );
1076 }
1077
1078 void TextField::OnLongPress( const LongPressGesture& gesture )
1079 {
1080   mController->LongPressEvent( gesture.state, gesture.localPoint.x, gesture.localPoint.y );
1081 }
1082
1083 bool TextField::OnKeyEvent( const KeyEvent& event )
1084 {
1085   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyEvent %p keyCode %d\n", mController.Get(), event.keyCode );
1086
1087   if( Dali::DALI_KEY_ESCAPE == event.keyCode ||
1088       "Return" == event.keyPressedName ) // Make a Dali key code for this
1089   {
1090     ClearKeyInputFocus();
1091     return true;
1092   }
1093
1094   return mController->KeyEvent( event );
1095 }
1096
1097 void TextField::AddDecoration( Actor& actor, bool needsClipping )
1098 {
1099   if( actor )
1100   {
1101     if( needsClipping )
1102     {
1103       mClippingDecorationActors.push_back( actor );
1104     }
1105     else
1106     {
1107       Self().Add( actor );
1108     }
1109   }
1110 }
1111
1112 void TextField::RequestTextRelayout()
1113 {
1114   RelayoutRequest();
1115 }
1116
1117 void TextField::TextChanged()
1118 {
1119   Dali::Toolkit::TextField handle( GetOwner() );
1120   mTextChangedSignal.Emit( handle );
1121 }
1122
1123 void TextField::OnStageConnect( Dali::Actor actor )
1124 {
1125   if ( mHasBeenStaged )
1126   {
1127     RenderText();
1128   }
1129   else
1130   {
1131     mHasBeenStaged = true;
1132   }
1133 }
1134
1135 void TextField::MaxLengthReached()
1136 {
1137   Dali::Toolkit::TextField handle( GetOwner() );
1138   mMaxLengthReachedSignal.Emit( handle );
1139 }
1140
1141 ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent )
1142 {
1143   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName );
1144   return mController->OnImfEvent( imfManager, imfEvent );
1145 }
1146
1147 void TextField::EnableClipping( bool clipping, const Vector2& size )
1148 {
1149   if( clipping )
1150   {
1151     // Not worth to created clip actor if width or height is equal to zero.
1152     if( size.width > Math::MACHINE_EPSILON_1000 && size.height > Math::MACHINE_EPSILON_1000 )
1153     {
1154       if( !mClipper )
1155       {
1156         Actor self = Self();
1157
1158         mClipper = Clipper::New( size );
1159         self.Add( mClipper->GetRootActor() );
1160         self.Add( mClipper->GetImageActor() );
1161       }
1162       else if ( mClipper )
1163       {
1164         mClipper->Refresh( size );
1165       }
1166     }
1167   }
1168   else
1169   {
1170     // Note - this will automatically remove the root & image actors
1171     mClipper.Reset();
1172   }
1173 }
1174
1175 void TextField::OnClipboardTextSelected( ClipboardEventNotifier& clipboard )
1176 {
1177   mController->PasteClipboardItemEvent();
1178 }
1179
1180 void TextField::KeyboardStatusChanged(bool keyboardShown)
1181 {
1182   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::KeyboardStatusChanged %p keyboardShown %d\n", mController.Get(), keyboardShown );
1183
1184   // Just hide the grab handle when keyboard is hidden.
1185   if (!keyboardShown )
1186   {
1187     mController->KeyboardFocusLostEvent();
1188   }
1189   else
1190   {
1191     mController->KeyboardFocusGainEvent(); // Initially called by OnKeyInputFocusGained
1192   }
1193 }
1194
1195 void TextField::OnStageConnection( int depth )
1196 {
1197   // Call the Control::OnStageConnection() to set the depth of the background.
1198   Control::OnStageConnection( depth );
1199
1200   // Sets the depth to the renderers inside the text's decorator.
1201   mDecorator->SetTextDepth( depth );
1202
1203   // The depth of the text renderer is set in the RenderText() called from OnRelayout().
1204 }
1205
1206 bool TextField::OnTouched( Actor actor, const TouchEvent& event )
1207 {
1208   return true;
1209 }
1210
1211 TextField::TextField()
1212 : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
1213   mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
1214   mExceedPolicy( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP ),
1215   mHasBeenStaged( false )
1216 {
1217 }
1218
1219 TextField::~TextField()
1220 {
1221   mClipper.Reset();
1222 }
1223
1224 } // namespace Internal
1225
1226 } // namespace Toolkit
1227
1228 } // namespace Dali