2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
18 //------------------------------------------------------------------------------
21 // This file was automatically generated by SWIG (http://www.swig.org).
24 // Do not make changes to this file unless you know what you are doing--modify
25 // the SWIG interface file instead.
26 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
32 using Tizen.NUI.BaseComponents;
35 /// The WidgetView is a class for displaying the widget image and controlling the widget.<br />
36 /// Input events that the WidgetView gets are delivered to the widget.
38 /// <since_tizen> 3 </since_tizen>
39 public class WidgetView : View
41 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
42 private EventHandler<WidgetViewEventArgs> _widgetAddedEventHandler;
43 private WidgetAddedEventCallbackType _widgetAddedEventCallback;
44 private EventHandler<WidgetViewEventArgs> _widgetContentUpdatedEventHandler;
45 private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback;
46 private EventHandler<WidgetViewEventArgs> _widgetDeletedEventHandler;
47 private WidgetDeletedEventCallbackType _widgetDeletedEventCallback;
48 private EventHandler<WidgetViewEventArgs> _widgetCreationAbortedEventHandler;
49 private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback;
50 private EventHandler<WidgetViewEventArgs> _widgetUpdatePeriodChangedEventHandler;
51 private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback;
52 private EventHandler<WidgetViewEventArgs> _widgetFaultedEventHandler;
53 private WidgetFaultedEventCallbackType _widgetFaultedEventCallback;
55 /// Creates a new WidgetView.
57 /// <since_tizen> 3 </since_tizen>
58 public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(NDalicManualPINVOKE.WidgetView_New(widgetId, contentInfo, width, height, updatePeriod), true)
60 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
64 internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetView_SWIGUpcast(cPtr), cMemoryOwn)
66 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
68 internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true)
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
74 private delegate void WidgetAddedEventCallbackType(IntPtr data);
75 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
76 private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data);
77 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
78 private delegate void WidgetDeletedEventCallbackType(IntPtr data);
79 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
80 private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data);
81 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
82 private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data);
83 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
84 private delegate void WidgetFaultedEventCallbackType(IntPtr data);
87 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
88 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
89 /// Most resources are only loaded when the control is placed on the stage.<br />
91 /// <since_tizen> 3 </since_tizen>
92 public event EventHandler<WidgetViewEventArgs> WidgetAdded
96 if (_widgetAddedEventHandler == null)
98 _widgetAddedEventCallback = OnWidgetAdded;
99 WidgetAddedSignal().Connect(_widgetAddedEventCallback);
102 _widgetAddedEventHandler += value;
107 _widgetAddedEventHandler -= value;
109 if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false)
111 WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
117 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
118 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
119 /// Most resources are only loaded when the control is placed on the stage.<br />
121 /// <since_tizen> 3 </since_tizen>
122 public event EventHandler<WidgetViewEventArgs> WidgetContentUpdated
126 if (_widgetContentUpdatedEventHandler == null)
128 _widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
129 WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback);
132 _widgetContentUpdatedEventHandler += value;
137 _widgetContentUpdatedEventHandler -= value;
139 if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false)
141 WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
147 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
148 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
149 /// Most resources are only loaded when the control is placed on the stage.<br />
151 /// <since_tizen> 3 </since_tizen>
152 public event EventHandler<WidgetViewEventArgs> WidgetDeleted
156 if (_widgetDeletedEventHandler == null)
158 _widgetDeletedEventCallback = OnWidgetDeleted;
159 WidgetDeletedSignal().Connect(_widgetDeletedEventCallback);
162 _widgetDeletedEventHandler += value;
167 _widgetDeletedEventHandler -= value;
169 if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false)
171 WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
177 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
178 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
179 /// Most resources are only loaded when the control is placed on the stage.<br />
181 /// <since_tizen> 3 </since_tizen>
182 public event EventHandler<WidgetViewEventArgs> WidgetCreationAborted
186 if (_widgetCreationAbortedEventHandler == null)
188 _widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
189 WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback);
192 _widgetCreationAbortedEventHandler += value;
197 _widgetCreationAbortedEventHandler -= value;
199 if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false)
201 WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
207 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
208 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
209 /// Most resources are only loaded when the control is placed on the stage.<br />
211 /// <since_tizen> 3 </since_tizen>
212 public event EventHandler<WidgetViewEventArgs> WidgetUpdatePeriodChanged
216 if (_widgetUpdatePeriodChangedEventHandler == null)
218 _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
219 WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback);
222 _widgetUpdatePeriodChangedEventHandler += value;
227 _widgetUpdatePeriodChangedEventHandler -= value;
229 if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false)
231 WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
237 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
238 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
239 /// Most resources are only loaded when the control is placed on the stage.<br />
241 /// <since_tizen> 3 </since_tizen>
242 public event EventHandler<WidgetViewEventArgs> WidgetFaulted
246 if (_widgetFaultedEventHandler == null)
248 _widgetFaultedEventCallback = OnWidgetFaulted;
249 WidgetFaultedSignal().Connect(_widgetFaultedEventCallback);
252 _widgetFaultedEventHandler += value;
257 _widgetFaultedEventHandler -= value;
259 if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false)
261 WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
267 /// Gets the ID of the widget.
269 /// <since_tizen> 3 </since_tizen>
270 public string WidgetID
275 GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp);
281 /// Gets the ID of the instance.
283 /// <since_tizen> 3 </since_tizen>
284 public string InstanceID
289 GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp);
295 /// Gets the content info.
297 /// <since_tizen> 3 </since_tizen>
298 public string ContentInfo
303 GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp);
311 /// <since_tizen> 3 </since_tizen>
317 GetProperty(WidgetView.Property.TITLE).Get(out temp);
323 /// Gets the update peroid.
325 /// <since_tizen> 3 </since_tizen>
326 public float UpdatePeriod
331 GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp);
337 /// Gets or sets the preview.
339 /// <since_tizen> 3 </since_tizen>
345 GetProperty(WidgetView.Property.PREVIEW).Get(out temp);
350 SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value));
355 /// Gets or sets the loading text.
357 /// <since_tizen> 3 </since_tizen>
358 public bool LoadingText
363 GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp);
368 SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value));
373 /// Gets or sets whether the widget state is faulted or not.
375 /// <since_tizen> 3 </since_tizen>
376 public bool WidgetStateFaulted
381 GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp);
386 SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value));
391 /// Gets or sets whether the widget is to delete permanently or not.
393 /// <since_tizen> 3 </since_tizen>
394 public bool PermanentDelete
399 GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp);
404 SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value));
409 /// Gets or sets retry text.
411 /// <since_tizen> 4 </since_tizen>
412 public PropertyMap RetryText
416 PropertyMap temp = new PropertyMap();
417 GetProperty(WidgetView.Property.RETRY_TEXT).Get(temp);
422 SetProperty(WidgetView.Property.RETRY_TEXT, new Tizen.NUI.PropertyValue(value));
427 /// Gets or sets effect.
429 /// <since_tizen> 4 </since_tizen>
430 public PropertyMap Effect
434 PropertyMap temp = new PropertyMap();
435 GetProperty(WidgetView.Property.EFFECT).Get(temp);
440 SetProperty(WidgetView.Property.EFFECT, new Tizen.NUI.PropertyValue(value));
445 /// Pauses a given widget.
447 /// <returns>True on success, false otherwise.</returns>
448 /// <since_tizen> 3 </since_tizen>
449 public bool PauseWidget()
451 bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr);
452 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
457 /// Resumes a given widget.
459 /// <returns>True on success, false otherwise.</returns>
460 /// <since_tizen> 3 </since_tizen>
461 public bool ResumeWidget()
463 bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr);
464 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
469 /// Cancels the touch event procedure.
470 /// If you call this function after feed the touch down event, the widget will get ON_HOLD events.
471 /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
473 /// <returns>True on success, false otherwise.</returns>
474 /// <since_tizen> 3 </since_tizen>
475 public bool CancelTouchEvent()
477 bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr);
478 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
483 /// Activates a widget in the faulted state.
484 /// A widget in faulted state must be activated before adding the widget.
486 /// <since_tizen> 3 </since_tizen>
487 public void ActivateFaultedWidget()
489 NDalicManualPINVOKE.WidgetView_ActivateFaultedWidget(swigCPtr);
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 /// Terminate a widget instance.
496 /// <returns>True on success, false otherwise</returns>
497 /// <since_tizen> 4 </since_tizen>
498 public bool TerminateWidget()
500 bool ret = NDalicManualPINVOKE.WidgetView_TerminateWidget(swigCPtr);
501 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
505 internal static WidgetView DownCast(BaseHandle handle)
507 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true);
508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
512 internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr)
514 WidgetView ret = new WidgetView(cPtr, false);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj)
521 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
524 internal WidgetView Assign(WidgetView handle)
526 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false);
527 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531 internal WidgetViewSignal WidgetAddedSignal()
533 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false);
534 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538 internal WidgetViewSignal WidgetDeletedSignal()
540 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetDeletedSignal(swigCPtr), false);
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545 internal WidgetViewSignal WidgetCreationAbortedSignal()
547 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetCreationAbortedSignal(swigCPtr), false);
548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552 internal WidgetViewSignal WidgetContentUpdatedSignal()
554 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetContentUpdatedSignal(swigCPtr), false);
555 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
559 internal WidgetViewSignal WidgetUpdatePeriodChangedSignal()
561 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetUpdatePeriodChangedSignal(swigCPtr), false);
562 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566 internal WidgetViewSignal WidgetFaultedSignal()
568 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetFaultedSignal(swigCPtr), false);
569 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574 /// To make the Button instance be disposed.
576 /// <since_tizen> 3 </since_tizen>
577 protected override void Dispose(DisposeTypes type)
584 if (type == DisposeTypes.Explicit)
587 //Release your own managed resources here.
588 //You should release all of your own disposable objects here.
592 //Release your own unmanaged resources here.
593 //You should not access any managed member here except static instance.
594 //because the execution order of Finalizes is non-deterministic.
596 if (_widgetAddedEventCallback != null)
598 this.WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
601 if (_widgetContentUpdatedEventCallback != null)
603 this.WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
606 if (_widgetCreationAbortedEventCallback != null)
608 this.WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
611 if (_widgetDeletedEventCallback != null)
613 this.WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
616 if (_widgetFaultedEventCallback != null)
618 this.WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
621 if (_widgetUpdatePeriodChangedEventCallback != null)
623 this.WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
626 if (swigCPtr.Handle != global::System.IntPtr.Zero)
631 NDalicManualPINVOKE.delete_WidgetView(swigCPtr);
633 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
639 // Callback for WidgetView WidgetAdded signal
640 private void OnWidgetAdded(IntPtr data)
642 WidgetViewEventArgs e = new WidgetViewEventArgs();
645 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
648 if (_widgetAddedEventHandler != null)
650 _widgetAddedEventHandler(this, e);
654 // Callback for WidgetView WidgetDeleted signal
655 private void OnWidgetDeleted(IntPtr data)
657 WidgetViewEventArgs e = new WidgetViewEventArgs();
660 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
663 if (_widgetDeletedEventHandler != null)
665 _widgetDeletedEventHandler(this, e);
669 // Callback for WidgetView WidgetCreationAborted signal
670 private void OnWidgetCreationAborted(IntPtr data)
672 WidgetViewEventArgs e = new WidgetViewEventArgs();
675 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
678 if (_widgetCreationAbortedEventHandler != null)
680 _widgetCreationAbortedEventHandler(this, e);
686 // Callback for WidgetView WidgetContentUpdated signal
687 private void OnWidgetContentUpdated(IntPtr data)
689 WidgetViewEventArgs e = new WidgetViewEventArgs();
692 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
695 if (_widgetContentUpdatedEventHandler != null)
697 _widgetContentUpdatedEventHandler(this, e);
701 // Callback for WidgetView WidgetUpdatePeriodChanged signal
702 private void OnWidgetUpdatePeriodChanged(IntPtr data)
704 WidgetViewEventArgs e = new WidgetViewEventArgs();
707 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
710 if (_widgetUpdatePeriodChangedEventHandler != null)
712 _widgetUpdatePeriodChangedEventHandler(this, e);
716 // Callback for WidgetView WidgetFaulted signal
717 private void OnWidgetFaulted(IntPtr data)
719 WidgetViewEventArgs e = new WidgetViewEventArgs();
722 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
725 if (_widgetFaultedEventHandler != null)
727 _widgetFaultedEventHandler(this, e);
732 /// Event arguments of the widget view.
734 /// <since_tizen> 3 </since_tizen>
735 public class WidgetViewEventArgs : EventArgs
737 private WidgetView _widgetView;
742 /// <since_tizen> 3 </since_tizen>
743 public WidgetView WidgetView
756 internal new class Property
758 internal static readonly int WIDGET_ID = NDalicManualPINVOKE.WidgetView_Property_WIDGET_ID_get();
759 internal static readonly int INSTANCE_ID = NDalicManualPINVOKE.WidgetView_Property_INSTANCE_ID_get();
760 internal static readonly int CONTENT_INFO = NDalicManualPINVOKE.WidgetView_Property_CONTENT_INFO_get();
761 internal static readonly int TITLE = NDalicManualPINVOKE.WidgetView_Property_TITLE_get();
762 internal static readonly int UPDATE_PERIOD = NDalicManualPINVOKE.WidgetView_Property_UPDATE_PERIOD_get();
763 internal static readonly int PREVIEW = NDalicManualPINVOKE.WidgetView_Property_PREVIEW_get();
764 internal static readonly int LOADING_TEXT = NDalicManualPINVOKE.WidgetView_Property_LOADING_TEXT_get();
765 internal static readonly int WIDGET_STATE_FAULTED = NDalicManualPINVOKE.WidgetView_Property_WIDGET_STATE_FAULTED_get();
766 internal static readonly int PERMANENT_DELETE = NDalicManualPINVOKE.WidgetView_Property_PERMANENT_DELETE_get();
767 internal static readonly int RETRY_TEXT = NDalicManualPINVOKE.WidgetView_Property_RETRY_TEXT_get();
768 internal static readonly int EFFECT = NDalicManualPINVOKE.WidgetView_Property_EFFECT_get();