[dali_2.3.42] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / application-devel.h
index 86da07a..0e04b0b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_APPLICATION_DEVEL_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
 
 // INTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/application.h>
+#include <dali/public-api/dali-adaptor-common.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/signals/dali-signal.h>
 
 namespace Dali
 {
-
 namespace DevelApplication
 {
+using CustomCommandReceivedSignalType = Signal<void(const std::string&)>; ///< Signal signature for CustomCommandReceivedSignal
 
+/**
+   * @brief This is the constructor for applications.
+   * Especially, it is for keyboard application.
+   * If you want to create Ime window, use this API with WindowType::IME.
+   *
+   * @param[in,out]  argc                A pointer to the number of arguments
+   * @param[in,out]  argv                A pointer to the argument list
+   * @param[in]      stylesheet          The path to user defined theme file
+   * @param[in]      windowMode          A member of WINDOW_MODE
+   * @param[in]      positionSize        A position and a size of the window
+   * @param[in]      type                It is window type for default window.
+   * @return A handle to the Application
+   * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
+   */
+DALI_ADAPTOR_API Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize, WindowType type);
 
 /**
  * @brief Ensures that the function passed in is called from the main loop when it is idle.
@@ -44,7 +63,7 @@ namespace DevelApplication
  *
  * @note Ownership of the callback is passed onto this class.
  */
-DALI_ADAPTOR_API bool AddIdleWithReturnValue( Application application, CallbackBase* callback );
+DALI_ADAPTOR_API bool AddIdleWithReturnValue(Application application, CallbackBase* callback);
 
 /**
 * @brief Gets the absolute path to the application's data directory which is used to store private data of the application.
@@ -52,6 +71,46 @@ DALI_ADAPTOR_API bool AddIdleWithReturnValue( Application application, CallbackB
 */
 DALI_ADAPTOR_API std::string GetDataPath();
 
+/**
+ * @brief Downcasts a ref object to Application handle
+ *
+ * If handle points to an Application object, the downcast produces valid base handle
+ * If not, the returned base handle is left uninitialized
+ *
+ * @param[in] refObject to an Application
+ * @return handle to an Application object or an uninitialized base handle
+ */
+DALI_ADAPTOR_API Application DownCast(Dali::RefObject* refObject);
+
+/**
+ * @brief This signal will be triggered when a custom command is received.
+ *
+ * For this signal to be triggered, the adaptor must be built with -DENABLE_NETWORK_LOGGING=ON
+ * and when running, DALI_NETWORK_CONTROL=1 must also be set.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName(const std::string&);
+ * @endcode
+ *
+ * @param[in] application A handle to the Application
+ * @return The signal when a custom command is received
+ */
+DALI_ADAPTOR_API CustomCommandReceivedSignalType& CustomCommandReceivedSignal(Application application);
+
+/**
+ * @brief Gets the render thread id of DALi.
+ * @note If render thread id getter doesn't supported, it will return 0 as default.
+ * @param application A handle to the Application
+ * @return The render thread id.
+ */
+DALI_ADAPTOR_API int32_t GetRenderThreadId(Application application);
+
+/**
+ * @brief Relayout the application and ensure all pending operations are flushed to the update thread.
+ * @param application A handle to the Application
+ */
+DALI_ADAPTOR_API void FlushUpdateMessages(Application application);
 
 } // namespace DevelApplication
 
@@ -59,14 +118,13 @@ DALI_ADAPTOR_API std::string GetDataPath();
 
 /**
  * @brief This is used to improve application launch performance.
- * It preloads so files, initializes some functions in advance and makes a window in advance.
+ * Initializes some functions in advance and makes a window in advance.
  * @param[in,out]  argc A pointer to the number of arguments
  * @param[in,out]  argv A pointer to the argument list
  *
  * @note Declared in C style for calling from app-launcher.
  *
  */
-extern "C"
-DALI_ADAPTOR_API void PreInitialize( int* argc, char** argv[] );
+extern "C" DALI_ADAPTOR_API void ApplicationPreInitialize(int* argc, char** argv[]);
 
 #endif // DALI_APPLICATION_DEVEL_H