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