Merge "Changed 'virtual' function override declarations to 'override' in automated...
[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) 2020 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
32 namespace Adaptor
33 {
34
35 class ComponentApplication;
36 typedef IntrusivePtr<ComponentApplication> ComponentApplicationPtr;
37
38 /**
39  * Implementation of the ComponentApplication class.
40  */
41 class ComponentApplication : public Application
42 {
43 public:
44   typedef Dali::ComponentApplication::CreateSignalType CreateSignal;
45
46 public:
47   /**
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
54    */
55   static ComponentApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
56
57   /**
58    * @brief The default constructor.
59    */
60   ComponentApplication( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
61
62   /**
63    * @brief Undefined copy constructor.
64    */
65   ComponentApplication( const ComponentApplication& ) = default;
66
67   /**
68    * @brief Destructor
69    */
70   virtual ~ComponentApplication() = default;
71
72   /**
73    *@brief Undefined assignment operator.
74    */
75   ComponentApplication& operator=( const ComponentApplication& ) = delete;
76
77 public:  // From Framework::Observer
78   /**
79    * Called when the framework is Component Application Created.
80    */
81   Any OnCreate() override;
82
83 public:
84   CreateSignal                           mCreateSignal;
85 };
86
87 inline ComponentApplication& GetImplementation(Dali::ComponentApplication& application)
88 {
89   DALI_ASSERT_ALWAYS(application && "application handle is empty");
90
91   BaseObject& handle = application.GetBaseObject();
92
93   return static_cast<Internal::Adaptor::ComponentApplication&>(handle);
94 }
95
96 inline const ComponentApplication& GetImplementation(const Dali::ComponentApplication& application)
97 {
98   DALI_ASSERT_ALWAYS(application && "application handle is empty");
99
100   const BaseObject& handle = application.GetBaseObject();
101
102   return static_cast<const Internal::Adaptor::ComponentApplication&>(handle);
103 }
104
105
106 } // namespace Adaptor
107
108 } // namespace Internal
109
110 } // namespace Dali
111 #endif