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