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
80 // Event side properties
83 * @brief name "widgetId", Get the id of the widget, type string, read-only
86 WIDGET_ID = PROPERTY_START_INDEX,
89 * @brief name "instanceId", type string, read-only
95 * @brief name "contentInfo", type string, read-only
101 * @brief name "title", type string, read-only
107 * @brief name "updatePeriod", type float, read-only
113 * @brief name "preview", type boolean if it is a show/hide flag, map otherwise
119 * @brief name "loadingText", type boolean if it is a show/hide flag, map otherwise
125 * @brief name "widgetStateFaulted", type boolean
128 WIDGET_STATE_FAULTED,
131 * @brief name "permanentDelete", type boolean
141 * @brief Create widget view.
145 * @privilege %http://tizen.org/privilege/widget.viewer
146 * @param[in] widgetId The widget id.
147 * @param[in] contentInfo Contents that will be given to the widget instance.
148 * @param[in] width The widget width.
149 * @param[in] height The widget height.
150 * @param[in] updatePeriod The period of updating contents of the widget.
151 * @return A handle to WidgetView.
153 static WidgetView New( const std::string& widgetId, const std::string& contentInfo, int width, int height, float updatePeriod );
156 * @brief Downcast a handle to WidgetView handle.
158 * If the BaseHandle points is a WidgetView the downcast returns a valid handle.
159 * If not the returned handle is left empty.
162 * @param[in] handle Handle to an object
163 * @return handle to a WidgetView or an empty handle
165 static WidgetView DownCast( BaseHandle handle );
168 * @brief Creates an empty handle.
174 * @brief Copy constructor.
177 * @param[in] handle The handle to copy from.
179 WidgetView( const WidgetView& handle );
182 * @brief Assignment operator.
185 * @param[in] handle The handle to copy from.
186 * @return A reference to this.
188 WidgetView& operator=( const WidgetView& handle );
193 * This is non-virtual since derived Handle types must not contain data or virtual methods.
199 * @brief Pauses a given widget.
203 * @privilege %http://tizen.org/privilege/widget.viewer
204 * @return true on success, false otherwise.
209 * @brief Resume a given widget.
213 * @privilege %http://tizen.org/privilege/widget.viewer
214 * @return true on success, false otherwise.
219 * @brief Cancels touch event procedure.
220 * If you call this function after feed the touch down event, the widget will get ON_HOLD events.
221 * If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
225 * @privilege %http://tizen.org/privilege/widget.viewer
226 * @return true on success, false otherwise.
228 bool CancelTouchEvent();
231 * @brief Activate a widget in faulted state.
232 * A widget in faulted state MUST be activated before adding the widget.
236 * @privilege %http://tizen.org/privilege/widget.viewer
238 void ActivateFaultedWidget();
242 typedef Signal< void ( WidgetView ) > WidgetViewSignalType; ///< WidgetView signal type @since_tizen 3.0
245 * @brief This signal is emitted when the widget is added.
249 * @privilege %http://tizen.org/privilege/widget.viewer
250 * @return The signal to connect to.
252 WidgetViewSignalType& WidgetAddedSignal();
255 * @brief This signal is emitted when the widget is deleted.
259 * @privilege %http://tizen.org/privilege/widget.viewer
260 * @return The signal to connect to.
262 WidgetViewSignalType& WidgetDeletedSignal();
265 * @brief This signal is emitted when the widget creation is aborted.
269 * @privilege %http://tizen.org/privilege/widget.viewer
270 * @return The signal to connect to.
272 WidgetViewSignalType& WidgetCreationAbortedSignal();
275 * @brief This signal is emitted when the widget content is updated.
279 * @privilege %http://tizen.org/privilege/widget.viewer
280 * @return The signal to connect to.
282 WidgetViewSignalType& WidgetContentUpdatedSignal();
285 * @brief This signal is emitted when the widget update period is changed.
289 * @privilege %http://tizen.org/privilege/widget.viewer
290 * @return The signal to connect to.
292 WidgetViewSignalType& WidgetUpdatePeriodChangedSignal();
295 * @brief This signal is emitted when the widget process is not running.
299 * @privilege %http://tizen.org/privilege/widget.viewer
300 * @return The signal to connect to.
302 WidgetViewSignalType& WidgetFaultedSignal();
304 public: // Not intended for application developers
308 * @brief Creates a handle using the WidgetView::Internal implementation.
311 * @param[in] implementation The WidgetView implementation.
313 DALI_INTERNAL WidgetView( Internal::WidgetView& implementation );
317 * @brief Allows the creation of this control from an Internal::CustomActor pointer.
320 * @param[in] internal A pointer to the internal CustomActor.
322 DALI_INTERNAL WidgetView( Dali::Internal::CustomActor* internal );
328 } // namespace WidgetView
332 #endif // __DALI_WIDGET_VIEW_WIDGET_VIEW_H__