Split dali-toolkit into Base & Optional
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / buttons / push-button.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
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 // CLASS HEADER
18
19 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
20
21 // INTERNAL INCLUDES
22
23 #include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
24
25 namespace Dali
26 {
27
28 namespace Toolkit
29 {
30
31 const char* const PushButton::SIGNAL_TOGGLED = "toggled";
32 const char* const PushButton::SIGNAL_PRESSED = "pressed";
33 const char* const PushButton::SIGNAL_RELEASED = "released";
34
35 const char* const PushButton::ACTION_PUSH_BUTTON_CLICK = "push-button-click";
36
37 PushButton::PushButton()
38 : Button()
39 {
40 }
41
42 PushButton::PushButton( Internal::PushButton& implementation )
43 : Button( implementation )
44 {
45 }
46
47 PushButton::PushButton( const PushButton& pushButton )
48 : Button( pushButton )
49 {
50 }
51
52 PushButton& PushButton::operator=( const PushButton& pushButton )
53 {
54   if( &pushButton != this )
55   {
56     Button::operator=( pushButton );
57   }
58   return *this;
59 }
60
61 PushButton::PushButton( Dali::Internal::CustomActor* internal )
62 : Button( internal )
63 {
64   VerifyCustomActorPointer<Internal::PushButton>(internal);
65 }
66
67 PushButton::~PushButton()
68 {
69 }
70
71 PushButton PushButton::New()
72 {
73   return Internal::PushButton::New();
74 }
75
76 PushButton PushButton::DownCast( BaseHandle handle )
77 {
78   return Control::DownCast<PushButton, Internal::PushButton>(handle);
79 }
80
81 void PushButton::SetAutoRepeating( bool autoRepeating )
82 {
83   Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
84 }
85
86 bool PushButton::IsAutoRepeating() const
87 {
88   return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
89 }
90
91 void PushButton::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
92 {
93   Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay );
94 }
95
96 float PushButton::GetInitialAutoRepeatingDelay() const
97 {
98   return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
99 }
100
101 void PushButton::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
102 {
103   Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
104 }
105
106 float PushButton::GetNextAutoRepeatingDelay() const
107 {
108   return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
109 }
110
111 void PushButton::SetToggleButton( bool toggle )
112 {
113   Dali::Toolkit::GetImplementation( *this ).SetToggleButton( toggle );
114 }
115
116 bool PushButton::IsToggleButton() const
117 {
118   return Dali::Toolkit::GetImplementation( *this ).IsToggleButton();
119 }
120
121 void PushButton::SetToggled( bool toggle )
122 {
123   Dali::Toolkit::GetImplementation( *this ).SetToggled( toggle );
124 }
125
126 bool PushButton::IsToggled() const
127 {
128   return Dali::Toolkit::GetImplementation( *this ).IsToggled();
129 }
130
131 void PushButton::SetButtonImage( Image image )
132 {
133   Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
134 }
135
136 void PushButton::SetButtonImage( Actor image )
137 {
138   Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
139 }
140
141 Actor PushButton::GetButtonImage() const
142 {
143   return Dali::Toolkit::GetImplementation( *this ).GetButtonImage();
144 }
145
146 void PushButton::SetBackgroundImage( Image image )
147 {
148   Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
149 }
150
151 void PushButton::SetBackgroundImage( Actor image )
152 {
153   Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
154 }
155
156 Actor PushButton::GetBackgroundImage() const
157 {
158   return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage();
159 }
160
161 void PushButton::SetPressedImage( Image image )
162 {
163   Dali::Toolkit::GetImplementation( *this ).SetPressedImage( image );
164 }
165
166 void PushButton::SetPressedImage( Actor image )
167 {
168   Dali::Toolkit::GetImplementation( *this ).SetPressedImage( image );
169 }
170
171 Actor PushButton::GetPressedImage() const
172 {
173   return Dali::Toolkit::GetImplementation( *this ).GetPressedImage();
174 }
175
176 void PushButton::SetDimmedBackgroundImage( Image image )
177 {
178   Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
179 }
180
181 void PushButton::SetDimmedBackgroundImage( Actor image )
182 {
183   Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
184 }
185
186 Actor PushButton::GetDimmedBackgroundImage() const
187 {
188   return Dali::Toolkit::GetImplementation( *this ).GetDimmedBackgroundImage();
189 }
190
191 void PushButton::SetDimmedImage( Image image )
192 {
193   Dali::Toolkit::GetImplementation( *this ).SetDimmedImage( image );
194 }
195
196 void PushButton::SetDimmedImage( Actor image )
197 {
198   Dali::Toolkit::GetImplementation( *this ).SetDimmedImage( image );
199 }
200
201 Actor PushButton::GetDimmedImage() const
202 {
203   return Dali::Toolkit::GetImplementation( *this ).GetDimmedImage();
204 }
205
206 void PushButton::SetLabelText( const std::string& text )
207 {
208   Dali::Toolkit::GetImplementation( *this ).SetLabelText( text );
209 }
210
211 void PushButton::SetLabelText( Actor text )
212 {
213   Dali::Toolkit::GetImplementation( *this ).SetLabelText( text );
214 }
215
216 Actor PushButton::GetLabelText() const
217 {
218   return Dali::Toolkit::GetImplementation( *this ).GetLabelText();
219 }
220
221 PushButton::ToggledSignalV2& PushButton::ToggledSignal()
222 {
223   return Dali::Toolkit::GetImplementation( *this ).ToggledSignal();
224 }
225
226 PushButton::PressedSignalV2& PushButton::PressedSignal()
227 {
228   return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
229 }
230
231 PushButton::ReleasedSignalV2& PushButton::ReleasedSignal()
232 {
233   return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
234 }
235
236 } // namespace Toolkit
237
238 } // namespace Dali