[dali_2.3.25] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / tizen-wayland / component-application-impl.h
1 #ifndef DALI_INTERNAL_COMPONENT_APPLICATION_H
2 #define DALI_INTERNAL_COMPONENT_APPLICATION_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/devel-api/adaptor-framework/component-application.h>
23 #include <dali/internal/adaptor/common/application-impl.h>
24
25 namespace Dali
26 {
27 class Adaptor;
28
29 namespace Internal
30 {
31 namespace Adaptor
32 {
33 class ComponentApplication;
34 typedef IntrusivePtr<ComponentApplication> ComponentApplicationPtr;
35
36 /**
37  * Implementation of the ComponentApplication class.
38  */
39 class ComponentApplication : public Application
40 {
41 public:
42   typedef Dali::ComponentApplication::CreateSignalType CreateSignal;
43
44 public:
45   /**
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
52    */
53   static ComponentApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
54
55   /**
56    * @brief The default constructor.
57    */
58   ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
59
60   /**
61    * @brief Undefined copy constructor.
62    */
63   ComponentApplication(const ComponentApplication&) = default;
64
65   /**
66    * @brief Destructor
67    */
68   virtual ~ComponentApplication() = default;
69
70   /**
71    *@brief Undefined assignment operator.
72    */
73   ComponentApplication& operator=(const ComponentApplication&) = delete;
74
75 public: // From Framework::Observer
76   /**
77    * Called when the framework is Component Application Created.
78    */
79   Any OnCreate() override;
80
81 public:
82   CreateSignal mCreateSignal;
83 };
84
85 inline ComponentApplication& GetImplementation(Dali::ComponentApplication& application)
86 {
87   DALI_ASSERT_ALWAYS(application && "application handle is empty");
88
89   BaseObject& handle = application.GetBaseObject();
90
91   return static_cast<Internal::Adaptor::ComponentApplication&>(handle);
92 }
93
94 inline const ComponentApplication& GetImplementation(const Dali::ComponentApplication& application)
95 {
96   DALI_ASSERT_ALWAYS(application && "application handle is empty");
97
98   const BaseObject& handle = application.GetBaseObject();
99
100   return static_cast<const Internal::Adaptor::ComponentApplication&>(handle);
101 }
102
103 } // namespace Adaptor
104
105 } // namespace Internal
106
107 } // namespace Dali
108 #endif