1 #ifndef __DALI_INTERNAL_WIDGET_DATA_H__
2 #define __DALI_INTERNAL_WIDGET_DATA_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 <dali/public-api/object/base-object.h>
25 #include <widget-data.h>
37 typedef IntrusivePtr<WidgetData> WidgetDataPtr;
40 * Implementation of the Application class.
42 class WidgetData : public BaseObject
47 * Create a new WidgetData
48 * @param[in] instanceId for widget instance
49 * @param[in] args for widget instance
50 * @param[in] content for widget instance
51 * @return A handle to the WidgetData
53 static Dali::WidgetData New( const char* instanceId, bundle* args, char* content );
56 * @brief Get widget instance id
58 * @return Id of widget instance
60 const char* GetInstanceId();
63 * @brief Get widget instance arguments
65 * @return Bundle which contains widget instance arguments
70 * @brief Get widget instance content
72 * @return Content of widget instance
77 * @brief Get widget instance Window
79 * @return Window of widget instance
81 Dali::Window GetWindow();
84 * @brief Set widget instance arguments
86 * @param[in] args arguments of widget instance
88 void SetArgs( bundle* args );
91 * @brief Set widget instance arguments
93 * @param[in] content content of widget instance
95 void SetContent( char* content );
98 * @brief Set widget instance arguments
100 * @param[in] window Window of widget instance
102 void SetWindow( Dali::Window window );
107 * Private Constructor
108 * @param[in] instanceId for widget instance
109 * @param[in] args for widget instance
110 * @param[in] content for widget instance
112 WidgetData( const char* instanceId, bundle* args, char* content );
117 virtual ~WidgetData();
120 WidgetData(const WidgetData&);
121 WidgetData& operator=(WidgetData&);
125 Dali::Window mWindow;
127 const char* mInstanceId;
132 inline WidgetData& GetImplementation(Dali::WidgetData& widgetData)
134 DALI_ASSERT_ALWAYS(widgetData && "widget data handle is empty");
136 BaseObject& handle = widgetData.GetBaseObject();
138 return static_cast<Internal::Adaptor::WidgetData&>(handle);
141 inline const WidgetData& GetImplementation(const Dali::WidgetData& widgetData)
143 DALI_ASSERT_ALWAYS(widgetData && "widget data handle is empty");
145 const BaseObject& handle = widgetData.GetBaseObject();
147 return static_cast<const Internal::Adaptor::WidgetData&>(handle);
150 } // namespace Adaptor
152 } // namespace Internal
156 #endif // __DALI_INTERNAL_WIDGET_DATA_H__