1 #ifndef DALI_APPLICATION_DEVEL_H
2 #define DALI_APPLICATION_DEVEL_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/adaptor-framework/application.h>
23 #include <dali/public-api/dali-adaptor-common.h>
26 #include <dali/public-api/signals/dali-signal.h>
30 namespace DevelApplication
33 using CustomCommandReceivedSignalType = Signal<void(const std::string&)>; ///< Signal signature for CustomCommandReceivedSignal
36 * @brief This is the constructor for applications.
37 * Especially, it is for keyboard application.
38 * If you want to create Ime window, use this API with WindowType::IME.
40 * @param[in,out] argc A pointer to the number of arguments
41 * @param[in,out] argv A pointer to the argument list
42 * @param[in] stylesheet The path to user defined theme file
43 * @param[in] windowMode A member of WINDOW_MODE
44 * @param[in] positionSize A position and a size of the window
45 * @param[in] type It is window type for default window.
46 * @return A handle to the Application
47 * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
49 DALI_ADAPTOR_API Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize, WindowType type);
52 * @brief Ensures that the function passed in is called from the main loop when it is idle.
53 * @param[in] application A handle to the Application
54 * @param[in] callback The function to call
55 * @return @c true if added successfully, @c false otherwise
57 * @note Function must be called from main event thread only
59 * A callback of the following type should be used:
63 * This callback will be called repeatedly as long as it returns true. A return of 0 deletes this callback.
65 * @note Ownership of the callback is passed onto this class.
67 DALI_ADAPTOR_API bool AddIdleWithReturnValue(Application application, CallbackBase* callback);
70 * @brief Gets the absolute path to the application's data directory which is used to store private data of the application.
71 * @return The absolute path to the application's data directory
73 DALI_ADAPTOR_API std::string GetDataPath();
76 * @brief Downcasts a ref object to Application handle
78 * If handle points to an Application object, the downcast produces valid base handle
79 * If not, the returned base handle is left uninitialized
81 * @param[in] refObject to an Application
82 * @return handle to an Application object or an uninitialized base handle
84 DALI_ADAPTOR_API Application DownCast(Dali::RefObject* refObject);
87 * @brief This signal will be triggered when a custom command is received.
89 * For this signal to be triggered, the adaptor must be built with -DENABLE_NETWORK_LOGGING=ON
90 * and when running, DALI_NETWORK_CONTROL=1 must also be set.
92 * A callback of the following type may be connected:
94 * void YourCallbackName(const std::string&);
97 * @param[in] application A handle to the Application
98 * @return The signal when a custom command is received
100 DALI_ADAPTOR_API CustomCommandReceivedSignalType& CustomCommandReceivedSignal(Application application);
102 } // namespace DevelApplication
107 * @brief This is used to improve application launch performance.
108 * Initializes some functions in advance and makes a window in advance.
109 * @param[in,out] argc A pointer to the number of arguments
110 * @param[in,out] argv A pointer to the argument list
112 * @note Declared in C style for calling from app-launcher.
115 extern "C" DALI_ADAPTOR_API void ApplicationPreInitialize(int* argc, char** argv[]);
117 #endif // DALI_APPLICATION_DEVEL_H