Merge "Updated @since tags for APIs added since 1.2.0 that are required for Tizen...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control.cpp
1 /*
2  * Copyright (c) 2015 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 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control-impl.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 Control Control::New()
31 {
32   return Internal::Control::New();
33 }
34
35 Control::Control()
36 {
37 }
38
39 Control::Control( const Control& uiControl )
40 : CustomActor( uiControl  )
41 {
42 }
43
44 Control::~Control()
45 {
46 }
47
48 Control& Control::operator=( const Control& handle )
49 {
50   if( &handle != this )
51   {
52     CustomActor::operator=( handle );
53   }
54   return *this;
55 }
56
57 Control Control::DownCast( BaseHandle handle )
58 {
59   return DownCast< Control, Internal::Control >(handle);
60 }
61
62 void Control::SetKeyInputFocus()
63 {
64   Internal::GetImplementation(*this).SetKeyInputFocus();
65 }
66
67 bool Control::HasKeyInputFocus()
68 {
69   return Internal::GetImplementation(*this).HasKeyInputFocus();
70 }
71
72 void Control::ClearKeyInputFocus()
73 {
74   Internal::GetImplementation(*this).ClearKeyInputFocus();
75 }
76
77 PinchGestureDetector Control::GetPinchGestureDetector() const
78 {
79   return Internal::GetImplementation(*this).GetPinchGestureDetector();
80 }
81
82 PanGestureDetector Control::GetPanGestureDetector() const
83 {
84   return Internal::GetImplementation(*this).GetPanGestureDetector();
85 }
86
87 TapGestureDetector Control::GetTapGestureDetector() const
88 {
89   return Internal::GetImplementation(*this).GetTapGestureDetector();
90 }
91
92 LongPressGestureDetector Control::GetLongPressGestureDetector() const
93 {
94   return Internal::GetImplementation(*this).GetLongPressGestureDetector();
95 }
96
97 void Control::SetStyleName( const std::string& styleName )
98 {
99   Internal::GetImplementation(*this).SetStyleName( styleName );
100 }
101
102 const std::string& Control::GetStyleName() const
103 {
104   return Internal::GetImplementation(*this).GetStyleName();
105 }
106
107 void Control::SetBackgroundColor( const Vector4& color )
108 {
109   Internal::GetImplementation(*this).SetBackgroundColor( color );
110 }
111
112 Vector4 Control::GetBackgroundColor() const
113 {
114   return Internal::GetImplementation(*this).GetBackgroundColor();
115 }
116
117 void Control::SetBackgroundImage( Image image )
118 {
119   Internal::GetImplementation(*this).SetBackgroundImage( image );
120 }
121
122 void Control::ClearBackground()
123 {
124   Internal::GetImplementation(*this).ClearBackground();
125 }
126
127 Control::KeyEventSignalType& Control::KeyEventSignal()
128 {
129   return Internal::GetImplementation(*this).KeyEventSignal();
130 }
131
132 Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
133 {
134   return Internal::GetImplementation(*this).KeyInputFocusGainedSignal();
135 }
136
137 Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
138 {
139   return Internal::GetImplementation(*this).KeyInputFocusLostSignal();
140 }
141
142 Control::Control(Internal::Control& implementation)
143 : CustomActor(implementation)
144 {
145 }
146
147 Control::Control(Dali::Internal::CustomActor* internal)
148 : CustomActor(internal)
149 {
150   VerifyCustomActorPointer<Internal::Control>(internal);
151 }
152
153 } // namespace Toolkit
154
155 } // namespace Dali