2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
19 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
23 #include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
31 const char* const PushButton::SIGNAL_TOGGLED = "toggled";
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::SetPressedImage( Image image )
163 Dali::Toolkit::GetImplementation( *this ).SetPressedImage( image );
166 void PushButton::SetPressedImage( Actor image )
168 Dali::Toolkit::GetImplementation( *this ).SetPressedImage( image );
171 Actor PushButton::GetPressedImage() const
173 return Dali::Toolkit::GetImplementation( *this ).GetPressedImage();
176 void PushButton::SetDimmedBackgroundImage( Image image )
178 Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
181 void PushButton::SetDimmedBackgroundImage( Actor image )
183 Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
186 Actor PushButton::GetDimmedBackgroundImage() const
188 return Dali::Toolkit::GetImplementation( *this ).GetDimmedBackgroundImage();
191 void PushButton::SetDimmedImage( Image image )
193 Dali::Toolkit::GetImplementation( *this ).SetDimmedImage( image );
196 void PushButton::SetDimmedImage( Actor image )
198 Dali::Toolkit::GetImplementation( *this ).SetDimmedImage( image );
201 Actor PushButton::GetDimmedImage() const
203 return Dali::Toolkit::GetImplementation( *this ).GetDimmedImage();
206 void PushButton::SetLabelText( const std::string& text )
208 Dali::Toolkit::GetImplementation( *this ).SetLabelText( text );
211 void PushButton::SetLabelText( Actor text )
213 Dali::Toolkit::GetImplementation( *this ).SetLabelText( text );
216 Actor PushButton::GetLabelText() const
218 return Dali::Toolkit::GetImplementation( *this ).GetLabelText();
221 PushButton::ToggledSignalV2& PushButton::ToggledSignal()
223 return Dali::Toolkit::GetImplementation( *this ).ToggledSignal();
226 PushButton::PressedSignalV2& PushButton::PressedSignal()
228 return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
231 PushButton::ReleasedSignalV2& PushButton::ReleasedSignal()
233 return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
236 } // namespace Toolkit