1 #ifndef __DALI_WIDGET_VIEW_WIDGET_VIEW_H__
2 #define __DALI_WIDGET_VIEW_WIDGET_VIEW_H__
6 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
12 * http://floralicense.org/license/
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.
22 #include <dali-toolkit/public-api/controls/control.h>
30 namespace Internal DALI_INTERNAL
36 * @addtogroup dali_widget_view
41 * @brief WidgetView is a class for displaying the widget image and controlling the widget.
42 * Input events that WidgetView gets are delivered to the widget.
45 * | %Signal Name | Method |
46 * |-----------------------------|----------------------------------------|
47 * | widgetAdded | @ref WidgetAddedSignal() |
48 * | widgetDeleted | @ref WidgetDeletedSignal() |
49 * | widgetCreationAborted | @ref WidgetCreationAbortedSignal() |
50 * | widgetContentUpdated | @ref WidgetContentUpdatedSignal() |
51 * | widgetUpdatePeriodChanged | @ref WidgetUpdatePeriodChangedSignal() |
52 * | widgetFaulted | @ref WidgetFaultedSignal() |
56 class DALI_IMPORT_API WidgetView : public Toolkit::Control
61 * @brief The start and end property ranges for this control.
66 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0
67 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices @SINCE_1_0.0
71 * @brief An enumeration of properties belonging to the WidgetView class.
73 * @privilege %http://tizen.org/privilege/widget.viewer
79 * @brief An enumeration of properties belonging to the WidgetView class.
81 * @privilege %http://tizen.org/privilege/widget.viewer
86 // Event side properties
89 * @brief name "widgetId", Get the id of the widget, type string, read-only
92 WIDGET_ID = PROPERTY_START_INDEX,
95 * @brief name "instanceId", type string, read-only
101 * @brief name "contentInfo", type string, read-only
107 * @brief name "title", type string, read-only
113 * @brief name "updatePeriod", type float, read-only
119 * @brief name "preview", type boolean if it is a show/hide flag, map otherwise
125 * @brief name "loadingText", type boolean if it is a show/hide flag, map otherwise
131 * @brief name "widgetStateFaulted", type boolean
134 WIDGET_STATE_FAULTED,
137 * @brief name "permanentDelete", type boolean
147 * @brief Create widget view.
151 * @privilege %http://tizen.org/privilege/widget.viewer
152 * @param[in] widgetId The widget id.
153 * @param[in] contentInfo Contents that will be given to the widget instance.
154 * @param[in] width The widget width.
155 * @param[in] height The widget height.
156 * @param[in] updatePeriod The period of updating contents of the widget.
157 * @return A handle to WidgetView.
159 static WidgetView New( const std::string& widgetId, const std::string& contentInfo, int width, int height, float updatePeriod );
162 * @brief Downcast a handle to WidgetView handle.
164 * If the BaseHandle points is a WidgetView the downcast returns a valid handle.
165 * If not the returned handle is left empty.
168 * @param[in] handle Handle to an object
169 * @return handle to a WidgetView or an empty handle
171 static WidgetView DownCast( BaseHandle handle );
174 * @brief Creates an empty handle.
180 * @brief Copy constructor.
183 * @param[in] handle The handle to copy from.
185 WidgetView( const WidgetView& handle );
188 * @brief Assignment operator.
191 * @param[in] handle The handle to copy from.
192 * @return A reference to this.
194 WidgetView& operator=( const WidgetView& handle );
199 * This is non-virtual since derived Handle types must not contain data or virtual methods.
205 * @brief Pauses a given widget.
209 * @privilege %http://tizen.org/privilege/widget.viewer
210 * @return true on success, false otherwise.
215 * @brief Resume a given widget.
219 * @privilege %http://tizen.org/privilege/widget.viewer
220 * @return true on success, false otherwise.
225 * @brief Cancels touch event procedure.
226 * If you call this function after feed the touch down event, the widget will get ON_HOLD events.
227 * If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
231 * @privilege %http://tizen.org/privilege/widget.viewer
232 * @return true on success, false otherwise.
234 bool CancelTouchEvent();
237 * @brief Activate a widget in faulted state.
238 * A widget in faulted state MUST be activated before adding the widget.
242 * @privilege %http://tizen.org/privilege/widget.viewer
244 void ActivateFaultedWidget();
248 typedef Signal< void ( WidgetView ) > WidgetViewSignalType; ///< WidgetView signal type @since_tizen 3.0
251 * @brief This signal is emitted when the widget is added.
255 * @privilege %http://tizen.org/privilege/widget.viewer
256 * @return The signal to connect to.
258 WidgetViewSignalType& WidgetAddedSignal();
261 * @brief This signal is emitted when the widget is deleted.
265 * @privilege %http://tizen.org/privilege/widget.viewer
266 * @return The signal to connect to.
268 WidgetViewSignalType& WidgetDeletedSignal();
271 * @brief This signal is emitted when the widget creation is aborted.
275 * @privilege %http://tizen.org/privilege/widget.viewer
276 * @return The signal to connect to.
278 WidgetViewSignalType& WidgetCreationAbortedSignal();
281 * @brief This signal is emitted when the widget content is updated.
285 * @privilege %http://tizen.org/privilege/widget.viewer
286 * @return The signal to connect to.
288 WidgetViewSignalType& WidgetContentUpdatedSignal();
291 * @brief This signal is emitted when the widget update period is changed.
295 * @privilege %http://tizen.org/privilege/widget.viewer
296 * @return The signal to connect to.
298 WidgetViewSignalType& WidgetUpdatePeriodChangedSignal();
301 * @brief This signal is emitted when the widget process is not running.
305 * @privilege %http://tizen.org/privilege/widget.viewer
306 * @return The signal to connect to.
308 WidgetViewSignalType& WidgetFaultedSignal();
310 public: // Not intended for application developers
314 * @brief Creates a handle using the WidgetView::Internal implementation.
317 * @param[in] implementation The WidgetView implementation.
319 DALI_INTERNAL WidgetView( Internal::WidgetView& implementation );
323 * @brief Allows the creation of this control from an Internal::CustomActor pointer.
326 * @param[in] internal A pointer to the internal CustomActor.
328 DALI_INTERNAL WidgetView( Dali::Internal::CustomActor* internal );
334 } // namespace WidgetView
338 #endif // __DALI_WIDGET_VIEW_WIDGET_VIEW_H__