ab953bf928dc8c85a6d1ad242ba9ba307280c1d7
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / 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/button.h>
21
22 // INTERNAL INCLUDES
23
24 #include <dali-toolkit/internal/controls/buttons/button-impl.h>
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
32 Button::Button()
33 {}
34
35 Button::Button( const Button& button )
36 : Control( button )
37 {
38 }
39
40 Button& Button::operator=( const Button& button )
41 {
42   if( &button != this )
43   {
44     Control::operator=( button );
45   }
46   return *this;
47 }
48
49 Button::~Button()
50 {
51 }
52
53 Button Button::DownCast( BaseHandle handle )
54 {
55   return Control::DownCast<Button, Internal::Button>(handle);
56 }
57
58 void Button::SetDisabled( bool disabled )
59 {
60   Dali::Toolkit::GetImplementation( *this ).SetDisabled( disabled );
61 }
62
63 bool Button::IsDisabled() const
64 {
65   return Dali::Toolkit::GetImplementation( *this ).IsDisabled();
66 }
67
68 void Button::SetAutoRepeating( bool autoRepeating )
69 {
70   Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
71 }
72
73 bool Button::IsAutoRepeating() const
74 {
75   return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
76 }
77
78 void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
79 {
80   Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay );
81 }
82
83 float Button::GetInitialAutoRepeatingDelay() const
84 {
85   return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
86 }
87
88 void Button::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
89 {
90   Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
91 }
92
93 float Button::GetNextAutoRepeatingDelay() const
94 {
95   return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
96 }
97
98 void Button::SetTogglableButton( bool togglable )
99 {
100   Dali::Toolkit::GetImplementation( *this ).SetTogglableButton( togglable );
101 }
102
103 bool Button::IsTogglableButton() const
104 {
105   return Dali::Toolkit::GetImplementation( *this ).IsTogglableButton();
106 }
107
108 void Button::SetSelected( bool selected )
109 {
110   Dali::Toolkit::GetImplementation( *this ).SetSelected( selected );
111 }
112
113 bool Button::IsSelected() const
114 {
115   return Dali::Toolkit::GetImplementation( *this ).IsSelected();
116 }
117
118 void Button::SetAnimationTime( float animationTime )
119 {
120   Dali::Toolkit::GetImplementation( *this ).SetAnimationTime( animationTime );
121 }
122
123 float Button::GetAnimationTime() const
124 {
125   return Dali::Toolkit::GetImplementation( *this ).GetAnimationTime();
126 }
127
128 void Button::SetLabel( const std::string& label )
129 {
130   Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
131 }
132
133 void Button::SetLabel( Actor label )
134 {
135   Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
136 }
137
138 Actor Button::GetLabel() const
139 {
140   return Dali::Toolkit::GetImplementation( *this ).GetLabel();
141 }
142
143 Button::ButtonSignalType& Button::PressedSignal()
144 {
145   return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
146 }
147
148 Button::ButtonSignalType& Button::ReleasedSignal()
149 {
150   return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
151 }
152
153 Button::ButtonSignalType& Button::ClickedSignal()
154 {
155   return Dali::Toolkit::GetImplementation( *this ).ClickedSignal();
156 }
157
158 Button::ButtonSignalType& Button::StateChangedSignal()
159 {
160   return Dali::Toolkit::GetImplementation( *this ).StateChangedSignal();
161 }
162
163 Button::Button( Internal::Button& implementation )
164 : Control( implementation )
165 {
166 }
167
168 Button::Button( Dali::Internal::CustomActor* internal )
169 : Control( internal )
170 {
171   VerifyCustomActorPointer<Internal::Button>(internal);
172 }
173
174 } // namespace Toolkit
175
176 } // namespace Dali