2 * Copyright (c) 2019 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/integration-api/debug.h>
25 #include <dali-toolkit/public-api/controls/control-impl.h>
26 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
34 Control Control::New()
36 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: DALi is deprecated and will be removed from next version. Please use NUI(C# interface of DALi).\n For more information on NUI, see the NUI quick start page : https://docs.tizen.org/application/dotnet/get-started/nui/quickstart/ \n" );
37 return Internal::Control::New();
44 Control::Control( const Control& uiControl )
45 : CustomActor( uiControl )
53 Control& Control::operator=( const Control& handle )
57 CustomActor::operator=( handle );
62 Control Control::DownCast( BaseHandle handle )
64 return DownCast< Control, Internal::Control >(handle);
67 void Control::SetKeyInputFocus()
69 Internal::GetImplementation(*this).SetKeyInputFocus();
72 bool Control::HasKeyInputFocus()
74 return Internal::GetImplementation(*this).HasKeyInputFocus();
77 void Control::ClearKeyInputFocus()
79 Internal::GetImplementation(*this).ClearKeyInputFocus();
82 PinchGestureDetector Control::GetPinchGestureDetector() const
84 return Internal::GetImplementation(*this).GetPinchGestureDetector();
87 PanGestureDetector Control::GetPanGestureDetector() const
89 return Internal::GetImplementation(*this).GetPanGestureDetector();
92 TapGestureDetector Control::GetTapGestureDetector() const
94 return Internal::GetImplementation(*this).GetTapGestureDetector();
97 LongPressGestureDetector Control::GetLongPressGestureDetector() const
99 return Internal::GetImplementation(*this).GetLongPressGestureDetector();
102 void Control::SetStyleName( const std::string& styleName )
104 Internal::GetImplementation(*this).SetStyleName( styleName );
107 const std::string& Control::GetStyleName() const
109 return Internal::GetImplementation(*this).GetStyleName();
112 void Control::SetBackgroundColor( const Vector4& color )
114 Internal::GetImplementation(*this).SetBackgroundColor( color );
117 void Control::ClearBackground()
119 Internal::GetImplementation(*this).ClearBackground();
122 bool Control::IsResourceReady() const
124 const Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this );
125 const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
127 return controlDataImpl.IsResourceReady();
130 Toolkit::Visual::ResourceStatus Control::GetVisualResourceStatus( Dali::Property::Index index )
132 const Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this );
133 const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
134 return controlDataImpl.GetVisualResourceStatus( index );
137 Control::KeyEventSignalType& Control::KeyEventSignal()
139 return Internal::GetImplementation(*this).KeyEventSignal();
142 Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
144 return Internal::GetImplementation(*this).KeyInputFocusGainedSignal();
147 Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
149 return Internal::GetImplementation(*this).KeyInputFocusLostSignal();
152 Control::ResourceReadySignalType& Control::ResourceReadySignal()
154 Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this );
155 Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl );
157 return controlImpl.mResourceReadySignal;
160 Control::Control(Internal::Control& implementation)
161 : CustomActor(implementation)
165 Control::Control(Dali::Internal::CustomActor* internal)
166 : CustomActor(internal)
168 VerifyCustomActorPointer<Internal::Control>(internal);
171 } // namespace Toolkit