/** Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts //------------------------------------------------------------------------------ // // // This file was automatically generated by SWIG (http://www.swig.org). // Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ namespace Tizen.NUI { using System; using System.Runtime.InteropServices; using Tizen.NUI.BaseComponents; /// /// The WidgetView is a class for displaying the widget image and controlling the widget.
/// Input events that the WidgetView gets are delivered to the widget. ///
public class WidgetView : View { private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetView_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// /// To make the Button instance be disposed. /// protected override void Dispose(DisposeTypes type) { if (disposed) { return; } if (type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. //You should release all of your own disposable objects here. } //Release your own unmanaged resources here. //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicManualPINVOKE.delete_WidgetView(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } base.Dispose(); } internal new class Property { internal static readonly int WIDGET_ID = NDalicManualPINVOKE.WidgetView_Property_WIDGET_ID_get(); internal static readonly int INSTANCE_ID = NDalicManualPINVOKE.WidgetView_Property_INSTANCE_ID_get(); internal static readonly int CONTENT_INFO = NDalicManualPINVOKE.WidgetView_Property_CONTENT_INFO_get(); internal static readonly int TITLE = NDalicManualPINVOKE.WidgetView_Property_TITLE_get(); internal static readonly int UPDATE_PERIOD = NDalicManualPINVOKE.WidgetView_Property_UPDATE_PERIOD_get(); internal static readonly int PREVIEW = NDalicManualPINVOKE.WidgetView_Property_PREVIEW_get(); internal static readonly int LOADING_TEXT = NDalicManualPINVOKE.WidgetView_Property_LOADING_TEXT_get(); internal static readonly int WIDGET_STATE_FAULTED = NDalicManualPINVOKE.WidgetView_Property_WIDGET_STATE_FAULTED_get(); internal static readonly int PERMANENT_DELETE = NDalicManualPINVOKE.WidgetView_Property_PERMANENT_DELETE_get(); } /// /// Creates a new WidgetView. /// /// 4 public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(NDalicManualPINVOKE.WidgetView_New(widgetId, contentInfo, width, height, updatePeriod), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal new static WidgetView DownCast(BaseHandle handle) { WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal WidgetView Assign(WidgetView handle) { WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr) { WidgetView ret = new WidgetView(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Event arguments of the widget view. /// public class WidgetViewEventArgs : EventArgs { private WidgetView _widgetView; /// /// The widet view. /// /// 4 public WidgetView WidgetView { get { return _widgetView; } set { _widgetView = value; } } } private EventHandler _widgetAddedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WidgetAddedEventCallbackType(IntPtr data); private WidgetAddedEventCallbackType _widgetAddedEventCallback; /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
/// Most resources are only loaded when the control is placed on the stage.
///
/// 3 public event EventHandler WidgetAdded { add { if (_widgetAddedEventHandler == null) { _widgetAddedEventCallback = OnWidgetAdded; WidgetAddedSignal().Connect(_widgetAddedEventCallback); } _widgetAddedEventHandler += value; } remove { _widgetAddedEventHandler -= value; if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false) { WidgetAddedSignal().Disconnect(_widgetAddedEventCallback); } } } // Callback for WidgetView WidgetAdded signal private void OnWidgetAdded(IntPtr data) { WidgetViewEventArgs e = new WidgetViewEventArgs(); if(data != null) { e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } if (_widgetAddedEventHandler != null) { _widgetAddedEventHandler(this, e); } } private EventHandler _widgetDeletedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WidgetDeletedEventCallbackType(IntPtr data); private WidgetDeletedEventCallbackType _widgetDeletedEventCallback; /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
/// Most resources are only loaded when the control is placed on the stage.
///
/// 4 public event EventHandler WidgetDeleted { add { if (_widgetDeletedEventHandler == null) { _widgetDeletedEventCallback = OnWidgetDeleted; WidgetDeletedSignal().Connect(_widgetDeletedEventCallback); } _widgetDeletedEventHandler += value; } remove { _widgetDeletedEventHandler -= value; if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false) { WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback); } } } // Callback for WidgetView WidgetDeleted signal private void OnWidgetDeleted(IntPtr data) { WidgetViewEventArgs e = new WidgetViewEventArgs(); if(data != null) { e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } if (_widgetDeletedEventHandler != null) { _widgetDeletedEventHandler(this, e); } } private EventHandler _widgetCreationAbortedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data); private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback; /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
/// Most resources are only loaded when the control is placed on the stage.
///
/// 4 public event EventHandler WidgetCreationAborted { add { if (_widgetCreationAbortedEventHandler == null) { _widgetCreationAbortedEventCallback = OnWidgetCreationAborted; WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback); } _widgetCreationAbortedEventHandler += value; } remove { _widgetCreationAbortedEventHandler -= value; if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false) { WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback); } } } // Callback for WidgetView WidgetCreationAborted signal private void OnWidgetCreationAborted(IntPtr data) { WidgetViewEventArgs e = new WidgetViewEventArgs(); if(data != null) { e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } if (_widgetCreationAbortedEventHandler != null) { _widgetCreationAbortedEventHandler(this, e); } } private EventHandler _widgetContentUpdatedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data); private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback; /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
/// Most resources are only loaded when the control is placed on the stage.
///
/// 4 public event EventHandler WidgetContentUpdated { add { if (_widgetContentUpdatedEventHandler == null) { _widgetContentUpdatedEventCallback = OnWidgetContentUpdated; WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback); } _widgetContentUpdatedEventHandler += value; } remove { _widgetContentUpdatedEventHandler -= value; if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false) { WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback); } } } // Callback for WidgetView WidgetContentUpdated signal private void OnWidgetContentUpdated(IntPtr data) { WidgetViewEventArgs e = new WidgetViewEventArgs(); if(data != null) { e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } if (_widgetContentUpdatedEventHandler != null) { _widgetContentUpdatedEventHandler(this, e); } } private EventHandler _widgetUpdatePeriodChangedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data); private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback; /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
/// Most resources are only loaded when the control is placed on the stage.
///
/// 4 public event EventHandler WidgetUpdatePeriodChanged { add { if (_widgetUpdatePeriodChangedEventHandler == null) { _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged; WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback); } _widgetUpdatePeriodChangedEventHandler += value; } remove { _widgetUpdatePeriodChangedEventHandler -= value; if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false) { WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback); } } } // Callback for WidgetView WidgetUpdatePeriodChanged signal private void OnWidgetUpdatePeriodChanged(IntPtr data) { WidgetViewEventArgs e = new WidgetViewEventArgs(); if(data != null) { e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } if (_widgetUpdatePeriodChangedEventHandler != null) { _widgetUpdatePeriodChangedEventHandler(this, e); } } private EventHandler _widgetFaultedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WidgetFaultedEventCallbackType(IntPtr data); private WidgetFaultedEventCallbackType _widgetFaultedEventCallback; /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
/// Most resources are only loaded when the control is placed on the stage.
///
/// 4 public event EventHandler WidgetFaulted { add { if (_widgetFaultedEventHandler == null) { _widgetFaultedEventCallback = OnWidgetFaulted; WidgetFaultedSignal().Connect(_widgetFaultedEventCallback); } _widgetFaultedEventHandler += value; } remove { _widgetFaultedEventHandler -= value; if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false) { WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback); } } } // Callback for WidgetView WidgetFaulted signal private void OnWidgetFaulted(IntPtr data) { WidgetViewEventArgs e = new WidgetViewEventArgs(); if(data != null) { e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } if (_widgetFaultedEventHandler != null) { _widgetFaultedEventHandler(this, e); } } /// /// Pauses a given widget. /// /// True on success, false otherwise. /// 4 public bool PauseWidget() { bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Resumes a given widget. /// /// True on success, false otherwise. /// 4 public bool ResumeWidget() { bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Cancels the touch event procedure. /// If you call this function after feed the touch down event, the widget will get ON_HOLD events. /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event. /// /// True on success, false otherwise. /// 4 public bool CancelTouchEvent() { bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Activates a widget in the faulted state. /// A widget in faulted state must be activated before adding the widget. /// /// 4 public void ActivateFaultedWidget() { NDalicManualPINVOKE.WidgetView_ActivateFaultedWidget(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal WidgetViewSignal WidgetAddedSignal() { WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal WidgetViewSignal WidgetDeletedSignal() { WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetDeletedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal WidgetViewSignal WidgetCreationAbortedSignal() { WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetCreationAbortedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal WidgetViewSignal WidgetContentUpdatedSignal() { WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetContentUpdatedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal WidgetViewSignal WidgetUpdatePeriodChangedSignal() { WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetUpdatePeriodChangedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal WidgetViewSignal WidgetFaultedSignal() { WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetFaultedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Gets the ID of the widget. /// /// 4 public string WidgetID { get { string temp; GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp); return temp; } } /// /// Gets the ID of the instance. /// /// 4 public string InstanceID { get { string temp; GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp); return temp; } } /// /// Gets the content info. /// /// 4 public string ContentInfo { get { string temp; GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp); return temp; } } /// /// Gets the title. /// /// 4 public string Title { get { string temp; GetProperty(WidgetView.Property.TITLE).Get(out temp); return temp; } } /// /// Gets the update peroid. /// /// 4 public float UpdatePeriod { get { float temp; GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp); return temp; } } /// /// Gets or sets the preview. /// /// 4 public bool Preview { get { bool temp; GetProperty(WidgetView.Property.PREVIEW).Get(out temp); return temp; } set { SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value)); } } /// /// Gets or sets the loading text. /// /// 4 public bool LoadingText { get { bool temp; GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp); return temp; } set { SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value)); } } /// /// Gets or sets whether the widget state is faulted or not. /// /// 4 public bool WidgetStateFaulted { get { bool temp; GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp); return temp; } set { SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value)); } } /// /// Gets or sets whether the widget is to delete permanently or not. /// /// 4 public bool PermanentDelete { get { bool temp; GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp); return temp; } set { SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value)); } } } }