[Tizen] Remove graphics-api relative codes in public-api/application.h
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / application.h
index 96eaedf..90ed7b5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_APPLICATION_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/view-mode.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/signals/callback.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/application-configuration.h>
 #include <dali/public-api/adaptor-framework/device-status.h>
 #include <dali/public-api/adaptor-framework/window.h>
 
 namespace Dali
 {
+class ObjectRegistry;
+
 /**
  * @addtogroup dali_adaptor_framework
  * @{
@@ -41,7 +41,7 @@ namespace Adaptor
 {
 class Application;
 }
-}
+} // namespace DALI_INTERNAL
 /**
  * @brief An Application class object should be created by every application
  * that wishes to use Dali.
@@ -93,7 +93,6 @@ class Application;
  * This class accepts command line arguments as well. The following options are supported:
  *
  * @code
- *     --no-vsync       Disable VSync on Render
  *  -w|--width          Stage Width
  *  -h|--height         Stage Height
  *  -d|--dpi            Emulated DPI
@@ -106,11 +105,10 @@ class Application;
 class DALI_ADAPTOR_API Application : public BaseHandle
 {
 public:
-
-  typedef Signal< void (DeviceStatus::Battery::Status) > LowBatterySignalType; ///< Application device signal type @SINCE_1_2.62
-  typedef Signal< void (DeviceStatus::Memory::Status) > LowMemorySignalType;   ///< Application device signal type @SINCE_1_2.62
-  typedef Signal< void (Application&) > AppSignalType;  ///< Application lifecycle signal and system signal callback type @SINCE_1_0.0
-  typedef Signal< void (Application&, void *) > AppControlSignalType; ///< Application control signal callback type @SINCE_1_0.0
+  typedef Signal<void(DeviceStatus::Battery::Status)> LowBatterySignalType; ///< Application device signal type @SINCE_1_2.62
+  typedef Signal<void(DeviceStatus::Memory::Status)>  LowMemorySignalType;  ///< Application device signal type @SINCE_1_2.62
+  typedef Signal<void(Application&)>                  AppSignalType;        ///< Application lifecycle signal and system signal callback type @SINCE_1_0.0
+  typedef Signal<void(Application&, void*)>           AppControlSignalType; ///< Application control signal callback type @SINCE_1_0.0
 
   /**
    * @brief Enumeration for deciding whether a Dali application window is opaque or transparent.
@@ -118,12 +116,11 @@ public:
    */
   enum WINDOW_MODE
   {
-    OPAQUE = 0,       ///< The window will be opaque @SINCE_1_0.0
-    TRANSPARENT = 1   ///< The window transparency will match the alpha value set in Dali::Stage::SetBackgroundcolor() @SINCE_1_0.0
+    OPAQUE      = 0, ///< The window will be opaque @SINCE_1_0.0
+    TRANSPARENT = 1  ///< The window transparency will match the alpha value set in Dali::Stage::SetBackgroundcolor() @SINCE_1_0.0
   };
 
 public:
-
   /**
    * @brief This is the constructor for applications without an argument list.
    * @SINCE_1_0.0
@@ -143,7 +140,7 @@ public:
    * @param[in,out]  argv        A pointer to the argument list
    * @return A handle to the Application
    */
-  static Application New( int* argc, char **argv[] );
+  static Application New(int* argc, char** argv[]);
 
   /**
    * @brief This is the constructor for applications with a name.
@@ -157,7 +154,7 @@ public:
    * @return A handle to the Application
    * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
    */
-  static Application New( int* argc, char **argv[], const std::string& stylesheet );
+  static Application New(int* argc, char** argv[], const std::string& stylesheet);
 
   /**
    * @brief This is the constructor for applications with a name.
@@ -172,7 +169,7 @@ public:
    * @return A handle to the Application
    * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
    */
-  static Application New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+  static Application New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode);
 
   /**
    * @brief This is the constructor for applications.
@@ -188,7 +185,7 @@ public:
    * @return A handle to the Application
    * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
    */
-  static Application New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize );
+  static Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize);
 
   /**
    * @brief Constructs an empty handle.
@@ -201,7 +198,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] application Handle to an object
    */
-  Application( const Application& application );
+  Application(const Application& application);
 
   /**
    * @brief Assignment operator.
@@ -209,7 +206,24 @@ public:
    * @param[in] application Handle to an object
    * @return A reference to this
    */
-  Application& operator=( const Application& application );
+  Application& operator=(const Application& application);
+
+  /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.24
+   * @param[in] rhs A reference to the moved handle
+   */
+  Application(Application&& rhs);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.24
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Application& operator=(Application&& rhs);
 
   /**
    * @brief Destructor.
@@ -223,24 +237,13 @@ public:
   /**
    * @brief This starts the application.
    *
-   * Choosing this form of main loop indicates that the default
-   * application configuration of APPLICATION_HANDLES_CONTEXT_LOSS is used. On platforms where
-   * context loss can occur, the application is responsible for tearing down and re-loading UI.
-   * The application should listen to Stage::ContextLostSignal and Stage::ContextRegainedSignal.
-   * @SINCE_1_0.0
-   */
-  void MainLoop();
-
-  /**
-   * @brief This starts the application, and allows the app to choose a different configuration.
+   * On platforms where context loss can occur, the application is responsible for tearing down and
+   * re-loading UI.  The application should listen to Stage::ContextLostSignal and
+   * Stage::ContextRegainedSignal.
    *
-   * If the application plans on using the ReplaceSurface or ReplaceWindow API, then this will
-   * trigger context loss & regain.
-   * The application should listen to Stage::ContextLostSignal and Stage::ContextRegainedSignal.
    * @SINCE_1_0.0
-   * @param[in] configuration The context loss configuration
    */
-  void MainLoop(Configuration::ContextLoss configuration);
+  void MainLoop();
 
   /**
    * @brief This lowers the application to bottom without actually quitting it.
@@ -270,10 +273,10 @@ public:
    *
    * @note Ownership of the callback is passed onto this class.
    */
-  bool AddIdle( CallbackBase* callback );
+  bool AddIdle(CallbackBase* callback);
 
   /**
-   * @brief Retrieves the window used by the Application class.
+   * @brief Retrieves the main window used by the Application class.
    *
    * The application writer can use the window to change indicator and orientation
    * properties.
@@ -283,18 +286,6 @@ public:
   Window GetWindow();
 
   /**
-   * @brief Replaces the current window.
-   *
-   * This will force context loss.
-   * If you plan on using this API in your application, then you should configure
-   * it to prevent discard behavior when handling the Init signal.
-   * @SINCE_1_0.0
-   * @param[in] windowPosition The position and size parameters of the new window
-   * @param[in] name The name of the new window
-   */
-  void ReplaceWindow(PositionSize windowPosition, const std::string& name);
-
-  /**
    * @brief Get path application resources are stored at
    *
    * @SINCE_1_2.2
@@ -318,46 +309,16 @@ public:
    */
   std::string GetLanguage() const;
 
-public: // Stereoscopy
-
-  /**
-   * @brief Sets the viewing mode for the application.
-   * @SINCE_1_0.0
-   * @param[in] viewMode The new viewing mode
-   * @DEPRECATED_1_3.51
-   */
-  void SetViewMode( ViewMode viewMode );
-
-  /**
-   * @brief Gets the current viewing mode.
-   * @SINCE_1_0.0
-   * @return The current viewing mode
-   * @DEPRECATED_1_3.51
-   */
-  ViewMode GetViewMode() const;
-
-  /**
-   * @brief Sets the stereo base (eye separation) for Stereoscopic 3D.
-   *
-   * The stereo base is the distance in millimetres between the eyes. Typical values are
-   * between 50mm and 70mm. The default value is 65mm.
-   * @SINCE_1_0.0
-   * @param[in] stereoBase The stereo base (eye separation) for Stereoscopic 3D
-   * @DEPRECATED_1_3.51
-   */
-  void SetStereoBase( float stereoBase );
-
   /**
-   * @brief Gets the stereo base (eye separation) for Stereoscopic 3D.
+   * @brief Gets the Object registry.
    *
-   * @SINCE_1_0.0
-   * @return The stereo base (eye separation) for Stereoscopic 3D
-   * @DEPRECATED_1_3.51
+   * @SINCE_1_9.21
+   * @return The object registry
+   * @note This will only be a valid handle after the InitSignal has been emitted.
    */
-  float GetStereoBase() const;
-
-public:  // Signals
+  ObjectRegistry GetObjectRegistry() const;
 
+public: // Signals
   /**
    * @brief The user should connect to this signal to determine when they should initialize
    * their application.
@@ -398,14 +359,6 @@ public:  // Signals
   AppSignalType& ResetSignal();
 
   /**
-   * @DEPRECATED_1_1.43 Use Window::ResizedSignal() instead.
-   * @brief This signal is emitted when the window application rendering on is resized.
-   * @SINCE_1_0.0
-   * @return The signal to connect to
-   */
-  AppSignalType& ResizeSignal() DALI_DEPRECATED_API;
-
-  /**
   * @brief This signal is emitted when another application sends a launch request to the application.
   *
   * When the application is launched, this signal is emitted after the main loop of the application starts up.
@@ -430,22 +383,6 @@ public:  // Signals
   AppSignalType& RegionChangedSignal();
 
   /**
-  * @DEPRECATED_1_2.62 Use LowBatterySignal() instead.
-  * @brief This signal is emitted when the battery level of the device is low.
-  * @SINCE_1_0.0
-  * @return The signal to connect to
-  */
-  AppSignalType& BatteryLowSignal() DALI_DEPRECATED_API;
-
-  /**
-  * @DEPRECATED_1_2.62 Use LowMemorySignal() instead.
-  * @brief This signal is emitted when the memory level of the device is low.
-  * @SINCE_1_0.0
-  * @return The signal to connect to
-  */
-  AppSignalType& MemoryLowSignal() DALI_DEPRECATED_API;
-
-  /**
    * @brief This signal is emitted when the battery level of the device is low.
    * @SINCE_1_2.62
    * @return The signal to connect to