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