1 #ifndef DALI_INTERNAL_COMPONENT_APPLICATION_H
2 #define DALI_INTERNAL_COMPONENT_APPLICATION_H
5 * Copyright (c) 2020 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>
35 class ComponentApplication;
36 typedef IntrusivePtr<ComponentApplication> ComponentApplicationPtr;
39 * Implementation of the ComponentApplication class.
41 class ComponentApplication : public Application
44 typedef Dali::ComponentApplication::CreateSignalType CreateSignal;
48 * Create a new component application
49 * @param[in] argc A pointer to the number of arguments
50 * @param[in] argv A pointer to the argument list
51 * @param[in] stylesheet The path to user defined theme file
52 * @param[in] windowMode A member of WINDOW_MODE
53 * @return A handle to the ComponentApplication
55 static ComponentApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
58 * @brief The default constructor.
60 ComponentApplication( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
63 * @brief Undefined copy constructor.
65 ComponentApplication( const ComponentApplication& ) = default;
70 virtual ~ComponentApplication() = default;
73 *@brief Undefined assignment operator.
75 ComponentApplication& operator=( const ComponentApplication& ) = delete;
77 public: // From Framework::Observer
79 * Called when the framework is Component Application Created.
81 virtual Any OnCreate();
84 CreateSignal mCreateSignal;
87 inline ComponentApplication& GetImplementation(Dali::ComponentApplication& application)
89 DALI_ASSERT_ALWAYS(application && "application handle is empty");
91 BaseObject& handle = application.GetBaseObject();
93 return static_cast<Internal::Adaptor::ComponentApplication&>(handle);
96 inline const ComponentApplication& GetImplementation(const Dali::ComponentApplication& application)
98 DALI_ASSERT_ALWAYS(application && "application handle is empty");
100 const BaseObject& handle = application.GetBaseObject();
102 return static_cast<const Internal::Adaptor::ComponentApplication&>(handle);
106 } // namespace Adaptor
108 } // namespace Internal