Merge "Remove obsolete and non functional SizeChanged signal from actor" into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / push-button.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
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
18 // CLASS HEADER
19
20 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
21
22 // INTERNAL INCLUDES
23
24 #include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
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::SetSelectedImage( Image image )
162 {
163   Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
164 }
165
166 void PushButton::SetSelectedImage( Actor image )
167 {
168   Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
169 }
170
171 Actor PushButton::GetSelectedImage() const
172 {
173   return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
174 }
175
176 void PushButton::SetDisabledBackgroundImage( Image image )
177 {
178   Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
179 }
180
181 void PushButton::SetDisabledBackgroundImage( Actor image )
182 {
183   Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
184 }
185
186 Actor PushButton::GetDisabledBackgroundImage() const
187 {
188   return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
189 }
190
191 void PushButton::SetDisabledImage( Image image )
192 {
193   Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
194 }
195
196 void PushButton::SetDisabledImage( Actor image )
197 {
198   Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
199 }
200
201 Actor PushButton::GetDisabledImage() const
202 {
203   return Dali::Toolkit::GetImplementation( *this ).GetDisabledImage();
204 }
205
206 void PushButton::SetLabel( const std::string& label )
207 {
208   Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
209 }
210
211 void PushButton::SetLabel( Actor label )
212 {
213   Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
214 }
215
216 Actor PushButton::GetLabel() const
217 {
218   return Dali::Toolkit::GetImplementation( *this ).GetLabel();
219 }
220
221 PushButton::PressedSignalType& PushButton::PressedSignal()
222 {
223   return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
224 }
225
226 PushButton::ReleasedSignalType& PushButton::ReleasedSignal()
227 {
228   return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
229 }
230
231 } // namespace Toolkit
232
233 } // namespace Dali