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