1 #ifndef DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H
2 #define DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H
5 * Copyright (c) 2017 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 <widget_base.h>
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>
39 class WidgetApplication;
40 typedef IntrusivePtr<WidgetApplication> WidgetApplicationPtr;
43 * Implementation of the WidgetApplication class.
45 class WidgetApplicationTizen : public WidgetApplication
49 typedef std::pair<const std::string, Dali::WidgetApplication::CreateWidgetFunction > CreateWidgetFunctionPair;
50 typedef std::vector< CreateWidgetFunctionPair > CreateWidgetFunctionContainer;
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
58 static WidgetApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet );
62 * @copydoc Dali::Internal::Adaptor::Application::OnInit()
64 virtual void OnInit();
67 * @copydoc Dali::WidgetApplication::RegisterWidgetCreator()
69 void RegisterWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction ) override;
72 * Add widget name - CreateWidgetFunction pair to container.
74 void AddWidgetCreatingFunctionPair( CreateWidgetFunctionPair pair );
77 * Find and get CreateWidgetFunctionPair in container by widget name.
79 CreateWidgetFunctionPair GetWidgetCreatingFunctionPair( const std::string& widgetName );
82 * Add widget_base_instance_h - Widget instance pair to container.
84 void AddWidget( widget_base_instance_h widgetBaseInstance, Dali::Widget widget , Dali::Window window );
87 * Find and get Widget instance in container by widget_base_instance_h.
89 Dali::Widget GetWidget( widget_base_instance_h widgetBaseInstance ) const;
92 * Delete widget_base_instance_h - Widget instance pair in container.
94 void DeleteWidget( widget_base_instance_h widgetBaseInstance );
97 * Find and get Window instance in container by widget_base_instance_h.
99 Dali::Window GetWindowFromWidget( widget_base_instance_h widgetBaseInstance ) const;
102 * Get the number of created widget.
104 int32_t GetWidgetCount();
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
114 WidgetApplicationTizen( int* argc, char **argv[], const std::string& stylesheet );
119 virtual ~WidgetApplicationTizen();
121 WidgetApplicationTizen(const Application&) = delete;
122 WidgetApplicationTizen& operator=(Application&) = delete;
126 typedef std::pair< widget_base_instance_h, Dali::Widget > WidgetInstancePair;
127 typedef std::vector< WidgetInstancePair > WidgetInstanceContainer;
129 CreateWidgetFunctionContainer mCreateWidgetFunctionContainer;
130 WidgetInstanceContainer mWidgetInstanceContainer;
132 typedef std::pair< widget_base_instance_h, Dali::Window > WindowInstancePair;
133 typedef std::vector< WindowInstancePair > WindowInstanceContainer;
134 WindowInstanceContainer mWindowInstanceContainer;
137 } // namespace Adaptor
139 } // namespace Internal
143 #endif // DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H