2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali-toolkit/public-api/controls/control.h>
22 #include <dali-toolkit/public-api/controls/control-impl.h>
30 Control Control::New()
32 return Internal::Control::New();
39 Control::Control(const Control& uiControl)
40 : CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL)
48 Control& Control::operator=( const Control& handle )
52 CustomActor::operator=( handle );
57 Control Control::DownCast( BaseHandle handle )
59 return DownCast< Control, Internal::Control >(handle);
62 Internal::Control& Control::GetImplementation()
64 return static_cast<Internal::Control&>(CustomActor::GetImplementation());
67 const Internal::Control& Control::GetImplementation() const
69 return static_cast<const Internal::Control&>(CustomActor::GetImplementation());
72 void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy )
74 GetImplementation().SetSizePolicy( widthPolicy, heightPolicy );
77 void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const
79 GetImplementation().GetSizePolicy( widthPolicy, heightPolicy );
82 void Control::SetMinimumSize( const Vector3& size )
84 GetImplementation().SetMinimumSize( size );
87 const Vector3& Control::GetMinimumSize() const
89 return GetImplementation().GetMinimumSize();
92 void Control::SetMaximumSize( const Vector3& size )
94 GetImplementation().SetMaximumSize( size );
97 const Vector3& Control::GetMaximumSize() const
99 return GetImplementation().GetMaximumSize();
102 Vector3 Control::GetNaturalSize()
104 return GetImplementation().GetNaturalSize();
107 float Control::GetHeightForWidth( float width )
109 return GetImplementation().GetHeightForWidth( width );
112 float Control::GetWidthForHeight( float height )
114 return GetImplementation().GetWidthForHeight( height );
117 void Control::SetKeyInputFocus()
119 GetImplementation().SetKeyInputFocus();
122 bool Control::HasKeyInputFocus()
124 return GetImplementation().HasKeyInputFocus();
127 void Control::ClearKeyInputFocus()
129 GetImplementation().ClearKeyInputFocus();
132 PinchGestureDetector Control::GetPinchGestureDetector() const
134 return GetImplementation().GetPinchGestureDetector();
137 PanGestureDetector Control::GetPanGestureDetector() const
139 return GetImplementation().GetPanGestureDetector();
142 TapGestureDetector Control::GetTapGestureDetector() const
144 return GetImplementation().GetTapGestureDetector();
147 LongPressGestureDetector Control::GetLongPressGestureDetector() const
149 return GetImplementation().GetLongPressGestureDetector();
152 void Control::SetBackgroundColor( const Vector4& color )
154 GetImplementation().SetBackgroundColor( color );
157 Vector4 Control::GetBackgroundColor() const
159 return GetImplementation().GetBackgroundColor();
162 void Control::SetBackground( Image image )
164 GetImplementation().SetBackground( image );
167 void Control::ClearBackground()
169 GetImplementation().ClearBackground();
172 Actor Control::GetBackgroundActor() const
174 return GetImplementation().GetBackgroundActor();
177 Control::KeyEventSignalType& Control::KeyEventSignal()
179 return GetImplementation().KeyEventSignal();
182 Control::Control(Internal::Control& implementation)
183 : CustomActor(implementation)
187 Control::Control(Dali::Internal::CustomActor* internal)
188 : CustomActor(internal)
190 VerifyCustomActorPointer<Internal::Control>(internal);
193 } // namespace Toolkit