1 #ifndef DALI_INTERNAL_COMPONENT_APPLICATION_H
2 #define DALI_INTERNAL_COMPONENT_APPLICATION_H
5 * Copyright (c) 2023 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/devel-api/adaptor-framework/component-application.h>
23 #include <dali/internal/adaptor/common/application-impl.h>
33 class ComponentApplication;
34 typedef IntrusivePtr<ComponentApplication> ComponentApplicationPtr;
37 * Implementation of the ComponentApplication class.
39 class ComponentApplication : public Application
42 typedef Dali::ComponentApplication::CreateSignalType CreateSignal;
46 * Create a new component application
47 * @param[in] argc A pointer to the number of arguments
48 * @param[in] argv A pointer to the argument list
49 * @param[in] stylesheet The path to user defined theme file
50 * @param[in] windowData The window data
51 * @return A handle to the ComponentApplication
53 static ComponentApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
56 * @brief The default constructor.
58 ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
61 * @brief Undefined copy constructor.
63 ComponentApplication(const ComponentApplication&) = default;
68 virtual ~ComponentApplication() = default;
71 *@brief Undefined assignment operator.
73 ComponentApplication& operator=(const ComponentApplication&) = delete;
75 public: // From Framework::Observer
77 * Called when the framework is Component Application Created.
79 Any OnCreate() override;
82 CreateSignal mCreateSignal;
85 inline ComponentApplication& GetImplementation(Dali::ComponentApplication& application)
87 DALI_ASSERT_ALWAYS(application && "application handle is empty");
89 BaseObject& handle = application.GetBaseObject();
91 return static_cast<Internal::Adaptor::ComponentApplication&>(handle);
94 inline const ComponentApplication& GetImplementation(const Dali::ComponentApplication& application)
96 DALI_ASSERT_ALWAYS(application && "application handle is empty");
98 const BaseObject& handle = application.GetBaseObject();
100 return static_cast<const Internal::Adaptor::ComponentApplication&>(handle);
103 } // namespace Adaptor
105 } // namespace Internal