CanvasRenderer: Add Set/GetViewBox() API
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / application-devel.h
1 #ifndef DALI_APPLICATION_DEVEL_H
2 #define DALI_APPLICATION_DEVEL_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/adaptor-framework/application.h>
23
24 namespace Dali
25 {
26 namespace DevelApplication
27 {
28 /**
29    * @brief This is the constructor for applications.
30    * Especially, it is for keyboard application.
31    * If you want to create Ime window, use this API with WindowType::IME.
32    *
33    * @param[in,out]  argc                A pointer to the number of arguments
34    * @param[in,out]  argv                A pointer to the argument list
35    * @param[in]      stylesheet          The path to user defined theme file
36    * @param[in]      windowMode          A member of WINDOW_MODE
37    * @param[in]      positionSize        A position and a size of the window
38    * @param[in]      type                It is window type for default window.
39    * @return A handle to the Application
40    * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
41    */
42 DALI_ADAPTOR_API Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize, WindowType type);
43
44 /**
45  * @brief Ensures that the function passed in is called from the main loop when it is idle.
46  * @param[in] application A handle to the Application
47  * @param[in] callback The function to call
48  * @return @c true if added successfully, @c false otherwise
49  *
50  * @note Function must be called from main event thread only
51  *
52  * A callback of the following type should be used:
53  * @code
54  *   bool MyFunction();
55  * @endcode
56  * This callback will be called repeatedly as long as it returns true. A return of 0 deletes this callback.
57  *
58  * @note Ownership of the callback is passed onto this class.
59  */
60 DALI_ADAPTOR_API bool AddIdleWithReturnValue(Application application, CallbackBase* callback);
61
62 /**
63 * @brief Gets the absolute path to the application's data directory which is used to store private data of the application.
64 * @return The absolute path to the application's data directory
65 */
66 DALI_ADAPTOR_API std::string GetDataPath();
67
68 /**
69  * @brief Downcasts a ref object to Application handle
70  *
71  * If handle points to an Application object, the downcast produces valid base handle
72  * If not, the returned base handle is left uninitialized
73  *
74  * @param[in] refObject to an Application
75  * @return handle to an Application object or an uninitialized base handle
76  */
77 DALI_ADAPTOR_API Application DownCast(Dali::RefObject* refObject);
78
79 } // namespace DevelApplication
80
81 } // namespace Dali
82
83 /**
84  * @brief This is used to improve application launch performance.
85  * Initializes some functions in advance and makes a window in advance.
86  * @param[in,out]  argc A pointer to the number of arguments
87  * @param[in,out]  argv A pointer to the argument list
88  *
89  * @note Declared in C style for calling from app-launcher.
90  *
91  */
92 extern "C" DALI_ADAPTOR_API void ApplicationPreInitialize(int* argc, char** argv[]);
93
94 #endif // DALI_APPLICATION_DEVEL_H