Merge "Added UIThreadLoader to GLIB framework" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.h
1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/actors/layer.h>
23 #include <dali/public-api/adaptor-framework/window-enumerations.h>
24 #include <dali/public-api/events/touch-event.h>
25 #include <dali/public-api/object/base-object.h>
26 #include <dali/public-api/object/property-array.h>
27 #include <dali/public-api/object/ref-object.h>
28
29 // INTERNAL INCLUDES
30 #include <dali/devel-api/adaptor-framework/window-devel.h>
31 #include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
32 #include <dali/internal/adaptor/common/adaptor-impl.h>
33 #include <dali/internal/window-system/common/event-handler.h>
34 #include <dali/public-api/adaptor-framework/key-grab.h>
35 #include <dali/public-api/adaptor-framework/window.h>
36
37 namespace Dali
38 {
39 class Adaptor;
40 class Actor;
41 class RenderSurfaceInterface;
42
43 namespace Internal
44 {
45 namespace Adaptor
46 {
47 class Orientation;
48 class WindowRenderSurface;
49 class WindowBase;
50
51 class Window;
52 using WindowPtr             = IntrusivePtr<Window>;
53 using OrientationPtr        = IntrusivePtr<Orientation>;
54 using MouseInOutEventPtr    = IntrusivePtr<Dali::DevelWindow::MouseInOutEvent>;
55 using MouseRelativeEventPtr = IntrusivePtr<Dali::DevelWindow::MouseRelativeEvent>;
56 using EventHandlerPtr       = IntrusivePtr<EventHandler>;
57
58 /**
59  * Window provides a surface to render onto with orientation & indicator properties.
60  */
61 class Window : public Dali::Internal::Adaptor::SceneHolder, public EventHandler::Observer, public ConnectionTracker
62 {
63 public:
64   typedef Dali::Window::FocusChangeSignalType                        FocusChangeSignalType;
65   typedef Dali::Window::ResizeSignalType                             ResizeSignalType;
66   typedef Dali::DevelWindow::VisibilityChangedSignalType             VisibilityChangedSignalType;
67   typedef Dali::DevelWindow::TransitionEffectEventSignalType         TransitionEffectEventSignalType;
68   typedef Dali::DevelWindow::KeyboardRepeatSettingsChangedSignalType KeyboardRepeatSettingsChangedSignalType;
69   typedef Dali::DevelWindow::AuxiliaryMessageSignalType              AuxiliaryMessageSignalType;
70   typedef Dali::DevelWindow::AccessibilityHighlightSignalType        AccessibilityHighlightSignalType;
71   typedef Dali::DevelWindow::MovedSignalType                         MovedSignalType;
72   typedef Dali::DevelWindow::OrientationChangedSignalType            OrientationChangedSignalType;
73   typedef Dali::DevelWindow::MouseInOutEventSignalType               MouseInOutEventSignalType;
74   typedef Dali::DevelWindow::MouseRelativeEventSignalType            MouseRelativeEventSignalType;
75   typedef Dali::DevelWindow::MoveCompletedSignalType                 MoveCompletedSignalType;
76   typedef Dali::DevelWindow::ResizeCompletedSignalType               ResizeCompletedSignalType;
77   typedef Dali::DevelWindow::InsetsChangedSignalType                 InsetsChangedSignalType;
78   typedef Dali::DevelWindow::PointerConstraintsSignalType            PointerConstraintsSignalType;
79   typedef Signal<void()>                                             SignalType;
80
81   /**
82    * @brief Create a new Window. This should only be called once by the Application class
83    * @param[in] name The window title
84    * @param[in] className The window class name
85    * @param[in] windowData The window data
86    * @return A newly allocated Window
87    */
88   static Window* New(const std::string& name, const std::string& className, const WindowData& windowData);
89
90   /**
91    * @brief Create a new Window. This should only be called once by the Application class
92    * @param[in] surface The surface used to render on.
93    * @param[in] name The window title
94    * @param[in] className The window class name
95    * @param[in] windowData The window data
96    * @return A newly allocated Window
97    */
98   static Window* New(Any surface, const std::string& name, const std::string& className, const WindowData& windowData);
99
100   /**
101    * @copydoc Dali::Window::SetClass()
102    */
103   void SetClass(std::string name, std::string className);
104
105   /**
106    * @brief Gets the window class name.
107    * @return The class of the window
108    */
109   std::string GetClassName() const;
110
111   /**
112    * @copydoc Dali::Window::Raise()
113    */
114   void Raise();
115
116   /**
117    * @copydoc Dali::Window::Lower()
118    */
119   void Lower();
120
121   /**
122    * @copydoc Dali::Window::Activate()
123    */
124   void Activate();
125
126   /**
127    * @copydoc Dali::DevelWindow::Maximize()
128    */
129   void Maximize(bool maximize);
130
131   /**
132    * @copydoc Dali::DevelWindow::IsMaximized()
133    */
134   bool IsMaximized() const;
135
136   /**
137    * @copydoc Dali::DevelWindow::SetMaximumSize()
138    */
139   void SetMaximumSize(Dali::Window::WindowSize size);
140
141   /**
142    * @copydoc Dali::DevelWindow::Minimize()
143    */
144   void Minimize(bool minimize);
145
146   /**
147    * @copydoc Dali::DevelWindow::IsMinimized()
148    */
149   bool IsMinimized() const;
150
151   /**
152    * @copydoc Dali::DevelWindow::SetMimimumSize()
153    */
154   void SetMimimumSize(Dali::Window::WindowSize size);
155
156   /**
157    * @copydoc Dali::Window::GetLayerCount()
158    */
159   uint32_t GetLayerCount() const;
160
161   /**
162    * @copydoc Dali::Window::GetLayer()
163    */
164   Dali::Layer GetLayer(uint32_t depth) const;
165
166   /**
167    * @copydoc Dali::Window::KeepRendering()
168    */
169   void KeepRendering(float durationSeconds);
170
171   /**
172    * @copydoc Dali::Window::SetPartialUpdateEnabled()
173    */
174   void SetPartialUpdateEnabled(bool enabled);
175
176   /**
177    * @copydoc Dali::Window::IsPartialUpdateEnabled()
178    */
179   bool IsPartialUpdateEnabled() const;
180
181   /**
182    * @brief Get window resource ID assigned by window manager
183    * @return The resource ID of the window
184    */
185   std::string GetNativeResourceId() const;
186
187   /**
188    * @copydoc Dali::Window::AddAvailableOrientation()
189    */
190   void AddAvailableOrientation(WindowOrientation orientation);
191
192   /**
193    * @copydoc Dali::Window::RemoveAvailableOrientation()
194    */
195   void RemoveAvailableOrientation(WindowOrientation orientation);
196
197   /**
198    * @copydoc Dali::Window::SetPreferredOrientation()
199    */
200   void SetPreferredOrientation(WindowOrientation orientation);
201
202   /**
203    * @copydoc Dali::Window::GetPreferredOrientation()
204    */
205   WindowOrientation GetPreferredOrientation();
206
207   /**
208    * @copydoc Dali::Window::SetAcceptFocus()
209    */
210   void SetAcceptFocus(bool accept);
211
212   /**
213    * @copydoc Dali::Window::IsFocusAcceptable()
214    */
215   bool IsFocusAcceptable() const;
216
217   /**
218    * @copydoc Dali::Window::Show()
219    */
220   void Show();
221
222   /**
223    * @copydoc Dali::Window::Hide()
224    */
225   void Hide();
226
227   /**
228    * @copydoc Dali::Window::GetSupportedAuxiliaryHintCount()
229    */
230   unsigned int GetSupportedAuxiliaryHintCount() const;
231
232   /**
233    * @copydoc Dali::Window::GetSupportedAuxiliaryHint()
234    */
235   std::string GetSupportedAuxiliaryHint(unsigned int index) const;
236
237   /**
238    * @copydoc Dali::Window::AddAuxiliaryHint()
239    */
240   unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value);
241
242   /**
243    * @copydoc Dali::Window::RemoveAuxiliaryHint()
244    */
245   bool RemoveAuxiliaryHint(unsigned int id);
246
247   /**
248    * @copydoc Dali::Window::SetAuxiliaryHintValue()
249    */
250   bool SetAuxiliaryHintValue(unsigned int id, const std::string& value);
251
252   /**
253    * @copydoc Dali::Window::GetAuxiliaryHintValue()
254    */
255   std::string GetAuxiliaryHintValue(unsigned int id) const;
256
257   /**
258    * @copydoc Dali::Window::GetAuxiliaryHintId()
259    */
260   unsigned int GetAuxiliaryHintId(const std::string& hint) const;
261
262   /**
263    * @copydoc Dali::Window::SetInputRegion()
264    */
265   void SetInputRegion(const Rect<int>& inputRegion);
266
267   /**
268    * @copydoc Dali::Window::SetType()
269    */
270   void SetType(WindowType type);
271
272   /**
273    * @copydoc Dali::Window::GetType() const
274    */
275   WindowType GetType() const;
276
277   /**
278    * @copydoc Dali::Window::SetNotificationLevel()
279    */
280   WindowOperationResult SetNotificationLevel(WindowNotificationLevel level);
281
282   /**
283    * @copydoc Dali::Window::GetNotificationLevel()
284    */
285   WindowNotificationLevel GetNotificationLevel() const;
286
287   /**
288    * @copydoc Dali::Window::SetOpaqueState()
289    */
290   void SetOpaqueState(bool opaque);
291
292   /**
293    * @copydoc Dali::Window::IsOpaqueState()
294    */
295   bool IsOpaqueState() const;
296
297   /**
298    * @copydoc Dali::Window::SetScreenOffMode()
299    */
300   WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode);
301
302   /**
303    * @copydoc Dali::Window::GetScreenOffMode()
304    */
305   WindowScreenOffMode GetScreenOffMode() const;
306
307   /**
308    * @copydoc Dali::Window::SetBrightness()
309    */
310   WindowOperationResult SetBrightness(int brightness);
311
312   /**
313    * @copydoc Dali::Window::GetBrightness()
314    */
315   int GetBrightness() const;
316
317   /**
318    * @copydoc Dali::Window::SetSize()
319    */
320   void SetSize(Dali::Window::WindowSize size);
321
322   /**
323    * @copydoc Dali::Window::GetSize()
324    */
325   Dali::Window::WindowSize GetSize() const;
326
327   /**
328    * @copydoc Dali::Window::SetPosition()
329    */
330   void SetPosition(Dali::Window::WindowPosition position);
331
332   /**
333    * @copydoc Dali::Window::GetPosition()
334    */
335   Dali::Window::WindowPosition GetPosition() const;
336
337   /**
338    * @copydoc Dali::DevelWindow::SetPositionSize()
339    */
340   void SetPositionSize(PositionSize positionSize);
341
342   /**
343    * @copydoc Dali::DevelWindow::GetPositionSize()
344    */
345   PositionSize GetPositionSize() const;
346
347   /**
348    * @copydoc Dali::Window::SetLayout()
349    */
350   void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan);
351
352   /**
353    * @copydoc Dali::Window::GetRootLayer()
354    */
355   Dali::Layer GetRootLayer() const;
356
357   /**
358    * @copydoc Dali::Window::SetTransparency()
359    */
360   void SetTransparency(bool transparent);
361
362   /**
363    * @copydoc Dali::KeyGrab::GrabKey()
364    */
365   bool GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode);
366
367   /**
368    * @copydoc Dali::KeyGrab::UngrabKey()
369    */
370   bool UngrabKey(Dali::KEY key);
371
372   /**
373    * @copydoc Dali::KeyGrab::GrabKeyList()
374    */
375   bool GrabKeyList(const Dali::Vector<Dali::KEY>& key, const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode, Dali::Vector<bool>& result);
376
377   /**
378    * @copydoc Dali::KeyGrab::UngrabKeyList()
379    */
380   bool UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool>& result);
381
382   /**
383    * @copydoc Dali::DevelWindow::Get()
384    */
385   static Dali::Window Get(Dali::Actor actor);
386
387   /**
388    * @copydoc Dali::DevelWindow::SetParent(Window window, Window parent)
389    */
390   void SetParent(Dali::Window& parent);
391
392   /**
393    * @copydoc Dali::DevelWindow::SetParent(Window window, Window parent, bool belowParent)
394    */
395   void SetParent(Dali::Window& parent, bool belowParent);
396
397   /**
398    * @copydoc Dali::DevelWindow::Unparent()
399    */
400   void Unparent();
401
402   /**
403    * @copydoc Dali::DevelWindow::GetParent()
404    */
405   Dali::Window GetParent();
406
407   /**
408    * @copydoc Dali::DevelWindow::GetCurrentOrientation()
409    */
410   WindowOrientation GetCurrentOrientation() const;
411
412   /**
413    * @copydoc Dali::DevelWindow::GetPhysicalOrientation()
414    */
415   int GetPhysicalOrientation() const;
416
417   /**
418    * @copydoc Dali::DevelWindow::SetAvailableOrientations()
419    */
420   void SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations);
421
422   /**
423    * @copydoc Dali::DevelWindow::SetPositionSizeWithOrientation()
424    */
425   void SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation);
426
427   /**
428    * @brief Emit the accessibility highlight signal.
429    * The highlight indicates that it is an object to interact with the user regardless of focus.
430    * After setting the highlight on the object, you can do things that the object can do, such as
431    * giving or losing focus.
432    *
433    * @param[in] highlight If window needs to grab or clear highlight.
434    */
435   void EmitAccessibilityHighlightSignal(bool highlight);
436
437   /**
438    * @brief Sets the render notification trigger to call when render thread is completed a frame
439    *
440    * @param[in] renderNotification to use
441    */
442   void SetRenderNotification(TriggerEventInterface* renderNotification);
443
444 public: // Dali::Internal::Adaptor::SceneHolder
445   /**
446    * @copydoc Dali::Internal::Adaptor::SceneHolder::GetNativeHandle
447    */
448   Dali::Any GetNativeHandle() const override;
449
450   /**
451    * @copydoc Dali::Internal::Adaptor::SceneHolder::IsVisible
452    */
453   bool IsVisible() const override;
454
455   /**
456    * @copydoc Dali::DevelWindow::GetNativeId()
457    */
458   int32_t GetNativeId() const;
459
460   /**
461    * @copydoc Dali::DevelWindow::RequestMoveToServer()
462    */
463   void RequestMoveToServer();
464
465   /**
466    * @copydoc Dali::DevelWindow::RequestResizeToServer()
467    */
468   void RequestResizeToServer(WindowResizeDirection direction);
469
470   /**
471    * @copydoc Dali::DevelWindow::EnableFloatingMode()
472    */
473   void EnableFloatingMode(bool enable);
474
475   /**
476    * @copydoc Dali::DevelWindow::IsFloatingModeEnabled()
477    */
478   bool IsFloatingModeEnabled();
479
480   /**
481    * @copydoc Dali::DevelWindow::IncludeInputRegion()
482    */
483   void IncludeInputRegion(const Rect<int>& inputRegion);
484
485   /**
486    * @copydoc Dali::DevelWindow::ExcludeInputRegion()
487    */
488   void ExcludeInputRegion(const Rect<int>& inputRegion);
489
490   /**
491    * @copydoc Dali::DevelWindow::SetNeedsRotationCompletedAcknowledgement()
492    */
493   void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement);
494
495   /**
496    * @copydoc Dali::DevelWindow::SendRotationCompletedAcknowledgement()
497    */
498   void SendRotationCompletedAcknowledgement();
499
500   /**
501    * @copydoc Dali::DevelWindow::IsWindowRotating()
502    */
503   bool IsWindowRotating() const;
504
505   /**
506    * @copydoc Dali::DevelWindow::GetLastKeyEvent()
507    */
508   const Dali::KeyEvent& GetLastKeyEvent() const;
509
510   /**
511    * @copydoc Dali::DevelWindow::PointerConstraintsLock()
512    */
513   bool PointerConstraintsLock();
514
515   /**
516    * @copydoc Dali::DevelWindow::PointerConstraintsUnlock()
517    */
518   bool PointerConstraintsUnlock();
519
520   /**
521    * @copydoc Dali::DevelWindow::LockedPointerRegionSet()
522    */
523   void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height);
524
525   /**
526    * @copydoc Dali::DevelWindow::LockedPointerCursorPositionHintSet()
527    */
528   void LockedPointerCursorPositionHintSet(int32_t x, int32_t y);
529
530   /**
531    * @copydoc Dali::DevelWindow::PointerWarp()
532    */
533   bool PointerWarp(int32_t x, int32_t y);
534
535   /**
536    * @copydoc Dali::DevelWindow::CursorVisibleSet()
537    */
538   void CursorVisibleSet(bool visible);
539
540   /**
541    * @copydoc Dali::DevelWindow::KeyboardGrab()
542    */
543   bool KeyboardGrab(Device::Subclass::Type deviceSubclass);
544
545   /**
546    * @copydoc Dali::DevelWindow::KeyboardUnGrab()
547    */
548   bool KeyboardUnGrab();
549
550 private:
551   /**
552    * @brief Enumeration for orietation mode.
553    * The Orientation Mode is related to screen size.
554    * If screen width is longer than height, the Orientation Mode will have LANDSCAPE.
555    * Otherwise screen width is shorter than height or same, the Orientation Mode will have PORTRAIT.
556    */
557   enum class OrientationMode
558   {
559     PORTRAIT = 0,
560     LANDSCAPE
561   };
562
563   /**
564    * Private constructor.
565    * @sa Window::New()
566    */
567   Window();
568
569   /**
570    * Destructor
571    */
572   ~Window() override;
573
574   /**
575    * Second stage initialization
576    */
577   void Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, WindowType type);
578
579   /**
580    * Called when the window becomes iconified or deiconified.
581    */
582   void OnIconifyChanged(bool iconified);
583
584   /**
585    * Called when the window becomes maximized or unmaximized.
586    */
587   void OnMaximizeChanged(bool maximized);
588
589   /**
590    * Called when the window focus is changed.
591    */
592   void OnFocusChanged(bool focusIn);
593
594   /**
595    * Called when the output is transformed.
596    */
597   void OnOutputTransformed();
598
599   /**
600    * Called when the window receives a delete request.
601    */
602   void OnDeleteRequest();
603
604   /**
605    * Called when the window receives a Transition effect-start/end event.
606    */
607   void OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type);
608
609   /**
610    * @brief Called when window receives a keyboard repeat event.
611    */
612   void OnKeyboardRepeatSettingsChanged();
613
614   /**
615    * @brief Called when the window redraw is requested.
616    */
617   void OnWindowRedrawRequest();
618
619   /**
620    * @brief Called when the window's geometry data is changed by display server or client.
621    * It is based on configure noification event.
622    *
623    * @param[in] positionSize the updated window's position and size.
624    */
625   void OnUpdatePositionSize(Dali::PositionSize& positionSize);
626
627   /**
628    * @brief Called when display server sent the auxiliary message.
629    *
630    * @param[in] key the auxiliary message's key.
631    * @param[in] value the auxiliary message's value.
632    * @param[in] options the auxiliary message's options. This is the list of string.
633    */
634   void OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options);
635
636   /**
637    * @brief Called when Accessibility is enabled.
638    *
639    * This method is to register the window to accessibility bridge.
640    */
641   void OnAccessibilityEnabled();
642
643   /**
644    * @brief Called when Accessibility is disabled.
645    *
646    * This method is to remove the window from accessibility bridge.
647    */
648   void OnAccessibilityDisabled();
649
650   /**
651    * Called when the window rotation is finished.
652    *
653    * This signal is emmit when window rotation is finisehd and WindowRotationCompleted() is called.
654    */
655   void OnRotationFinished();
656
657   /**
658    * @brief Called when the mouse in or out event is received.
659    * @param[in] mouseInOutEvent the mouse event
660    */
661   void OnMouseInOutEvent(const Dali::DevelWindow::MouseInOutEvent& mouseInOutEvent);
662
663   /**
664    * @brief Called when the mouse relative event is received.
665    * @param[in] mouseRelativeEvent the mouse event
666    */
667   void OnMouseRelativeEvent(const Dali::DevelWindow::MouseRelativeEvent& mouseRelativeEvent);
668
669   /**
670    * @brief Called when the pointer is locked/unlocked
671    *
672    * @param[in] position The x, y coordinate relative to window where event happened
673    * @param[in] locked The status whether pointer is locked/unlocked
674    * @param[in] confined The status whether pointer is confined/unconfined
675    */
676   void OnPointerConstraints(const Dali::Int32Pair& position, bool locked, bool confined);
677
678   /**
679    * @brief Called when the window is moved by display server.
680    *
681    * @param[in] position the moved window's position.
682    */
683   void OnMoveCompleted(Dali::Window::WindowPosition& position);
684
685   /**
686    * @brief Called when the window is resized by display server.
687    *
688    * @param[in] positionSize the resized window's size.
689    */
690   void OnResizeCompleted(Dali::Window::WindowSize& size);
691
692   /**
693    * @brief Set available orientation to window base.
694    */
695   void SetAvailableAnlges(const std::vector<int>& angles);
696
697   /**
698    * @brief Convert from window orientation to angle using OrientationMode.
699    */
700   int ConvertToAngle(WindowOrientation orientation);
701
702   /**
703    * @brief Convert from angle to window orientation using OrientationMode.
704    */
705   WindowOrientation ConvertToOrientation(int angle) const;
706
707   /**
708    * @brief Check available window orientation for Available orientation.
709    */
710   bool IsOrientationAvailable(WindowOrientation orientation) const;
711
712   /**
713    * @brief Sets user geometry flag when window's geometry is changed.
714    * Window is created with screen size or not.
715    * If window is created with screen size or the geometry is changed by user,
716    * client should inform to server setting user.geometry flag
717    */
718   void SetUserGeometryPolicy();
719
720   /**
721    * @brief Called when window insets are changed by appearing or disappearing indicator, virtual keyboard, or clipboard.
722    *
723    * @param[in] partType the type of the part that occurs the window insets change.
724    * @param[in] partState the state of the part that occurs the window insets change.
725    * @param[in] insets the extents value of window insets.
726    */
727   void OnInsetsChanged(WindowInsetsPartType partType, WindowInsetsPartState partState, const Extents& insets);
728
729 private: // Dali::Internal::Adaptor::SceneHolder
730   /**
731    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet
732    */
733   void OnAdaptorSet(Dali::Adaptor& adaptor) override;
734
735   /**
736    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnSurfaceSet
737    */
738   void OnSurfaceSet(Dali::RenderSurfaceInterface* surface) override;
739
740   /**
741    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnPause
742    */
743   void OnPause() override;
744
745   /**
746    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnResume
747    */
748   void OnResume() override;
749
750   /**
751    * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculatePosition
752    */
753   Vector2 RecalculatePosition(const Vector2& position) override;
754
755 private: // Dali::Internal::Adaptor::EventHandler::Observer
756   /**
757    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnTouchPoint
758    */
759   void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
760
761   /**
762    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
763    */
764   void OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent) override;
765
766   /**
767    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnKeyEvent
768    */
769   void OnKeyEvent(Dali::Integration::KeyEvent& keyEvent) override;
770
771   /**
772    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnRotation
773    */
774   void OnRotation(const RotationEvent& rotation) override;
775
776 public: // Signals
777   /**
778    * @copydoc Dali::Window::FocusChangeSignal()
779    */
780   FocusChangeSignalType& FocusChangeSignal()
781   {
782     return mFocusChangeSignal;
783   }
784
785   /**
786    * @copydoc Dali::Window::ResizedSignal()
787    */
788   ResizeSignalType& ResizeSignal()
789   {
790     return mResizeSignal;
791   }
792
793   /**
794    * This signal is emitted when the window is requesting to be deleted
795    */
796   SignalType& DeleteRequestSignal()
797   {
798     return mDeleteRequestSignal;
799   }
800
801   /**
802    * @copydoc Dali::DevelWindow::VisibilityChangedSignal()
803    */
804   VisibilityChangedSignalType& VisibilityChangedSignal()
805   {
806     return mVisibilityChangedSignal;
807   }
808
809   /**
810    * @copydoc Dali::Window::SignalEventProcessingFinished()
811    */
812   Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal()
813   {
814     return mScene.EventProcessingFinishedSignal();
815   }
816
817   /**
818    * @copydoc Dali::DevelWindow::TransitionEffectEventSignal()
819    */
820   TransitionEffectEventSignalType& TransitionEffectEventSignal()
821   {
822     return mTransitionEffectEventSignal;
823   }
824
825   /**
826    * @copydoc Dali::DevelWindow::KeyboardRepeatSettingsChangedSignal()
827    */
828   KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal()
829   {
830     return mKeyboardRepeatSettingsChangedSignal;
831   }
832
833   /**
834    * @copydoc Dali::DevelWindow::AuxiliaryMessageSignal()
835    */
836   AuxiliaryMessageSignalType& AuxiliaryMessageSignal()
837   {
838     return mAuxiliaryMessageSignal;
839   }
840
841   /**
842    * @copydoc Dali::DevelWindow::AccessibilityHighlightSignal()
843    */
844   AccessibilityHighlightSignalType& AccessibilityHighlightSignal()
845   {
846     return mAccessibilityHighlightSignal;
847   }
848
849   /**
850    * @copydoc Dali::DevelWindow::MovedSignal()
851    */
852   MovedSignalType& MovedSignal()
853   {
854     return mMovedSignal;
855   }
856
857   /**
858    * @copydoc Dali::DevelWindow::OrientationChangedSignal()
859    */
860   OrientationChangedSignalType& OrientationChangedSignal()
861   {
862     return mOrientationChangedSignal;
863   }
864
865   /**
866    * @copydoc Dali::DevelWindow::MouseInOutEventSignal()
867    */
868   MouseInOutEventSignalType& MouseInOutEventSignal()
869   {
870     return mMouseInOutEventSignal;
871   }
872
873   /**
874    * @copydoc Dali::DevelWindow::MouseRelativeEventSignal()
875    */
876   MouseRelativeEventSignalType& MouseRelativeEventSignal()
877   {
878     return mMouseRelativeEventSignal;
879   }
880
881   /**
882    * @copydoc Dali::DevelWindow::PointerConstraintsSignal()
883    */
884   PointerConstraintsSignalType& PointerConstraintsSignal()
885   {
886     return mPointerConstraintsSignal;
887   }
888
889   /**
890    * @copydoc Dali::DevelWindow::MoveCompletedSignal()
891    */
892   MoveCompletedSignalType& MoveCompletedSignal()
893   {
894     return mMoveCompletedSignal;
895   }
896
897   /**
898    * @copydoc Dali::DevelWindow::ResizeCompletedSignal()
899    */
900   ResizeCompletedSignalType& ResizeCompletedSignal()
901   {
902     return mResizeCompletedSignal;
903   }
904
905   /**
906    * @copydoc Dali::DevelWindow::InsetsChangedSignal()
907    */
908   InsetsChangedSignalType& InsetsChangedSignal()
909   {
910     return mInsetsChangedSignal;
911   }
912
913 private:
914   WindowRenderSurface* mWindowSurface; ///< The window rendering surface
915   WindowBase*          mWindowBase;
916   std::string          mName;
917   std::string          mClassName;
918   Dali::Window         mParentWindow;
919
920   OrientationPtr   mOrientation;
921   std::vector<int> mAvailableAngles;
922   int              mPreferredAngle;
923
924   int mRotationAngle;  ///< The angle of the rotation
925   int mWindowWidth;    ///< The width of the window
926   int mWindowHeight;   ///< The height of the window
927   int mNativeWindowId; ///< The Native Window Id
928
929   EventHandlerPtr mEventHandler;    ///< The window events handler
930   OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
931
932   // Signals
933   SignalType                              mDeleteRequestSignal;
934   FocusChangeSignalType                   mFocusChangeSignal;
935   ResizeSignalType                        mResizeSignal;
936   VisibilityChangedSignalType             mVisibilityChangedSignal;
937   TransitionEffectEventSignalType         mTransitionEffectEventSignal;
938   KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal;
939   AuxiliaryMessageSignalType              mAuxiliaryMessageSignal;
940   AccessibilityHighlightSignalType        mAccessibilityHighlightSignal;
941   MovedSignalType                         mMovedSignal;
942   OrientationChangedSignalType            mOrientationChangedSignal;
943   MouseInOutEventSignalType               mMouseInOutEventSignal;
944   MouseRelativeEventSignalType            mMouseRelativeEventSignal;
945   MoveCompletedSignalType                 mMoveCompletedSignal;
946   ResizeCompletedSignalType               mResizeCompletedSignal;
947   InsetsChangedSignalType                 mInsetsChangedSignal;
948   PointerConstraintsSignalType            mPointerConstraintsSignal;
949
950   Dali::KeyEvent mLastKeyEvent;
951
952   bool mIsTransparent : 1;
953   bool mIsFocusAcceptable : 1;
954   bool mIconified : 1;
955   bool mMaximized : 1;
956   bool mOpaqueState : 1;
957   bool mWindowRotationAcknowledgement : 1;
958   bool mFocused : 1;
959   bool mIsWindowRotating : 1;      ///< The window rotating flag.
960   bool mIsEnabledUserGeometry : 1; ///< The user geometry enable flag.
961   bool mIsEmittedWindowCreatedEvent : 1; ///< The Window Created Event emit flag for accessibility.
962 };
963
964 } // namespace Adaptor
965 } // namespace Internal
966
967 // Helpers for public-api forwarding methods
968
969 inline Internal::Adaptor::Window& GetImplementation(Dali::Window& window)
970 {
971   DALI_ASSERT_ALWAYS(window && "Window handle is empty");
972   BaseObject& object = window.GetBaseObject();
973   return static_cast<Internal::Adaptor::Window&>(object);
974 }
975
976 inline const Internal::Adaptor::Window& GetImplementation(const Dali::Window& window)
977 {
978   DALI_ASSERT_ALWAYS(window && "Window handle is empty");
979   const BaseObject& object = window.GetBaseObject();
980   return static_cast<const Internal::Adaptor::Window&>(object);
981 }
982
983 } // namespace Dali
984
985 #endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H