Merge "Add window focus API and signals" into devel/master
[platform/core/uifw/dali-adaptor.git] / adaptors / 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 <window.h>
20
21 // INTERNAL INCLUDES
22 #include <window-impl.h>
23 #include <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   GetImplementation(*this).ShowIndicator( visibleMode );
62 }
63
64 Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
65 {
66   return GetImplementation(*this).IndicatorVisibilityChangedSignal();
67 }
68
69 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
70 {
71   GetImplementation(*this).SetIndicatorBgOpacity( opacity );
72 }
73
74 void Window::RotateIndicator( WindowOrientation orientation )
75 {
76   GetImplementation(*this).RotateIndicator( orientation );
77 }
78
79 void Window::SetClass( std::string name, std::string klass )
80 {
81   GetImplementation(*this).SetClass( name, klass );
82 }
83
84 void Window::Raise()
85 {
86   GetImplementation(*this).Raise();
87 }
88
89 void Window::Lower()
90 {
91   GetImplementation(*this).Lower();
92 }
93
94 void Window::Activate()
95 {
96   GetImplementation(*this).Activate();
97 }
98
99 void Window::AddAvailableOrientation( WindowOrientation orientation )
100 {
101   GetImplementation(*this).AddAvailableOrientation( orientation );
102 }
103
104 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
105 {
106   GetImplementation(*this).RemoveAvailableOrientation( orientation );
107 }
108
109 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
110 {
111   GetImplementation(*this).SetPreferredOrientation( orientation );
112 }
113
114 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
115 {
116   return GetImplementation(*this).GetPreferredOrientation();
117 }
118
119 DragAndDropDetector Window::GetDragAndDropDetector() const
120 {
121   return GetImplementation(*this).GetDragAndDropDetector();
122 }
123
124 Any Window::GetNativeHandle() const
125 {
126   return GetImplementation(*this).GetNativeHandle();
127 }
128
129 Window::Window( Internal::Adaptor::Window* window )
130 : BaseHandle( window )
131 {
132 }
133
134 } // namespace Dali