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;
43 internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetView_SWIGUpcast(cPtr), cMemoryOwn)
45 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
48 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj)
50 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
54 /// To make the Button instance be disposed.
56 /// <since_tizen> 3 </since_tizen>
57 protected override void Dispose(DisposeTypes type)
64 if (type == DisposeTypes.Explicit)
67 //Release your own managed resources here.
68 //You should release all of your own disposable objects here.
72 //Release your own unmanaged resources here.
73 //You should not access any managed member here except static instance.
74 //because the execution order of Finalizes is non-deterministic.
76 if (_widgetAddedEventCallback != null)
78 this.WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
81 if (_widgetContentUpdatedEventCallback != null)
83 this.WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
86 if (_widgetCreationAbortedEventCallback != null)
88 this.WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
91 if (_widgetDeletedEventCallback != null)
93 this.WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
96 if (_widgetFaultedEventCallback != null)
98 this.WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
101 if (_widgetUpdatePeriodChangedEventCallback != null)
103 this.WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
106 if (swigCPtr.Handle != global::System.IntPtr.Zero)
111 NDalicManualPINVOKE.delete_WidgetView(swigCPtr);
113 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
118 internal new class Property
120 internal static readonly int WIDGET_ID = NDalicManualPINVOKE.WidgetView_Property_WIDGET_ID_get();
121 internal static readonly int INSTANCE_ID = NDalicManualPINVOKE.WidgetView_Property_INSTANCE_ID_get();
122 internal static readonly int CONTENT_INFO = NDalicManualPINVOKE.WidgetView_Property_CONTENT_INFO_get();
123 internal static readonly int TITLE = NDalicManualPINVOKE.WidgetView_Property_TITLE_get();
124 internal static readonly int UPDATE_PERIOD = NDalicManualPINVOKE.WidgetView_Property_UPDATE_PERIOD_get();
125 internal static readonly int PREVIEW = NDalicManualPINVOKE.WidgetView_Property_PREVIEW_get();
126 internal static readonly int LOADING_TEXT = NDalicManualPINVOKE.WidgetView_Property_LOADING_TEXT_get();
127 internal static readonly int WIDGET_STATE_FAULTED = NDalicManualPINVOKE.WidgetView_Property_WIDGET_STATE_FAULTED_get();
128 internal static readonly int PERMANENT_DELETE = NDalicManualPINVOKE.WidgetView_Property_PERMANENT_DELETE_get();
129 internal static readonly int RETRY_TEXT = NDalicManualPINVOKE.WidgetView_Property_RETRY_TEXT_get();
130 internal static readonly int EFFECT = NDalicManualPINVOKE.WidgetView_Property_EFFECT_get();
134 /// Creates a new WidgetView.
136 /// <since_tizen> 3 </since_tizen>
137 public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(NDalicManualPINVOKE.WidgetView_New(widgetId, contentInfo, width, height, updatePeriod), true)
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 internal static WidgetView DownCast(BaseHandle handle)
145 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true)
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 internal WidgetView Assign(WidgetView handle)
157 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr)
164 WidgetView ret = new WidgetView(cPtr, false);
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 /// Event arguments of the widget view.
172 /// <since_tizen> 3 </since_tizen>
173 public class WidgetViewEventArgs : EventArgs
175 private WidgetView _widgetView;
180 /// <since_tizen> 3 </since_tizen>
181 public WidgetView WidgetView
194 private EventHandler<WidgetViewEventArgs> _widgetAddedEventHandler;
195 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
196 private delegate void WidgetAddedEventCallbackType(IntPtr data);
197 private WidgetAddedEventCallbackType _widgetAddedEventCallback;
200 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
201 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
202 /// Most resources are only loaded when the control is placed on the stage.<br />
204 /// <since_tizen> 3 </since_tizen>
205 public event EventHandler<WidgetViewEventArgs> WidgetAdded
209 if (_widgetAddedEventHandler == null)
211 _widgetAddedEventCallback = OnWidgetAdded;
212 WidgetAddedSignal().Connect(_widgetAddedEventCallback);
215 _widgetAddedEventHandler += value;
220 _widgetAddedEventHandler -= value;
222 if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false)
224 WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
229 // Callback for WidgetView WidgetAdded signal
230 private void OnWidgetAdded(IntPtr data)
232 WidgetViewEventArgs e = new WidgetViewEventArgs();
235 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
238 if (_widgetAddedEventHandler != null)
240 _widgetAddedEventHandler(this, e);
244 private EventHandler<WidgetViewEventArgs> _widgetDeletedEventHandler;
245 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
246 private delegate void WidgetDeletedEventCallbackType(IntPtr data);
247 private WidgetDeletedEventCallbackType _widgetDeletedEventCallback;
250 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
251 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
252 /// Most resources are only loaded when the control is placed on the stage.<br />
254 /// <since_tizen> 3 </since_tizen>
255 public event EventHandler<WidgetViewEventArgs> WidgetDeleted
259 if (_widgetDeletedEventHandler == null)
261 _widgetDeletedEventCallback = OnWidgetDeleted;
262 WidgetDeletedSignal().Connect(_widgetDeletedEventCallback);
265 _widgetDeletedEventHandler += value;
270 _widgetDeletedEventHandler -= value;
272 if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false)
274 WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
279 // Callback for WidgetView WidgetDeleted signal
280 private void OnWidgetDeleted(IntPtr data)
282 WidgetViewEventArgs e = new WidgetViewEventArgs();
285 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
288 if (_widgetDeletedEventHandler != null)
290 _widgetDeletedEventHandler(this, e);
294 private EventHandler<WidgetViewEventArgs> _widgetCreationAbortedEventHandler;
295 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
296 private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data);
297 private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback;
300 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
301 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
302 /// Most resources are only loaded when the control is placed on the stage.<br />
304 /// <since_tizen> 3 </since_tizen>
305 public event EventHandler<WidgetViewEventArgs> WidgetCreationAborted
309 if (_widgetCreationAbortedEventHandler == null)
311 _widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
312 WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback);
315 _widgetCreationAbortedEventHandler += value;
320 _widgetCreationAbortedEventHandler -= value;
322 if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false)
324 WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
329 // Callback for WidgetView WidgetCreationAborted signal
330 private void OnWidgetCreationAborted(IntPtr data)
332 WidgetViewEventArgs e = new WidgetViewEventArgs();
335 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
338 if (_widgetCreationAbortedEventHandler != null)
340 _widgetCreationAbortedEventHandler(this, e);
344 private EventHandler<WidgetViewEventArgs> _widgetContentUpdatedEventHandler;
345 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
346 private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data);
347 private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback;
350 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
351 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
352 /// Most resources are only loaded when the control is placed on the stage.<br />
354 /// <since_tizen> 3 </since_tizen>
355 public event EventHandler<WidgetViewEventArgs> WidgetContentUpdated
359 if (_widgetContentUpdatedEventHandler == null)
361 _widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
362 WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback);
365 _widgetContentUpdatedEventHandler += value;
370 _widgetContentUpdatedEventHandler -= value;
372 if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false)
374 WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
379 // Callback for WidgetView WidgetContentUpdated signal
380 private void OnWidgetContentUpdated(IntPtr data)
382 WidgetViewEventArgs e = new WidgetViewEventArgs();
385 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
388 if (_widgetContentUpdatedEventHandler != null)
390 _widgetContentUpdatedEventHandler(this, e);
394 private EventHandler<WidgetViewEventArgs> _widgetUpdatePeriodChangedEventHandler;
395 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
396 private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data);
397 private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback;
400 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
401 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
402 /// Most resources are only loaded when the control is placed on the stage.<br />
404 /// <since_tizen> 3 </since_tizen>
405 public event EventHandler<WidgetViewEventArgs> WidgetUpdatePeriodChanged
409 if (_widgetUpdatePeriodChangedEventHandler == null)
411 _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
412 WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback);
415 _widgetUpdatePeriodChangedEventHandler += value;
420 _widgetUpdatePeriodChangedEventHandler -= value;
422 if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false)
424 WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
429 // Callback for WidgetView WidgetUpdatePeriodChanged signal
430 private void OnWidgetUpdatePeriodChanged(IntPtr data)
432 WidgetViewEventArgs e = new WidgetViewEventArgs();
435 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
438 if (_widgetUpdatePeriodChangedEventHandler != null)
440 _widgetUpdatePeriodChangedEventHandler(this, e);
444 private EventHandler<WidgetViewEventArgs> _widgetFaultedEventHandler;
445 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
446 private delegate void WidgetFaultedEventCallbackType(IntPtr data);
447 private WidgetFaultedEventCallbackType _widgetFaultedEventCallback;
450 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
451 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
452 /// Most resources are only loaded when the control is placed on the stage.<br />
454 /// <since_tizen> 3 </since_tizen>
455 public event EventHandler<WidgetViewEventArgs> WidgetFaulted
459 if (_widgetFaultedEventHandler == null)
461 _widgetFaultedEventCallback = OnWidgetFaulted;
462 WidgetFaultedSignal().Connect(_widgetFaultedEventCallback);
465 _widgetFaultedEventHandler += value;
470 _widgetFaultedEventHandler -= value;
472 if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false)
474 WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
479 // Callback for WidgetView WidgetFaulted signal
480 private void OnWidgetFaulted(IntPtr data)
482 WidgetViewEventArgs e = new WidgetViewEventArgs();
485 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
488 if (_widgetFaultedEventHandler != null)
490 _widgetFaultedEventHandler(this, e);
495 /// Pauses a given widget.
497 /// <returns>True on success, false otherwise.</returns>
498 /// <since_tizen> 3 </since_tizen>
499 public bool PauseWidget()
501 bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr);
502 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507 /// Resumes a given widget.
509 /// <returns>True on success, false otherwise.</returns>
510 /// <since_tizen> 3 </since_tizen>
511 public bool ResumeWidget()
513 bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr);
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519 /// Cancels the touch event procedure.
520 /// If you call this function after feed the touch down event, the widget will get ON_HOLD events.
521 /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
523 /// <returns>True on success, false otherwise.</returns>
524 /// <since_tizen> 3 </since_tizen>
525 public bool CancelTouchEvent()
527 bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr);
528 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533 /// Activates a widget in the faulted state.
534 /// A widget in faulted state must be activated before adding the widget.
536 /// <since_tizen> 3 </since_tizen>
537 public void ActivateFaultedWidget()
539 NDalicManualPINVOKE.WidgetView_ActivateFaultedWidget(swigCPtr);
540 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
544 /// Terminate a widget instance.
546 /// <returns>True on success, false otherwise</returns>
547 /// <since_tizen> 4 </since_tizen>
548 public bool TerminateWidget()
550 bool ret = NDalicManualPINVOKE.WidgetView_TerminateWidget(swigCPtr);
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555 internal WidgetViewSignal WidgetAddedSignal()
557 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false);
558 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
562 internal WidgetViewSignal WidgetDeletedSignal()
564 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetDeletedSignal(swigCPtr), false);
565 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569 internal WidgetViewSignal WidgetCreationAbortedSignal()
571 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetCreationAbortedSignal(swigCPtr), false);
572 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576 internal WidgetViewSignal WidgetContentUpdatedSignal()
578 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetContentUpdatedSignal(swigCPtr), false);
579 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583 internal WidgetViewSignal WidgetUpdatePeriodChangedSignal()
585 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetUpdatePeriodChangedSignal(swigCPtr), false);
586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590 internal WidgetViewSignal WidgetFaultedSignal()
592 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetFaultedSignal(swigCPtr), false);
593 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598 /// Gets the ID of the widget.
600 /// <since_tizen> 3 </since_tizen>
601 public string WidgetID
606 GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp);
612 /// Gets the ID of the instance.
614 /// <since_tizen> 3 </since_tizen>
615 public string InstanceID
620 GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp);
626 /// Gets the content info.
628 /// <since_tizen> 3 </since_tizen>
629 public string ContentInfo
634 GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp);
642 /// <since_tizen> 3 </since_tizen>
648 GetProperty(WidgetView.Property.TITLE).Get(out temp);
654 /// Gets the update peroid.
656 /// <since_tizen> 3 </since_tizen>
657 public float UpdatePeriod
662 GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp);
668 /// Gets or sets the preview.
670 /// <since_tizen> 3 </since_tizen>
676 GetProperty(WidgetView.Property.PREVIEW).Get(out temp);
681 SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value));
686 /// Gets or sets the loading text.
688 /// <since_tizen> 3 </since_tizen>
689 public bool LoadingText
694 GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp);
699 SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value));
704 /// Gets or sets whether the widget state is faulted or not.
706 /// <since_tizen> 3 </since_tizen>
707 public bool WidgetStateFaulted
712 GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp);
717 SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value));
722 /// Gets or sets whether the widget is to delete permanently or not.
724 /// <since_tizen> 3 </since_tizen>
725 public bool PermanentDelete
730 GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp);
735 SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value));
740 /// Gets or sets retry text.
742 /// <since_tizen> 4 </since_tizen>
743 public PropertyMap RetryText
747 PropertyMap temp = new PropertyMap();
748 GetProperty(WidgetView.Property.RETRY_TEXT).Get(temp);
753 SetProperty(WidgetView.Property.RETRY_TEXT, new Tizen.NUI.PropertyValue(value));
758 /// Gets or sets effect.
760 /// <since_tizen> 4 </since_tizen>
761 public PropertyMap Effect
765 PropertyMap temp = new PropertyMap();
766 GetProperty(WidgetView.Property.EFFECT).Get(temp);
771 SetProperty(WidgetView.Property.EFFECT, new Tizen.NUI.PropertyValue(value));