2 * Copyright (c) 2015 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::SetKeyInputFocus()
74 GetImplementation().SetKeyInputFocus();
77 bool Control::HasKeyInputFocus()
79 return GetImplementation().HasKeyInputFocus();
82 void Control::ClearKeyInputFocus()
84 GetImplementation().ClearKeyInputFocus();
87 PinchGestureDetector Control::GetPinchGestureDetector() const
89 return GetImplementation().GetPinchGestureDetector();
92 PanGestureDetector Control::GetPanGestureDetector() const
94 return GetImplementation().GetPanGestureDetector();
97 TapGestureDetector Control::GetTapGestureDetector() const
99 return GetImplementation().GetTapGestureDetector();
102 LongPressGestureDetector Control::GetLongPressGestureDetector() const
104 return GetImplementation().GetLongPressGestureDetector();
107 void Control::SetStyleName( const std::string& styleName )
109 GetImplementation().SetStyleName( styleName );
112 const std::string& Control::GetStyleName() const
114 return GetImplementation().GetStyleName();
117 void Control::SetBackgroundColor( const Vector4& color )
119 GetImplementation().SetBackgroundColor( color );
122 Vector4 Control::GetBackgroundColor() const
124 return GetImplementation().GetBackgroundColor();
127 void Control::SetBackgroundImage( Image image )
129 GetImplementation().SetBackgroundImage( image );
132 void Control::ClearBackground()
134 GetImplementation().ClearBackground();
137 Actor Control::GetBackgroundActor() const
139 return GetImplementation().GetBackgroundActor();
142 Control::KeyEventSignalType& Control::KeyEventSignal()
144 return GetImplementation().KeyEventSignal();
147 Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
149 return GetImplementation().KeyInputFocusGainedSignal();
152 Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
154 return GetImplementation().KeyInputFocusLostSignal();
157 Control::Control(Internal::Control& implementation)
158 : CustomActor(implementation)
162 Control::Control(Dali::Internal::CustomActor* internal)
163 : CustomActor(internal)
165 VerifyCustomActorPointer<Internal::Control>(internal);
168 } // namespace Toolkit