1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
31 using Tizen.NUI.BaseComponents;
34 /// The WidgetView is a class for displaying the widget image and controlling the widget.<br>
35 /// Input events that the WidgetView gets are delivered to the widget.
37 public class WidgetView : View
39 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
41 internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetView_SWIGUpcast(cPtr), cMemoryOwn)
43 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
46 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj)
48 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
52 /// To make the Button instance be disposed.
54 protected override void Dispose(DisposeTypes type)
61 if (type == DisposeTypes.Explicit)
64 //Release your own managed resources here.
65 //You should release all of your own disposable objects here.
69 //Release your own unmanaged resources here.
70 //You should not access any managed member here except static instance.
71 //because the execution order of Finalizes is non-deterministic.
72 if (swigCPtr.Handle != global::System.IntPtr.Zero)
77 NDalicManualPINVOKE.delete_WidgetView(swigCPtr);
79 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
84 internal new class Property
86 internal static readonly int WIDGET_ID = NDalicManualPINVOKE.WidgetView_Property_WIDGET_ID_get();
87 internal static readonly int INSTANCE_ID = NDalicManualPINVOKE.WidgetView_Property_INSTANCE_ID_get();
88 internal static readonly int CONTENT_INFO = NDalicManualPINVOKE.WidgetView_Property_CONTENT_INFO_get();
89 internal static readonly int TITLE = NDalicManualPINVOKE.WidgetView_Property_TITLE_get();
90 internal static readonly int UPDATE_PERIOD = NDalicManualPINVOKE.WidgetView_Property_UPDATE_PERIOD_get();
91 internal static readonly int PREVIEW = NDalicManualPINVOKE.WidgetView_Property_PREVIEW_get();
92 internal static readonly int LOADING_TEXT = NDalicManualPINVOKE.WidgetView_Property_LOADING_TEXT_get();
93 internal static readonly int WIDGET_STATE_FAULTED = NDalicManualPINVOKE.WidgetView_Property_WIDGET_STATE_FAULTED_get();
94 internal static readonly int PERMANENT_DELETE = NDalicManualPINVOKE.WidgetView_Property_PERMANENT_DELETE_get();
98 /// Creates a new WidgetView.
100 /// <since_tizen> 4 </since_tizen>
101 public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(NDalicManualPINVOKE.WidgetView_New(widgetId, contentInfo, width, height, updatePeriod), true)
103 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107 internal new static WidgetView DownCast(BaseHandle handle)
109 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true);
110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true)
116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119 internal WidgetView Assign(WidgetView handle)
121 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false);
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr)
128 WidgetView ret = new WidgetView(cPtr, false);
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 /// Event arguments of the widget view.
136 public class WidgetViewEventArgs : EventArgs
138 private WidgetView _widgetView;
143 /// <since_tizen> 4 </since_tizen>
144 public WidgetView WidgetView
157 private EventHandler<WidgetViewEventArgs> _widgetAddedEventHandler;
158 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
159 private delegate void WidgetAddedEventCallbackType(IntPtr data);
160 private WidgetAddedEventCallbackType _widgetAddedEventCallback;
163 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br>
164 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
165 /// Most resources are only loaded when the control is placed on the stage.<br>
167 /// <since_tizen> 3 </since_tizen>
168 public event EventHandler<WidgetViewEventArgs> WidgetAdded
172 if (_widgetAddedEventHandler == null)
174 _widgetAddedEventCallback = OnWidgetAdded;
175 WidgetAddedSignal().Connect(_widgetAddedEventCallback);
178 _widgetAddedEventHandler += value;
183 _widgetAddedEventHandler -= value;
185 if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false)
187 WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
192 // Callback for WidgetView WidgetAdded signal
193 private void OnWidgetAdded(IntPtr data)
195 WidgetViewEventArgs e = new WidgetViewEventArgs();
198 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
201 if (_widgetAddedEventHandler != null)
203 _widgetAddedEventHandler(this, e);
207 private EventHandler<WidgetViewEventArgs> _widgetDeletedEventHandler;
208 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
209 private delegate void WidgetDeletedEventCallbackType(IntPtr data);
210 private WidgetDeletedEventCallbackType _widgetDeletedEventCallback;
213 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br>
214 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
215 /// Most resources are only loaded when the control is placed on the stage.<br>
217 /// <since_tizen> 4 </since_tizen>
218 public event EventHandler<WidgetViewEventArgs> WidgetDeleted
222 if (_widgetDeletedEventHandler == null)
224 _widgetDeletedEventCallback = OnWidgetDeleted;
225 WidgetDeletedSignal().Connect(_widgetDeletedEventCallback);
228 _widgetDeletedEventHandler += value;
233 _widgetDeletedEventHandler -= value;
235 if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false)
237 WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
242 // Callback for WidgetView WidgetDeleted signal
243 private void OnWidgetDeleted(IntPtr data)
245 WidgetViewEventArgs e = new WidgetViewEventArgs();
248 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
251 if (_widgetDeletedEventHandler != null)
253 _widgetDeletedEventHandler(this, e);
257 private EventHandler<WidgetViewEventArgs> _widgetCreationAbortedEventHandler;
258 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
259 private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data);
260 private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback;
263 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br>
264 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
265 /// Most resources are only loaded when the control is placed on the stage.<br>
267 /// <since_tizen> 4 </since_tizen>
268 public event EventHandler<WidgetViewEventArgs> WidgetCreationAborted
272 if (_widgetCreationAbortedEventHandler == null)
274 _widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
275 WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback);
278 _widgetCreationAbortedEventHandler += value;
283 _widgetCreationAbortedEventHandler -= value;
285 if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false)
287 WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
292 // Callback for WidgetView WidgetCreationAborted signal
293 private void OnWidgetCreationAborted(IntPtr data)
295 WidgetViewEventArgs e = new WidgetViewEventArgs();
298 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
301 if (_widgetCreationAbortedEventHandler != null)
303 _widgetCreationAbortedEventHandler(this, e);
307 private EventHandler<WidgetViewEventArgs> _widgetContentUpdatedEventHandler;
308 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
309 private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data);
310 private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback;
313 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br>
314 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
315 /// Most resources are only loaded when the control is placed on the stage.<br>
317 /// <since_tizen> 4 </since_tizen>
318 public event EventHandler<WidgetViewEventArgs> WidgetContentUpdated
322 if (_widgetContentUpdatedEventHandler == null)
324 _widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
325 WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback);
328 _widgetContentUpdatedEventHandler += value;
333 _widgetContentUpdatedEventHandler -= value;
335 if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false)
337 WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
342 // Callback for WidgetView WidgetContentUpdated signal
343 private void OnWidgetContentUpdated(IntPtr data)
345 WidgetViewEventArgs e = new WidgetViewEventArgs();
348 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
351 if (_widgetContentUpdatedEventHandler != null)
353 _widgetContentUpdatedEventHandler(this, e);
357 private EventHandler<WidgetViewEventArgs> _widgetUpdatePeriodChangedEventHandler;
358 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
359 private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data);
360 private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback;
363 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br>
364 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
365 /// Most resources are only loaded when the control is placed on the stage.<br>
367 /// <since_tizen> 4 </since_tizen>
368 public event EventHandler<WidgetViewEventArgs> WidgetUpdatePeriodChanged
372 if (_widgetUpdatePeriodChangedEventHandler == null)
374 _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
375 WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback);
378 _widgetUpdatePeriodChangedEventHandler += value;
383 _widgetUpdatePeriodChangedEventHandler -= value;
385 if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false)
387 WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
392 // Callback for WidgetView WidgetUpdatePeriodChanged signal
393 private void OnWidgetUpdatePeriodChanged(IntPtr data)
395 WidgetViewEventArgs e = new WidgetViewEventArgs();
398 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
401 if (_widgetUpdatePeriodChangedEventHandler != null)
403 _widgetUpdatePeriodChangedEventHandler(this, e);
407 private EventHandler<WidgetViewEventArgs> _widgetFaultedEventHandler;
408 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
409 private delegate void WidgetFaultedEventCallbackType(IntPtr data);
410 private WidgetFaultedEventCallbackType _widgetFaultedEventCallback;
413 /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br>
414 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
415 /// Most resources are only loaded when the control is placed on the stage.<br>
417 /// <since_tizen> 4 </since_tizen>
418 public event EventHandler<WidgetViewEventArgs> WidgetFaulted
422 if (_widgetFaultedEventHandler == null)
424 _widgetFaultedEventCallback = OnWidgetFaulted;
425 WidgetFaultedSignal().Connect(_widgetFaultedEventCallback);
428 _widgetFaultedEventHandler += value;
433 _widgetFaultedEventHandler -= value;
435 if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false)
437 WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
442 // Callback for WidgetView WidgetFaulted signal
443 private void OnWidgetFaulted(IntPtr data)
445 WidgetViewEventArgs e = new WidgetViewEventArgs();
448 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
451 if (_widgetFaultedEventHandler != null)
453 _widgetFaultedEventHandler(this, e);
458 /// Pauses a given widget.
460 /// <returns>True on success, false otherwise.</returns>
461 /// <since_tizen> 4 </since_tizen>
462 public bool PauseWidget()
464 bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr);
465 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470 /// Resumes a given widget.
472 /// <returns>True on success, false otherwise.</returns>
473 /// <since_tizen> 4 </since_tizen>
474 public bool ResumeWidget()
476 bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr);
477 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
482 /// Cancels the touch event procedure.
483 /// If you call this function after feed the touch down event, the widget will get ON_HOLD events.
484 /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
486 /// <returns>True on success, false otherwise.</returns>
487 /// <since_tizen> 4 </since_tizen>
488 public bool CancelTouchEvent()
490 bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr);
491 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
496 /// Activates a widget in the faulted state.
497 /// A widget in faulted state must be activated before adding the widget.
499 /// <since_tizen> 4 </since_tizen>
500 public void ActivateFaultedWidget()
502 NDalicManualPINVOKE.WidgetView_ActivateFaultedWidget(swigCPtr);
503 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
506 internal WidgetViewSignal WidgetAddedSignal()
508 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false);
509 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
513 internal WidgetViewSignal WidgetDeletedSignal()
515 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetDeletedSignal(swigCPtr), false);
516 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
520 internal WidgetViewSignal WidgetCreationAbortedSignal()
522 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetCreationAbortedSignal(swigCPtr), false);
523 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 internal WidgetViewSignal WidgetContentUpdatedSignal()
529 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetContentUpdatedSignal(swigCPtr), false);
530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534 internal WidgetViewSignal WidgetUpdatePeriodChangedSignal()
536 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetUpdatePeriodChangedSignal(swigCPtr), false);
537 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
541 internal WidgetViewSignal WidgetFaultedSignal()
543 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetFaultedSignal(swigCPtr), false);
544 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549 /// Gets the ID of the widget.
551 /// <since_tizen> 4 </since_tizen>
552 public string WidgetID
557 GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp);
563 /// Gets the ID of the instance.
565 /// <since_tizen> 4 </since_tizen>
566 public string InstanceID
571 GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp);
577 /// Gets the content info.
579 /// <since_tizen> 4 </since_tizen>
580 public string ContentInfo
585 GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp);
593 /// <since_tizen> 4 </since_tizen>
599 GetProperty(WidgetView.Property.TITLE).Get(out temp);
605 /// Gets the update peroid.
607 /// <since_tizen> 4 </since_tizen>
608 public float UpdatePeriod
613 GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp);
619 /// Gets or sets the preview.
621 /// <since_tizen> 4 </since_tizen>
627 GetProperty(WidgetView.Property.PREVIEW).Get(out temp);
632 SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value));
637 /// Gets or sets the loading text.
639 /// <since_tizen> 4 </since_tizen>
640 public bool LoadingText
645 GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp);
650 SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value));
655 /// Gets or sets whether the widget state is faulted or not.
657 /// <since_tizen> 4 </since_tizen>
658 public bool WidgetStateFaulted
663 GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp);
668 SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value));
673 /// Gets or sets whether the widget is to delete permanently or not.
675 /// <since_tizen> 4 </since_tizen>
676 public bool PermanentDelete
681 GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp);
686 SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value));