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