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 #ifdef WIDGET_SUPPOERTED
23 #include <widget_base.h>
27 #include <dali/internal/adaptor/common/application-impl.h>
28 #include <dali/internal/system/common/widget-application-impl.h>
30 #ifndef WIDGET_SUPPOERTED
31 typedef void* widget_base_instance_h;
44 class WidgetApplication;
45 typedef IntrusivePtr<WidgetApplication> WidgetApplicationPtr;
48 * Implementation of the WidgetApplication class.
50 class WidgetApplicationTizen : public WidgetApplication
54 typedef std::pair<const std::string, Dali::WidgetApplication::CreateWidgetFunction > CreateWidgetFunctionPair;
55 typedef std::vector< CreateWidgetFunctionPair > CreateWidgetFunctionContainer;
58 * Create a new widget application
59 * @param[in] argc A pointer to the number of arguments
60 * @param[in] argv A pointer to the argument list
61 * @param[in] stylesheet The path to user defined theme file
63 static WidgetApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet );
68 * @copydoc Dali::WidgetApplication::RegisterWidgetCreator()
70 void RegisterWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction ) override;
73 * Add widget name - CreateWidgetFunction pair to container.
75 void AddWidgetCreatingFunctionPair( CreateWidgetFunctionPair pair );
78 * Find and get CreateWidgetFunctionPair in container by widget name.
80 CreateWidgetFunctionPair GetWidgetCreatingFunctionPair( const std::string& widgetName );
83 * Add widget_base_instance_h - Widget instance pair to container.
85 void AddWidget( widget_base_instance_h widgetBaseInstance, Dali::Widget widget );
88 * Find and get Widget instance in container by widget_base_instance_h.
90 Dali::Widget GetWidget( widget_base_instance_h widgetBaseInstance );
93 * Delete widget_base_instance_h - Widget instance pair in container.
95 void DeleteWidget( widget_base_instance_h widgetBaseInstance );
100 * Private Constructor
101 * @param[in] argc A pointer to the number of arguments
102 * @param[in] argv A pointer to the argument list
103 * @param[in] stylesheet The path to user defined theme file
105 WidgetApplicationTizen( int* argc, char **argv[], const std::string& stylesheet );
110 virtual ~WidgetApplicationTizen();
112 WidgetApplicationTizen(const Application&) = delete;
113 WidgetApplicationTizen& operator=(Application&) = delete;
117 typedef std::pair< widget_base_instance_h, Dali::Widget > WidgetInstancePair;
118 typedef std::vector< WidgetInstancePair > WidgetInstanceContainer;
120 CreateWidgetFunctionContainer mCreateWidgetFunctionContainer;
121 WidgetInstanceContainer mWidgetInstanceContainer;
125 } // namespace Adaptor
127 } // namespace Internal
131 #endif // DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H