Changed 'virtual' function override declarations to 'override'.
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / tizen-wayland / widget-application-impl-tizen.h
1 #ifndef DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H
2 #define DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H
3
4 /*
5  * Copyright (c) 2017 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 // EXTERNAL INCLUDES
22 #include <widget_base.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/internal/adaptor/common/application-impl.h>
26 #include <dali/internal/system/common/widget-application-impl.h>
27 #include <dali/devel-api/adaptor-framework/window-devel.h>
28
29 namespace Dali
30 {
31 class Widget;
32
33 namespace Internal
34 {
35
36 namespace Adaptor
37 {
38
39 class WidgetApplication;
40 typedef IntrusivePtr<WidgetApplication> WidgetApplicationPtr;
41
42 /**
43  * Implementation of the WidgetApplication class.
44  */
45 class WidgetApplicationTizen : public WidgetApplication
46 {
47 public:
48
49   typedef std::pair<const std::string, Dali::WidgetApplication::CreateWidgetFunction >  CreateWidgetFunctionPair;
50   typedef std::vector< CreateWidgetFunctionPair >   CreateWidgetFunctionContainer;
51
52   /**
53    * Create a new widget application
54    * @param[in]  argc         A pointer to the number of arguments
55    * @param[in]  argv         A pointer to the argument list
56    * @param[in]  stylesheet   The path to user defined theme file
57    */
58   static WidgetApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet );
59
60 public:
61   /**
62    * @copydoc Dali::Internal::Adaptor::Application::OnInit()
63    */
64   void OnInit() override;
65
66   /**
67    * @copydoc Dali::WidgetApplication::RegisterWidgetCreator()
68    */
69   void RegisterWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction ) override;
70
71   /**
72    * Add widget name - CreateWidgetFunction pair to container.
73    */
74   void AddWidgetCreatingFunctionPair( CreateWidgetFunctionPair pair );
75
76   /**
77    * Find and get CreateWidgetFunctionPair in container by widget name.
78    */
79   CreateWidgetFunctionPair GetWidgetCreatingFunctionPair( const std::string& widgetName );
80
81   /**
82    * Add widget_base_instance_h - Widget instance pair to container.
83    */
84   void AddWidget( widget_base_instance_h widgetBaseInstance, Dali::Widget widget , Dali::Window window );
85
86   /**
87    * Find and get Widget instance in container by widget_base_instance_h.
88    */
89   Dali::Widget GetWidget( widget_base_instance_h widgetBaseInstance ) const;
90
91   /**
92    * Delete widget_base_instance_h - Widget instance pair in container.
93    */
94   void DeleteWidget( widget_base_instance_h widgetBaseInstance );
95
96   /**
97    * Find and get Window instance in container by widget_base_instance_h.
98    */
99   Dali::Window GetWindowFromWidget( widget_base_instance_h widgetBaseInstance ) const;
100
101   /**
102    * Get the number of created widget.
103    */
104   int32_t GetWidgetCount();
105
106 protected:
107
108   /**
109    * Private Constructor
110    * @param[in]  argc         A pointer to the number of arguments
111    * @param[in]  argv         A pointer to the argument list
112    * @param[in]  stylesheet   The path to user defined theme file
113    */
114   WidgetApplicationTizen( int* argc, char **argv[], const std::string& stylesheet );
115
116   /**
117    * Destructor
118    */
119   virtual ~WidgetApplicationTizen();
120
121   WidgetApplicationTizen(const Application&) = delete;
122   WidgetApplicationTizen& operator=(Application&) = delete;
123
124 private:
125
126   typedef std::pair< widget_base_instance_h, Dali::Widget > WidgetInstancePair;
127   typedef std::vector< WidgetInstancePair >                 WidgetInstanceContainer;
128
129   CreateWidgetFunctionContainer  mCreateWidgetFunctionContainer;
130   WidgetInstanceContainer        mWidgetInstanceContainer;
131
132   typedef std::pair< widget_base_instance_h, Dali::Window >  WindowInstancePair;
133   typedef std::vector< WindowInstancePair >                 WindowInstanceContainer;
134   WindowInstanceContainer mWindowInstanceContainer;
135 };
136
137 } // namespace Adaptor
138
139 } // namespace Internal
140
141 } // namespace Dali
142
143 #endif // DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H