[dali_1.0.5] Merge branch 'tizen'
[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 Window& Window::operator=(BaseHandle::NullType* rhs)
54 {
55   DALI_ASSERT_ALWAYS( (rhs == NULL) && "Can only assign NULL pointer to handle");
56   Reset();
57   return *this;
58 }
59
60 void Window::SetIndicatorStyle( IndicatorStyle style )
61 {
62   GetImplementation(*this).SetIndicatorStyle( style );
63 }
64
65 void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
66 {
67   GetImplementation(*this).ShowIndicator( visibleMode );
68 }
69
70 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
71 {
72   GetImplementation(*this).SetIndicatorBgOpacity( opacity );
73 }
74
75 void Window::RotateIndicator( WindowOrientation orientation )
76 {
77   GetImplementation(*this).RotateIndicator( orientation );
78 }
79
80 void Window::SetClass( std::string name, std::string klass )
81 {
82   GetImplementation(*this).SetClass( name, klass );
83 }
84
85 void Window::Raise()
86 {
87   GetImplementation(*this).Raise();
88 }
89
90 void Window::Lower()
91 {
92   GetImplementation(*this).Lower();
93 }
94
95 void Window::Activate()
96 {
97   GetImplementation(*this).Activate();
98 }
99
100 Orientation Window::GetOrientation()
101 {
102   Internal::Adaptor::OrientationPtr orientation = GetImplementation(*this).GetOrientation();
103   return Orientation(orientation.Get());
104 }
105
106 void Window::AddAvailableOrientation( WindowOrientation orientation )
107 {
108   GetImplementation(*this).AddAvailableOrientation( orientation );
109 }
110
111 void Window::RemoveAvailableOrientation( WindowOrientation orientation )
112 {
113   GetImplementation(*this).RemoveAvailableOrientation( orientation );
114 }
115
116 void Window::SetAvailableOrientations(const std::vector<Dali::Window::WindowOrientation>& orientations)
117 {
118   GetImplementation(*this).SetAvailableOrientations( orientations );
119 }
120
121 const std::vector<Dali::Window::WindowOrientation>& Window::GetAvailableOrientations()
122 {
123   return GetImplementation(*this).GetAvailableOrientations();
124 }
125
126 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
127 {
128   GetImplementation(*this).SetPreferredOrientation( orientation );
129 }
130
131 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
132 {
133   return GetImplementation(*this).GetPreferredOrientation();
134 }
135
136 DragAndDropDetector Window::GetDragAndDropDetector() const
137 {
138   return GetImplementation(*this).GetDragAndDropDetector();
139 }
140
141 Window::Window( Internal::Adaptor::Window* window )
142 : BaseHandle( window )
143 {
144 }
145
146 } // namespace Dali