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 GetImplementation(*this).ShowIndicator( visibleMode );
65 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
67 return GetImplementation(*this).IndicatorVisibilityChangedSignal();
70 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
72 GetImplementation(*this).SetIndicatorBgOpacity( opacity );
75 void Window::RotateIndicator( WindowOrientation orientation )
77 GetImplementation(*this).RotateIndicator( orientation );
80 void Window::SetClass( std::string name, std::string klass )
82 GetImplementation(*this).SetClass( name, klass );
87 GetImplementation(*this).Raise();
92 GetImplementation(*this).Lower();
95 void Window::Activate()
97 GetImplementation(*this).Activate();
100 void Window::AddAvailableOrientation( WindowOrientation orientation )
102 GetImplementation(*this).AddAvailableOrientation( orientation );
105 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
107 GetImplementation(*this).RemoveAvailableOrientation( orientation );
110 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
112 GetImplementation(*this).SetPreferredOrientation( orientation );
115 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
117 return GetImplementation(*this).GetPreferredOrientation();
120 DragAndDropDetector Window::GetDragAndDropDetector() const
122 return GetImplementation(*this).GetDragAndDropDetector();
125 Any Window::GetNativeHandle() const
127 return GetImplementation(*this).GetNativeHandle();
130 Window::FocusSignalType& Window::FocusChangedSignal()
132 return GetImplementation(*this).FocusChangedSignal();
135 void Window::SetAcceptFocus( bool accept )
137 GetImplementation(*this).SetAcceptFocus( accept );
140 bool Window::IsFocusAcceptable() const
142 return GetImplementation(*this).IsFocusAcceptable();
147 GetImplementation(*this).Show();
152 GetImplementation(*this).Hide();
155 bool Window::IsVisible() const
157 return GetImplementation(*this).IsVisible();
160 unsigned int Window::GetSupportedAuxiliaryHintCount() const
162 return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
165 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
167 return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
170 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
172 return GetImplementation(*this).AddAuxiliaryHint( hint, value );
175 bool Window::RemoveAuxiliaryHint( unsigned int id )
177 return GetImplementation(*this).RemoveAuxiliaryHint( id );
180 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
182 return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
185 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
187 return GetImplementation(*this).GetAuxiliaryHintValue( id );
190 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
192 return GetImplementation(*this).GetAuxiliaryHintId( hint );
195 void Window::SetInputRegion( const Rect< int >& inputRegion )
197 return GetImplementation(*this).SetInputRegion( inputRegion );
200 void Window::SetType( Window::Type type )
202 GetImplementation(*this).SetType( type );
205 Window::Type Window::GetType() const
207 return GetImplementation(*this).GetType();
210 bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
212 return GetImplementation(*this).SetNotificationLevel( level );
215 Window::NotificationLevel::Type Window::GetNotificationLevel() const
217 return GetImplementation(*this).GetNotificationLevel();
220 void Window::SetOpaqueState( bool opaque )
222 GetImplementation(*this).SetOpaqueState( opaque );
225 bool Window::IsOpaqueState() const
227 return GetImplementation(*this).IsOpaqueState();
230 bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
232 return GetImplementation(*this).SetScreenOffMode(screenMode);
235 Window::ScreenOffMode::Type Window::GetScreenOffMode() const
237 return GetImplementation(*this).GetScreenOffMode();
240 bool Window::SetBrightness( int brightness )
242 return GetImplementation(*this).SetBrightness( brightness );
245 int Window::GetBrightness() const
247 return GetImplementation(*this).GetBrightness();
250 Window::ResizedSignalType& Window::ResizedSignal()
252 return GetImplementation(*this).ResizedSignal();
255 void Window::SetSize( Window::WindowSize size )
257 GetImplementation(*this).SetSize( size );
260 Window::WindowSize Window::GetSize() const
262 return GetImplementation(*this).GetSize();
265 void Window::SetPosition( Window::WindowPosition position )
267 GetImplementation(*this).SetPosition( position );
270 Window::WindowPosition Window::GetPosition() const
272 return GetImplementation(*this).GetPosition();
275 void Window::SetTransparency( bool transparent )
277 GetImplementation(*this).SetTransparency( transparent );
280 Window::Window( Internal::Adaptor::Window* window )
281 : BaseHandle( window )