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/push-button.h>
24 #include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
32 const char* const PushButton::SIGNAL_TOGGLED = "toggled";
33 const char* const PushButton::SIGNAL_PRESSED = "pressed";
34 const char* const PushButton::SIGNAL_RELEASED = "released";
36 const char* const PushButton::ACTION_PUSH_BUTTON_CLICK = "push-button-click";
38 PushButton::PushButton()
43 PushButton::PushButton( Internal::PushButton& implementation )
44 : Button( implementation )
48 PushButton::PushButton( const PushButton& pushButton )
49 : Button( pushButton )
53 PushButton& PushButton::operator=( const PushButton& pushButton )
55 if( &pushButton != this )
57 Button::operator=( pushButton );
62 PushButton::PushButton( Dali::Internal::CustomActor* internal )
65 VerifyCustomActorPointer<Internal::PushButton>(internal);
68 PushButton::~PushButton()
72 PushButton PushButton::New()
74 return Internal::PushButton::New();
77 PushButton PushButton::DownCast( BaseHandle handle )
79 return Control::DownCast<PushButton, Internal::PushButton>(handle);
82 void PushButton::SetAutoRepeating( bool autoRepeating )
84 Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
87 bool PushButton::IsAutoRepeating() const
89 return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
92 void PushButton::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
94 Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay );
97 float PushButton::GetInitialAutoRepeatingDelay() const
99 return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
102 void PushButton::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
104 Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
107 float PushButton::GetNextAutoRepeatingDelay() const
109 return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
112 void PushButton::SetToggleButton( bool toggle )
114 Dali::Toolkit::GetImplementation( *this ).SetToggleButton( toggle );
117 bool PushButton::IsToggleButton() const
119 return Dali::Toolkit::GetImplementation( *this ).IsToggleButton();
122 void PushButton::SetToggled( bool toggle )
124 Dali::Toolkit::GetImplementation( *this ).SetToggled( toggle );
127 bool PushButton::IsToggled() const
129 return Dali::Toolkit::GetImplementation( *this ).IsToggled();
132 void PushButton::SetButtonImage( Image image )
134 Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
137 void PushButton::SetButtonImage( Actor image )
139 Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
142 Actor PushButton::GetButtonImage() const
144 return Dali::Toolkit::GetImplementation( *this ).GetButtonImage();
147 void PushButton::SetBackgroundImage( Image image )
149 Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
152 void PushButton::SetBackgroundImage( Actor image )
154 Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
157 Actor PushButton::GetBackgroundImage() const
159 return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage();
162 void PushButton::SetPressedImage( Image image )
164 Dali::Toolkit::GetImplementation( *this ).SetPressedImage( image );
167 void PushButton::SetPressedImage( Actor image )
169 Dali::Toolkit::GetImplementation( *this ).SetPressedImage( image );
172 Actor PushButton::GetPressedImage() const
174 return Dali::Toolkit::GetImplementation( *this ).GetPressedImage();
177 void PushButton::SetDimmedBackgroundImage( Image image )
179 Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
182 void PushButton::SetDimmedBackgroundImage( Actor image )
184 Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
187 Actor PushButton::GetDimmedBackgroundImage() const
189 return Dali::Toolkit::GetImplementation( *this ).GetDimmedBackgroundImage();
192 void PushButton::SetDimmedImage( Image image )
194 Dali::Toolkit::GetImplementation( *this ).SetDimmedImage( image );
197 void PushButton::SetDimmedImage( Actor image )
199 Dali::Toolkit::GetImplementation( *this ).SetDimmedImage( image );
202 Actor PushButton::GetDimmedImage() const
204 return Dali::Toolkit::GetImplementation( *this ).GetDimmedImage();
207 void PushButton::SetLabelText( const std::string& text )
209 Dali::Toolkit::GetImplementation( *this ).SetLabelText( text );
212 void PushButton::SetLabelText( Actor text )
214 Dali::Toolkit::GetImplementation( *this ).SetLabelText( text );
217 Actor PushButton::GetLabelText() const
219 return Dali::Toolkit::GetImplementation( *this ).GetLabelText();
222 PushButton::ToggledSignalV2& PushButton::ToggledSignal()
224 return Dali::Toolkit::GetImplementation( *this ).ToggledSignal();
227 PushButton::PressedSignalV2& PushButton::PressedSignal()
229 return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
232 PushButton::ReleasedSignalV2& PushButton::ReleasedSignal()
234 return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
237 } // namespace Toolkit