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/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>
29 Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent)
31 Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent);
32 return Window(window);
35 Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent)
37 Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
38 return Window(window);
49 Window::Window(const Window& handle)
54 Window& Window::operator=(const Window& rhs)
56 BaseHandle::operator=(rhs);
60 void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
62 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ShowIndicator is deprecated and will be removed from next release.\n" );
64 GetImplementation(*this).ShowIndicator( visibleMode );
67 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
69 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IndicatorVisibilityChangedSignal is deprecated and will be removed from next release.\n" );
71 return GetImplementation(*this).IndicatorVisibilityChangedSignal();
74 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
76 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetIndicatorBgOpacity is deprecated and will be removed from next release.\n" );
78 GetImplementation(*this).SetIndicatorBgOpacity( opacity );
81 void Window::RotateIndicator( WindowOrientation orientation )
83 DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: RotateIndicator is deprecated and will be removed from next release.\n" );
85 GetImplementation(*this).RotateIndicator( orientation );
88 void Window::SetClass( std::string name, std::string klass )
90 GetImplementation(*this).SetClass( name, klass );
95 GetImplementation(*this).Raise();
100 GetImplementation(*this).Lower();
103 void Window::Activate()
105 GetImplementation(*this).Activate();
108 void Window::AddAvailableOrientation( WindowOrientation orientation )
110 GetImplementation(*this).AddAvailableOrientation( orientation );
113 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
115 GetImplementation(*this).RemoveAvailableOrientation( orientation );
118 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
120 GetImplementation(*this).SetPreferredOrientation( orientation );
123 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
125 return GetImplementation(*this).GetPreferredOrientation();
128 DragAndDropDetector Window::GetDragAndDropDetector() const
130 return GetImplementation(*this).GetDragAndDropDetector();
133 Any Window::GetNativeHandle() const
135 return GetImplementation(*this).GetNativeHandle();
138 Window::FocusSignalType& Window::FocusChangedSignal()
140 return GetImplementation(*this).FocusChangedSignal();
143 void Window::SetAcceptFocus( bool accept )
145 GetImplementation(*this).SetAcceptFocus( accept );
148 bool Window::IsFocusAcceptable() const
150 return GetImplementation(*this).IsFocusAcceptable();
155 GetImplementation(*this).Show();
160 GetImplementation(*this).Hide();
163 bool Window::IsVisible() const
165 return GetImplementation(*this).IsVisible();
168 unsigned int Window::GetSupportedAuxiliaryHintCount() const
170 return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
173 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
175 return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
178 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
180 return GetImplementation(*this).AddAuxiliaryHint( hint, value );
183 bool Window::RemoveAuxiliaryHint( unsigned int id )
185 return GetImplementation(*this).RemoveAuxiliaryHint( id );
188 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
190 return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
193 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
195 return GetImplementation(*this).GetAuxiliaryHintValue( id );
198 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
200 return GetImplementation(*this).GetAuxiliaryHintId( hint );
203 void Window::SetInputRegion( const Rect< int >& inputRegion )
205 return GetImplementation(*this).SetInputRegion( inputRegion );
208 void Window::SetType( Window::Type type )
210 GetImplementation(*this).SetType( type );
213 Window::Type Window::GetType() const
215 return GetImplementation(*this).GetType();
218 bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
220 return GetImplementation(*this).SetNotificationLevel( level );
223 Window::NotificationLevel::Type Window::GetNotificationLevel() const
225 return GetImplementation(*this).GetNotificationLevel();
228 void Window::SetOpaqueState( bool opaque )
230 GetImplementation(*this).SetOpaqueState( opaque );
233 bool Window::IsOpaqueState() const
235 return GetImplementation(*this).IsOpaqueState();
238 bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
240 return GetImplementation(*this).SetScreenOffMode(screenMode);
243 Window::ScreenOffMode::Type Window::GetScreenOffMode() const
245 return GetImplementation(*this).GetScreenOffMode();
248 bool Window::SetBrightness( int brightness )
250 return GetImplementation(*this).SetBrightness( brightness );
253 int Window::GetBrightness() const
255 return GetImplementation(*this).GetBrightness();
258 Window::ResizedSignalType& Window::ResizedSignal()
260 return GetImplementation(*this).ResizedSignal();
263 void Window::SetSize( Window::WindowSize size )
265 GetImplementation(*this).SetSize( size );
268 Window::WindowSize Window::GetSize() const
270 return GetImplementation(*this).GetSize();
273 void Window::SetPosition( Window::WindowPosition position )
275 GetImplementation(*this).SetPosition( position );
278 Window::WindowPosition Window::GetPosition() const
280 return GetImplementation(*this).GetPosition();
283 void Window::SetTransparency( bool transparent )
285 GetImplementation(*this).SetTransparency( transparent );
288 Window::Window( Internal::Adaptor::Window* window )
289 : BaseHandle( window )