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>
38 class WidgetApplication;
39 typedef IntrusivePtr<WidgetApplication> WidgetApplicationPtr;
42 * Implementation of the WidgetApplication class.
44 class WidgetApplicationTizen : public WidgetApplication
48 typedef std::pair<const std::string, Dali::WidgetApplication::CreateWidgetFunction > CreateWidgetFunctionPair;
49 typedef std::vector< CreateWidgetFunctionPair > CreateWidgetFunctionContainer;
52 * Create a new widget application
53 * @param[in] argc A pointer to the number of arguments
54 * @param[in] argv A pointer to the argument list
55 * @param[in] stylesheet The path to user defined theme file
57 static WidgetApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet );
61 * @copydoc Dali::Internal::Adaptor::Application::OnInit()
63 virtual void OnInit();
66 * @copydoc Dali::WidgetApplication::RegisterWidgetCreator()
68 void RegisterWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction ) override;
71 * Add widget name - CreateWidgetFunction pair to container.
73 void AddWidgetCreatingFunctionPair( CreateWidgetFunctionPair pair );
76 * Find and get CreateWidgetFunctionPair in container by widget name.
78 CreateWidgetFunctionPair GetWidgetCreatingFunctionPair( const std::string& widgetName );
81 * Add widget_base_instance_h - Widget instance pair to container.
83 void AddWidget( widget_base_instance_h widgetBaseInstance, Dali::Widget widget );
86 * Find and get Widget instance in container by widget_base_instance_h.
88 Dali::Widget GetWidget( widget_base_instance_h widgetBaseInstance );
91 * Delete widget_base_instance_h - Widget instance pair in container.
93 void DeleteWidget( widget_base_instance_h widgetBaseInstance );
99 * @param[in] argc A pointer to the number of arguments
100 * @param[in] argv A pointer to the argument list
101 * @param[in] stylesheet The path to user defined theme file
103 WidgetApplicationTizen( int* argc, char **argv[], const std::string& stylesheet );
108 virtual ~WidgetApplicationTizen();
110 WidgetApplicationTizen(const Application&) = delete;
111 WidgetApplicationTizen& operator=(Application&) = delete;
115 typedef std::pair< widget_base_instance_h, Dali::Widget > WidgetInstancePair;
116 typedef std::vector< WidgetInstancePair > WidgetInstanceContainer;
118 CreateWidgetFunctionContainer mCreateWidgetFunctionContainer;
119 WidgetInstanceContainer mWidgetInstanceContainer;
123 } // namespace Adaptor
125 } // namespace Internal
129 #endif // DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H