Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-base.h
1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_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/public-api/adaptor-framework/window.h>
23 #include <dali/public-api/adaptor-framework/key-grab.h>
24 #include <dali/internal/window-system/common/indicator-interface.h>
25
26 // EXTERNAL INCLUDES
27 #include <string>
28 #include <vector>
29
30 namespace Dali
31 {
32 namespace Internal
33 {
34 namespace Adaptor
35 {
36
37 /**
38  * WindowBase interface
39  */
40 class WindowBase
41 {
42 public:
43
44   /**
45    * @brief Default constructor
46    */
47   WindowBase() = default;
48
49   /**
50    * @brief Destructor
51    */
52   virtual ~WindowBase() = default;
53
54 public:
55
56   /**
57    * Second stage initialization
58    */
59   virtual void Initialize() = 0;
60
61   /**
62    * @copydoc Dali::Window::ShowIndicator()
63    */
64   virtual void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode ) = 0;
65
66   /**
67    * Set the indicator properties on the window
68    */
69   virtual void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ) = 0;
70
71   /**
72    * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorTypeChanged()
73    */
74   virtual void IndicatorTypeChanged( IndicatorInterface::Type type ) = 0;
75
76   /**
77    * @copydoc Dali::Window::SetClass()
78    */
79   virtual void SetClass( std::string name, std::string className ) = 0;
80
81   /**
82    * @copydoc Dali::Window::Raise()
83    */
84   virtual void Raise() = 0;
85
86   /**
87    * @copydoc Dali::Window::Lower()
88    */
89   virtual void Lower() = 0;
90
91   /**
92    * @copydoc Dali::Window::Activate()
93    */
94   virtual void Activate() = 0;
95
96   /**
97    * @copydoc Dali::Window::SetAvailableOrientations()
98    */
99   virtual void SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations ) = 0;
100
101   /**
102    * @copydoc Dali::Window::SetPreferredOrientation()
103    */
104   virtual void SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) = 0;
105
106   /**
107    * @copydoc Dali::Window::SetAcceptFocus()
108    */
109   virtual void SetAcceptFocus( bool accept ) = 0;
110
111   /**
112    * @copydoc Dali::Window::Show()
113    */
114   virtual void Show() = 0;
115
116   /**
117    * @copydoc Dali::Window::Hide()
118    */
119   virtual void Hide() = 0;
120
121   /**
122    * @copydoc Dali::Window::GetSupportedAuxiliaryHintCount()
123    */
124   virtual unsigned int GetSupportedAuxiliaryHintCount() const = 0;
125
126   /**
127    * @copydoc Dali::Window::GetSupportedAuxiliaryHint()
128    */
129   virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const = 0;
130
131   /**
132    * @copydoc Dali::Window::AddAuxiliaryHint()
133    */
134   virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) = 0;
135
136   /**
137    * @copydoc Dali::Window::RemoveAuxiliaryHint()
138    */
139   virtual bool RemoveAuxiliaryHint( unsigned int id ) = 0;
140
141   /**
142    * @copydoc Dali::Window::SetAuxiliaryHintValue()
143    */
144   virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) = 0;
145
146   /**
147    * @copydoc Dali::Window::GetAuxiliaryHintValue()
148    */
149   virtual std::string GetAuxiliaryHintValue( unsigned int id ) const = 0;
150
151   /**
152    * @copydoc Dali::Window::GetAuxiliaryHintId()
153    */
154   virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const = 0;
155
156   /**
157    * @copydoc Dali::Window::SetInputRegion()
158    */
159   virtual void SetInputRegion( const Rect< int >& inputRegion ) = 0;
160
161   /**
162    * @copydoc Dali::Window::SetType()
163    */
164   virtual void SetType( Dali::Window::Type type ) = 0;
165
166   /**
167    * @copydoc Dali::Window::SetNotificationLevel()
168    */
169   virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) = 0;
170
171   /**
172    * @copydoc Dali::Window::GetNotificationLevel()
173    */
174   virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const = 0;
175
176   /**
177    * @copydoc Dali::Window::SetOpaqueState()
178    */
179   virtual void SetOpaqueState( bool opaque ) = 0;
180
181   /**
182    * @copydoc Dali::Window::SetScreenOffMode()
183    */
184   virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) = 0;
185
186   /**
187    * @copydoc Dali::Window::GetScreenOffMode()
188    */
189   virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const = 0;
190
191   /**
192    * @copydoc Dali::Window::SetBrightness()
193    */
194   virtual bool SetBrightness( int brightness ) = 0;
195
196   /**
197    * @copydoc Dali::Window::GetBrightness()
198    */
199   virtual int GetBrightness() const = 0;
200
201   /**
202    * @copydoc Dali::KeyGrab::GrabKey()
203    */
204   virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) = 0;
205
206   /**
207    * @copydoc Dali::KeyGrab::UngrabKey()
208    */
209   virtual bool UngrabKey( Dali::KEY key ) = 0;
210
211   /**
212    * @copydoc Dali::KeyGrab::GrabKeyList()
213    */
214   virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) = 0;
215
216   /**
217    * @copydoc Dali::KeyGrab::UngrabKeyList()
218    */
219   virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) = 0;
220
221 protected:
222
223   // Undefined
224   WindowBase(const WindowBase&) = delete;
225
226   // Undefined
227   WindowBase& operator=(const WindowBase& rhs) = delete;
228
229 };
230
231 } // namespace Adaptor
232
233 } // namespace internal
234
235 } // namespace Dali
236
237 #endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_H