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 public class WidgetView : View
40 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
42 internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetView_SWIGUpcast(cPtr), cMemoryOwn)
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
47 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj)
49 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
53 /// To make the Button instance be disposed.
55 protected override void Dispose(DisposeTypes type)
62 if (type == DisposeTypes.Explicit)
65 //Release your own managed resources here.
66 //You should release all of your own disposable objects here.
70 //Release your own unmanaged resources here.
71 //You should not access any managed member here except static instance.
72 //because the execution order of Finalizes is non-deterministic.
73 if (swigCPtr.Handle != global::System.IntPtr.Zero)
78 NDalicManualPINVOKE.delete_WidgetView(swigCPtr);
80 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
85 internal new class Property
87 internal static readonly int WIDGET_ID = NDalicManualPINVOKE.WidgetView_Property_WIDGET_ID_get();
88 internal static readonly int INSTANCE_ID = NDalicManualPINVOKE.WidgetView_Property_INSTANCE_ID_get();
89 internal static readonly int CONTENT_INFO = NDalicManualPINVOKE.WidgetView_Property_CONTENT_INFO_get();
90 internal static readonly int TITLE = NDalicManualPINVOKE.WidgetView_Property_TITLE_get();
91 internal static readonly int UPDATE_PERIOD = NDalicManualPINVOKE.WidgetView_Property_UPDATE_PERIOD_get();
92 internal static readonly int PREVIEW = NDalicManualPINVOKE.WidgetView_Property_PREVIEW_get();
93 internal static readonly int LOADING_TEXT = NDalicManualPINVOKE.WidgetView_Property_LOADING_TEXT_get();
94 internal static readonly int WIDGET_STATE_FAULTED = NDalicManualPINVOKE.WidgetView_Property_WIDGET_STATE_FAULTED_get();
95 internal static readonly int PERMANENT_DELETE = NDalicManualPINVOKE.WidgetView_Property_PERMANENT_DELETE_get();
96 internal static readonly int RETRY_TEXT = NDalicManualPINVOKE.WidgetView_Property_RETRY_TEXT_get();
97 internal static readonly int EFFECT = NDalicManualPINVOKE.WidgetView_Property_EFFECT_get();
101 /// Creates a new WidgetView.
103 /// <since_tizen> 4 </since_tizen>
104 public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(NDalicManualPINVOKE.WidgetView_New(widgetId, contentInfo, width, height, updatePeriod), true)
106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110 internal new static WidgetView DownCast(BaseHandle handle)
112 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true);
113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true)
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 internal WidgetView Assign(WidgetView handle)
124 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false);
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr)
131 WidgetView ret = new WidgetView(cPtr, false);
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137 /// Event arguments of the widget view.
139 public class WidgetViewEventArgs : EventArgs
141 private WidgetView _widgetView;
146 /// <since_tizen> 4 </since_tizen>
147 public WidgetView WidgetView
160 private EventHandler<WidgetViewEventArgs> _widgetAddedEventHandler;
161 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
162 private delegate void WidgetAddedEventCallbackType(IntPtr data);
163 private WidgetAddedEventCallbackType _widgetAddedEventCallback;
166 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
167 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
168 /// Most resources are only loaded when the control is placed on the stage.<br />
170 /// <since_tizen> 3 </since_tizen>
171 public event EventHandler<WidgetViewEventArgs> WidgetAdded
175 if (_widgetAddedEventHandler == null)
177 _widgetAddedEventCallback = OnWidgetAdded;
178 WidgetAddedSignal().Connect(_widgetAddedEventCallback);
181 _widgetAddedEventHandler += value;
186 _widgetAddedEventHandler -= value;
188 if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false)
190 WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
195 // Callback for WidgetView WidgetAdded signal
196 private void OnWidgetAdded(IntPtr data)
198 WidgetViewEventArgs e = new WidgetViewEventArgs();
201 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
204 if (_widgetAddedEventHandler != null)
206 _widgetAddedEventHandler(this, e);
210 private EventHandler<WidgetViewEventArgs> _widgetDeletedEventHandler;
211 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
212 private delegate void WidgetDeletedEventCallbackType(IntPtr data);
213 private WidgetDeletedEventCallbackType _widgetDeletedEventCallback;
216 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
217 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
218 /// Most resources are only loaded when the control is placed on the stage.<br />
220 /// <since_tizen> 4 </since_tizen>
221 public event EventHandler<WidgetViewEventArgs> WidgetDeleted
225 if (_widgetDeletedEventHandler == null)
227 _widgetDeletedEventCallback = OnWidgetDeleted;
228 WidgetDeletedSignal().Connect(_widgetDeletedEventCallback);
231 _widgetDeletedEventHandler += value;
236 _widgetDeletedEventHandler -= value;
238 if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false)
240 WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
245 // Callback for WidgetView WidgetDeleted signal
246 private void OnWidgetDeleted(IntPtr data)
248 WidgetViewEventArgs e = new WidgetViewEventArgs();
251 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
254 if (_widgetDeletedEventHandler != null)
256 _widgetDeletedEventHandler(this, e);
260 private EventHandler<WidgetViewEventArgs> _widgetCreationAbortedEventHandler;
261 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
262 private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data);
263 private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback;
266 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
267 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
268 /// Most resources are only loaded when the control is placed on the stage.<br />
270 /// <since_tizen> 4 </since_tizen>
271 public event EventHandler<WidgetViewEventArgs> WidgetCreationAborted
275 if (_widgetCreationAbortedEventHandler == null)
277 _widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
278 WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback);
281 _widgetCreationAbortedEventHandler += value;
286 _widgetCreationAbortedEventHandler -= value;
288 if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false)
290 WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
295 // Callback for WidgetView WidgetCreationAborted signal
296 private void OnWidgetCreationAborted(IntPtr data)
298 WidgetViewEventArgs e = new WidgetViewEventArgs();
301 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
304 if (_widgetCreationAbortedEventHandler != null)
306 _widgetCreationAbortedEventHandler(this, e);
310 private EventHandler<WidgetViewEventArgs> _widgetContentUpdatedEventHandler;
311 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
312 private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data);
313 private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback;
316 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
317 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
318 /// Most resources are only loaded when the control is placed on the stage.<br />
320 /// <since_tizen> 4 </since_tizen>
321 public event EventHandler<WidgetViewEventArgs> WidgetContentUpdated
325 if (_widgetContentUpdatedEventHandler == null)
327 _widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
328 WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback);
331 _widgetContentUpdatedEventHandler += value;
336 _widgetContentUpdatedEventHandler -= value;
338 if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false)
340 WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
345 // Callback for WidgetView WidgetContentUpdated signal
346 private void OnWidgetContentUpdated(IntPtr data)
348 WidgetViewEventArgs e = new WidgetViewEventArgs();
351 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
354 if (_widgetContentUpdatedEventHandler != null)
356 _widgetContentUpdatedEventHandler(this, e);
360 private EventHandler<WidgetViewEventArgs> _widgetUpdatePeriodChangedEventHandler;
361 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
362 private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data);
363 private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback;
366 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
367 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
368 /// Most resources are only loaded when the control is placed on the stage.<br />
370 /// <since_tizen> 4 </since_tizen>
371 public event EventHandler<WidgetViewEventArgs> WidgetUpdatePeriodChanged
375 if (_widgetUpdatePeriodChangedEventHandler == null)
377 _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
378 WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback);
381 _widgetUpdatePeriodChangedEventHandler += value;
386 _widgetUpdatePeriodChangedEventHandler -= value;
388 if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false)
390 WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
395 // Callback for WidgetView WidgetUpdatePeriodChanged signal
396 private void OnWidgetUpdatePeriodChanged(IntPtr data)
398 WidgetViewEventArgs e = new WidgetViewEventArgs();
401 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
404 if (_widgetUpdatePeriodChangedEventHandler != null)
406 _widgetUpdatePeriodChangedEventHandler(this, e);
410 private EventHandler<WidgetViewEventArgs> _widgetFaultedEventHandler;
411 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
412 private delegate void WidgetFaultedEventCallbackType(IntPtr data);
413 private WidgetFaultedEventCallbackType _widgetFaultedEventCallback;
416 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
417 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
418 /// Most resources are only loaded when the control is placed on the stage.<br />
420 /// <since_tizen> 4 </since_tizen>
421 public event EventHandler<WidgetViewEventArgs> WidgetFaulted
425 if (_widgetFaultedEventHandler == null)
427 _widgetFaultedEventCallback = OnWidgetFaulted;
428 WidgetFaultedSignal().Connect(_widgetFaultedEventCallback);
431 _widgetFaultedEventHandler += value;
436 _widgetFaultedEventHandler -= value;
438 if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false)
440 WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
445 // Callback for WidgetView WidgetFaulted signal
446 private void OnWidgetFaulted(IntPtr data)
448 WidgetViewEventArgs e = new WidgetViewEventArgs();
451 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
454 if (_widgetFaultedEventHandler != null)
456 _widgetFaultedEventHandler(this, e);
461 /// Pauses a given widget.
463 /// <returns>True on success, false otherwise.</returns>
464 /// <since_tizen> 4 </since_tizen>
465 public bool PauseWidget()
467 bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr);
468 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
473 /// Resumes a given widget.
475 /// <returns>True on success, false otherwise.</returns>
476 /// <since_tizen> 4 </since_tizen>
477 public bool ResumeWidget()
479 bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr);
480 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485 /// Cancels the touch event procedure.
486 /// If you call this function after feed the touch down event, the widget will get ON_HOLD events.
487 /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
489 /// <returns>True on success, false otherwise.</returns>
490 /// <since_tizen> 4 </since_tizen>
491 public bool CancelTouchEvent()
493 bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr);
494 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499 /// Activates a widget in the faulted state.
500 /// A widget in faulted state must be activated before adding the widget.
502 /// <since_tizen> 4 </since_tizen>
503 public void ActivateFaultedWidget()
505 NDalicManualPINVOKE.WidgetView_ActivateFaultedWidget(swigCPtr);
506 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
510 /// Terminate a widget instance.
512 /// <returns>True on success, false otherwise</returns>
513 public bool TerminateWidget()
515 bool ret = NDalicManualPINVOKE.WidgetView_TerminateWidget(swigCPtr);
516 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
520 internal WidgetViewSignal WidgetAddedSignal()
522 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false);
523 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 internal WidgetViewSignal WidgetDeletedSignal()
529 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetDeletedSignal(swigCPtr), false);
530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534 internal WidgetViewSignal WidgetCreationAbortedSignal()
536 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetCreationAbortedSignal(swigCPtr), false);
537 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
541 internal WidgetViewSignal WidgetContentUpdatedSignal()
543 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetContentUpdatedSignal(swigCPtr), false);
544 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
548 internal WidgetViewSignal WidgetUpdatePeriodChangedSignal()
550 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetUpdatePeriodChangedSignal(swigCPtr), false);
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555 internal WidgetViewSignal WidgetFaultedSignal()
557 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetFaultedSignal(swigCPtr), false);
558 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
563 /// Gets the ID of the widget.
565 /// <since_tizen> 4 </since_tizen>
566 public string WidgetID
571 GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp);
577 /// Gets the ID of the instance.
579 /// <since_tizen> 4 </since_tizen>
580 public string InstanceID
585 GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp);
591 /// Gets the content info.
593 /// <since_tizen> 4 </since_tizen>
594 public string ContentInfo
599 GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp);
607 /// <since_tizen> 4 </since_tizen>
613 GetProperty(WidgetView.Property.TITLE).Get(out temp);
619 /// Gets the update peroid.
621 /// <since_tizen> 4 </since_tizen>
622 public float UpdatePeriod
627 GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp);
633 /// Gets or sets the preview.
635 /// <since_tizen> 4 </since_tizen>
641 GetProperty(WidgetView.Property.PREVIEW).Get(out temp);
646 SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value));
651 /// Gets or sets the loading text.
653 /// <since_tizen> 4 </since_tizen>
654 public bool LoadingText
659 GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp);
664 SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value));
669 /// Gets or sets whether the widget state is faulted or not.
671 /// <since_tizen> 4 </since_tizen>
672 public bool WidgetStateFaulted
677 GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp);
682 SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value));
687 /// Gets or sets whether the widget is to delete permanently or not.
689 /// <since_tizen> 4 </since_tizen>
690 public bool PermanentDelete
695 GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp);
700 SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value));
705 /// Gets or sets retry text.
707 public PropertyMap RetryText
711 PropertyMap temp = new PropertyMap();
712 GetProperty(WidgetView.Property.RETRY_TEXT).Get(temp);
717 SetProperty(WidgetView.Property.RETRY_TEXT, new Tizen.NUI.PropertyValue(value));
722 /// Gets or sets effect.
724 public PropertyMap Effect
728 PropertyMap temp = new PropertyMap();
729 GetProperty(WidgetView.Property.EFFECT).Get(temp);
734 SetProperty(WidgetView.Property.EFFECT, new Tizen.NUI.PropertyValue(value));