Revert "[Tizen] Revert "Support screen rotation""
[platform/core/uifw/dali-adaptor.git] / adaptors / integration-api / adaptor.h
index 6ac79ea..08d7f4b 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTEGRATION_ADAPTOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/signals/dali-signal.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/common/view-mode.h>
+#include <dali/public-api/math/uint-16-pair.h>
 
 // INTERNAL INCLUDES
-#include "window.h"
-#include "application-configuration.h"
+
+#ifdef DALI_ADAPTOR_COMPILATION  // full path doesn't exist until adaptor is installed so we have to use relative
+// @todo Make dali-adaptor code folder structure mirror the folder structure installed to dali-env
+#include <window.h>
+#include <application-configuration.h>
+#else
+#include <dali/public-api/adaptor-framework/window.h>
+#include <dali/public-api/adaptor-framework/application-configuration.h>
+#endif
+
 
 namespace Dali
 {
@@ -105,6 +115,8 @@ public:
 
   typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals
 
+  typedef Uint16Pair SurfaceSize;          ///< Surface size type
+
 public:
   /**
    * @brief Create a new adaptor using the window.
@@ -173,6 +185,7 @@ public:
 
   /**
    * @brief Ensures that the function passed in is called from the main loop when it is idle.
+   * @note Function must be called from the main event thread only.
    *
    * A callback of the following type may be used:
    * @code
@@ -187,6 +200,16 @@ public:
   bool AddIdle( CallbackBase* callback );
 
   /**
+   * @brief Removes a previously added @p callback.
+   * @note Function must be called from the main event thread only.
+   *
+   * Does nothing if the @p callback doesn't exist.
+   *
+   * @param[in] callback The callback to be removed.
+   */
+  void RemoveIdle( CallbackBase* callback );
+
+  /**
    * @brief Replaces the rendering surface
    *
    * @param[in] nativeWindow native window handle
@@ -202,6 +225,13 @@ public:
   RenderSurface& GetSurface();
 
   /**
+   * @brief Gets native window handle
+   *
+   * @return Native window handle
+   */
+  Any GetNativeWindowHandle();
+
+  /**
    * @brief Release any locks the surface may hold.
    *
    * For example, after compositing an offscreen surface, use this method to allow
@@ -247,6 +277,13 @@ public:
   static bool IsAvailable();
 
   /**
+   * @brief Call this method to notify Dali when scene is created and initialized.
+   *
+   * Notify Adaptor that the scene has been created.
+   */
+  void NotifySceneCreated();
+
+  /**
    * @brief Call this method to notify Dali when the system language changes.
    *
    * Use this only when NOT using Dali::Application, As Application created using
@@ -287,6 +324,21 @@ public:
    */
   void FeedKeyEvent( KeyEvent& keyEvent );
 
+  /**
+   * @copydoc Dali::Core::SceneCreated();
+   */
+  void SceneCreated();
+
+  /**
+   * @copydoc Dali::Application::SetViewMode();
+   */
+  void SetViewMode( ViewMode viewMode );
+
+  /**
+   * @copydoc Dali::Application::SetStereoBase();
+   */
+  void SetStereoBase( float stereoBase );
+
 public:  // Signals
 
   /**