*/
extern void widget_viewer_evas_set_permanent_delete(Evas_Object *widget, int flag);
+/**
+ * @brief Gets the widget object's instance ID.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/widget.viewer
+ * @remarks The returned instance ID should not be freed.
+ * @remarks The returned widget instance ID is volatile. If the device reboots or the widget's process restarts, it will be changed.\n
+ * So, you should not assume this value is a persistent one.
+ * @remarks The returned string is usable only before the widget is destroyed. If it's going to be needed after that, it should be copied.
+ * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] widget A widget object
+ * @return The widget's instance ID as a string, NULL in case of errors
+ * @exception #WIDGET_ERROR_NONE Successfully retrieved the widget instance ID
+ * @exception #WIDGET_ERROR_NOT_SUPPORTED Not supported
+ * @exception #WIDGET_ERROR_FAULT Widget is not ready
+ * @exception #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @exception #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @see get_last_result()
+ */
+extern const char *widget_viewer_evas_get_widget_instance_id(Evas_Object *widget);
/**
* @}
return;
}
+EAPI const char *widget_viewer_evas_get_widget_instance_id(Evas_Object *widget)
+{
+ struct widget_info *info;
+
+ if (!is_widget_feature_enabled()) {
+ set_last_result(WIDGET_ERROR_NOT_SUPPORTED);
+ return NULL;
+ }
+
+ if (__check_privilege("http://tizen.org/privilege/widget.viewer") < 0) {
+ set_last_result(WIDGET_ERROR_PERMISSION_DENIED);
+ ErrPrint("Permission deny");
+ return NULL;
+ }
+
+ if (!s_info.initialized) {
+ set_last_result(WIDGET_ERROR_FAULT);
+ ErrPrint("widget viewer evas is not initialized");
+ return NULL;
+ }
+
+ if (!widget) {
+ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
+ ErrPrint("widget object is invalid");
+ return NULL;
+ }
+
+ info = evas_object_data_get(widget, WIDGET_INFO_TAG);
+ if (!info) {
+ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
+ ErrPrint("widget(%p) don't have the info", widget);
+ return NULL;
+ }
+
+ return (const char *)info->instance_id;
+}
+
/* End of a file */