Refactoring window system
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / ubuntu-x11 / window-base-ecore-x.h
1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_ECOREX_WINDOW_BASE_ECORE_X_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_WINDOW_BASE_ECORE_X_H
3
4 /*
5  * Copyright (c) 2018 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 // INTERNAL INCLUDES
22 #include <dali/internal/window-system/common/window-base.h>
23
24 // EXTERNAL HEADERS
25 #include <Ecore.h>
26 #include <Ecore_X.h>
27
28 namespace Dali
29 {
30 namespace Internal
31 {
32 namespace Adaptor
33 {
34
35 class Window;
36 class WindowRenderSurface;
37 class WindowRenderSurfaceEcoreX;
38
39 /**
40  * WindowBaseEcoreX class provides an WindowBase EcoreX implementation.
41  */
42 class WindowBaseEcoreX : public WindowBase
43 {
44 public:
45
46   /**
47    * @brief Constructor
48    */
49   WindowBaseEcoreX( Window* window, WindowRenderSurface* windowRenderSurface );
50
51   /**
52    * @brief Destructor
53    */
54   virtual ~WindowBaseEcoreX();
55
56 public:
57
58   /**
59    * @brief Called when the window property is changed.
60    */
61   Eina_Bool OnWindowPropertyChanged( void* data, int type, void* event );
62
63   /**
64    * Called when the window receives a delete request
65    */
66   void OnDeleteRequest();
67
68 public:
69
70   /**
71    * @copydoc Dali::Internal::Adaptor::WindowBase::Initialize()
72    */
73   virtual void Initialize() override;
74
75   /**
76    * @copydoc Dali::Internal::Adaptor::WindowBase::ShowIndicator()
77    */
78   virtual void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode ) override;
79
80   /**
81    * @copydoc Dali::Internal::Adaptor::WindowBase::SetIndicatorProperties()
82    */
83   virtual void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ) override;
84
85   /**
86    * @copydoc Dali::Internal::Adaptor::WindowBase::IndicatorTypeChanged()
87    */
88   virtual void IndicatorTypeChanged( IndicatorInterface::Type type ) override;
89
90   /**
91    * @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
92    */
93   virtual void SetClass( std::string name, std::string className ) override;
94
95   /**
96    * @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
97    */
98   virtual void Raise() override;
99
100   /**
101    * @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
102    */
103   virtual void Lower() override;
104
105   /**
106    * @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
107    */
108   virtual void Activate() override;
109
110   /**
111    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableOrientations()
112    */
113   virtual void SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations ) override;
114
115   /**
116    * @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredOrientation()
117    */
118   virtual void SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) override;
119
120   /**
121    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
122    */
123   virtual void SetAcceptFocus( bool accept ) override;
124
125   /**
126    * @copydoc Dali::Internal::Adaptor::WindowBase::Show()
127    */
128   virtual void Show() override;
129
130   /**
131    * @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
132    */
133   virtual void Hide() override;
134
135   /**
136    * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
137    */
138   virtual unsigned int GetSupportedAuxiliaryHintCount() const override;
139
140   /**
141    * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
142    */
143   virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
144
145   /**
146    * @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
147    */
148   virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
149
150   /**
151    * @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
152    */
153   virtual bool RemoveAuxiliaryHint( unsigned int id ) override;
154
155   /**
156    * @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
157    */
158   virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
159
160   /**
161    * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
162    */
163   virtual std::string GetAuxiliaryHintValue( unsigned int id ) const override;
164
165   /**
166    * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
167    */
168   virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
169
170   /**
171    * @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
172    */
173   virtual void SetInputRegion( const Rect< int >& inputRegion ) override;
174
175   /**
176    * @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
177    */
178   virtual void SetType( Dali::Window::Type type ) override;
179
180   /**
181    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
182    */
183   virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
184
185   /**
186    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
187    */
188   virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
189
190   /**
191    * @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
192    */
193   virtual void SetOpaqueState( bool opaque ) override;
194
195   /**
196    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
197    */
198   virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
199
200   /**
201    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
202    */
203   virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
204
205   /**
206    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
207    */
208   virtual bool SetBrightness( int brightness ) override;
209
210   /**
211    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
212    */
213   virtual int GetBrightness() const override;
214
215 protected:
216
217   // Undefined
218   WindowBaseEcoreX(const WindowBaseEcoreX&) = delete;
219
220   // Undefined
221   WindowBaseEcoreX& operator=(const WindowBaseEcoreX& rhs) = delete;
222
223 private:
224
225   Dali::Vector< Ecore_Event_Handler* > mEcoreEventHandler;
226
227   Window*                              mWindow;
228   WindowRenderSurfaceEcoreX*           mWindowSurface;
229   Ecore_X_Window                       mEcoreWindow;
230
231   bool                                 mRotationAppSet:1;
232 };
233
234 } // namespace Adaptor
235
236 } // namespace internal
237
238 } // namespace Dali
239
240 #endif // DALI_INTERNAL_WINDOWSYSTEM_ECOREX_WINDOW_BASE_ECORE_X_H