/** 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; /// /// WidgetView is a class for displaying the widget image and controlling the widget.
/// Input events that 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 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 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(); } /// /// Create a new WidgetView. /// 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 widget view. /// public class WidgetViewEventArgs : EventArgs { private WidgetView _widgetView; /// /// The widet view. /// public WidgetView WidgetView { get { return _widgetView; } set { _widgetView = value; } } } private EventHandler _widgetAddedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WidgetAddedEventCallbackType(IntPtr data); private WidgetAddedEventCallbackType _widgetAddedEventCallback; /// /// Event for ResourceReady signal which can be used to subscribe/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 stage.
///
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; /// /// Event for ResourceReady signal which can be used to subscribe/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 stage.
///
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; /// /// Event for ResourceReady signal which can be used to subscribe/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 stage.
///
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; /// /// Event for ResourceReady signal which can be used to subscribe/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 stage.
///
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; /// /// Event for ResourceReady signal which can be used to subscribe/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 stage.
///
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; /// /// Event for ResourceReady signal which can be used to subscribe/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 stage.
///
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. public bool PauseWidget() { bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Resume a given widget. /// /// true on success, false otherwise. public bool ResumeWidget() { bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Cancels 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. public bool CancelTouchEvent() { bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Activate a widget in faulted state. /// A widget in faulted state MUST be activated before adding the widget. /// 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 widget. /// public string WidgetID { get { string temp; GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp); return temp; } } /// /// Gets the id of instance. /// public string InstanceID { get { string temp; GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp); return temp; } } /// /// Gets the content info. /// public string ContentInfo { get { string temp; GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp); return temp; } } /// /// Gets the title. /// public string Title { get { string temp; GetProperty(WidgetView.Property.TITLE).Get(out temp); return temp; } } /// /// Gets the update peroid. /// public float UpdatePeriod { get { float temp; GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp); return temp; } } /// /// Gets/sets the preview. /// 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/sets the loading text. /// 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/sets whether the widget state is faulted or not. /// 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/sets whether the widget is permanent delete or not. /// 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)); } } } }