Merge "Support scroll in web engine." into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / macos / window-base-mac.h
1 #pragma once
2
3 /*
4  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 // INTERNAL INCLUDES
21 #include <dali/internal/window-system/common/window-base.h>
22 #include <memory>
23
24 namespace Dali::Internal::Adaptor
25 {
26
27 /**
28  * WindowBaseCocoa class provides an WindowBase Win32 implementation.
29  */
30 class WindowBaseCocoa : public WindowBase
31 {
32 public:
33
34   struct Impl;
35
36   /**
37    * @brief Constructor
38    */
39   WindowBaseCocoa( PositionSize positionSize, Any surface, bool isTransparent );
40
41   /**
42    * @brief Destructor
43    */
44   ~WindowBaseCocoa();
45
46 public:
47
48   /**
49    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
50    */
51   Any GetNativeWindow() override;
52
53   /**
54    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
55    */
56   int GetNativeWindowId() override;
57
58   /**
59   * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
60    */
61   EGLNativeWindowType CreateEglWindow( int width, int height ) override;
62
63   /**
64    * @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
65    */
66   void DestroyEglWindow() override;
67
68   /**
69    * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
70    */
71   void SetEglWindowRotation( int angle ) override;
72
73   /**
74    * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
75    */
76   void SetEglWindowBufferTransform( int angle ) override;
77
78   /**
79    * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
80    */
81   void SetEglWindowTransform( int angle ) override;
82
83   /**
84    * @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
85    */
86   void ResizeEglWindow( PositionSize positionSize ) override;
87
88   /**
89    * @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
90    */
91   bool IsEglWindowRotationSupported() override;
92
93   /**
94    * @copydoc Dali::Internal::Adaptor::WindowBase::Move()
95    */
96   void Move( PositionSize positionSize ) override;
97
98   /**
99    * @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
100    */
101   void Resize( PositionSize positionSize ) override;
102
103   /**
104    * @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
105    */
106   void MoveResize( PositionSize positionSize ) override;
107
108   /**
109    * @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
110    */
111   void SetClass( const std::string& name, const std::string& className ) override;
112
113   /**
114    * @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
115    */
116   void Raise() override;
117
118   /**
119    * @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
120    */
121   void Lower() override;
122
123   /**
124    * @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
125    */
126   void Activate() override;
127
128   /**
129    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
130    */
131   void SetAvailableAnlges( const std::vector< int >& angles ) override;
132
133   /**
134    * @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
135    */
136   void SetPreferredAngle( int angle ) override;
137
138   /**
139    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
140    */
141   void SetAcceptFocus( bool accept ) override;
142
143   /**
144    * @copydoc Dali::Internal::Adaptor::WindowBase::Show()
145    */
146   void Show() override;
147
148   /**
149    * @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
150    */
151   void Hide() override;
152
153   /**
154    * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
155    */
156   unsigned int GetSupportedAuxiliaryHintCount() const override;
157
158   /**
159    * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
160    */
161   std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
162
163   /**
164    * @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
165    */
166   unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
167
168   /**
169    * @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
170    */
171   bool RemoveAuxiliaryHint( unsigned int id ) override;
172
173   /**
174    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
175    */
176   bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
177
178   /**
179    * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
180    */
181   std::string GetAuxiliaryHintValue( unsigned int id ) const override;
182
183   /**
184    * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
185    */
186   unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
187
188   /**
189    * @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
190    */
191   void SetInputRegion( const Rect< int >& inputRegion ) override;
192
193   /**
194    * @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
195    */
196   void SetType( Dali::WindowType type ) override;
197
198   /**
199    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
200    */
201   bool SetNotificationLevel( WindowNotificationLevel level ) override;
202
203   /**
204    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
205    */
206   WindowNotificationLevel GetNotificationLevel() const override;
207
208   /**
209    * @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
210    */
211   void SetOpaqueState( bool opaque ) override;
212
213   /**
214    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
215    */
216   bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
217
218   /**
219    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
220    */
221   WindowScreenOffMode GetScreenOffMode() const override;
222
223   /**
224    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
225    */
226   bool SetBrightness( int brightness ) override;
227
228   /**
229    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
230    */
231   int GetBrightness() const override;
232
233   /**
234    * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
235    */
236   bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
237
238   /**
239    * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
240    */
241   bool UngrabKey( Dali::KEY key ) override;
242
243   /**
244    * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
245    */
246   bool GrabKeyList(
247     const Dali::Vector< Dali::KEY >& key,
248     const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode,
249     Dali::Vector< bool >& result
250   ) override;
251
252   /**
253    * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
254    */
255   bool UngrabKeyList(
256     const Dali::Vector< Dali::KEY >& key,
257     Dali::Vector< bool >& result
258   ) override;
259
260   /**
261    * @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
262    */
263   void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
264
265   /**
266    * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
267    */
268   int GetOrientation() const override;
269
270   /**
271    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
272    */
273   int GetScreenRotationAngle() override;
274
275   /**
276    * @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
277    */
278   void SetWindowRotationAngle( int degree ) override;
279
280   /**
281    * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
282    */
283   void WindowRotationCompleted( int degree, int width, int height ) override;
284
285   /**
286    * @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
287    */
288   void SetTransparency( bool transparent ) override;
289
290   /**
291    * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
292    */
293   void SetParent( WindowBase* parentWinBase ) override;
294
295   /**
296    * @copydoc  Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
297    */
298   int CreateFrameRenderedSyncFence() override;
299
300   /**
301    * @copydoc  Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
302    */
303   int CreateFramePresentedSyncFence() override;
304
305 private:
306
307   // Undefined
308   WindowBaseCocoa(const WindowBaseCocoa &) = delete;
309
310   // Undefined
311   WindowBaseCocoa& operator=(const WindowBaseCocoa& rhs) = delete;
312
313 private:
314   std::unique_ptr<Impl> mImpl;
315 };
316
317 } // namespace Dali::Internal::Adaptor