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