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 /// WidgetView is a class for displaying the widget image and controlling the widget.<br>
35 /// Input events that 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 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 /// Create a new WidgetView.
100 public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(NDalicManualPINVOKE.WidgetView_New(widgetId, contentInfo, width, height, updatePeriod), true)
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106 internal new static WidgetView DownCast(BaseHandle handle)
108 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true);
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true)
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 internal WidgetView Assign(WidgetView handle)
120 WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr)
127 WidgetView ret = new WidgetView(cPtr, false);
128 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 /// Event arguments of widget view.
135 public class WidgetViewEventArgs : EventArgs
137 private WidgetView _widgetView;
142 public WidgetView WidgetView
155 private EventHandler<WidgetViewEventArgs> _widgetAddedEventHandler;
156 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
157 private delegate void WidgetAddedEventCallbackType(IntPtr data);
158 private WidgetAddedEventCallbackType _widgetAddedEventCallback;
161 /// Event for ResourceReady signal which can be used to subscribe/unsubscribe the event handler.<br>
162 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
163 /// Most resources are only loaded when the control is placed on stage.<br>
165 public event EventHandler<WidgetViewEventArgs> WidgetAdded
169 if (_widgetAddedEventHandler == null)
171 _widgetAddedEventCallback = OnWidgetAdded;
172 WidgetAddedSignal().Connect(_widgetAddedEventCallback);
175 _widgetAddedEventHandler += value;
180 _widgetAddedEventHandler -= value;
182 if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false)
184 WidgetAddedSignal().Disconnect(_widgetAddedEventCallback);
189 // Callback for WidgetView WidgetAdded signal
190 private void OnWidgetAdded(IntPtr data)
192 WidgetViewEventArgs e = new WidgetViewEventArgs();
195 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
198 if (_widgetAddedEventHandler != null)
200 _widgetAddedEventHandler(this, e);
204 private EventHandler<WidgetViewEventArgs> _widgetDeletedEventHandler;
205 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
206 private delegate void WidgetDeletedEventCallbackType(IntPtr data);
207 private WidgetDeletedEventCallbackType _widgetDeletedEventCallback;
210 /// Event for ResourceReady signal which can be used to subscribe/unsubscribe the event handler.<br>
211 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
212 /// Most resources are only loaded when the control is placed on stage.<br>
214 public event EventHandler<WidgetViewEventArgs> WidgetDeleted
218 if (_widgetDeletedEventHandler == null)
220 _widgetDeletedEventCallback = OnWidgetDeleted;
221 WidgetDeletedSignal().Connect(_widgetDeletedEventCallback);
224 _widgetDeletedEventHandler += value;
229 _widgetDeletedEventHandler -= value;
231 if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false)
233 WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback);
238 // Callback for WidgetView WidgetDeleted signal
239 private void OnWidgetDeleted(IntPtr data)
241 WidgetViewEventArgs e = new WidgetViewEventArgs();
244 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
247 if (_widgetDeletedEventHandler != null)
249 _widgetDeletedEventHandler(this, e);
253 private EventHandler<WidgetViewEventArgs> _widgetCreationAbortedEventHandler;
254 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
255 private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data);
256 private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback;
259 /// Event for ResourceReady signal which can be used to subscribe/unsubscribe the event handler.<br>
260 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
261 /// Most resources are only loaded when the control is placed on stage.<br>
263 public event EventHandler<WidgetViewEventArgs> WidgetCreationAborted
267 if (_widgetCreationAbortedEventHandler == null)
269 _widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
270 WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback);
273 _widgetCreationAbortedEventHandler += value;
278 _widgetCreationAbortedEventHandler -= value;
280 if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false)
282 WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback);
287 // Callback for WidgetView WidgetCreationAborted signal
288 private void OnWidgetCreationAborted(IntPtr data)
290 WidgetViewEventArgs e = new WidgetViewEventArgs();
293 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
296 if (_widgetCreationAbortedEventHandler != null)
298 _widgetCreationAbortedEventHandler(this, e);
302 private EventHandler<WidgetViewEventArgs> _widgetContentUpdatedEventHandler;
303 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
304 private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data);
305 private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback;
308 /// Event for ResourceReady signal which can be used to subscribe/unsubscribe the event handler.<br>
309 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
310 /// Most resources are only loaded when the control is placed on stage.<br>
312 public event EventHandler<WidgetViewEventArgs> WidgetContentUpdated
316 if (_widgetContentUpdatedEventHandler == null)
318 _widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
319 WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback);
322 _widgetContentUpdatedEventHandler += value;
327 _widgetContentUpdatedEventHandler -= value;
329 if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false)
331 WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback);
336 // Callback for WidgetView WidgetContentUpdated signal
337 private void OnWidgetContentUpdated(IntPtr data)
339 WidgetViewEventArgs e = new WidgetViewEventArgs();
342 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
345 if (_widgetContentUpdatedEventHandler != null)
347 _widgetContentUpdatedEventHandler(this, e);
351 private EventHandler<WidgetViewEventArgs> _widgetUpdatePeriodChangedEventHandler;
352 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
353 private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data);
354 private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback;
357 /// Event for ResourceReady signal which can be used to subscribe/unsubscribe the event handler.<br>
358 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
359 /// Most resources are only loaded when the control is placed on stage.<br>
361 public event EventHandler<WidgetViewEventArgs> WidgetUpdatePeriodChanged
365 if (_widgetUpdatePeriodChangedEventHandler == null)
367 _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
368 WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback);
371 _widgetUpdatePeriodChangedEventHandler += value;
376 _widgetUpdatePeriodChangedEventHandler -= value;
378 if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false)
380 WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback);
385 // Callback for WidgetView WidgetUpdatePeriodChanged signal
386 private void OnWidgetUpdatePeriodChanged(IntPtr data)
388 WidgetViewEventArgs e = new WidgetViewEventArgs();
391 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
394 if (_widgetUpdatePeriodChangedEventHandler != null)
396 _widgetUpdatePeriodChangedEventHandler(this, e);
400 private EventHandler<WidgetViewEventArgs> _widgetFaultedEventHandler;
401 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
402 private delegate void WidgetFaultedEventCallbackType(IntPtr data);
403 private WidgetFaultedEventCallbackType _widgetFaultedEventCallback;
406 /// Event for ResourceReady signal which can be used to subscribe/unsubscribe the event handler.<br>
407 /// This signal is emitted after all resources required by a control are loaded and ready.<br>
408 /// Most resources are only loaded when the control is placed on stage.<br>
410 public event EventHandler<WidgetViewEventArgs> WidgetFaulted
414 if (_widgetFaultedEventHandler == null)
416 _widgetFaultedEventCallback = OnWidgetFaulted;
417 WidgetFaultedSignal().Connect(_widgetFaultedEventCallback);
420 _widgetFaultedEventHandler += value;
425 _widgetFaultedEventHandler -= value;
427 if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false)
429 WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback);
434 // Callback for WidgetView WidgetFaulted signal
435 private void OnWidgetFaulted(IntPtr data)
437 WidgetViewEventArgs e = new WidgetViewEventArgs();
440 e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
443 if (_widgetFaultedEventHandler != null)
445 _widgetFaultedEventHandler(this, e);
450 /// Pauses a given widget.
452 /// <returns>true on success, false otherwise.</returns>
453 public bool PauseWidget()
455 bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr);
456 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
461 /// Resume a given widget.
463 /// <returns>true on success, false otherwise.</returns>
464 public bool ResumeWidget()
466 bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr);
467 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
472 /// Cancels touch event procedure.
473 /// If you call this function after feed the touch down event, the widget will get ON_HOLD events.
474 /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event.
476 /// <returns>true on success, false otherwise.</returns>
477 public bool CancelTouchEvent()
479 bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr);
480 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485 /// Activate a widget in faulted state.
486 /// A widget in faulted state MUST be activated before adding the widget.
488 public void ActivateFaultedWidget()
490 NDalicManualPINVOKE.WidgetView_ActivateFaultedWidget(swigCPtr);
491 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 internal WidgetViewSignal WidgetAddedSignal()
496 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false);
497 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
501 internal WidgetViewSignal WidgetDeletedSignal()
503 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetDeletedSignal(swigCPtr), false);
504 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508 internal WidgetViewSignal WidgetCreationAbortedSignal()
510 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetCreationAbortedSignal(swigCPtr), false);
511 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
515 internal WidgetViewSignal WidgetContentUpdatedSignal()
517 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetContentUpdatedSignal(swigCPtr), false);
518 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522 internal WidgetViewSignal WidgetUpdatePeriodChangedSignal()
524 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetUpdatePeriodChangedSignal(swigCPtr), false);
525 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529 internal WidgetViewSignal WidgetFaultedSignal()
531 WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetFaultedSignal(swigCPtr), false);
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
537 /// Gets the id of widget.
539 public string WidgetID
544 GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp);
550 /// Gets the id of instance.
552 public string InstanceID
557 GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp);
563 /// Gets the content info.
565 public string ContentInfo
570 GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp);
583 GetProperty(WidgetView.Property.TITLE).Get(out temp);
589 /// Gets the update peroid.
591 public float UpdatePeriod
596 GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp);
602 /// Gets/sets the preview.
609 GetProperty(WidgetView.Property.PREVIEW).Get(out temp);
614 SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value));
619 /// Gets/sets the loading text.
621 public bool LoadingText
626 GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp);
631 SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value));
636 /// Gets/sets whether the widget state is faulted or not.
638 public bool WidgetStateFaulted
643 GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp);
648 SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value));
653 /// Gets/sets whether the widget is permanent delete or not.
655 public bool PermanentDelete
660 GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp);
665 SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value));