Merge "Remove unnecessarily exported signals and action names" into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control.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 #include <dali-toolkit/public-api/controls/control.h>
19 #include <dali-toolkit/public-api/controls/control-impl.h>
20
21 namespace Dali
22 {
23
24 namespace Toolkit
25 {
26
27 Control Control::New()
28 {
29   return Internal::Control::New();
30 }
31
32 Control::Control()
33 {
34 }
35
36 Control::Control(const Control& uiControl)
37 : CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL)
38 {
39 }
40
41 Control::~Control()
42 {
43 }
44
45 Control& Control::operator=( const Control& handle )
46 {
47   if( &handle != this )
48   {
49     CustomActor::operator=( handle );
50   }
51   return *this;
52 }
53
54 Control Control::DownCast( BaseHandle handle )
55 {
56   return DownCast< Control, Internal::Control >(handle);
57 }
58
59 Internal::Control& Control::GetImplementation()
60 {
61   return static_cast<Internal::Control&>(CustomActor::GetImplementation());
62 }
63
64 const Internal::Control& Control::GetImplementation() const
65 {
66   return static_cast<const Internal::Control&>(CustomActor::GetImplementation());
67 }
68
69 void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy )
70 {
71   GetImplementation().SetSizePolicy( widthPolicy, heightPolicy );
72 }
73
74 void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const
75 {
76   GetImplementation().GetSizePolicy( widthPolicy, heightPolicy );
77 }
78
79 void Control::SetMinimumSize( const Vector3& size )
80 {
81   GetImplementation().SetMinimumSize( size );
82 }
83
84 const Vector3& Control::GetMinimumSize() const
85 {
86   return GetImplementation().GetMinimumSize();
87 }
88
89 void Control::SetMaximumSize( const Vector3& size )
90 {
91   GetImplementation().SetMaximumSize( size );
92 }
93
94 const Vector3& Control::GetMaximumSize() const
95 {
96   return GetImplementation().GetMaximumSize();
97 }
98
99 Vector3 Control::GetNaturalSize()
100 {
101   return GetImplementation().GetNaturalSize();
102 }
103
104 float Control::GetHeightForWidth( float width )
105 {
106   return GetImplementation().GetHeightForWidth( width );
107 }
108
109 float Control::GetWidthForHeight( float height )
110 {
111   return GetImplementation().GetWidthForHeight( height );
112 }
113
114 void Control::SetKeyInputFocus()
115 {
116   GetImplementation().SetKeyInputFocus();
117 }
118
119 bool Control::HasKeyInputFocus()
120 {
121   return GetImplementation().HasKeyInputFocus();
122 }
123
124 void Control::ClearKeyInputFocus()
125 {
126   GetImplementation().ClearKeyInputFocus();
127 }
128
129 PinchGestureDetector Control::GetPinchGestureDetector() const
130 {
131   return GetImplementation().GetPinchGestureDetector();
132 }
133
134 PanGestureDetector Control::GetPanGestureDetector() const
135 {
136   return GetImplementation().GetPanGestureDetector();
137 }
138
139 TapGestureDetector Control::GetTapGestureDetector() const
140 {
141   return GetImplementation().GetTapGestureDetector();
142 }
143
144 LongPressGestureDetector Control::GetLongPressGestureDetector() const
145 {
146   return GetImplementation().GetLongPressGestureDetector();
147 }
148
149 void Control::SetBackgroundColor( const Vector4& color )
150 {
151   GetImplementation().SetBackgroundColor( color );
152 }
153
154 Vector4 Control::GetBackgroundColor() const
155 {
156   return GetImplementation().GetBackgroundColor();
157 }
158
159 void Control::SetBackground( Image image )
160 {
161   GetImplementation().SetBackground( image );
162 }
163
164 void Control::ClearBackground()
165 {
166   GetImplementation().ClearBackground();
167 }
168
169 Actor Control::GetBackgroundActor() const
170 {
171   return GetImplementation().GetBackgroundActor();
172 }
173
174 Control::KeyEventSignalType& Control::KeyEventSignal()
175 {
176   return GetImplementation().KeyEventSignal();
177 }
178
179 Control::Control(Internal::Control& implementation)
180 : CustomActor(implementation)
181 {
182 }
183
184 Control::Control(Dali::Internal::CustomActor* internal)
185 : CustomActor(internal)
186 {
187   VerifyCustomActorPointer<Internal::Control>(internal);
188 }
189
190 } // namespace Toolkit
191
192 } // namespace Dali