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_PRESSED = "pressed";
33 const char* const PushButton::SIGNAL_RELEASED = "released";
35 const char* const PushButton::ACTION_PUSH_BUTTON_CLICK = "push-button-click";
37 PushButton::PushButton()
42 PushButton::PushButton( Internal::PushButton& implementation )
43 : Button( implementation )
47 PushButton::PushButton( const PushButton& pushButton )
48 : Button( pushButton )
52 PushButton& PushButton::operator=( const PushButton& pushButton )
54 if( &pushButton != this )
56 Button::operator=( pushButton );
61 PushButton::PushButton( Dali::Internal::CustomActor* internal )
64 VerifyCustomActorPointer<Internal::PushButton>(internal);
67 PushButton::~PushButton()
71 PushButton PushButton::New()
73 return Internal::PushButton::New();
76 PushButton PushButton::DownCast( BaseHandle handle )
78 return Control::DownCast<PushButton, Internal::PushButton>(handle);
81 void PushButton::SetAutoRepeating( bool autoRepeating )
83 Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
86 bool PushButton::IsAutoRepeating() const
88 return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
91 void PushButton::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
93 Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay );
96 float PushButton::GetInitialAutoRepeatingDelay() const
98 return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
101 void PushButton::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
103 Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
106 float PushButton::GetNextAutoRepeatingDelay() const
108 return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
111 void PushButton::SetToggleButton( bool toggle )
113 Dali::Toolkit::GetImplementation( *this ).SetToggleButton( toggle );
116 bool PushButton::IsToggleButton() const
118 return Dali::Toolkit::GetImplementation( *this ).IsToggleButton();
121 void PushButton::SetToggled( bool toggle )
123 Dali::Toolkit::GetImplementation( *this ).SetToggled( toggle );
126 bool PushButton::IsToggled() const
128 return Dali::Toolkit::GetImplementation( *this ).IsToggled();
131 void PushButton::SetButtonImage( Image image )
133 Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
136 void PushButton::SetButtonImage( Actor image )
138 Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
141 Actor PushButton::GetButtonImage() const
143 return Dali::Toolkit::GetImplementation( *this ).GetButtonImage();
146 void PushButton::SetBackgroundImage( Image image )
148 Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
151 void PushButton::SetBackgroundImage( Actor image )
153 Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
156 Actor PushButton::GetBackgroundImage() const
158 return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage();
161 void PushButton::SetSelectedImage( Image image )
163 Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
166 void PushButton::SetSelectedImage( Actor image )
168 Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
171 Actor PushButton::GetSelectedImage() const
173 return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
176 void PushButton::SetDisabledBackgroundImage( Image image )
178 Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
181 void PushButton::SetDisabledBackgroundImage( Actor image )
183 Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
186 Actor PushButton::GetDisabledBackgroundImage() const
188 return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
191 void PushButton::SetDisabledImage( Image image )
193 Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
196 void PushButton::SetDisabledImage( Actor image )
198 Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
201 Actor PushButton::GetDisabledImage() const
203 return Dali::Toolkit::GetImplementation( *this ).GetDisabledImage();
206 void PushButton::SetLabel( const std::string& label )
208 Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
211 void PushButton::SetLabel( Actor label )
213 Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
216 Actor PushButton::GetLabel() const
218 return Dali::Toolkit::GetImplementation( *this ).GetLabel();
221 PushButton::PressedSignalType& PushButton::PressedSignal()
223 return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
226 PushButton::ReleasedSignalType& PushButton::ReleasedSignal()
228 return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
231 } // namespace Toolkit