//------------------------------------------------------------------------------ // // // This file was automatically generated by SWIG (http://www.swig.org). // Version 3.0.10 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ namespace Dali { using System; using System.Runtime.InteropServices; public class Button : View { private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal Button(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Button_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Button obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Button() { DisposeQueue.Instance.Add(this); } public override void Dispose() { if (!Window.IsInstalled()) { DisposeQueue.Instance.Add(this); return; } lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicPINVOKE.delete_Button(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } global::System.GC.SuppressFinalize(this); base.Dispose(); } } public class ClickedEventArgs : EventArgs { private Button _button; public Button Button { get { return _button; } set { _button = value; } } } public class PressedEventArgs : EventArgs { private Button _button; public Button Button { get { return _button; } set { _button = value; } } } public class ReleasedEventArgs : EventArgs { private Button _button; public Button Button { get { return _button; } set { _button = value; } } } public class StateChangedEventArgs : EventArgs { private Button _button; public Button Button { get { return _button; } set { _button = value; } } } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool ClickedCallbackDelegate(global::System.IntPtr data); private DaliEventHandlerWithReturnType _buttonClickedEventHandler; private ClickedCallbackDelegate _buttonClickedCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool PressedCallbackDelegate(global::System.IntPtr data); private DaliEventHandlerWithReturnType _buttonPressedEventHandler; private PressedCallbackDelegate _buttonPressedCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool ReleasedCallbackDelegate(global::System.IntPtr data); private DaliEventHandlerWithReturnType _buttonReleasedEventHandler; private ReleasedCallbackDelegate _buttonReleasedCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool StateChangedCallbackDelegate(global::System.IntPtr data); private DaliEventHandlerWithReturnType _buttonStateChangedEventHandler; private StateChangedCallbackDelegate _buttonStateChangedCallbackDelegate; public event DaliEventHandlerWithReturnType Clicked { add { lock(this) { // Restricted to only one listener if (_buttonClickedEventHandler == null) { _buttonClickedEventHandler += value; _buttonClickedCallbackDelegate = new ClickedCallbackDelegate(OnClicked); this.ClickedSignal().Connect(_buttonClickedCallbackDelegate); } } } remove { lock(this) { if (_buttonClickedEventHandler != null) { this.ClickedSignal().Disconnect(_buttonClickedCallbackDelegate); } _buttonClickedEventHandler -= value; } } } // Callback for button click signal private bool OnClicked (IntPtr data) { ClickedEventArgs e = new ClickedEventArgs(); e.Button = Button.GetButtonFromPtr(data); if (_buttonClickedEventHandler != null) { //here we send all data to user event handlers return _buttonClickedEventHandler(this, e); } return false; } public event DaliEventHandlerWithReturnType Pressed { add { lock(this) { // Restricted to only one listener if (_buttonPressedEventHandler == null) { _buttonPressedEventHandler += value; _buttonPressedCallbackDelegate = new PressedCallbackDelegate(OnPressed); this.PressedSignal().Connect(_buttonPressedCallbackDelegate); } } } remove { lock(this) { if (_buttonPressedEventHandler != null) { this.PressedSignal().Disconnect(_buttonPressedCallbackDelegate); } _buttonPressedEventHandler -= value; } } } // Callback for button click signal private bool OnPressed (IntPtr data) { PressedEventArgs e = new PressedEventArgs(); e.Button = Button.GetButtonFromPtr(data); if (_buttonPressedEventHandler != null) { //here we send all data to user event handlers return _buttonPressedEventHandler(this, e); } return false; } public event DaliEventHandlerWithReturnType Released { add { lock(this) { // Restricted to only one listener if (_buttonReleasedEventHandler == null) { _buttonReleasedEventHandler += value; _buttonReleasedCallbackDelegate = new ReleasedCallbackDelegate(OnReleased); this.ReleasedSignal().Connect(_buttonReleasedCallbackDelegate); } } } remove { lock(this) { if (_buttonReleasedEventHandler != null) { this.ReleasedSignal().Disconnect(_buttonReleasedCallbackDelegate); } _buttonReleasedEventHandler -= value; } } } // Callback for button click signal private bool OnReleased (IntPtr data) { ReleasedEventArgs e = new ReleasedEventArgs(); e.Button = Button.GetButtonFromPtr(data); if (_buttonReleasedEventHandler != null) { //here we send all data to user event handlers return _buttonReleasedEventHandler(this, e); } return false; } public event DaliEventHandlerWithReturnType StateChanged { add { lock(this) { // Restricted to only one listener if (_buttonStateChangedEventHandler == null) { _buttonStateChangedEventHandler += value; _buttonStateChangedCallbackDelegate = new StateChangedCallbackDelegate(OnStateChanged); this.StateChangedSignal().Connect(_buttonStateChangedCallbackDelegate); } } } remove { lock(this) { if (_buttonStateChangedEventHandler != null) { this.StateChangedSignal().Disconnect(_buttonStateChangedCallbackDelegate); } _buttonStateChangedEventHandler -= value; } } } // Callback for button click signal private bool OnStateChanged (IntPtr data) { StateChangedEventArgs e = new StateChangedEventArgs(); e.Button = Button.GetButtonFromPtr(data); if (_buttonStateChangedEventHandler != null) { //here we send all data to user event handlers return _buttonStateChangedEventHandler(this, e); } return false; } internal static Button GetButtonFromPtr(global::System.IntPtr cPtr) { Button ret = new Button(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public Dali.Property.Map UnselectedVisual { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.UNSELECTED_VISUAL).Get( temp ); return temp; } set { SetProperty( Button.Property.UNSELECTED_VISUAL, new Dali.Property.Value( value ) ); } } public Dali.Property.Map SelectedVisual { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.SELECTED_VISUAL).Get( temp ); return temp; } set { SetProperty( Button.Property.SELECTED_VISUAL, new Dali.Property.Value( value ) ); } } public Dali.Property.Map DisabledSelectedVisual { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.DISABLED_SELECTED_VISUAL).Get( temp ); return temp; } set { SetProperty( Button.Property.DISABLED_SELECTED_VISUAL, new Dali.Property.Value( value ) ); } } public Dali.Property.Map DisabledUnselectedVisual { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.DISABLED_UNSELECTED_VISUAL).Get( temp ); return temp; } set { SetProperty( Button.Property.DISABLED_UNSELECTED_VISUAL, new Dali.Property.Value( value ) ); } } public Dali.Property.Map UnselectedBackgroundVisual { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get( temp ); return temp; } set { SetProperty( Button.Property.UNSELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) ); } } public Dali.Property.Map SelectedBackgroundVisual { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.SELECTED_BACKGROUND_VISUAL).Get( temp ); return temp; } set { SetProperty( Button.Property.SELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) ); } } public Dali.Property.Map DisabledUnselectedBackgroundVisual { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL).Get( temp ); return temp; } set { SetProperty( Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) ); } } public Dali.Property.Map DisabledSelectedBackgroundVisual { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL).Get( temp ); return temp; } set { SetProperty( Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) ); } } public string LabelRelativeAlignment { get { string temp; GetProperty( Button.Property.LABEL_RELATIVE_ALIGNMENT).Get( out temp ); return temp; } set { SetProperty( Button.Property.LABEL_RELATIVE_ALIGNMENT, new Dali.Property.Value( value ) ); } } public Vector4 LabelPadding { get { Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f); GetProperty( Button.Property.LABEL_PADDING).Get( temp ); return temp; } set { SetProperty( Button.Property.LABEL_PADDING, new Dali.Property.Value( value ) ); } } public Vector4 ForegroundVisualPadding { get { Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f); GetProperty( Button.Property.FOREGROUND_VISUAL_PADDING).Get( temp ); return temp; } set { SetProperty( Button.Property.FOREGROUND_VISUAL_PADDING, new Dali.Property.Value( value ) ); } } public class Property { public static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get(); public static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get(); public static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get(); public static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get(); public static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get(); public static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get(); public static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get(); public static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get(); public static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get(); public static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get(); public static readonly int FOREGROUND_VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get(); public static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get(); public static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get(); public static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get(); public static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get(); public static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get(); public static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get(); public static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get(); public static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get(); } public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Button(Button button) : this(NDalicPINVOKE.new_Button__SWIG_1(Button.getCPtr(button)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public new static Button DownCast(BaseHandle handle) { Button ret = new Button(NDalicPINVOKE.Button_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal ButtonSignal PressedSignal() { ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal ButtonSignal ReleasedSignal() { ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal ButtonSignal ClickedSignal() { ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal ButtonSignal StateChangedSignal() { ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public bool AutoRepeating { get { bool temp = false; GetProperty( Button.Property.AUTO_REPEATING).Get( out temp ); return temp; } set { SetProperty( Button.Property.AUTO_REPEATING, new Dali.Property.Value( value ) ); } } public float InitialAutoRepeatingDelay { get { float temp = 0.0f; GetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get( out temp ); return temp; } set { SetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) ); } } public float NextAutoRepeatingDelay { get { float temp = 0.0f; GetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY).Get( out temp ); return temp; } set { SetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) ); } } public bool Togglable { get { bool temp = false; GetProperty( Button.Property.TOGGLABLE).Get( out temp ); return temp; } set { SetProperty( Button.Property.TOGGLABLE, new Dali.Property.Value( value ) ); } } public bool Selected { get { bool temp = false; GetProperty( Button.Property.SELECTED).Get( out temp ); return temp; } set { SetProperty( Button.Property.SELECTED, new Dali.Property.Value( value ) ); } } public Vector4 UnselectedColor { get { Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f); GetProperty( Button.Property.UNSELECTED_COLOR).Get( temp ); return temp; } set { SetProperty( Button.Property.UNSELECTED_COLOR, new Dali.Property.Value( value ) ); } } public Vector4 SelectedColor { get { Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f); GetProperty( Button.Property.SELECTED_COLOR).Get( temp ); return temp; } set { SetProperty( Button.Property.SELECTED_COLOR, new Dali.Property.Value( value ) ); } } public Dali.Property.Map Label { get { Dali.Property.Map temp = new Dali.Property.Map(); GetProperty( Button.Property.LABEL).Get( temp ); return temp; } set { SetProperty( Button.Property.LABEL, new Dali.Property.Value( value ) ); } } public string LabelText { get { Dali.Property.Map map = new Dali.Property.Map(); GetProperty( Button.Property.LABEL).Get(map); Dali.Property.Value value = map.Find( Dali.Constants.TextVisualProperty.Text, "Text"); string str; value.Get(out str); return str; } set { SetProperty( Button.Property.LABEL, new Dali.Property.Value( value ) ); } } } }