[Tizen] Add deprecated log to Control
[platform/core/uifw/dali-toolkit-legacy.git] / dali-toolkit / public-api / controls / control.cpp
1 /*
2  * Copyright (c) 2019 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 // CLASS HEADER
19 #include <dali-toolkit/public-api/controls/control.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/public-api/controls/control-impl.h>
26 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
27
28 namespace Dali
29 {
30
31 namespace Toolkit
32 {
33
34 Control Control::New()
35 {
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();
38 }
39
40 Control::Control()
41 {
42 }
43
44 Control::Control( const Control& uiControl )
45 : CustomActor( uiControl  )
46 {
47 }
48
49 Control::~Control()
50 {
51 }
52
53 Control& Control::operator=( const Control& handle )
54 {
55   if( &handle != this )
56   {
57     CustomActor::operator=( handle );
58   }
59   return *this;
60 }
61
62 Control Control::DownCast( BaseHandle handle )
63 {
64   return DownCast< Control, Internal::Control >(handle);
65 }
66
67 void Control::SetKeyInputFocus()
68 {
69   Internal::GetImplementation(*this).SetKeyInputFocus();
70 }
71
72 bool Control::HasKeyInputFocus()
73 {
74   return Internal::GetImplementation(*this).HasKeyInputFocus();
75 }
76
77 void Control::ClearKeyInputFocus()
78 {
79   Internal::GetImplementation(*this).ClearKeyInputFocus();
80 }
81
82 PinchGestureDetector Control::GetPinchGestureDetector() const
83 {
84   return Internal::GetImplementation(*this).GetPinchGestureDetector();
85 }
86
87 PanGestureDetector Control::GetPanGestureDetector() const
88 {
89   return Internal::GetImplementation(*this).GetPanGestureDetector();
90 }
91
92 TapGestureDetector Control::GetTapGestureDetector() const
93 {
94   return Internal::GetImplementation(*this).GetTapGestureDetector();
95 }
96
97 LongPressGestureDetector Control::GetLongPressGestureDetector() const
98 {
99   return Internal::GetImplementation(*this).GetLongPressGestureDetector();
100 }
101
102 void Control::SetStyleName( const std::string& styleName )
103 {
104   Internal::GetImplementation(*this).SetStyleName( styleName );
105 }
106
107 const std::string& Control::GetStyleName() const
108 {
109   return Internal::GetImplementation(*this).GetStyleName();
110 }
111
112 void Control::SetBackgroundColor( const Vector4& color )
113 {
114   Internal::GetImplementation(*this).SetBackgroundColor( color );
115 }
116
117 void Control::ClearBackground()
118 {
119   Internal::GetImplementation(*this).ClearBackground();
120 }
121
122 bool Control::IsResourceReady() const
123 {
124   const Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this );
125   const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
126
127   return controlDataImpl.IsResourceReady();
128 }
129
130 Toolkit::Visual::ResourceStatus Control::GetVisualResourceStatus( Dali::Property::Index index )
131 {
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 );
135 }
136
137 Control::KeyEventSignalType& Control::KeyEventSignal()
138 {
139   return Internal::GetImplementation(*this).KeyEventSignal();
140 }
141
142 Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
143 {
144   return Internal::GetImplementation(*this).KeyInputFocusGainedSignal();
145 }
146
147 Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
148 {
149   return Internal::GetImplementation(*this).KeyInputFocusLostSignal();
150 }
151
152 Control::ResourceReadySignalType&  Control::ResourceReadySignal()
153 {
154   Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this );
155   Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl );
156
157   return controlImpl.mResourceReadySignal;
158 }
159
160 Control::Control(Internal::Control& implementation)
161 : CustomActor(implementation)
162 {
163 }
164
165 Control::Control(Dali::Internal::CustomActor* internal)
166 : CustomActor(internal)
167 {
168   VerifyCustomActorPointer<Internal::Control>(internal);
169 }
170
171 } // namespace Toolkit
172
173 } // namespace Dali