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
31 class ComponentApplication;
\r
37 * @brief An ComponentApplication class object should be created by every component-based application
\r
38 * that wishes to use Dali.
\r
40 * Component application draw multiple UI applications based on frame components.
\r
41 * component application can draw multiple UIs in one process.
\r
43 * It provides a means for initializing the
\r
44 * resources required by the Dali::Core.
\r
46 * The ComponentApplication class emits several signals which the user can
\r
47 * connect to. The user should not create any Dali objects in the main
\r
48 * function and instead should connect to the Init signal of the
\r
49 * ComponentApplication and create the Dali Widget object in the connected callback.
\r
52 class DALI_ADAPTOR_API ComponentApplication : public Application
\r
55 typedef Signal< Any () > CreateSignalType;
\r
59 * @brief This is the constructor for component applications without an argument list.
\r
60 * @return A handle to the ComponentApplication
\r
62 static ComponentApplication New( );
\r
65 * @brief This is the constructor for component applications.
\r
67 * @param[in,out] argc A pointer to the number of arguments
68 * @param[in,out] argv A pointer to the argument list
\r
69 * @return A handle to the ComponentApplication
\r
71 static ComponentApplication New( int* argc, char **argv[] );
\r
74 * @brief This is the constructor for component applications with a stylesheet
\r
76 * @param[in,out] argc A pointer to the number of arguments
77 * @param[in,out] argv A pointer to the argument list
\r
78 * @param[in] stylesheet The path to user defined theme file
79 * @return A handle to the ComponentApplication
\r
81 static ComponentApplication New( int* argc, char **argv[], const std::string& stylesheet );
\r
84 * @brief The default constructor.
\r
86 ComponentApplication() = default;
\r
89 * @brief Copy Constructor.
\r
91 * @param[in] componentApplication Handle to an object
\r
93 ComponentApplication( const ComponentApplication& componentApplication ) = default;
\r
96 * @brief Assignment operator.
\r
98 * @param[in] componentApplication Handle to an object
\r
99 * @return A reference to this
\r
101 ComponentApplication& operator=( const ComponentApplication& componentApplication ) = default;
\r
104 * @brief Destructor
\r
106 ~ComponentApplication() = default;
\r
109 * @brief The user should connect to this signal to determine when they should initialize
\r
110 * their application.
\r
111 * The callback function is called before the main loop of the application starts.
\r
112 * @return The signal to connect to
\r
114 CreateSignalType& CreateSignal();
\r
119 * @brief Internal constructor.
\r
121 explicit DALI_INTERNAL ComponentApplication(Internal::Adaptor::ComponentApplication* componentApplication);
\r
124 } // namespace Dali
\r
126 #endif // DALI_COMPONENT_APPLICATION_H
\r