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