Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / buttons / push-button-impl.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // CLASS HEADER
18
19 #include "push-button-impl.h"
20
21 // EXTERNAL INCLUDES
22
23 #include <algorithm>
24
25 // INTERNAL INCLUDES
26
27 #include "push-button-default-painter-impl.h"
28
29 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
30
31 namespace Dali
32 {
33
34 namespace Toolkit
35 {
36
37 const Property::Index PushButton::PROPERTY_AUTO_REPEATING               = Internal::Button::BUTTON_PROPERTY_END_INDEX + 1;
38 const Property::Index PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_END_INDEX + 2;
39 const Property::Index PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY    = Internal::Button::BUTTON_PROPERTY_END_INDEX + 3;
40 const Property::Index PushButton::PROPERTY_TOGGLABLE                    = Internal::Button::BUTTON_PROPERTY_END_INDEX + 4;
41 const Property::Index PushButton::PROPERTY_TOGGLE                       = Internal::Button::BUTTON_PROPERTY_END_INDEX + 5;
42 const Property::Index PushButton::PROPERTY_NORMAL_STATE_ACTOR           = Internal::Button::BUTTON_PROPERTY_END_INDEX + 6;
43 const Property::Index PushButton::PROPERTY_PRESSED_STATE_ACTOR          = Internal::Button::BUTTON_PROPERTY_END_INDEX + 7;
44 const Property::Index PushButton::PROPERTY_DIMMED_STATE_ACTOR           = Internal::Button::BUTTON_PROPERTY_END_INDEX + 8;
45 const Property::Index PushButton::PROPERTY_LABEL_ACTOR                  = Internal::Button::BUTTON_PROPERTY_END_INDEX + 9;
46
47 namespace Internal
48 {
49
50 namespace
51 {
52
53 BaseHandle Create()
54 {
55   return Toolkit::PushButton::New();
56 }
57
58 TypeRegistration typeRegistration( typeid(Toolkit::PushButton), typeid(Toolkit::Button), Create );
59
60 SignalConnectorType signalConnector1( typeRegistration, Toolkit::PushButton::SIGNAL_TOGGLED , &PushButton::DoConnectSignal );
61 SignalConnectorType signalConnector2( typeRegistration, Toolkit::PushButton::SIGNAL_PRESSED , &PushButton::DoConnectSignal );
62 SignalConnectorType signalConnector3( typeRegistration, Toolkit::PushButton::SIGNAL_RELEASED, &PushButton::DoConnectSignal );
63
64 TypeAction action1( typeRegistration, Toolkit::PushButton::ACTION_PUSH_BUTTON_CLICK, &PushButton::DoAction );
65
66 PropertyRegistration property1( typeRegistration, "auto-repeating",               Toolkit::PushButton::PROPERTY_AUTO_REPEATING,               Property::BOOLEAN, &PushButton::SetProperty, &PushButton::GetProperty );
67 PropertyRegistration property2( typeRegistration, "initial-auto-repeating-delay", Toolkit::PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, Property::FLOAT,   &PushButton::SetProperty, &PushButton::GetProperty );
68 PropertyRegistration property3( typeRegistration, "next-auto-repeating-delay",    Toolkit::PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY,    Property::FLOAT,   &PushButton::SetProperty, &PushButton::GetProperty );
69 PropertyRegistration property4( typeRegistration, "togglable",                    Toolkit::PushButton::PROPERTY_TOGGLABLE,                    Property::BOOLEAN, &PushButton::SetProperty, &PushButton::GetProperty );
70 PropertyRegistration property5( typeRegistration, "toggle",                       Toolkit::PushButton::PROPERTY_TOGGLE,                       Property::BOOLEAN, &PushButton::SetProperty, &PushButton::GetProperty );
71 PropertyRegistration property6( typeRegistration, "normal-state-actor",           Toolkit::PushButton::PROPERTY_NORMAL_STATE_ACTOR,           Property::MAP,     &PushButton::SetProperty, &PushButton::GetProperty );
72 PropertyRegistration property7( typeRegistration, "pressed-state-actor",          Toolkit::PushButton::PROPERTY_PRESSED_STATE_ACTOR,          Property::MAP,     &PushButton::SetProperty, &PushButton::GetProperty );
73 PropertyRegistration property8( typeRegistration, "dimmed-state-actor",           Toolkit::PushButton::PROPERTY_DIMMED_STATE_ACTOR,           Property::MAP,     &PushButton::SetProperty, &PushButton::GetProperty );
74 PropertyRegistration property9( typeRegistration, "label-actor",                  Toolkit::PushButton::PROPERTY_LABEL_ACTOR,                  Property::MAP,     &PushButton::SetProperty, &PushButton::GetProperty );
75
76 } // unnamed namespace
77
78 namespace
79 {
80
81 const unsigned int INITIAL_AUTOREPEATING_DELAY( 0.15f );
82 const unsigned int NEXT_AUTOREPEATING_DELAY( 0.05f );
83
84 // Helper function used to cast a ButtonPainter to PushButtonDefaultPainter
85 PushButtonDefaultPainterPtr GetPushButtonPainter( Dali::Toolkit::Internal::ButtonPainterPtr painter )
86 {
87   return static_cast<PushButtonDefaultPainter*>( painter.Get() );
88 }
89
90 } // unnamed namespace
91
92 Dali::Toolkit::PushButton PushButton::New()
93 {
94   // Create the implementation, temporarily owned on stack
95   IntrusivePtr< PushButton > internalPushButton = new PushButton();
96
97   // Pass ownership to CustomActor
98   Dali::Toolkit::PushButton pushButton( *internalPushButton );
99
100   // Second-phase init of the implementation
101   // This can only be done after the CustomActor connection has been made...
102   internalPushButton->Initialize();
103
104   return pushButton;
105 }
106
107 void PushButton::SetAutoRepeating( bool autoRepeating )
108 {
109   mAutoRepeating = autoRepeating;
110
111   // An autorepeating button can't be a toggle button.
112   if( autoRepeating )
113   {
114     mToggleButton = false;
115     if( mToggled )
116     {
117       // Emit a signal is not wanted, only change the appearance.
118       Toolkit::PushButton handle( GetOwner() );
119       GetPushButtonPainter( mPainter )->Toggled( handle );
120       mToggled = false;
121     }
122   }
123
124   // Notifies the painter.
125   GetPushButtonPainter( mPainter )->SetAutoRepeating( mAutoRepeating );
126 }
127
128 bool PushButton::IsAutoRepeating() const
129 {
130   return mAutoRepeating;
131 }
132
133 void PushButton::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
134 {
135   DALI_ASSERT_ALWAYS( initialAutoRepeatingDelay > 0.f );
136   mInitialAutoRepeatingDelay = initialAutoRepeatingDelay;
137 }
138
139 float PushButton::GetInitialAutoRepeatingDelay() const
140 {
141   return mInitialAutoRepeatingDelay;
142 }
143
144 void PushButton::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
145 {
146   DALI_ASSERT_ALWAYS( nextAutoRepeatingDelay > 0.f );
147   mNextAutoRepeatingDelay = nextAutoRepeatingDelay;
148 }
149
150 float PushButton::GetNextAutoRepeatingDelay() const
151 {
152   return mNextAutoRepeatingDelay;
153 }
154
155 void PushButton::SetToggleButton( bool toggle )
156 {
157   mToggleButton = toggle;
158
159   // A toggle button can't be an autorepeating button.
160   if( toggle )
161   {
162     mAutoRepeating = false;
163
164     // Notifies the painter.
165     GetPushButtonPainter( mPainter )->SetAutoRepeating( mAutoRepeating );
166   }
167 }
168
169 bool PushButton::IsToggleButton() const
170 {
171   return mToggleButton;
172 }
173
174 void PushButton::SetToggled( bool toggle )
175 {
176   if( !mDimmed && mToggleButton && ( toggle != mToggled ) )
177   {
178     mToggled = toggle;
179
180     Toolkit::PushButton handle( GetOwner() );
181
182     // Notifies the painter the button has been toggled.
183     GetPushButtonPainter( mPainter )->Toggled( handle );
184
185     // Emit signal.
186     mToggledSignalV2.Emit( handle, mToggled );
187   }
188 }
189
190 bool PushButton::IsToggled() const
191 {
192   return mToggleButton && mToggled;
193 }
194
195 void PushButton::SetButtonImage( Image image )
196 {
197   SetButtonImage( ImageActor::New( image ) );
198 }
199
200 void PushButton::SetButtonImage( Actor image )
201 {
202   Toolkit::PushButton handle( GetOwner() );
203   GetPushButtonPainter( mPainter )->SetButtonImage( handle, image );
204 }
205
206 Actor& PushButton::GetButtonImage()
207 {
208   return mButtonImage;
209 }
210
211 Actor PushButton::GetButtonImage() const
212 {
213   return mButtonImage;
214 }
215
216 void PushButton::SetBackgroundImage( Image image )
217 {
218   SetBackgroundImage( ImageActor::New( image ) );
219 }
220
221 void PushButton::SetBackgroundImage( Actor image )
222 {
223   Toolkit::PushButton handle( GetOwner() );
224   GetPushButtonPainter( mPainter )->SetBackgroundImage( handle, image );
225 }
226
227 Actor& PushButton::GetBackgroundImage()
228 {
229   return mBackgroundImage;
230 }
231
232 Actor PushButton::GetBackgroundImage() const
233 {
234   return mBackgroundImage;
235 }
236
237 void PushButton::SetPressedImage( Image image )
238 {
239   SetPressedImage( ImageActor::New( image ) );
240 }
241
242 void PushButton::SetPressedImage( Actor image )
243 {
244   Toolkit::PushButton handle( GetOwner() );
245   GetPushButtonPainter( mPainter )->SetPressedImage( handle, image );
246 }
247
248 Actor& PushButton::GetPressedImage()
249 {
250   return mPressedImage;
251 }
252
253 Actor PushButton::GetPressedImage() const
254 {
255   return mPressedImage;
256 }
257
258 void PushButton::SetDimmedBackgroundImage( Image image )
259 {
260   SetDimmedBackgroundImage( ImageActor::New( image ) );
261 }
262
263 void PushButton::SetDimmedBackgroundImage( Actor image )
264 {
265   Toolkit::PushButton handle( GetOwner() );
266   GetPushButtonPainter( mPainter )->SetDimmedBackgroundImage( handle, image );
267 }
268
269 Actor& PushButton::GetDimmedBackgroundImage()
270 {
271   return mDimmedBackgroundImage;
272 }
273
274 Actor PushButton::GetDimmedBackgroundImage() const
275 {
276   return mDimmedBackgroundImage;
277 }
278
279 void PushButton::SetDimmedImage( Image image )
280 {
281   SetDimmedImage( ImageActor::New( image ) );
282 }
283
284 void PushButton::SetDimmedImage( Actor image )
285 {
286   Toolkit::PushButton handle( GetOwner() );
287   GetPushButtonPainter( mPainter )->SetDimmedImage( handle, image );
288 }
289
290 Actor& PushButton::GetDimmedImage()
291 {
292   return mDimmedImage;
293 }
294
295 Actor PushButton::GetDimmedImage() const
296 {
297   return mDimmedImage;
298 }
299
300 void PushButton::SetLabelText( const std::string& text )
301 {
302   Toolkit::TextView textView ( Toolkit::TextView::New( text ) );
303   textView.SetWidthExceedPolicy( Toolkit::TextView::ShrinkToFit ); // Make sure our text always fits inside the button
304   SetLabelText( textView );
305 }
306
307 void PushButton::SetLabelText( Actor text )
308 {
309   Toolkit::PushButton handle( GetOwner() );
310   GetPushButtonPainter( mPainter )->SetLabelText( handle, text );
311 }
312
313 Actor& PushButton::GetLabel()
314 {
315   return mLabel;
316 }
317
318 Actor PushButton::GetLabelText() const
319 {
320   return mLabel;
321 }
322
323 Actor& PushButton::GetFadeOutBackgroundImage()
324 {
325   return mFadeOutBackgroundImage;
326 }
327
328 Actor& PushButton::GetFadeOutButtonImage()
329 {
330   return mFadeOutButtonImage;
331 }
332
333 Toolkit::PushButton::ToggledSignalV2& PushButton::ToggledSignal()
334 {
335   return mToggledSignalV2;
336 }
337
338 Toolkit::PushButton::PressedSignalV2& PushButton::PressedSignal()
339 {
340   return mPressedSignalV2;
341 }
342
343 Toolkit::PushButton::ReleasedSignalV2& PushButton::ReleasedSignal()
344 {
345   return mReleasedSignalV2;
346 }
347
348 bool PushButton::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
349 {
350   Dali::BaseHandle handle( object );
351
352   bool connected( true );
353   Toolkit::PushButton button = Toolkit::PushButton::DownCast(handle);
354
355   if( Toolkit::PushButton::SIGNAL_TOGGLED == signalName )
356   {
357     button.ToggledSignal().Connect( tracker, functor );
358   }
359   else if( Toolkit::PushButton::SIGNAL_PRESSED == signalName )
360   {
361     button.PressedSignal().Connect( tracker, functor );
362   }
363   else if( Toolkit::PushButton::SIGNAL_RELEASED == signalName )
364   {
365     button.ReleasedSignal().Connect( tracker, functor );
366   }
367   else
368   {
369     // signalName does not match any signal
370     connected = false;
371   }
372
373   return connected;
374 }
375
376 void PushButton::SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )
377 {
378   Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( Dali::BaseHandle( object ) );
379
380   if ( pushButton )
381   {
382     PushButton& pushButtonImpl( GetImplementation( pushButton ) );
383
384     switch ( propertyIndex )
385     {
386       case Toolkit::PushButton::PROPERTY_AUTO_REPEATING:
387       {
388         pushButtonImpl.SetAutoRepeating( value.Get< bool >() );
389         break;
390       }
391
392       case Toolkit::PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
393       {
394         pushButtonImpl.SetInitialAutoRepeatingDelay( value.Get< float >() );
395         break;
396       }
397
398       case Toolkit::PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
399       {
400         pushButtonImpl.SetNextAutoRepeatingDelay( value.Get< float >() );
401         break;
402       }
403
404       case Toolkit::PushButton::PROPERTY_TOGGLABLE:
405       {
406         pushButtonImpl.SetToggleButton( value.Get< bool >() );
407         break;
408       }
409
410       case Toolkit::PushButton::PROPERTY_TOGGLE:
411       {
412         pushButtonImpl.SetToggled( value.Get< bool >() );
413         break;
414       }
415
416       case Toolkit::PushButton::PROPERTY_NORMAL_STATE_ACTOR:
417       {
418         pushButtonImpl.SetButtonImage( Scripting::NewActor( value.Get< Property::Map >() ) );
419         break;
420       }
421
422       case Toolkit::PushButton::PROPERTY_PRESSED_STATE_ACTOR:
423       {
424         pushButtonImpl.SetPressedImage( Scripting::NewActor( value.Get< Property::Map >() ) );
425         break;
426       }
427
428       case Toolkit::PushButton::PROPERTY_DIMMED_STATE_ACTOR:
429       {
430         pushButtonImpl.SetDimmedImage( Scripting::NewActor( value.Get< Property::Map >() ) );
431         break;
432       }
433
434       case Toolkit::PushButton::PROPERTY_LABEL_ACTOR:
435       {
436         pushButtonImpl.SetLabelText( Scripting::NewActor( value.Get< Property::Map >() ) );
437         break;
438       }
439     }
440   }
441 }
442
443 Property::Value PushButton::GetProperty( BaseObject* object, Property::Index propertyIndex )
444 {
445   Property::Value value;
446
447   Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( Dali::BaseHandle( object ) );
448
449   if ( pushButton )
450   {
451     PushButton& pushButtonImpl( GetImplementation( pushButton ) );
452
453     switch ( propertyIndex )
454     {
455       case Toolkit::PushButton::PROPERTY_AUTO_REPEATING:
456       {
457         value = pushButtonImpl.mAutoRepeating;
458         break;
459       }
460
461       case Toolkit::PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
462       {
463         value = pushButtonImpl.mInitialAutoRepeatingDelay;
464         break;
465       }
466
467       case Toolkit::PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
468       {
469         value = pushButtonImpl.mNextAutoRepeatingDelay;
470         break;
471       }
472
473       case Toolkit::PushButton::PROPERTY_TOGGLABLE:
474       {
475         value = pushButtonImpl.mToggleButton;
476         break;
477       }
478
479       case Toolkit::PushButton::PROPERTY_TOGGLE:
480       {
481         value = pushButtonImpl.mToggled;
482         break;
483       }
484
485       case Toolkit::PushButton::PROPERTY_NORMAL_STATE_ACTOR:
486       {
487         Property::Map map;
488         Scripting::CreatePropertyMap( pushButtonImpl.mButtonImage, map );
489         value = map;
490         break;
491       }
492
493       case Toolkit::PushButton::PROPERTY_PRESSED_STATE_ACTOR:
494       {
495         Property::Map map;
496         Scripting::CreatePropertyMap( pushButtonImpl.mPressedImage, map );
497         value = map;
498         break;
499       }
500
501       case Toolkit::PushButton::PROPERTY_DIMMED_STATE_ACTOR:
502       {
503         Property::Map map;
504         Scripting::CreatePropertyMap( pushButtonImpl.mDimmedImage, map );
505         value = map;
506         break;
507       }
508
509       case Toolkit::PushButton::PROPERTY_LABEL_ACTOR:
510       {
511         Property::Map map;
512         Scripting::CreatePropertyMap( pushButtonImpl.mLabel, map );
513         value = map;
514         break;
515       }
516     }
517   }
518
519   return value;
520 }
521
522 void PushButton::OnButtonInitialize()
523 {
524   // Push button requires the Leave event.
525   Actor root = Self();
526   root.SetLeaveRequired( true );
527 }
528
529 void PushButton::OnButtonDown()
530 {
531   if( !mToggleButton )
532   {
533     Toolkit::PushButton handle( GetOwner() );
534
535     // Notifies the painter the button has been pressed.
536     GetPushButtonPainter( mPainter )->Pressed( handle );
537
538     if( mAutoRepeating )
539     {
540       SetUpTimer( mInitialAutoRepeatingDelay );
541     }
542
543     //Emit signal.
544     mPressedSignalV2.Emit( handle );
545   }
546 }
547
548 void PushButton::OnButtonUp()
549 {
550   if( ButtonDown == mState )
551   {
552     if( mToggleButton )
553     {
554       mToggled = !mToggled;
555
556       Toolkit::PushButton handle( GetOwner() );
557
558       // Notifies the painter the button has been toggled.
559       GetPushButtonPainter( mPainter )->Toggled( handle );
560
561       //Emit signal.
562       mToggledSignalV2.Emit( handle, mToggled );
563     }
564     else
565     {
566       Toolkit::PushButton handle( GetOwner() );
567
568       // Notifies the painter the button has been clicked.
569       GetPushButtonPainter( mPainter )->Released( handle );
570       GetPushButtonPainter( mPainter )->Clicked( handle );
571
572       if( mAutoRepeating )
573       {
574         mAutoRepeatingTimer.Reset();
575       }
576
577       //Emit signal.
578       mReleasedSignalV2.Emit( handle );
579       mClickedSignalV2.Emit( handle );
580     }
581   }
582 }
583
584 void PushButton::OnTouchPointLeave()
585 {
586   if( ButtonDown == mState )
587   {
588     if( !mToggleButton )
589     {
590       Toolkit::PushButton handle( GetOwner() );
591
592       // Notifies the painter the button has been released.
593       GetPushButtonPainter( mPainter )->Released( handle );
594
595       if( mAutoRepeating )
596       {
597         mAutoRepeatingTimer.Reset();
598       }
599
600       //Emit signal.
601       mReleasedSignalV2.Emit( handle );
602     }
603   }
604 }
605
606 void PushButton::OnTouchPointInterrupted()
607 {
608   OnTouchPointLeave();
609 }
610
611 void PushButton::OnAnimationTimeSet( float animationTime )
612 {
613   GetPushButtonPainter( mPainter )->SetAnimationTime( animationTime );
614 }
615
616 float PushButton::OnAnimationTimeRequested() const
617 {
618   return GetPushButtonPainter( mPainter )->GetAnimationTime();
619 }
620
621 PushButton::PushButton()
622 : Button(),
623   mAutoRepeating( false ),
624   mInitialAutoRepeatingDelay( INITIAL_AUTOREPEATING_DELAY ),
625   mNextAutoRepeatingDelay( NEXT_AUTOREPEATING_DELAY ),
626   mToggleButton( false ),
627   mAutoRepeatingTimer(),
628   mToggled( false ),
629   mClickActionPerforming(false)
630 {
631   // Creates specific painter.
632   mPainter = PushButtonDefaultPainterPtr( new PushButtonDefaultPainter() );
633 }
634
635 PushButton::~PushButton()
636 {
637   if( mAutoRepeatingTimer )
638   {
639     mAutoRepeatingTimer.Reset();
640   }
641
642   mPainter = NULL;
643 }
644
645 void PushButton::SetUpTimer( float delay )
646 {
647   mAutoRepeatingTimer = Dali::Timer::New( static_cast<unsigned int>( 1000.f * delay ) );
648   mAutoRepeatingTimer.TickSignal().Connect( this, &PushButton::AutoRepeatingSlot );
649   mAutoRepeatingTimer.Start();
650 }
651
652 bool PushButton::AutoRepeatingSlot()
653 {
654   bool consumed = false;
655   if( !mDimmed )
656   {
657     // Restart the autorepeat timer.
658     SetUpTimer( mNextAutoRepeatingDelay );
659
660     Toolkit::PushButton handle( GetOwner() );
661
662     // Notifies the painter the button has been pressed.
663     GetPushButtonPainter( mPainter )->Pressed( handle );
664
665     //Emit signal.
666     consumed = mReleasedSignalV2.Emit( handle );
667     consumed |= mClickedSignalV2.Emit( handle );
668     consumed |= mPressedSignalV2.Emit( handle );
669  }
670
671   return consumed;
672 }
673
674 void PushButton::OnActivated()
675 {
676   // When the button is activated, it performs the click action
677   std::vector<Property::Value> attributes;
678   DoClickAction(attributes);
679 }
680
681 void PushButton::DoClickAction(const PropertyValueContainer& attributes)
682 {
683   // Prevents the button signals from doing a recursive loop by sending an action
684   // and re-emitting the signals.
685   if(!mClickActionPerforming)
686   {
687     mClickActionPerforming = true;
688     OnButtonDown();
689     mState = ButtonDown;
690     OnButtonUp();
691     mClickActionPerforming = false;
692   }
693 }
694
695 bool PushButton::DoAction(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes)
696 {
697   bool ret = false;
698
699   Dali::BaseHandle handle(object);
700
701   Toolkit::PushButton button = Toolkit::PushButton::DownCast(handle);
702
703   DALI_ASSERT_ALWAYS(button);
704
705   if(Toolkit::PushButton::ACTION_PUSH_BUTTON_CLICK == actionName)
706   {
707     GetImplementation(button).DoClickAction(attributes);
708     ret = true;
709   }
710
711   return ret;
712 }
713
714 } // namespace Internal
715
716 } // namespace Toolkit
717
718 } // namespace Dali