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