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