Merge "Remove CXX03 Build & old Tizen Version Builds" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / window.cpp
1 /*
2  * Copyright (c) 2017 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/public-api/adaptor-framework/window.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/internal/window-system/common/window-impl.h>
24 #include <dali/internal/window-system/common/orientation-impl.h>
25
26 namespace Dali
27 {
28
29 Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent)
30 {
31   Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent);
32
33   Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
34   Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
35   Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &sceneHolder, name, "", isTransparent );
36
37   return Window(window);
38 }
39
40 Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent)
41 {
42   Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
43
44   Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
45   Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
46   Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &sceneHolder, name, className, isTransparent );
47
48   return Window(window);
49 }
50
51 Window::Window()
52 {
53 }
54
55 Window::~Window()
56 {
57 }
58
59 Window::Window(const Window& handle)
60 : BaseHandle(handle)
61 {
62 }
63
64 Window& Window::operator=(const Window& rhs)
65 {
66   BaseHandle::operator=(rhs);
67   return *this;
68 }
69
70 void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
71 {
72   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ShowIndicator is deprecated and will be removed from next release.\n" );
73
74   GetImplementation(*this).ShowIndicator( visibleMode );
75 }
76
77 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
78 {
79   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IndicatorVisibilityChangedSignal is deprecated and will be removed from next release.\n" );
80
81   return GetImplementation(*this).IndicatorVisibilityChangedSignal();
82 }
83
84 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
85 {
86   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetIndicatorBgOpacity is deprecated and will be removed from next release.\n" );
87
88   GetImplementation(*this).SetIndicatorBgOpacity( opacity );
89 }
90
91 void Window::RotateIndicator( WindowOrientation orientation )
92 {
93   DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: RotateIndicator is deprecated and will be removed from next release.\n" );
94
95   GetImplementation(*this).RotateIndicator( orientation );
96 }
97
98 void Window::SetClass( std::string name, std::string klass )
99 {
100   GetImplementation(*this).SetClass( name, klass );
101 }
102
103 void Window::Raise()
104 {
105   GetImplementation(*this).Raise();
106 }
107
108 void Window::Lower()
109 {
110   GetImplementation(*this).Lower();
111 }
112
113 void Window::Activate()
114 {
115   GetImplementation(*this).Activate();
116 }
117
118 void Window::AddAvailableOrientation( WindowOrientation orientation )
119 {
120   GetImplementation(*this).AddAvailableOrientation( orientation );
121 }
122
123 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
124 {
125   GetImplementation(*this).RemoveAvailableOrientation( orientation );
126 }
127
128 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
129 {
130   GetImplementation(*this).SetPreferredOrientation( orientation );
131 }
132
133 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
134 {
135   return GetImplementation(*this).GetPreferredOrientation();
136 }
137
138 DragAndDropDetector Window::GetDragAndDropDetector() const
139 {
140   return GetImplementation(*this).GetDragAndDropDetector();
141 }
142
143 Any Window::GetNativeHandle() const
144 {
145   return GetImplementation(*this).GetNativeHandle();
146 }
147
148 Window::FocusSignalType& Window::FocusChangedSignal()
149 {
150   return GetImplementation(*this).FocusChangedSignal();
151 }
152
153 void Window::SetAcceptFocus( bool accept )
154 {
155   GetImplementation(*this).SetAcceptFocus( accept );
156 }
157
158 bool Window::IsFocusAcceptable() const
159 {
160   return GetImplementation(*this).IsFocusAcceptable();
161 }
162
163 void Window::Show()
164 {
165   GetImplementation(*this).Show();
166 }
167
168 void Window::Hide()
169 {
170   GetImplementation(*this).Hide();
171 }
172
173 bool Window::IsVisible() const
174 {
175   return GetImplementation(*this).IsVisible();
176 }
177
178 unsigned int Window::GetSupportedAuxiliaryHintCount() const
179 {
180   return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
181 }
182
183 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
184 {
185   return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
186 }
187
188 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
189 {
190   return GetImplementation(*this).AddAuxiliaryHint( hint, value );
191 }
192
193 bool Window::RemoveAuxiliaryHint( unsigned int id )
194 {
195   return GetImplementation(*this).RemoveAuxiliaryHint( id );
196 }
197
198 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
199 {
200   return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
201 }
202
203 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
204 {
205   return GetImplementation(*this).GetAuxiliaryHintValue( id );
206 }
207
208 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
209 {
210   return GetImplementation(*this).GetAuxiliaryHintId( hint );
211 }
212
213 void Window::SetInputRegion( const Rect< int >& inputRegion )
214 {
215   return GetImplementation(*this).SetInputRegion( inputRegion );
216 }
217
218 void Window::SetType( Window::Type type )
219 {
220   GetImplementation(*this).SetType( type );
221 }
222
223 Window::Type Window::GetType() const
224 {
225   return GetImplementation(*this).GetType();
226 }
227
228 bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
229 {
230   return GetImplementation(*this).SetNotificationLevel( level );
231 }
232
233 Window::NotificationLevel::Type Window::GetNotificationLevel() const
234 {
235   return GetImplementation(*this).GetNotificationLevel();
236 }
237
238 void Window::SetOpaqueState( bool opaque )
239 {
240   GetImplementation(*this).SetOpaqueState( opaque );
241 }
242
243 bool Window::IsOpaqueState() const
244 {
245   return GetImplementation(*this).IsOpaqueState();
246 }
247
248 bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
249 {
250   return GetImplementation(*this).SetScreenOffMode(screenMode);
251 }
252
253 Window::ScreenOffMode::Type Window::GetScreenOffMode() const
254 {
255   return GetImplementation(*this).GetScreenOffMode();
256 }
257
258 bool Window::SetBrightness( int brightness )
259 {
260   return GetImplementation(*this).SetBrightness( brightness );
261 }
262
263 int Window::GetBrightness() const
264 {
265   return GetImplementation(*this).GetBrightness();
266 }
267
268 Window::ResizedSignalType& Window::ResizedSignal()
269 {
270   return GetImplementation(*this).ResizedSignal();
271 }
272
273 void Window::SetSize( Window::WindowSize size )
274 {
275   GetImplementation(*this).SetSize( size );
276 }
277
278 Window::WindowSize Window::GetSize() const
279 {
280   return GetImplementation(*this).GetSize();
281 }
282
283 void Window::SetPosition( Window::WindowPosition position )
284 {
285   GetImplementation(*this).SetPosition( position );
286 }
287
288 Window::WindowPosition Window::GetPosition() const
289 {
290   return GetImplementation(*this).GetPosition();
291 }
292
293 void Window::SetTransparency( bool transparent )
294 {
295   GetImplementation(*this).SetTransparency( transparent );
296 }
297
298 Window::Window( Internal::Adaptor::Window* window )
299 : BaseHandle( window )
300 {
301 }
302
303 } // namespace Dali