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 GetImplementation(*this).ShowIndicator( visibleMode );
64 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
66 return GetImplementation(*this).IndicatorVisibilityChangedSignal();
69 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
71 GetImplementation(*this).SetIndicatorBgOpacity( opacity );
74 void Window::RotateIndicator( WindowOrientation orientation )
76 GetImplementation(*this).RotateIndicator( orientation );
79 void Window::SetClass( std::string name, std::string klass )
81 GetImplementation(*this).SetClass( name, klass );
86 GetImplementation(*this).Raise();
91 GetImplementation(*this).Lower();
94 void Window::Activate()
96 GetImplementation(*this).Activate();
99 void Window::AddAvailableOrientation( WindowOrientation orientation )
101 GetImplementation(*this).AddAvailableOrientation( orientation );
104 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
106 GetImplementation(*this).RemoveAvailableOrientation( orientation );
109 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
111 GetImplementation(*this).SetPreferredOrientation( orientation );
114 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
116 return GetImplementation(*this).GetPreferredOrientation();
119 DragAndDropDetector Window::GetDragAndDropDetector() const
121 return GetImplementation(*this).GetDragAndDropDetector();
124 Any Window::GetNativeHandle() const
126 return GetImplementation(*this).GetNativeHandle();
129 Window::FocusSignalType& Window::FocusChangedSignal()
131 return GetImplementation(*this).FocusChangedSignal();
134 void Window::SetAcceptFocus( bool accept )
136 GetImplementation(*this).SetAcceptFocus( accept );
139 bool Window::IsFocusAcceptable() const
141 return GetImplementation(*this).IsFocusAcceptable();
146 GetImplementation(*this).Show();
151 GetImplementation(*this).Hide();
154 bool Window::IsVisible() const
156 return GetImplementation(*this).IsVisible();
159 unsigned int Window::GetSupportedAuxiliaryHintCount() const
161 return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
164 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
166 return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
169 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
171 return GetImplementation(*this).AddAuxiliaryHint( hint, value );
174 bool Window::RemoveAuxiliaryHint( unsigned int id )
176 return GetImplementation(*this).RemoveAuxiliaryHint( id );
179 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
181 return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
184 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
186 return GetImplementation(*this).GetAuxiliaryHintValue( id );
189 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
191 return GetImplementation(*this).GetAuxiliaryHintId( hint );
194 void Window::SetInputRegion( const Rect< int >& inputRegion )
196 return GetImplementation(*this).SetInputRegion( inputRegion );
199 void Window::SetType( Window::Type type )
201 GetImplementation(*this).SetType( type );
204 Window::Type Window::GetType() const
206 return GetImplementation(*this).GetType();
209 bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
211 return GetImplementation(*this).SetNotificationLevel( level );
214 Window::NotificationLevel::Type Window::GetNotificationLevel() const
216 return GetImplementation(*this).GetNotificationLevel();
219 void Window::SetOpaqueState( bool opaque )
221 GetImplementation(*this).SetOpaqueState( opaque );
224 bool Window::IsOpaqueState() const
226 return GetImplementation(*this).IsOpaqueState();
229 bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
231 return GetImplementation(*this).SetScreenOffMode(screenMode);
234 Window::ScreenOffMode::Type Window::GetScreenOffMode() const
236 return GetImplementation(*this).GetScreenOffMode();
239 bool Window::SetBrightness( int brightness )
241 return GetImplementation(*this).SetBrightness( brightness );
244 int Window::GetBrightness() const
246 return GetImplementation(*this).GetBrightness();
249 Window::ResizedSignalType& Window::ResizedSignal()
251 return GetImplementation(*this).ResizedSignal();
254 void Window::SetSize( Window::WindowSize size )
256 GetImplementation(*this).SetSize( size );
259 Window::WindowSize Window::GetSize() const
261 return GetImplementation(*this).GetSize();
264 void Window::SetPosition( Window::WindowPosition position )
266 GetImplementation(*this).SetPosition( position );
269 Window::WindowPosition Window::GetPosition() const
271 return GetImplementation(*this).GetPosition();
274 void Window::SetTransparency( bool transparent )
276 GetImplementation(*this).SetTransparency( transparent );
279 Window::Window( Internal::Adaptor::Window* window )
280 : BaseHandle( window )