Dali 3D User Interface Engine
window-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_WINDOW_H__
2 #define __DALI_INTERNAL_WINDOW_H__
3 
4 /*
5  * Copyright (c) 2014 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
24 
25 // INTERNAL INCLUDES
28 #include <adaptor-impl.h>
29 #include <window.h>
30 #include <orientation.h>
31 #include <render-surface.h>
32 #include <drag-and-drop-detector.h>
33 
34 namespace Dali
35 {
36 class Adaptor;
37 class RenderSurface;
38 
39 namespace Integration
40 {
41 class SystemOverlay;
42 }
43 
44 namespace Internal
45 {
46 namespace Adaptor
47 {
48 class Orientation;
49 
50 class Window;
53 
58 {
59 public:
62 
71  static Window* New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent = false);
72 
77  void SetAdaptor(Dali::Adaptor& adaptor);
78 
83  RenderSurface* GetSurface();
84 
89 
94 
99 
103  void SetClass( std::string name, std::string klass );
104 
108  void Raise();
109 
113  void Lower();
114 
118  void Activate();
119 
124 
129 
133  void SetAvailableOrientations(const std::vector<Dali::Window::WindowOrientation>& orientations);
134 
138  const std::vector<Dali::Window::WindowOrientation>& GetAvailableOrientations();
139 
144 
149 
153  Dali::DragAndDropDetector GetDragAndDropDetector() const;
154 
158  Dali::Any GetNativeHandle() const;
159 
163  void RotationDone( int orientation, int width, int height );
164 
165 private:
170  Window();
171 
175  virtual ~Window();
176 
180  void Initialize(const PositionSize& posSize, const std::string& name, const std::string& className);
181 
186  void DoShowIndicator( Dali::Window::WindowOrientation lastOrientation );
187 
193 
198 
202  void SetIndicatorProperties( bool isShown, Dali::Window::WindowOrientation lastOrientation );
203 
204 private: // IndicatorInterface::Observer interface
205 
209  virtual void IndicatorTypeChanged( IndicatorInterface::Type type );
210 
214  virtual void IndicatorClosed( IndicatorInterface* indicator);
215 
219  virtual void IndicatorVisibilityChanged( bool isVisible );
220 
221 private: // Adaptor::Observer interface
222 
226  virtual void OnStart();
227 
231  virtual void OnPause();
232 
236  virtual void OnResume();
237 
241  virtual void OnStop();
242 
246  virtual void OnDestroy();
247 
248 public: // Signals
249 
254 
259 
260 private:
261 
262  typedef std::vector< IndicatorInterface * > DiscardedIndicators;
263 
264  RenderSurface* mSurface;
268  bool mStarted:1;
278  Dali::DragAndDropDetector mDragAndDropDetector;
279 
280  struct EventHandler;
282 
284  std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
286 
287  // Signals
290 };
291 
292 } // namespace Adaptor
293 } // namepsace Internal
294 
295 // Helpers for public-api forwarding methods
296 
298 {
299  DALI_ASSERT_ALWAYS( window && "Window handle is empty" );
300  BaseObject& object = window.GetBaseObject();
301  return static_cast<Internal::Adaptor::Window&>(object);
302 }
303 
305 {
306  DALI_ASSERT_ALWAYS( window && "Window handle is empty" );
307  const BaseObject& object = window.GetBaseObject();
308  return static_cast<const Internal::Adaptor::Window&>(object);
309 }
310 
311 } // namespace Dali
312 
313 
314 #endif // __DALI_INTERNAL_WINDOW_H__
Dali Docs Home
Read more about Dali