[Tizen] Add OffscreenApplication
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / offscreen-application.h
index 19588c8..dd5eacb 100644 (file)
  *
  */
 
-/**
- * @addtogroup dali_adaptor_framework
- * @{
- */
-
 // EXTERNAL INCLUDES
 #include <dali/public-api/signals/dali-signal.h>
 #include <dali/public-api/object/any.h>
+#include <dali/public-api/object/base-handle.h>
 
 namespace Dali
 {
 
+/**
+ * @addtogroup dali_adaptor_framework
+ * @{
+ */
+
 class OffscreenWindow;
 
 namespace Internal
@@ -39,12 +40,18 @@ class OffscreenApplication;
 
 /**
  * @brief Appliations can draw UI on offscreen surface with the OffscreenApplication.
- * When you use a OffscreenApplication, you don't have to make a Window.
+ * When you use a OffscreenApplication, you don't have to create a Window.
  */
 class DALI_IMPORT_API OffscreenApplication : public Dali::BaseHandle
 {
 public:
 
+  enum class RenderMode
+  {
+    AUTO,         // UI is rendered automatically
+    MANUAL        // UI is rendered by RenderOnce()
+  };
+
   typedef Signal<void (void)> OffscreenApplicationSignalType;
 
 public:
@@ -55,43 +62,47 @@ public:
    * @param[in] width The initial width of the default OffscreenWindow
    * @param[in] height The initial height of the default OffscreenWindow
    * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
+   * @param[in] renderMode The RenderMode of the OffscreenApplication
    */
-  static OffscreenApplication New( uint16_t width, uint16_t height, bool isTranslucent );
+  static OffscreenApplication New( uint16_t width, uint16_t height, bool isTranslucent,
+                                   RenderMode renderMode = RenderMode::AUTO );
 
   /**
    * @brief This is the constructor of OffscreenApplication
    *
    * @param[in] surface The native surface handle to create the OffscreenWindow
    * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
+   * @param[in] renderMode The RenderMode of the OffscreenApplication
    */
-  static OffscreenApplication New( Dali::Any surface, bool isTranslucent );
+  static OffscreenApplication New( Dali::Any surface, bool isTranslucent,
+                                   RenderMode renderMode = RenderMode::AUTO );
 
   /**
    * @brief Constructs an empty handle
    */
- OffscreenApplication();
 OffscreenApplication();
 
   /**
    * @brief Copy constructor
    */
- OffscreenApplication( const OffscreenApplication& offscreenApplication );
 OffscreenApplication( const OffscreenApplication& offscreenApplication );
 
   /**
    * @brief Assignment operator
    */
- OffscreenApplication& operator=( const OffscreenApplication& offscreenApplication );
 OffscreenApplication& operator=( const OffscreenApplication& offscreenApplication );
 
   /**
    * @brief Destructor
    */
-   ~OffscreenApplication();
+  ~OffscreenApplication();
 
 public:
 
   /**
-   * @brief Runs the OffscreenApplication (rendering, event handling, etc)
+   * @brief Starts the OffscreenApplication (rendering, event handling, etc)
    */
-  void Run();
+  void Start();
 
   /**
    * @brief Stops the OffscreenApplication
@@ -105,12 +116,17 @@ public:
    */
   OffscreenWindow GetWindow();
 
+  /**
+   * @brief Renders once more even if we're paused
+   */
+  void RenderOnce();
+
 public:  // Signals
 
   /**
    * @brief Signal to notify the client when the application is ready to be initialized
    *
-   * @note OffscreenApplication::Run() should be called to be initialized
+   * @note OffscreenApplication::Start() should be called to be initialized
    *
    * @return The signal
    */