[dali_2.3.25] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / component-application.h
1 #ifndef DALI_COMPONENT_APPLICATION_H\r
2 #define DALI_COMPONENT_APPLICATION_H\r
3 \r
4 /*\r
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
6  *\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  * http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  *\r
19  */\r
20 \r
21 // INTERNAL INCLUDES\r
22 #include <dali/public-api/adaptor-framework/application.h>\r
23 \r
24 namespace Dali\r
25 {\r
26 namespace Internal DALI_INTERNAL\r
27 {\r
28 namespace Adaptor\r
29 {\r
30 class ComponentApplication;\r
31 }\r
32 \r
33 } // namespace DALI_INTERNAL\r
34 \r
35 /**\r
36  * @brief An ComponentApplication class object should be created by every component-based application\r
37  * that wishes to use Dali.\r
38  *\r
39  * Component application draw multiple UI applications based on frame components.\r
40  * component application can draw multiple UIs in one process.\r
41  *\r
42  * It provides a means for initializing the\r
43  * resources required by the Dali::Core.\r
44  *\r
45  * The ComponentApplication class emits several signals which the user can\r
46  * connect to.  The user should not create any Dali objects in the main\r
47  * function and instead should connect to the Init signal of the\r
48  * ComponentApplication and create the Dali Widget object in the connected callback.\r
49  *\r
50  */\r
51 class DALI_ADAPTOR_API ComponentApplication : public Application\r
52 {\r
53 public:\r
54   typedef Signal<Any()> CreateSignalType;\r
55 \r
56 public:\r
57   /**
58    * @brief This is the constructor for component applications without an argument list.\r
59    * @return A handle to the ComponentApplication\r
60    */\r
61   static ComponentApplication New();\r
62 \r
63   /**
64    * @brief This is the constructor for component applications.\r
65    *\r
66    * @param[in,out]  argc        A pointer to the number of arguments
67    * @param[in,out]  argv        A pointer to the argument list\r
68    * @return A handle to the ComponentApplication\r
69    */\r
70   static ComponentApplication New(int* argc, char** argv[]);\r
71 \r
72   /**
73    * @brief This is the constructor for component applications with a stylesheet\r
74    *\r
75    * @param[in,out]  argc        A pointer to the number of arguments
76    * @param[in,out]  argv        A pointer to the argument list\r
77    * @param[in]      stylesheet  The path to user defined theme file
78    * @return A handle to the ComponentApplication\r
79    */\r
80   static ComponentApplication New(int* argc, char** argv[], const std::string& stylesheet);\r
81 \r
82   /**\r
83    * @brief The default constructor.\r
84    */\r
85   ComponentApplication() = default;\r
86 \r
87   /**\r
88    * @brief Copy Constructor.\r
89    *\r
90    * @param[in] componentApplication Handle to an object\r
91    */\r
92   ComponentApplication(const ComponentApplication& componentApplication) = default;\r
93 \r
94   /**\r
95    * @brief Assignment operator.\r
96    *\r
97    * @param[in] componentApplication Handle to an object\r
98    * @return A reference to this\r
99    */\r
100   ComponentApplication& operator=(const ComponentApplication& componentApplication) = default;\r
101 \r
102   /**\r
103    * @brief Destructor\r
104    */\r
105   ~ComponentApplication() = default;\r
106 \r
107   /**\r
108   * @brief The user should connect to this signal to determine when they should initialize\r
109   * their application.\r
110   * The callback function is called before the main loop of the application starts.\r
111   * @return The signal to connect to\r
112   */\r
113   CreateSignalType& CreateSignal();\r
114 \r
115 public:\r
116   /// @cond internal\r
117   /**\r
118    * @brief Internal constructor.\r
119    */\r
120   explicit DALI_INTERNAL ComponentApplication(Internal::Adaptor::ComponentApplication* componentApplication);\r
121   /// @endcond\r
122 };\r
123 } // namespace Dali\r
124 \r
125 #endif // DALI_COMPONENT_APPLICATION_H\r