[widget-viewer-dali] Change the license as Flora
[platform/core/uifw/widget-viewer-dali.git] / public_api / widget_view_manager / widget_view_manager.h
1 #ifndef __DALI_WIDGET_VIEW_WIDGET_VIEW_MANAGER_H__
2 #define __DALI_WIDGET_VIEW_WIDGET_VIEW_MANAGER_H__
3
4 /*
5  * Samsung API
6  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7  *
8  * Licensed under the Flora License, Version 1.1 (the License);
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://floralicense.org/license/
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an AS IS BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 // INTERNAL INCLUDES
22 #include <public_api/widget_view/widget_view.h>
23
24 // EXTERNAL INCLUDES
25 #include <dali/public-api/object/base-handle.h>
26 #include <dali/public-api/adaptor-framework/application.h>
27
28 namespace Dali
29 {
30
31 namespace WidgetView
32 {
33
34 namespace Internal DALI_INTERNAL
35 {
36 class WidgetViewManager;
37 }
38
39 /**
40  * @addtogroup dali_widget_view
41  * @{
42  */
43
44 /**
45  * @brief WidgetViewManager manages addition of WidgetView controls.
46  *
47  * This class provides the functionality of adding the widget views and controlling the widgets.
48  *
49  * @since_tizen 3.0
50  */
51 class DALI_IMPORT_API WidgetViewManager : public BaseHandle
52 {
53 public:
54
55   /**
56    * @brief Create widget view manager.
57    *
58    * @since_tizen 3.0
59    * @privlevel public
60    * @privilege %http://tizen.org/privilege/widget.viewer
61    * @param[in] application Application class for the widget view manager.
62    * @param[in] name Widget view manager name. It is used for socket name internally.
63    * @return A handle to WidgetViewManager.
64    */
65   static WidgetViewManager New( Application application, const std::string& name );
66
67   /**
68    * @brief Downcast a handle to WidgetViewManager handle.
69    *
70    * If the BaseHandle points is a WidgetViewManager the downcast returns a valid handle.
71    * If not the returned handle is left empty.
72    *
73    * @since_tizen 3.0
74    * @param[in] handle Handle to an object
75    * @return handle to a WidgetViewManager or an empty handle
76    */
77   static WidgetViewManager DownCast( BaseHandle handle );
78
79   /**
80    * @brief Creates an WidgetViewManager handle.
81    *
82    * Calling member functions with an uninitialised handle is not allowed.
83    * @since_tizen 3.0
84    */
85   WidgetViewManager();
86
87   /**
88    * @brief Copy constructor.
89    *
90    * @since_tizen 3.0
91    * @param[in] handle The handle to copy from.
92    */
93   WidgetViewManager( const WidgetViewManager& handle );
94
95   /**
96    * @brief Assignment operator.
97    *
98    * @since_tizen 3.0
99    * @param[in] handle The handle to copy from.
100    * @return A reference to this.
101    */
102   WidgetViewManager& operator=( const WidgetViewManager& handle );
103
104   /**
105    * @brief Destructor
106    *
107    * This is non-virtual since derived Handle types must not contain data or virtual methods.
108    * @since_tizen 3.0
109    */
110   ~WidgetViewManager();
111
112   /**
113    * @brief Creates a new widget view object
114    *
115    * @since_tizen 3.0
116    * @privlevel public
117    * @privilege %http://tizen.org/privilege/widget.viewer
118    * @param[in] widgetId The widget id.
119    * @param[in] contentInfo Contents that will be given to the widget instance.
120    * @param[in] width The widget width.
121    * @param[in] height The widget height.
122    * @param[in] updatePeriod The period of updating contents of the widget.
123    * @return A handle to WidgetView.
124    */
125   WidgetView AddWidget( const std::string& widgetId, const std::string& contentInfo, int width, int height, double updatePeriod );
126
127 public: // Not intended for application developers
128
129   /**
130    * @brief Creates a handle using the WidgetView::Internal implementation.
131    *
132    * @since_tizen 3.0
133    * @param[in] implementation The WidgetViewManager implementation.
134    */
135   explicit DALI_INTERNAL WidgetViewManager( Internal::WidgetViewManager* implementation );
136 };
137
138 /**
139  * @}
140  */
141
142 } // namespace WidgetView
143
144 } // namespace Dali
145
146 #endif // __DALI_WIDGET_VIEW_WIDGET_VIEW_MANAGER_H__