Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / button-impl.cpp
1 /*
2  * Copyright (c) 2014 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 "button-impl.h"
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/events/touch-event.h>
23 #include <dali/public-api/object/type-registry.h>
24 #include <dali/public-api/actors/image-actor.h>
25 #include <dali/public-api/scripting/scripting.h>
26
27 // INTERNAL INCLUDES
28
29 namespace Dali
30 {
31
32 namespace Toolkit
33 {
34
35 const Property::Index Button::PROPERTY_DISABLED                     = Internal::Button::BUTTON_PROPERTY_START_INDEX;
36 const Property::Index Button::PROPERTY_AUTO_REPEATING               = Internal::Button::BUTTON_PROPERTY_START_INDEX + 1;
37 const Property::Index Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_START_INDEX + 2;
38 const Property::Index Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY    = Internal::Button::BUTTON_PROPERTY_START_INDEX + 3;
39 const Property::Index Button::PROPERTY_TOGGLABLE                    = Internal::Button::BUTTON_PROPERTY_START_INDEX + 4;
40 const Property::Index Button::PROPERTY_SELECTED                     = Internal::Button::BUTTON_PROPERTY_START_INDEX + 5;
41 const Property::Index Button::PROPERTY_NORMAL_STATE_ACTOR           = Internal::Button::BUTTON_PROPERTY_START_INDEX + 6;
42 const Property::Index Button::PROPERTY_SELECTED_STATE_ACTOR         = Internal::Button::BUTTON_PROPERTY_START_INDEX + 7;
43 const Property::Index Button::PROPERTY_DISABLED_STATE_ACTOR         = Internal::Button::BUTTON_PROPERTY_START_INDEX + 8;
44 const Property::Index Button::PROPERTY_LABEL_ACTOR                  = Internal::Button::BUTTON_PROPERTY_START_INDEX + 9;
45
46 namespace Internal
47 {
48
49 namespace
50 {
51
52 const unsigned int INITIAL_AUTOREPEATING_DELAY( 0.15f );
53 const unsigned int NEXT_AUTOREPEATING_DELAY( 0.05f );
54
55 // Signals
56
57 const char* const SIGNAL_PRESSED =       "pressed";
58 const char* const SIGNAL_RELEASED =      "released";
59 const char* const SIGNAL_CLICKED =       "clicked";
60 const char* const SIGNAL_STATE_CHANGED = "state-changed";
61
62 // Actions
63
64 const char* const ACTION_BUTTON_CLICK =  "button-click";
65
66 BaseHandle Create()
67 {
68   // empty handle as we cannot create button (but type registered for clicked signal)
69   return BaseHandle();
70 }
71
72 TypeRegistration typeRegistration( typeid( Toolkit::Button ), typeid( Toolkit::Control ), Create );
73
74 SignalConnectorType signalConnector1( typeRegistration, SIGNAL_PRESSED , &Button::DoConnectSignal );
75 SignalConnectorType signalConnector2( typeRegistration, SIGNAL_RELEASED, &Button::DoConnectSignal );
76 SignalConnectorType signalConnector3( typeRegistration, SIGNAL_CLICKED, &Button::DoConnectSignal );
77 SignalConnectorType signalConnector4( typeRegistration, SIGNAL_STATE_CHANGED, &Button::DoConnectSignal );
78
79 TypeAction action1( typeRegistration, ACTION_BUTTON_CLICK, &Button::DoAction );
80
81 PropertyRegistration property1( typeRegistration, "disabled",                     Toolkit::Button::PROPERTY_DISABLED,                     Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
82 PropertyRegistration property2( typeRegistration, "auto-repeating",               Toolkit::Button::PROPERTY_AUTO_REPEATING,               Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
83 PropertyRegistration property3( typeRegistration, "initial-auto-repeating-delay", Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, Property::FLOAT,   &Button::SetProperty, &Button::GetProperty );
84 PropertyRegistration property4( typeRegistration, "next-auto-repeating-delay",    Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY,    Property::FLOAT,   &Button::SetProperty, &Button::GetProperty );
85 PropertyRegistration property5( typeRegistration, "togglable",                    Toolkit::Button::PROPERTY_TOGGLABLE,                    Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
86 PropertyRegistration property6( typeRegistration, "selected",                     Toolkit::Button::PROPERTY_SELECTED,                     Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
87 PropertyRegistration property7( typeRegistration, "normal-state-actor",           Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR,           Property::MAP,     &Button::SetProperty, &Button::GetProperty );
88 PropertyRegistration property8( typeRegistration, "selected-state-actor",         Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR,         Property::MAP,     &Button::SetProperty, &Button::GetProperty );
89 PropertyRegistration property9( typeRegistration, "disabled-state-actor",         Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR,         Property::MAP,     &Button::SetProperty, &Button::GetProperty );
90 PropertyRegistration property10( typeRegistration, "label-actor",                 Toolkit::Button::PROPERTY_LABEL_ACTOR,                  Property::MAP,     &Button::SetProperty, &Button::GetProperty );
91
92 } // unnamed namespace
93
94 Button::Button()
95 : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
96   mAutoRepeatingTimer(),
97   mDisabled( false ),
98   mAutoRepeating( false ),
99   mTogglableButton( false ),
100   mSelected( false ),
101   mInitialAutoRepeatingDelay( INITIAL_AUTOREPEATING_DELAY ),
102   mNextAutoRepeatingDelay( NEXT_AUTOREPEATING_DELAY ),
103   mAnimationTime( 0.0f ),
104   mClickActionPerforming( false ),
105   mState( ButtonUp )
106 {
107 }
108
109 Button::~Button()
110 {
111   if( mAutoRepeatingTimer )
112   {
113     mAutoRepeatingTimer.Reset();
114   }
115 }
116
117 void Button::SetDisabled( bool disabled )
118 {
119   if( disabled != mDisabled )
120   {
121     mDisabled = disabled;
122
123     OnDisabled( mDisabled );
124   }
125 }
126
127 bool Button::IsDisabled() const
128 {
129   return mDisabled;
130 }
131
132 void Button::SetAutoRepeating( bool autoRepeating )
133 {
134   mAutoRepeating = autoRepeating;
135
136   // An autorepeating button can't be a togglable button.
137   if( autoRepeating )
138   {
139     mTogglableButton = false;
140
141     if( mSelected )
142     {
143       // Emit a signal is not wanted, only change the appearance.
144       OnSelected( false );
145
146       mSelected = false;
147
148       RelayoutRequest();
149     }
150   }
151 }
152
153 bool Button::IsAutoRepeating() const
154 {
155   return mAutoRepeating;
156 }
157
158 void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
159 {
160   DALI_ASSERT_ALWAYS( initialAutoRepeatingDelay > 0.f );
161   mInitialAutoRepeatingDelay = initialAutoRepeatingDelay;
162 }
163
164 float Button::GetInitialAutoRepeatingDelay() const
165 {
166   return mInitialAutoRepeatingDelay;
167 }
168
169 void Button::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
170 {
171   DALI_ASSERT_ALWAYS( nextAutoRepeatingDelay > 0.f );
172   mNextAutoRepeatingDelay = nextAutoRepeatingDelay;
173 }
174
175 float Button::GetNextAutoRepeatingDelay() const
176 {
177   return mNextAutoRepeatingDelay;
178 }
179
180 void Button::SetTogglableButton( bool togglable )
181 {
182   mTogglableButton = togglable;
183
184   // A togglable button can't be an autorepeating button.
185   if( togglable )
186   {
187     mAutoRepeating = false;
188   }
189 }
190
191 bool Button::IsTogglableButton() const
192 {
193   return mTogglableButton;
194 }
195
196 void Button::SetSelected( bool selected )
197 {
198   if( !mDisabled && mTogglableButton && ( selected != mSelected ) )
199   {
200     // Notifies the derived class the button has been selected.
201     OnSelected( selected );
202
203     mSelected = selected;
204
205     Toolkit::Button handle( GetOwner() );
206
207     // Emit signal.
208     mStateChangedSignal.Emit( handle );
209
210     RelayoutRequest();
211   }
212 }
213
214 bool Button::IsSelected() const
215 {
216   return mTogglableButton && mSelected;
217 }
218
219 void Button::SetAnimationTime( float animationTime )
220 {
221   mAnimationTime = animationTime;
222 }
223
224 float Button::GetAnimationTime() const
225 {
226   return mAnimationTime;
227 }
228
229 void Button::SetLabel( const std::string& label )
230 {
231 }
232
233 void Button::SetLabel( Actor label )
234 {
235   if( mLabel != label )
236   {
237     if( mLabel && mLabel.GetParent() )
238     {
239       mLabel.GetParent().Remove( mLabel );
240     }
241
242     mLabel = label;
243
244     OnLabelSet();
245
246     RelayoutRequest();
247   }
248 }
249
250 Actor Button::GetLabel() const
251 {
252   return mLabel;
253 }
254
255 Actor& Button::GetLabel()
256 {
257   return mLabel;
258 }
259
260 Actor Button::GetButtonImage() const
261 {
262   return mButtonContent;
263 }
264
265 Actor& Button::GetButtonImage()
266 {
267   return mButtonContent;
268 }
269
270 Actor Button::GetSelectedImage() const
271 {
272   return mSelectedContent;
273 }
274
275 Actor& Button::GetSelectedImage()
276 {
277   return mSelectedContent;
278 }
279
280 Actor Button::GetBackgroundImage() const
281 {
282   return mBackgroundContent;
283 }
284
285 Actor& Button::GetBackgroundImage()
286 {
287   return mBackgroundContent;
288 }
289
290 Actor Button::GetDisabledImage() const
291 {
292   return mDisabledContent;
293 }
294
295 Actor& Button::GetDisabledImage()
296 {
297   return mDisabledContent;
298 }
299
300 Actor Button::GetDisabledSelectedImage() const
301 {
302   return mDisabledSelectedContent;
303 }
304
305 Actor& Button::GetDisabledSelectedImage()
306 {
307   return mDisabledSelectedContent;
308 }
309
310 Actor Button::GetDisabledBackgroundImage() const
311 {
312   return mDisabledBackgroundContent;
313 }
314
315 Actor& Button::GetDisabledBackgroundImage()
316 {
317   return mDisabledBackgroundContent;
318 }
319
320 bool Button::DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes )
321 {
322   bool ret = false;
323
324   Dali::BaseHandle handle( object );
325
326   Toolkit::Button button = Toolkit::Button::DownCast( handle );
327
328   DALI_ASSERT_ALWAYS( button );
329
330   if( 0 == strcmp( actionName.c_str(), ACTION_BUTTON_CLICK ) )
331   {
332     GetImplementation( button ).DoClickAction( attributes );
333     ret = true;
334   }
335
336   return ret;
337 }
338
339 void Button::DoClickAction( const PropertyValueContainer& attributes )
340 {
341   // Prevents the button signals from doing a recursive loop by sending an action
342   // and re-emitting the signals.
343   if( !mClickActionPerforming )
344   {
345     mClickActionPerforming = true;
346     OnButtonDown();
347     mState = ButtonDown;
348     OnButtonUp();
349     mClickActionPerforming = false;
350   }
351 }
352
353 void Button::OnButtonStageDisconnection()
354 {
355   if( ButtonDown == mState )
356   {
357     if( !mTogglableButton )
358     {
359       Toolkit::Button handle( GetOwner() );
360
361       // Notifies the derived class the button has been released.
362       OnReleased();
363
364       if( mAutoRepeating )
365       {
366         mAutoRepeatingTimer.Reset();
367       }
368     }
369   }
370 }
371
372 void Button::OnButtonDown()
373 {
374   if( !mTogglableButton )
375   {
376     Toolkit::Button handle( GetOwner() );
377
378     // Notifies the derived class the button has been pressed.
379     OnPressed();
380
381     if( mAutoRepeating )
382     {
383       SetUpTimer( mInitialAutoRepeatingDelay );
384     }
385
386     //Emit signal.
387     mPressedSignal.Emit( handle );
388   }
389 }
390
391 void Button::OnButtonUp()
392 {
393   if( ButtonDown == mState )
394   {
395     if( mTogglableButton )
396     {
397       SetSelected( !mSelected );
398     }
399     else
400     {
401       // Notifies the derived class the button has been clicked.
402       OnReleased();
403       OnClicked();
404
405       if( mAutoRepeating )
406       {
407         mAutoRepeatingTimer.Reset();
408       }
409
410       Toolkit::Button handle( GetOwner() );
411
412       //Emit signal.
413       mReleasedSignal.Emit( handle );
414       mClickedSignal.Emit( handle );
415     }
416   }
417 }
418
419 void Button::OnTouchPointLeave()
420 {
421   if( ButtonDown == mState )
422   {
423     if( !mTogglableButton )
424     {
425       Toolkit::Button handle( GetOwner() );
426
427       // Notifies the derived class the button has been released.
428       OnReleased();
429
430       if( mAutoRepeating )
431       {
432         mAutoRepeatingTimer.Reset();
433       }
434
435       //Emit signal.
436       mReleasedSignal.Emit( handle );
437     }
438   }
439 }
440
441 void Button::OnTouchPointInterrupted()
442 {
443   OnTouchPointLeave();
444 }
445
446 Toolkit::Button::ButtonSignalType& Button::PressedSignal()
447 {
448   return mPressedSignal;
449 }
450
451 Toolkit::Button::ButtonSignalType& Button::ReleasedSignal()
452 {
453   return mReleasedSignal;
454 }
455
456 Toolkit::Button::ButtonSignalType& Button::ClickedSignal()
457 {
458   return mClickedSignal;
459 }
460
461 Toolkit::Button::ButtonSignalType& Button::StateChangedSignal()
462 {
463   return mStateChangedSignal;
464 }
465
466 bool Button::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
467 {
468   Dali::BaseHandle handle( object );
469
470   bool connected( true );
471   Toolkit::Button button = Toolkit::Button::DownCast( handle );
472
473   if( 0 == strcmp( signalName.c_str(), SIGNAL_PRESSED ) )
474   {
475     button.PressedSignal().Connect( tracker, functor );
476   }
477   else if( 0 == strcmp( signalName.c_str(), SIGNAL_RELEASED ) )
478   {
479     button.ReleasedSignal().Connect( tracker, functor );
480   }
481   else if( 0 == strcmp( signalName.c_str(), SIGNAL_CLICKED ) )
482   {
483     button.ClickedSignal().Connect( tracker, functor );
484   }
485   else if( 0 == strcmp( signalName.c_str(), SIGNAL_STATE_CHANGED ) )
486   {
487     button.StateChangedSignal().Connect( tracker, functor );
488   }
489   else
490   {
491     // signalName does not match any signal
492     connected = false;
493   }
494
495   return connected;
496 }
497
498 bool Button::OnTouchEvent(const TouchEvent& event)
499 {
500   // Only events are processed when the button is not disabled and the touch event has only
501   // one touch point.
502   if( ( !mDisabled ) && ( 1 == event.GetPointCount() ) )
503   {
504     switch( event.GetPoint(0).state )
505     {
506       case TouchPoint::Down:
507       {
508         OnButtonDown(); // Notification for derived classes.
509
510         // Sets the button state to ButtonDown.
511         mState = ButtonDown;
512         break;
513       }
514       case TouchPoint::Up:
515       {
516         OnButtonUp(); // Notification for derived classes.
517
518         // Sets the button state to ButtonUp.
519         mState = ButtonUp;
520         break;
521       }
522       case TouchPoint::Interrupted:
523       {
524         OnTouchPointInterrupted(); // Notification for derived classes.
525
526         // Sets the button state to the default (ButtonUp).
527         mState = ButtonUp;
528         break;
529       }
530       case TouchPoint::Leave:
531       {
532         OnTouchPointLeave(); // Notification for derived classes.
533
534         // Sets the button state to the default (ButtonUp).
535         mState = ButtonUp;
536         break;
537       }
538       case TouchPoint::Motion:
539       case TouchPoint::Stationary: // FALLTHROUGH
540       {
541         // Nothing to do
542         break;
543       }
544       default:
545       {
546         DALI_ASSERT_ALWAYS( !"Point status unhandled." );
547         break;
548       }
549     }
550   }
551   else if( 1 < event.GetPointCount() )
552   {
553     OnTouchPointLeave(); // Notification for derived classes.
554
555     // Sets the button state to the default (ButtonUp).
556     mState = ButtonUp;
557   }
558
559   return false;
560 }
561
562 void Button::OnInitialize()
563 {
564   Actor self = Self();
565
566   mTapDetector = TapGestureDetector::New();
567   mTapDetector.Attach( self );
568   mTapDetector.DetectedSignal().Connect(this, &Button::OnTap);
569
570   OnButtonInitialize();
571
572   self.SetKeyboardFocusable( true );
573 }
574
575 void Button::OnActivated()
576 {
577   // When the button is activated, it performs the click action
578   PropertyValueContainer attributes;
579   DoClickAction( attributes );
580 }
581
582 void Button::OnTap(Actor actor, const TapGesture& tap)
583 {
584   // Do nothing.
585 }
586
587 void Button::SetUpTimer( float delay )
588 {
589   mAutoRepeatingTimer = Dali::Timer::New( static_cast<unsigned int>( 1000.f * delay ) );
590   mAutoRepeatingTimer.TickSignal().Connect( this, &Button::AutoRepeatingSlot );
591   mAutoRepeatingTimer.Start();
592 }
593
594 bool Button::AutoRepeatingSlot()
595 {
596   bool consumed = false;
597   if( !mDisabled )
598   {
599     // Restart the autorepeat timer.
600     SetUpTimer( mNextAutoRepeatingDelay );
601
602     Toolkit::Button handle( GetOwner() );
603
604     // Notifies the derived class the button has been pressed.
605     OnPressed();
606
607     //Emit signal.
608     consumed = mReleasedSignal.Emit( handle );
609     consumed |= mClickedSignal.Emit( handle );
610     consumed |= mPressedSignal.Emit( handle );
611  }
612
613   return consumed;
614 }
615
616 void Button::OnControlStageDisconnection()
617 {
618   OnButtonStageDisconnection(); // Notification for derived classes.
619   mState = ButtonUp;
620 }
621
622 Button::ButtonState Button::GetState()
623 {
624   return mState;
625 }
626
627 void Button::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
628 {
629   Toolkit::Button button = Toolkit::Button::DownCast( Dali::BaseHandle( object ) );
630
631   if ( button )
632   {
633     switch ( index )
634     {
635       case Toolkit::Button::PROPERTY_DISABLED:
636       {
637         GetImplementation( button ).SetDisabled( value.Get<bool>() );
638         break;
639       }
640
641       case Toolkit::Button::PROPERTY_AUTO_REPEATING:
642       {
643         GetImplementation( button ).SetAutoRepeating( value.Get< bool >() );
644         break;
645       }
646
647       case Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
648       {
649         GetImplementation( button ).SetInitialAutoRepeatingDelay( value.Get< float >() );
650         break;
651       }
652
653       case Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
654       {
655         GetImplementation( button ).SetNextAutoRepeatingDelay( value.Get< float >() );
656         break;
657       }
658
659       case Toolkit::Button::PROPERTY_TOGGLABLE:
660       {
661         GetImplementation( button ).SetTogglableButton( value.Get< bool >() );
662         break;
663       }
664
665       case Toolkit::Button::PROPERTY_SELECTED:
666       {
667         GetImplementation( button ).SetSelected( value.Get< bool >() );
668         break;
669       }
670
671       case Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR:
672       {
673         GetImplementation( button ).SetButtonImage( Scripting::NewActor( value.Get< Property::Map >() ) );
674         break;
675       }
676
677       case Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR:
678       {
679         GetImplementation( button ).SetSelectedImage( Scripting::NewActor( value.Get< Property::Map >() ) );
680         break;
681       }
682
683       case Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR:
684       {
685         GetImplementation( button ).SetDisabledImage( Scripting::NewActor( value.Get< Property::Map >() ) );
686         break;
687       }
688
689       case Toolkit::Button::PROPERTY_LABEL_ACTOR:
690       {
691         GetImplementation( button ).SetLabel( Scripting::NewActor( value.Get< Property::Map >() ) );
692         break;
693       }
694     }
695   }
696 }
697
698 Property::Value Button::GetProperty( BaseObject* object, Property::Index propertyIndex )
699 {
700   Property::Value value;
701
702   Toolkit::Button button = Toolkit::Button::DownCast( Dali::BaseHandle( object ) );
703
704   if ( button )
705   {
706     switch ( propertyIndex )
707     {
708       case Toolkit::Button::PROPERTY_DISABLED:
709       {
710         value = GetImplementation( button ).mDisabled;
711         break;
712       }
713
714       case Toolkit::Button::PROPERTY_AUTO_REPEATING:
715       {
716         value = GetImplementation( button ).mAutoRepeating;
717         break;
718       }
719
720       case Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
721       {
722         value = GetImplementation( button ).mInitialAutoRepeatingDelay;
723         break;
724       }
725
726       case Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
727       {
728         value = GetImplementation( button ).mNextAutoRepeatingDelay;
729         break;
730       }
731
732       case Toolkit::Button::PROPERTY_TOGGLABLE:
733       {
734         value = GetImplementation( button ).mTogglableButton;
735         break;
736       }
737
738       case Toolkit::Button::PROPERTY_SELECTED:
739       {
740         value = GetImplementation( button ).mSelected;
741         break;
742       }
743
744       case Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR:
745       {
746         Property::Map map;
747         Scripting::CreatePropertyMap( GetImplementation( button ).mButtonContent, map );
748         value = map;
749         break;
750       }
751
752       case Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR:
753       {
754         Property::Map map;
755         Scripting::CreatePropertyMap( GetImplementation( button ).mSelectedContent, map );
756         value = map;
757         break;
758       }
759
760       case Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR:
761       {
762         Property::Map map;
763         Scripting::CreatePropertyMap( GetImplementation( button ).mDisabledContent, map );
764         value = map;
765         break;
766       }
767
768       case Toolkit::Button::PROPERTY_LABEL_ACTOR:
769       {
770         Property::Map map;
771         Scripting::CreatePropertyMap( GetImplementation( button ).mLabel, map );
772         value = map;
773         break;
774       }
775     }
776   }
777
778   return value;
779 }
780
781 } // namespace Internal
782
783 } // namespace Toolkit
784
785 } // namespace Dali