Merge branch 'devel/master' into tizen
[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   /**
540    * @copydoc Dali::DevelWindow::CursorVisibleSet()
541    */
542   void CursorVisibleSet(bool visible);
543
544   /**
545    * @copydoc Dali::DevelWindow::KeyboardGrab()
546    */
547   bool KeyboardGrab(Device::Subclass::Type deviceSubclass);
548
549   /**
550    * @copydoc Dali::DevelWindow::KeyboardUnGrab()
551    */
552   bool KeyboardUnGrab();
553
554 private:
555   /**
556    * @brief Enumeration for orietation mode.
557    * The Orientation Mode is related to screen size.
558    * If screen width is longer than height, the Orientation Mode will have LANDSCAPE.
559    * Otherwise screen width is shorter than height or same, the Orientation Mode will have PORTRAIT.
560    */
561   enum class OrientationMode
562   {
563     PORTRAIT = 0,
564     LANDSCAPE
565   };
566
567   /**
568    * Private constructor.
569    * @sa Window::New()
570    */
571   Window();
572
573   /**
574    * Destructor
575    */
576   ~Window() override;
577
578   /**
579    * Second stage initialization
580    */
581   void Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, WindowType type);
582
583   /**
584    * Called when the window becomes iconified or deiconified.
585    */
586   void OnIconifyChanged(bool iconified);
587
588   /**
589    * Called when the window becomes maximized or unmaximized.
590    */
591   void OnMaximizeChanged(bool maximized);
592
593   /**
594    * Called when the window focus is changed.
595    */
596   void OnFocusChanged(bool focusIn);
597
598   /**
599    * Called when the output is transformed.
600    */
601   void OnOutputTransformed();
602
603   /**
604    * Called when the window receives a delete request.
605    */
606   void OnDeleteRequest();
607
608   /**
609    * Called when the window receives a Transition effect-start/end event.
610    */
611   void OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type);
612
613   /**
614    * @brief Called when window receives a keyboard repeat event.
615    */
616   void OnKeyboardRepeatSettingsChanged();
617
618   /**
619    * @brief Called when the window redraw is requested.
620    */
621   void OnWindowRedrawRequest();
622
623   /**
624    * @brief Called when the window's geometry data is changed by display server or client.
625    * It is based on configure noification event.
626    *
627    * @param[in] positionSize the updated window's position and size.
628    */
629   void OnUpdatePositionSize(Dali::PositionSize& positionSize);
630
631   /**
632    * @brief Called when display server sent the auxiliary message.
633    *
634    * @param[in] key the auxiliary message's key.
635    * @param[in] value the auxiliary message's value.
636    * @param[in] options the auxiliary message's options. This is the list of string.
637    */
638   void OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options);
639
640   /**
641    * @brief Called when Accessibility is enabled.
642    *
643    * This method is to register the window to accessibility bridge.
644    */
645   void OnAccessibilityEnabled();
646
647   /**
648    * @brief Called when Accessibility is disabled.
649    *
650    * This method is to remove the window from accessibility bridge.
651    */
652   void OnAccessibilityDisabled();
653
654   /**
655    * Called when the window rotation is finished.
656    *
657    * This signal is emmit when window rotation is finisehd and WindowRotationCompleted() is called.
658    */
659   void OnRotationFinished();
660
661   /**
662    * @brief Called when the mouse in or out event is received.
663    * @param[in] mouseInOutEvent the mouse event
664    */
665   void OnMouseInOutEvent(const Dali::DevelWindow::MouseInOutEvent& mouseInOutEvent);
666
667   /**
668    * @brief Called when the mouse relative event is received.
669    * @param[in] MouseRelativeEvent the mouse event
670    */
671   void OnMouseRelativeEvent(const Dali::DevelWindow::MouseRelativeEvent& MouseRelativeEvent);
672
673   /**
674    * @brief Called when the window is moved by display server.
675    *
676    * @param[in] position the moved window's position.
677    */
678   void OnMoveCompleted(Dali::Window::WindowPosition& position);
679
680   /**
681    * @brief Called when the window is resized by display server.
682    *
683    * @param[in] positionSize the resized window's size.
684    */
685   void OnResizeCompleted(Dali::Window::WindowSize& size);
686
687   /**
688    * @brief Set available orientation to window base.
689    */
690   void SetAvailableAnlges(const std::vector<int>& angles);
691
692   /**
693    * @brief Convert from window orientation to angle using OrientationMode.
694    */
695   int ConvertToAngle(WindowOrientation orientation);
696
697   /**
698    * @brief Convert from angle to window orientation using OrientationMode.
699    */
700   WindowOrientation ConvertToOrientation(int angle) const;
701
702   /**
703    * @brief Check available window orientation for Available orientation.
704    */
705   bool IsOrientationAvailable(WindowOrientation orientation) const;
706
707   /**
708    * @brief Sets user geometry flag when window's geometry is changed.
709    * Window is created with screen size or not.
710    * If window is created with screen size or the geometry is changed by user,
711    * client should inform to server setting user.geometry flag
712    */
713   void SetUserGeometryPolicy();
714
715   /**
716    * @brief Called when window insets are changed by appearing or disappearing indicator, virtual keyboard, or clipboard.
717    *
718    * @param[in] partType the type of the part that occurs the window insets change.
719    * @param[in] partState the state of the part that occurs the window insets change.
720    * @param[in] insets the extents value of window insets.
721    */
722   void OnInsetsChanged(WindowInsetsPartType partType, WindowInsetsPartState partState, const Extents& insets);
723
724 private: // Dali::Internal::Adaptor::SceneHolder
725   /**
726    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet
727    */
728   void OnAdaptorSet(Dali::Adaptor& adaptor) override;
729
730   /**
731    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnSurfaceSet
732    */
733   void OnSurfaceSet(Dali::RenderSurfaceInterface* surface) override;
734
735   /**
736    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnPause
737    */
738   void OnPause() override;
739
740   /**
741    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnResume
742    */
743   void OnResume() override;
744
745   /**
746    * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculatePosition
747    */
748   Vector2 RecalculatePosition(const Vector2& position) override;
749
750 private: // Dali::Internal::Adaptor::EventHandler::Observer
751   /**
752    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnTouchPoint
753    */
754   void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
755
756   /**
757    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
758    */
759   void OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent) override;
760
761   /**
762    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnKeyEvent
763    */
764   void OnKeyEvent(Dali::Integration::KeyEvent& keyEvent) override;
765
766   /**
767    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnRotation
768    */
769   void OnRotation(const RotationEvent& rotation) override;
770
771 public: // Signals
772   /**
773    * @copydoc Dali::Window::FocusChangeSignal()
774    */
775   FocusChangeSignalType& FocusChangeSignal()
776   {
777     return mFocusChangeSignal;
778   }
779
780   /**
781    * @copydoc Dali::Window::ResizedSignal()
782    */
783   ResizeSignalType& ResizeSignal()
784   {
785     return mResizeSignal;
786   }
787
788   /**
789    * This signal is emitted when the window is requesting to be deleted
790    */
791   SignalType& DeleteRequestSignal()
792   {
793     return mDeleteRequestSignal;
794   }
795
796   /**
797    * @copydoc Dali::DevelWindow::VisibilityChangedSignal()
798    */
799   VisibilityChangedSignalType& VisibilityChangedSignal()
800   {
801     return mVisibilityChangedSignal;
802   }
803
804   /**
805    * @copydoc Dali::Window::SignalEventProcessingFinished()
806    */
807   Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal()
808   {
809     return mScene.EventProcessingFinishedSignal();
810   }
811
812   /**
813    * @copydoc Dali::DevelWindow::TransitionEffectEventSignal()
814    */
815   TransitionEffectEventSignalType& TransitionEffectEventSignal()
816   {
817     return mTransitionEffectEventSignal;
818   }
819
820   /**
821    * @copydoc Dali::DevelWindow::KeyboardRepeatSettingsChangedSignal()
822    */
823   KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal()
824   {
825     return mKeyboardRepeatSettingsChangedSignal;
826   }
827
828   /**
829    * @copydoc Dali::DevelWindow::AuxiliaryMessageSignal()
830    */
831   AuxiliaryMessageSignalType& AuxiliaryMessageSignal()
832   {
833     return mAuxiliaryMessageSignal;
834   }
835
836   /**
837    * @copydoc Dali::DevelWindow::AccessibilityHighlightSignal()
838    */
839   AccessibilityHighlightSignalType& AccessibilityHighlightSignal()
840   {
841     return mAccessibilityHighlightSignal;
842   }
843
844   /**
845    * @copydoc Dali::DevelWindow::MovedSignal()
846    */
847   MovedSignalType& MovedSignal()
848   {
849     return mMovedSignal;
850   }
851
852   /**
853    * @copydoc Dali::DevelWindow::OrientationChangedSignal()
854    */
855   OrientationChangedSignalType& OrientationChangedSignal()
856   {
857     return mOrientationChangedSignal;
858   }
859
860   /**
861    * @copydoc Dali::DevelWindow::MouseInOutEventSignal()
862    */
863   MouseInOutEventSignalType& MouseInOutEventSignal()
864   {
865     return mMouseInOutEventSignal;
866   }
867
868   /**
869    * @copydoc Dali::DevelWindow::MouseRelativeEventSignal()
870    */
871   MouseRelativeEventSignalType& MouseRelativeEventSignal()
872   {
873     return mMouseRelativeEventSignal;
874   }
875
876   /**
877    * @copydoc Dali::DevelWindow::MoveCompletedSignal()
878    */
879   MoveCompletedSignalType& MoveCompletedSignal()
880   {
881     return mMoveCompletedSignal;
882   }
883
884   /**
885    * @copydoc Dali::DevelWindow::ResizeCompletedSignal()
886    */
887   ResizeCompletedSignalType& ResizeCompletedSignal()
888   {
889     return mResizeCompletedSignal;
890   }
891
892   /**
893    * @copydoc Dali::DevelWindow::InsetsChangedSignal()
894    */
895   InsetsChangedSignalType& InsetsChangedSignal()
896   {
897     return mInsetsChangedSignal;
898   }
899
900 private:
901   WindowRenderSurface* mWindowSurface; ///< The window rendering surface
902   WindowBase*          mWindowBase;
903   std::string          mName;
904   std::string          mClassName;
905   Dali::Window         mParentWindow;
906
907   OrientationPtr   mOrientation;
908   std::vector<int> mAvailableAngles;
909   int              mPreferredAngle;
910
911   int mRotationAngle;  ///< The angle of the rotation
912   int mWindowWidth;    ///< The width of the window
913   int mWindowHeight;   ///< The height of the window
914   int mNativeWindowId; ///< The Native Window Id
915
916   EventHandlerPtr mEventHandler;    ///< The window events handler
917   OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
918
919   // Signals
920   SignalType                              mDeleteRequestSignal;
921   FocusChangeSignalType                   mFocusChangeSignal;
922   ResizeSignalType                        mResizeSignal;
923   VisibilityChangedSignalType             mVisibilityChangedSignal;
924   TransitionEffectEventSignalType         mTransitionEffectEventSignal;
925   KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal;
926   AuxiliaryMessageSignalType              mAuxiliaryMessageSignal;
927   AccessibilityHighlightSignalType        mAccessibilityHighlightSignal;
928   MovedSignalType                         mMovedSignal;
929   OrientationChangedSignalType            mOrientationChangedSignal;
930   MouseInOutEventSignalType               mMouseInOutEventSignal;
931   MouseRelativeEventSignalType            mMouseRelativeEventSignal;
932   MoveCompletedSignalType                 mMoveCompletedSignal;
933   ResizeCompletedSignalType               mResizeCompletedSignal;
934   InsetsChangedSignalType                 mInsetsChangedSignal;
935
936   Dali::KeyEvent   mLastKeyEvent;
937   Dali::TouchEvent mLastTouchEvent;
938
939   bool mIsTransparent : 1;
940   bool mIsFocusAcceptable : 1;
941   bool mIconified : 1;
942   bool mMaximized : 1;
943   bool mOpaqueState : 1;
944   bool mWindowRotationAcknowledgement : 1;
945   bool mFocused : 1;
946   bool mIsWindowRotating : 1;      ///< The window rotating flag.
947   bool mIsEnabledUserGeometry : 1; ///< The user geometry enable flag.
948 };
949
950 } // namespace Adaptor
951 } // namespace Internal
952
953 // Helpers for public-api forwarding methods
954
955 inline Internal::Adaptor::Window& GetImplementation(Dali::Window& window)
956 {
957   DALI_ASSERT_ALWAYS(window && "Window handle is empty");
958   BaseObject& object = window.GetBaseObject();
959   return static_cast<Internal::Adaptor::Window&>(object);
960 }
961
962 inline const Internal::Adaptor::Window& GetImplementation(const Dali::Window& window)
963 {
964   DALI_ASSERT_ALWAYS(window && "Window handle is empty");
965   const BaseObject& object = window.GetBaseObject();
966   return static_cast<const Internal::Adaptor::Window&>(object);
967 }
968
969 } // namespace Dali
970
971 #endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H