Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-adaptor.git] / adaptors / public-api / adaptor-framework / window.cpp
1 /*
2  * Copyright (c) 2014 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()
35 {
36 }
37
38 Window::~Window()
39 {
40 }
41
42 Window::Window(const Window& handle)
43 : BaseHandle(handle)
44 {
45 }
46
47 Window& Window::operator=(const Window& rhs)
48 {
49   BaseHandle::operator=(rhs);
50   return *this;
51 }
52
53 void Window::SetIndicatorStyle( IndicatorStyle style )
54 {
55   GetImplementation(*this).SetIndicatorStyle( style );
56 }
57
58 void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
59 {
60   GetImplementation(*this).ShowIndicator( visibleMode );
61 }
62
63 Window::IndicatorSignalV2& Window::IndicatorVisibilityChangedSignal()
64 {
65   return GetImplementation(*this).IndicatorVisibilityChangedSignal();
66 }
67
68 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
69 {
70   GetImplementation(*this).SetIndicatorBgOpacity( opacity );
71 }
72
73 void Window::RotateIndicator( WindowOrientation orientation )
74 {
75   GetImplementation(*this).RotateIndicator( orientation );
76 }
77
78 void Window::SetClass( std::string name, std::string klass )
79 {
80   GetImplementation(*this).SetClass( name, klass );
81 }
82
83 void Window::Raise()
84 {
85   GetImplementation(*this).Raise();
86 }
87
88 void Window::Lower()
89 {
90   GetImplementation(*this).Lower();
91 }
92
93 void Window::Activate()
94 {
95   GetImplementation(*this).Activate();
96 }
97
98 Orientation Window::GetOrientation()
99 {
100   Internal::Adaptor::OrientationPtr orientation = GetImplementation(*this).GetOrientation();
101   return Orientation(orientation.Get());
102 }
103
104 void Window::AddAvailableOrientation( WindowOrientation orientation )
105 {
106   GetImplementation(*this).AddAvailableOrientation( orientation );
107 }
108
109 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
110 {
111   GetImplementation(*this).RemoveAvailableOrientation( orientation );
112 }
113
114 void Window::SetAvailableOrientations(const std::vector<Dali::Window::WindowOrientation>& orientations)
115 {
116   GetImplementation(*this).SetAvailableOrientations( orientations );
117 }
118
119 const std::vector<Dali::Window::WindowOrientation>& Window::GetAvailableOrientations()
120 {
121   return GetImplementation(*this).GetAvailableOrientations();
122 }
123
124 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
125 {
126   GetImplementation(*this).SetPreferredOrientation( orientation );
127 }
128
129 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
130 {
131   return GetImplementation(*this).GetPreferredOrientation();
132 }
133
134 DragAndDropDetector Window::GetDragAndDropDetector() const
135 {
136   return GetImplementation(*this).GetDragAndDropDetector();
137 }
138
139 Any Window::GetNativeHandle() const
140 {
141   return GetImplementation(*this).GetNativeHandle();
142 }
143
144 Window::Window( Internal::Adaptor::Window* window )
145 : BaseHandle( window )
146 {
147 }
148
149 } // namespace Dali