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();
99 /// Creates a new WidgetView.
101 /// <since_tizen> 4 </since_tizen>
102 public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(NDalicManualPINVOKE.WidgetView_New(widgetId, contentInfo, width, height, updatePeriod), true)
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 internal new static WidgetView DownCast(BaseHandle handle)
110 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true);
111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true)
117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 internal WidgetView Assign(WidgetView handle)
122 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false);
123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr)
129 WidgetView ret = new WidgetView(cPtr, false);
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// Event arguments of the widget view.
137 public class WidgetViewEventArgs : EventArgs
139 private WidgetView _widgetView;
144 /// <since_tizen> 4 </since_tizen>
145 public WidgetView WidgetView
158 private EventHandler<WidgetViewEventArgs> _widgetAddedEventHandler;
159 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
160 private delegate void WidgetAddedEventCallbackType(IntPtr data);
161 private WidgetAddedEventCallbackType _widgetAddedEventCallback;
164 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
165 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
166 /// Most resources are only loaded when the control is placed on the stage.<br />
168 /// <since_tizen> 3 </since_tizen>
169 public event EventHandler<WidgetViewEventArgs> WidgetAdded
173 if (_widgetAddedEventHandler == null)
175 _widgetAddedEventCallback = OnWidgetAdded;
176 WidgetAddedSignal().Connect(_widgetAddedEventCallback);
179 _widgetAddedEventHandler += value;
184 _widgetAddedEventHandler -= value;
186 if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false)
188 WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
193 // Callback for WidgetView WidgetAdded signal
194 private void OnWidgetAdded(IntPtr data)
196 WidgetViewEventArgs e = new WidgetViewEventArgs();
199 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
202 if (_widgetAddedEventHandler != null)
204 _widgetAddedEventHandler(this, e);
208 private EventHandler<WidgetViewEventArgs> _widgetDeletedEventHandler;
209 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
210 private delegate void WidgetDeletedEventCallbackType(IntPtr data);
211 private WidgetDeletedEventCallbackType _widgetDeletedEventCallback;
214 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
215 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
216 /// Most resources are only loaded when the control is placed on the stage.<br />
218 /// <since_tizen> 4 </since_tizen>
219 public event EventHandler<WidgetViewEventArgs> WidgetDeleted
223 if (_widgetDeletedEventHandler == null)
225 _widgetDeletedEventCallback = OnWidgetDeleted;
226 WidgetDeletedSignal().Connect(_widgetDeletedEventCallback);
229 _widgetDeletedEventHandler += value;
234 _widgetDeletedEventHandler -= value;
236 if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false)
238 WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
243 // Callback for WidgetView WidgetDeleted signal
244 private void OnWidgetDeleted(IntPtr data)
246 WidgetViewEventArgs e = new WidgetViewEventArgs();
249 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
252 if (_widgetDeletedEventHandler != null)
254 _widgetDeletedEventHandler(this, e);
258 private EventHandler<WidgetViewEventArgs> _widgetCreationAbortedEventHandler;
259 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
260 private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data);
261 private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback;
264 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
265 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
266 /// Most resources are only loaded when the control is placed on the stage.<br />
268 /// <since_tizen> 4 </since_tizen>
269 public event EventHandler<WidgetViewEventArgs> WidgetCreationAborted
273 if (_widgetCreationAbortedEventHandler == null)
275 _widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
276 WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback);
279 _widgetCreationAbortedEventHandler += value;
284 _widgetCreationAbortedEventHandler -= value;
286 if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false)
288 WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
293 // Callback for WidgetView WidgetCreationAborted signal
294 private void OnWidgetCreationAborted(IntPtr data)
296 WidgetViewEventArgs e = new WidgetViewEventArgs();
299 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
302 if (_widgetCreationAbortedEventHandler != null)
304 _widgetCreationAbortedEventHandler(this, e);
308 private EventHandler<WidgetViewEventArgs> _widgetContentUpdatedEventHandler;
309 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
310 private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data);
311 private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback;
314 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
315 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
316 /// Most resources are only loaded when the control is placed on the stage.<br />
318 /// <since_tizen> 4 </since_tizen>
319 public event EventHandler<WidgetViewEventArgs> WidgetContentUpdated
323 if (_widgetContentUpdatedEventHandler == null)
325 _widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
326 WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback);
329 _widgetContentUpdatedEventHandler += value;
334 _widgetContentUpdatedEventHandler -= value;
336 if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false)
338 WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
343 // Callback for WidgetView WidgetContentUpdated signal
344 private void OnWidgetContentUpdated(IntPtr data)
346 WidgetViewEventArgs e = new WidgetViewEventArgs();
349 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
352 if (_widgetContentUpdatedEventHandler != null)
354 _widgetContentUpdatedEventHandler(this, e);
358 private EventHandler<WidgetViewEventArgs> _widgetUpdatePeriodChangedEventHandler;
359 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
360 private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data);
361 private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback;
364 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
365 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
366 /// Most resources are only loaded when the control is placed on the stage.<br />
368 /// <since_tizen> 4 </since_tizen>
369 public event EventHandler<WidgetViewEventArgs> WidgetUpdatePeriodChanged
373 if (_widgetUpdatePeriodChangedEventHandler == null)
375 _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
376 WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback);
379 _widgetUpdatePeriodChangedEventHandler += value;
384 _widgetUpdatePeriodChangedEventHandler -= value;
386 if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false)
388 WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
393 // Callback for WidgetView WidgetUpdatePeriodChanged signal
394 private void OnWidgetUpdatePeriodChanged(IntPtr data)
396 WidgetViewEventArgs e = new WidgetViewEventArgs();
399 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
402 if (_widgetUpdatePeriodChangedEventHandler != null)
404 _widgetUpdatePeriodChangedEventHandler(this, e);
408 private EventHandler<WidgetViewEventArgs> _widgetFaultedEventHandler;
409 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
410 private delegate void WidgetFaultedEventCallbackType(IntPtr data);
411 private WidgetFaultedEventCallbackType _widgetFaultedEventCallback;
414 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
415 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
416 /// Most resources are only loaded when the control is placed on the stage.<br />
418 /// <since_tizen> 4 </since_tizen>
419 public event EventHandler<WidgetViewEventArgs> WidgetFaulted
423 if (_widgetFaultedEventHandler == null)
425 _widgetFaultedEventCallback = OnWidgetFaulted;
426 WidgetFaultedSignal().Connect(_widgetFaultedEventCallback);
429 _widgetFaultedEventHandler += value;
434 _widgetFaultedEventHandler -= value;
436 if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false)
438 WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
443 // Callback for WidgetView WidgetFaulted signal
444 private void OnWidgetFaulted(IntPtr data)
446 WidgetViewEventArgs e = new WidgetViewEventArgs();
449 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
452 if (_widgetFaultedEventHandler != null)
454 _widgetFaultedEventHandler(this, e);
459 /// Pauses a given widget.
461 /// <returns>True on success, false otherwise.</returns>
462 /// <since_tizen> 4 </since_tizen>
463 public bool PauseWidget()
465 bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr);
466 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
471 /// Resumes a given widget.
473 /// <returns>True on success, false otherwise.</returns>
474 /// <since_tizen> 4 </since_tizen>
475 public bool ResumeWidget()
477 bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr);
478 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
483 /// Cancels the touch event procedure.
484 /// If you call this function after feed the touch down event, the widget will get ON_HOLD events.
485 /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
487 /// <returns>True on success, false otherwise.</returns>
488 /// <since_tizen> 4 </since_tizen>
489 public bool CancelTouchEvent()
491 bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr);
492 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497 /// Activates a widget in the faulted state.
498 /// A widget in faulted state must be activated before adding the widget.
500 /// <since_tizen> 4 </since_tizen>
501 public void ActivateFaultedWidget()
503 NDalicManualPINVOKE.WidgetView_ActivateFaultedWidget(swigCPtr);
504 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507 internal WidgetViewSignal WidgetAddedSignal()
509 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false);
510 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
514 internal WidgetViewSignal WidgetDeletedSignal()
516 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetDeletedSignal(swigCPtr), false);
517 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
521 internal WidgetViewSignal WidgetCreationAbortedSignal()
523 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetCreationAbortedSignal(swigCPtr), false);
524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
528 internal WidgetViewSignal WidgetContentUpdatedSignal()
530 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetContentUpdatedSignal(swigCPtr), false);
531 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
535 internal WidgetViewSignal WidgetUpdatePeriodChangedSignal()
537 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetUpdatePeriodChangedSignal(swigCPtr), false);
538 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542 internal WidgetViewSignal WidgetFaultedSignal()
544 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetFaultedSignal(swigCPtr), false);
545 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
550 /// Gets the ID of the widget.
552 /// <since_tizen> 4 </since_tizen>
553 public string WidgetID
558 GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp);
564 /// Gets the ID of the instance.
566 /// <since_tizen> 4 </since_tizen>
567 public string InstanceID
572 GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp);
578 /// Gets the content info.
580 /// <since_tizen> 4 </since_tizen>
581 public string ContentInfo
586 GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp);
594 /// <since_tizen> 4 </since_tizen>
600 GetProperty(WidgetView.Property.TITLE).Get(out temp);
606 /// Gets the update peroid.
608 /// <since_tizen> 4 </since_tizen>
609 public float UpdatePeriod
614 GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp);
620 /// Gets or sets the preview.
622 /// <since_tizen> 4 </since_tizen>
628 GetProperty(WidgetView.Property.PREVIEW).Get(out temp);
633 SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value));
638 /// Gets or sets the loading text.
640 /// <since_tizen> 4 </since_tizen>
641 public bool LoadingText
646 GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp);
651 SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value));
656 /// Gets or sets whether the widget state is faulted or not.
658 /// <since_tizen> 4 </since_tizen>
659 public bool WidgetStateFaulted
664 GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp);
669 SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value));
674 /// Gets or sets whether the widget is to delete permanently or not.
676 /// <since_tizen> 4 </since_tizen>
677 public bool PermanentDelete
682 GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp);
687 SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value));