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.
18 #include <dali-toolkit/public-api/controls/control.h>
19 #include <dali-toolkit/public-api/controls/control-impl.h>
27 Control Control::New()
29 return Internal::Control::New();
36 Control::Control(const Control& uiControl)
37 : CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL)
45 Control& Control::operator=( const Control& handle )
49 CustomActor::operator=( handle );
54 Control Control::DownCast( BaseHandle handle )
56 return DownCast< Control, Internal::Control >(handle);
59 Internal::Control& Control::GetImplementation()
61 return static_cast<Internal::Control&>(CustomActor::GetImplementation());
64 const Internal::Control& Control::GetImplementation() const
66 return static_cast<const Internal::Control&>(CustomActor::GetImplementation());
69 void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy )
71 GetImplementation().SetSizePolicy( widthPolicy, heightPolicy );
74 void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const
76 GetImplementation().GetSizePolicy( widthPolicy, heightPolicy );
79 void Control::SetMinimumSize( const Vector3& size )
81 GetImplementation().SetMinimumSize( size );
84 const Vector3& Control::GetMinimumSize() const
86 return GetImplementation().GetMinimumSize();
89 void Control::SetMaximumSize( const Vector3& size )
91 GetImplementation().SetMaximumSize( size );
94 const Vector3& Control::GetMaximumSize() const
96 return GetImplementation().GetMaximumSize();
99 Vector3 Control::GetNaturalSize()
101 return GetImplementation().GetNaturalSize();
104 float Control::GetHeightForWidth( float width )
106 return GetImplementation().GetHeightForWidth( width );
109 float Control::GetWidthForHeight( float height )
111 return GetImplementation().GetWidthForHeight( height );
114 void Control::SetKeyInputFocus()
116 GetImplementation().SetKeyInputFocus();
119 bool Control::HasKeyInputFocus()
121 return GetImplementation().HasKeyInputFocus();
124 void Control::ClearKeyInputFocus()
126 GetImplementation().ClearKeyInputFocus();
129 PinchGestureDetector Control::GetPinchGestureDetector() const
131 return GetImplementation().GetPinchGestureDetector();
134 PanGestureDetector Control::GetPanGestureDetector() const
136 return GetImplementation().GetPanGestureDetector();
139 TapGestureDetector Control::GetTapGestureDetector() const
141 return GetImplementation().GetTapGestureDetector();
144 LongPressGestureDetector Control::GetLongPressGestureDetector() const
146 return GetImplementation().GetLongPressGestureDetector();
149 void Control::SetBackgroundColor( const Vector4& color )
151 GetImplementation().SetBackgroundColor( color );
154 Vector4 Control::GetBackgroundColor() const
156 return GetImplementation().GetBackgroundColor();
159 void Control::SetBackground( Image image )
161 GetImplementation().SetBackground( image );
164 void Control::ClearBackground()
166 GetImplementation().ClearBackground();
169 Actor Control::GetBackgroundActor() const
171 return GetImplementation().GetBackgroundActor();
174 Control::KeyEventSignalType& Control::KeyEventSignal()
176 return GetImplementation().KeyEventSignal();
179 Control::Control(Internal::Control& implementation)
180 : CustomActor(implementation)
184 Control::Control(Dali::Internal::CustomActor* internal)
185 : CustomActor(internal)
187 VerifyCustomActorPointer<Internal::Control>(internal);
190 } // namespace Toolkit