1 #ifndef __DALI_WIDGET_VIEW_WIDGET_VIEW_H__
2 #define __DALI_WIDGET_VIEW_WIDGET_VIEW_H__
5 * Copyright (c) 2016 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-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.
46 class DALI_IMPORT_API WidgetView : public Toolkit::Control
51 * @brief Create widget view.
54 * @param[in] widgetId The widget id.
55 * @param[in] contentInfo Contents that will be given to the widget instance.
56 * @param[in] width The widget width.
57 * @param[in] height The widget height.
58 * @param[in] period The period of updating contents of the widget.
59 * @return A handle to WidgetView.
61 static WidgetView New( const std::string& widgetId, const std::string& contentInfo, int width, int height, double period );
64 * @brief Downcast a handle to WidgetView handle.
66 * If the BaseHandle points is a WidgetView the downcast returns a valid handle.
67 * If not the returned handle is left empty.
70 * @param[in] handle Handle to an object
71 * @return handle to a WidgetView or an empty handle
73 static WidgetView DownCast( BaseHandle handle );
76 * @brief Creates an empty handle.
82 * @brief Copy constructor.
85 * @param[in] handle The handle to copy from.
87 WidgetView( const WidgetView& handle );
90 * @brief Assignment operator.
93 * @param[in] handle The handle to copy from.
94 * @return A reference to this.
96 WidgetView& operator=( const WidgetView& handle );
101 * This is non-virtual since derived Handle types must not contain data or virtual methods.
107 * @brief Get the id of the widget.
110 * @return The widget id on success, otherwise an empty string.
112 const std::string& GetWidgetId() const;
115 * @brief Get the instance id of the widget.
118 * @return The instance id on success, otherwise an empty string.
120 const std::string& GetInstanceId() const;
123 * @brief Get the content string of the widget.
124 * This string can be used for creating contents of widget again after reboot a device or recovered from crash(abnormal status).
127 * @return The content string to be recognize content of the widget or an empty string if there is no specific content string.
129 const std::string& GetContentInfo() const;
132 * @brief Get the summarized string of the widget content for accessibility.
133 * If the accessibility feature is turned on, a viewer can use this text to describe the widget.
136 * @return The title string to be used for summarizing the widget or an empty string if there is no summarized text for content of given widget.
138 const std::string& GetTitle() const;
141 * @brief Get the update period of the widget.
144 * @return The update period of the widget.
146 double GetPeriod() const;
149 * @brief Activate a widget in faulted state.
150 * A widget in faulted state MUST be activated before adding the widget.
154 * @privilege %http://tizen.org/privilege/widget.viewer
156 void ActivateFaultedWidget();
159 * @brief Check whether the widget is faulted.
162 * @return true for faulted state, otherwise false.
164 bool IsWidgetFaulted();
167 * @brief Set the deletion mode.
170 * @param[in] permanentDelete Pass true if you want to delete this widget instance permanently, or pass false if you want to keep it and it will be re-created soon.
172 void SetPermanentDelete( bool permanentDelete );
176 typedef Signal< void ( WidgetView ) > WidgetViewSignalType; ///< WidgetView signal type @since_tizen 3.0
179 * @brief This signal is emitted when the widget is added.
182 * @return The signal to connect to.
184 WidgetViewSignalType& WidgetAddedSignal();
187 * @brief This signal is emitted when the widget is deleted.
190 * @return The signal to connect to.
192 WidgetViewSignalType& WidgetDeletedSignal();
194 public: // Not intended for application developers
197 * @brief Creates a handle using the WidgetView::Internal implementation.
200 * @param[in] implementation The WidgetView implementation.
202 DALI_INTERNAL WidgetView( Internal::WidgetView& implementation );
205 * @brief Allows the creation of this control from an Internal::CustomActor pointer.
208 * @param[in] internal A pointer to the internal CustomActor.
210 DALI_INTERNAL WidgetView( Dali::Internal::CustomActor* internal );
216 } // namespace WidgetView
220 #endif // __DALI_WIDGET_VIEW_WIDGET_VIEW_H__