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