1 #ifndef DALI_COMPONENT_APPLICATION_H
\r
2 #define DALI_COMPONENT_APPLICATION_H
\r
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
\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
11 * http://www.apache.org/licenses/LICENSE-2.0
\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
21 // INTERNAL INCLUDES
\r
22 #include <dali/public-api/adaptor-framework/application.h>
\r
26 namespace Internal DALI_INTERNAL
\r
30 class ComponentApplication;
\r
33 } // namespace DALI_INTERNAL
\r
36 * @brief An ComponentApplication class object should be created by every component-based application
\r
37 * that wishes to use Dali.
\r
39 * Component application draw multiple UI applications based on frame components.
\r
40 * component application can draw multiple UIs in one process.
\r
42 * It provides a means for initializing the
\r
43 * resources required by the Dali::Core.
\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
51 class DALI_ADAPTOR_API ComponentApplication : public Application
\r
54 typedef Signal<Any()> CreateSignalType;
\r
58 * @brief This is the constructor for component applications without an argument list.
\r
59 * @return A handle to the ComponentApplication
\r
61 static ComponentApplication New();
\r
64 * @brief This is the constructor for component applications.
\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
70 static ComponentApplication New(int* argc, char** argv[]);
\r
73 * @brief This is the constructor for component applications with a stylesheet
\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
80 static ComponentApplication New(int* argc, char** argv[], const std::string& stylesheet);
\r
83 * @brief The default constructor.
\r
85 ComponentApplication() = default;
\r
88 * @brief Copy Constructor.
\r
90 * @param[in] componentApplication Handle to an object
\r
92 ComponentApplication(const ComponentApplication& componentApplication) = default;
\r
95 * @brief Assignment operator.
\r
97 * @param[in] componentApplication Handle to an object
\r
98 * @return A reference to this
\r
100 ComponentApplication& operator=(const ComponentApplication& componentApplication) = default;
\r
103 * @brief Destructor
\r
105 ~ComponentApplication() = default;
\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
113 CreateSignalType& CreateSignal();
\r
118 * @brief Internal constructor.
\r
120 explicit DALI_INTERNAL ComponentApplication(Internal::Adaptor::ComponentApplication* componentApplication);
\r
123 } // namespace Dali
\r
125 #endif // DALI_COMPONENT_APPLICATION_H
\r