Add Window::SetLayout method
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / macos / window-base-mac.h
1 #pragma once
2
3 /*
4  * Copyright (c) 2022 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  * WindowBaseCocoa class provides an WindowBase Win32 implementation.
28  */
29 class WindowBaseCocoa : public WindowBase
30 {
31 public:
32   struct Impl;
33
34   /**
35    * @brief Constructor
36    */
37   WindowBaseCocoa(PositionSize positionSize, Any surface, bool isTransparent);
38
39   /**
40    * @brief Destructor
41    */
42   ~WindowBaseCocoa();
43
44 public:
45   /**
46    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
47    */
48   Any GetNativeWindow() override;
49
50   /**
51    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
52    */
53   int GetNativeWindowId() override;
54
55   /**
56    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowResourceId()
57    */
58   std::string GetNativeWindowResourceId() override;
59
60   /**
61   * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
62    */
63   EGLNativeWindowType CreateEglWindow(int width, int height) override;
64
65   /**
66    * @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
67    */
68   void DestroyEglWindow() override;
69
70   /**
71    * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
72    */
73   void SetEglWindowRotation(int angle) override;
74
75   /**
76    * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
77    */
78   void SetEglWindowBufferTransform(int angle) override;
79
80   /**
81    * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
82    */
83   void SetEglWindowTransform(int angle) override;
84
85   /**
86    * @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
87    */
88   void ResizeEglWindow(PositionSize positionSize) override;
89
90   /**
91    * @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
92    */
93   bool IsEglWindowRotationSupported() override;
94
95   /**
96    * @copydoc Dali::Internal::Adaptor::WindowBase::Move()
97    */
98   void Move(PositionSize positionSize) override;
99
100   /**
101    * @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
102    */
103   void Resize(PositionSize positionSize) override;
104
105   /**
106    * @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
107    */
108   void MoveResize(PositionSize positionSize) override;
109
110  /**
111    * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
112    */
113   void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
114
115   /**
116    * @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
117    */
118   void SetClass(const std::string& name, const std::string& className) override;
119
120   /**
121    * @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
122    */
123   void Raise() override;
124
125   /**
126    * @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
127    */
128   void Lower() override;
129
130   /**
131    * @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
132    */
133   void Activate() override;
134
135   /**
136    * @copydoc Dali::Internal::Adaptor::WindowBase::Maximize()
137    */
138   void Maximize(bool maximize) override;
139
140   /**
141    * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
142    */
143   bool IsMaximized() const override;
144
145   /**
146    * @copydoc Dali::Internal::Adaptor::WindowBase::SetMaximumSize()
147    */
148   void SetMaximumSize(Dali::Window::WindowSize size) override;
149
150   /**
151    * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
152    */
153   void Minimize(bool minimize) override;
154
155   /**
156    * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
157    */
158   bool IsMinimized() const override;
159
160   /**
161    * @copydoc Dali::Internal::Adaptor::WindowBase::SetMimimumSize()
162    */
163   void SetMimimumSize(Dali::Window::WindowSize size) override;
164
165   /**
166    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
167    */
168   void SetAvailableAnlges(const std::vector<int>& angles) override;
169
170   /**
171    * @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
172    */
173   void SetPreferredAngle(int angle) override;
174
175   /**
176    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
177    */
178   void SetAcceptFocus(bool accept) override;
179
180   /**
181    * @copydoc Dali::Internal::Adaptor::WindowBase::Show()
182    */
183   void Show() override;
184
185   /**
186    * @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
187    */
188   void Hide() override;
189
190   /**
191    * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
192    */
193   unsigned int GetSupportedAuxiliaryHintCount() const override;
194
195   /**
196    * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
197    */
198   std::string GetSupportedAuxiliaryHint(unsigned int index) const override;
199
200   /**
201    * @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
202    */
203   unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value) override;
204
205   /**
206    * @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
207    */
208   bool RemoveAuxiliaryHint(unsigned int id) override;
209
210   /**
211    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
212    */
213   bool SetAuxiliaryHintValue(unsigned int id, const std::string& value) override;
214
215   /**
216    * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
217    */
218   std::string GetAuxiliaryHintValue(unsigned int id) const override;
219
220   /**
221    * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
222    */
223   unsigned int GetAuxiliaryHintId(const std::string& hint) const override;
224
225   /**
226    * @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
227    */
228   void SetInputRegion(const Rect<int>& inputRegion) override;
229
230   /**
231    * @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
232    */
233   void SetType(Dali::WindowType type) override;
234
235   /**
236    * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
237    */
238   Dali::WindowType GetType() const override;
239
240   /**
241    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
242    */
243   WindowOperationResult SetNotificationLevel(WindowNotificationLevel level) override;
244
245   /**
246    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
247    */
248   WindowNotificationLevel GetNotificationLevel() const override;
249
250   /**
251    * @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
252    */
253   void SetOpaqueState(bool opaque) override;
254
255   /**
256    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
257    */
258   WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
259
260   /**
261    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
262    */
263   WindowScreenOffMode GetScreenOffMode() const override;
264
265   /**
266    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
267    */
268   WindowOperationResult SetBrightness(int brightness) override;
269
270   /**
271    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
272    */
273   int GetBrightness() const override;
274
275   /**
276    * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
277    */
278   bool GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode) override;
279
280   /**
281    * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
282    */
283   bool UngrabKey(Dali::KEY key) override;
284
285   /**
286    * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
287    */
288   bool GrabKeyList(
289     const Dali::Vector<Dali::KEY>&            key,
290     const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode,
291     Dali::Vector<bool>&                       result) override;
292
293   /**
294    * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
295    */
296   bool UngrabKeyList(
297     const Dali::Vector<Dali::KEY>& key,
298     Dali::Vector<bool>&            result) override;
299
300   /**
301    * @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
302    */
303   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
304
305   /**
306    * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
307    */
308   int GetWindowRotationAngle() const override;
309
310   /**
311    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
312    */
313   int GetScreenRotationAngle() override;
314
315   /**
316    * @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
317    */
318   void SetWindowRotationAngle(int degree) override;
319
320   /**
321    * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
322    */
323   void WindowRotationCompleted(int degree, int width, int height) override;
324
325   /**
326    * @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
327    */
328   void SetTransparency(bool transparent) override;
329
330   /**
331    * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
332    */
333   void SetParent(WindowBase* parentWinBase, bool belowParent) override;
334
335   /**
336    * @copydoc  Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
337    */
338   int CreateFrameRenderedSyncFence() override;
339
340   /**
341    * @copydoc  Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
342    */
343   int CreateFramePresentedSyncFence() override;
344
345   /**
346    * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
347    */
348   void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
349
350   /**
351    * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
352    */
353   void InitializeIme() override;
354
355   /**
356    * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
357    */
358   void ImeWindowReadyToRender() override;
359
360   /**
361    * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
362    */
363   void RequestMoveToServer() override;
364
365   /**
366    * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
367    */
368   void RequestResizeToServer(WindowResizeDirection direction) override;
369
370   /**
371    * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
372    */
373   void EnableFloatingMode(bool enable) override;
374
375   /**
376    * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
377    */
378   bool IsFloatingModeEnabled() const override;
379
380   /**
381    * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
382    */
383   void IncludeInputRegion(const Rect<int>& inputRegion) override;
384
385   /**
386    * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
387    */
388   void ExcludeInputRegion(const Rect<int>& inputRegion) override;
389
390 private:
391   // Undefined
392   WindowBaseCocoa(const WindowBaseCocoa&) = delete;
393
394   // Undefined
395   WindowBaseCocoa& operator=(const WindowBaseCocoa& rhs) = delete;
396
397 private:
398   std::unique_ptr<Impl> mImpl;
399 };
400
401 } // namespace Dali::Internal::Adaptor