2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <dali-toolkit/public-api/controls/buttons/button.h>
24 #include <dali-toolkit/internal/controls/buttons/button-impl.h>
32 const char* const Button::SIGNAL_PRESSED = "pressed";
33 const char* const Button::SIGNAL_RELEASED = "released";
34 const char* const Button::SIGNAL_CLICKED = "clicked";
35 const char* const Button::SIGNAL_STATE_CHANGED = "state-changed";
37 const char* const Button::ACTION_BUTTON_CLICK = "button-click";
42 Button::Button( const Button& button )
47 Button& Button::operator=( const Button& button )
51 Control::operator=( button );
60 Button Button::DownCast( BaseHandle handle )
62 return Control::DownCast<Button, Internal::Button>(handle);
65 void Button::SetDisabled( bool disabled )
67 Dali::Toolkit::GetImplementation( *this ).SetDisabled( disabled );
70 bool Button::IsDisabled() const
72 return Dali::Toolkit::GetImplementation( *this ).IsDisabled();
75 void Button::SetAutoRepeating( bool autoRepeating )
77 Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
80 bool Button::IsAutoRepeating() const
82 return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
85 void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
87 Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay );
90 float Button::GetInitialAutoRepeatingDelay() const
92 return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
95 void Button::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
97 Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
100 float Button::GetNextAutoRepeatingDelay() const
102 return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
105 void Button::SetTogglableButton( bool togglable )
107 Dali::Toolkit::GetImplementation( *this ).SetTogglableButton( togglable );
110 bool Button::IsTogglableButton() const
112 return Dali::Toolkit::GetImplementation( *this ).IsTogglableButton();
115 void Button::SetSelected( bool selected )
117 Dali::Toolkit::GetImplementation( *this ).SetSelected( selected );
120 bool Button::IsSelected() const
122 return Dali::Toolkit::GetImplementation( *this ).IsSelected();
125 void Button::SetAnimationTime( float animationTime )
127 Dali::Toolkit::GetImplementation( *this ).SetAnimationTime( animationTime );
130 float Button::GetAnimationTime() const
132 return Dali::Toolkit::GetImplementation( *this ).GetAnimationTime();
135 void Button::SetLabel( const std::string& label )
137 Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
140 void Button::SetLabel( Actor label )
142 Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
145 Actor Button::GetLabel() const
147 return Dali::Toolkit::GetImplementation( *this ).GetLabel();
150 Button::ButtonSignalType& Button::PressedSignal()
152 return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
155 Button::ButtonSignalType& Button::ReleasedSignal()
157 return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
160 Button::ButtonSignalType& Button::ClickedSignal()
162 return Dali::Toolkit::GetImplementation( *this ).ClickedSignal();
165 Button::ButtonSignalType& Button::StateChangedSignal()
167 return Dali::Toolkit::GetImplementation( *this ).StateChangedSignal();
170 Button::Button( Internal::Button& implementation )
171 : Control( implementation )
175 Button::Button( Dali::Internal::CustomActor* internal )
176 : Control( internal )
178 VerifyCustomActorPointer<Internal::Button>(internal);
181 } // namespace Toolkit