2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/public-api/adaptor-framework/window.h>
22 #include <dali/internal/window-system/common/window-impl.h>
23 #include <dali/internal/window-system/common/orientation-impl.h>
28 Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent)
30 Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent);
31 return Window(window);
34 Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent)
36 Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
37 return Window(window);
48 Window::Window(const Window& handle)
53 Window& Window::operator=(const Window& rhs)
55 BaseHandle::operator=(rhs);
59 void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
61 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ShowIndicator is deprecated and will be removed from next release.\n" );
63 GetImplementation(*this).ShowIndicator( visibleMode );
66 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
68 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IndicatorVisibilityChangedSignal is deprecated and will be removed from next release.\n" );
70 return GetImplementation(*this).IndicatorVisibilityChangedSignal();
73 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
75 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetIndicatorBgOpacity is deprecated and will be removed from next release.\n" );
77 GetImplementation(*this).SetIndicatorBgOpacity( opacity );
80 void Window::RotateIndicator( WindowOrientation orientation )
82 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: RotateIndicator is deprecated and will be removed from next release.\n" );
84 GetImplementation(*this).RotateIndicator( orientation );
87 void Window::SetClass( std::string name, std::string klass )
89 GetImplementation(*this).SetClass( name, klass );
94 GetImplementation(*this).Raise();
99 GetImplementation(*this).Lower();
102 void Window::Activate()
104 GetImplementation(*this).Activate();
107 void Window::AddAvailableOrientation( WindowOrientation orientation )
109 GetImplementation(*this).AddAvailableOrientation( orientation );
112 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
114 GetImplementation(*this).RemoveAvailableOrientation( orientation );
117 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
119 GetImplementation(*this).SetPreferredOrientation( orientation );
122 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
124 return GetImplementation(*this).GetPreferredOrientation();
127 DragAndDropDetector Window::GetDragAndDropDetector() const
129 return GetImplementation(*this).GetDragAndDropDetector();
132 Any Window::GetNativeHandle() const
134 return GetImplementation(*this).GetNativeHandle();
137 Window::FocusSignalType& Window::FocusChangedSignal()
139 return GetImplementation(*this).FocusChangedSignal();
142 void Window::SetAcceptFocus( bool accept )
144 GetImplementation(*this).SetAcceptFocus( accept );
147 bool Window::IsFocusAcceptable() const
149 return GetImplementation(*this).IsFocusAcceptable();
154 GetImplementation(*this).Show();
159 GetImplementation(*this).Hide();
162 bool Window::IsVisible() const
164 return GetImplementation(*this).IsVisible();
167 unsigned int Window::GetSupportedAuxiliaryHintCount() const
169 return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
172 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
174 return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
177 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
179 return GetImplementation(*this).AddAuxiliaryHint( hint, value );
182 bool Window::RemoveAuxiliaryHint( unsigned int id )
184 return GetImplementation(*this).RemoveAuxiliaryHint( id );
187 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
189 return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
192 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
194 return GetImplementation(*this).GetAuxiliaryHintValue( id );
197 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
199 return GetImplementation(*this).GetAuxiliaryHintId( hint );
202 void Window::SetInputRegion( const Rect< int >& inputRegion )
204 return GetImplementation(*this).SetInputRegion( inputRegion );
207 void Window::SetType( Window::Type type )
209 GetImplementation(*this).SetType( type );
212 Window::Type Window::GetType() const
214 return GetImplementation(*this).GetType();
217 bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
219 return GetImplementation(*this).SetNotificationLevel( level );
222 Window::NotificationLevel::Type Window::GetNotificationLevel() const
224 return GetImplementation(*this).GetNotificationLevel();
227 void Window::SetOpaqueState( bool opaque )
229 GetImplementation(*this).SetOpaqueState( opaque );
232 bool Window::IsOpaqueState() const
234 return GetImplementation(*this).IsOpaqueState();
237 bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
239 return GetImplementation(*this).SetScreenOffMode(screenMode);
242 Window::ScreenOffMode::Type Window::GetScreenOffMode() const
244 return GetImplementation(*this).GetScreenOffMode();
247 bool Window::SetBrightness( int brightness )
249 return GetImplementation(*this).SetBrightness( brightness );
252 int Window::GetBrightness() const
254 return GetImplementation(*this).GetBrightness();
257 Window::ResizedSignalType& Window::ResizedSignal()
259 return GetImplementation(*this).ResizedSignal();
262 void Window::SetSize( Window::WindowSize size )
264 GetImplementation(*this).SetSize( size );
267 Window::WindowSize Window::GetSize() const
269 return GetImplementation(*this).GetSize();
272 void Window::SetPosition( Window::WindowPosition position )
274 GetImplementation(*this).SetPosition( position );
277 Window::WindowPosition Window::GetPosition() const
279 return GetImplementation(*this).GetPosition();
282 void Window::SetTransparency( bool transparent )
284 GetImplementation(*this).SetTransparency( transparent );
287 Window::Window( Internal::Adaptor::Window* window )
288 : BaseHandle( window )