1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
14 using System.Runtime.InteropServices;
17 public class Button : View {
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 internal Button(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Button_SWIGUpcast(cPtr), cMemoryOwn) {
21 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Button obj) {
25 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 DisposeQueue.Instance.Add(this);
32 public override void Dispose() {
33 if (!Window.IsInstalled()) {
34 DisposeQueue.Instance.Add(this);
39 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 NDalicPINVOKE.delete_Button(swigCPtr);
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
46 global::System.GC.SuppressFinalize(this);
53 public class ClickedEventArgs : EventArgs
55 private Button _button;
70 public class PressedEventArgs : EventArgs
72 private Button _button;
87 public class ReleasedEventArgs : EventArgs
89 private Button _button;
104 public class StateChangedEventArgs : EventArgs
106 private Button _button;
122 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
123 private delegate bool ClickedCallbackDelegate(global::System.IntPtr data);
124 private DaliEventHandlerWithReturnType<object,ClickedEventArgs,bool> _buttonClickedEventHandler;
125 private ClickedCallbackDelegate _buttonClickedCallbackDelegate;
127 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
128 private delegate bool PressedCallbackDelegate(global::System.IntPtr data);
129 private DaliEventHandlerWithReturnType<object,PressedEventArgs,bool> _buttonPressedEventHandler;
130 private PressedCallbackDelegate _buttonPressedCallbackDelegate;
132 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
133 private delegate bool ReleasedCallbackDelegate(global::System.IntPtr data);
134 private DaliEventHandlerWithReturnType<object,ReleasedEventArgs,bool> _buttonReleasedEventHandler;
135 private ReleasedCallbackDelegate _buttonReleasedCallbackDelegate;
137 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
138 private delegate bool StateChangedCallbackDelegate(global::System.IntPtr data);
139 private DaliEventHandlerWithReturnType<object,StateChangedEventArgs,bool> _buttonStateChangedEventHandler;
140 private StateChangedCallbackDelegate _buttonStateChangedCallbackDelegate;
143 public event DaliEventHandlerWithReturnType<object,ClickedEventArgs,bool> Clicked
149 // Restricted to only one listener
150 if (_buttonClickedEventHandler == null)
152 _buttonClickedEventHandler += value;
154 _buttonClickedCallbackDelegate = new ClickedCallbackDelegate(OnClicked);
155 this.ClickedSignal().Connect(_buttonClickedCallbackDelegate);
164 if (_buttonClickedEventHandler != null)
166 this.ClickedSignal().Disconnect(_buttonClickedCallbackDelegate);
169 _buttonClickedEventHandler -= value;
174 // Callback for button click signal
175 private bool OnClicked (IntPtr data)
177 ClickedEventArgs e = new ClickedEventArgs();
179 e.Button = Button.GetButtonFromPtr(data);
181 if (_buttonClickedEventHandler != null)
183 //here we send all data to user event handlers
184 return _buttonClickedEventHandler(this, e);
190 public event DaliEventHandlerWithReturnType<object,PressedEventArgs,bool> Pressed
196 // Restricted to only one listener
197 if (_buttonPressedEventHandler == null)
199 _buttonPressedEventHandler += value;
201 _buttonPressedCallbackDelegate = new PressedCallbackDelegate(OnPressed);
202 this.PressedSignal().Connect(_buttonPressedCallbackDelegate);
211 if (_buttonPressedEventHandler != null)
213 this.PressedSignal().Disconnect(_buttonPressedCallbackDelegate);
216 _buttonPressedEventHandler -= value;
221 // Callback for button click signal
222 private bool OnPressed (IntPtr data)
224 PressedEventArgs e = new PressedEventArgs();
226 e.Button = Button.GetButtonFromPtr(data);
228 if (_buttonPressedEventHandler != null)
230 //here we send all data to user event handlers
231 return _buttonPressedEventHandler(this, e);
237 public event DaliEventHandlerWithReturnType<object,ReleasedEventArgs,bool> Released
243 // Restricted to only one listener
244 if (_buttonReleasedEventHandler == null)
246 _buttonReleasedEventHandler += value;
248 _buttonReleasedCallbackDelegate = new ReleasedCallbackDelegate(OnReleased);
249 this.ReleasedSignal().Connect(_buttonReleasedCallbackDelegate);
258 if (_buttonReleasedEventHandler != null)
260 this.ReleasedSignal().Disconnect(_buttonReleasedCallbackDelegate);
263 _buttonReleasedEventHandler -= value;
268 // Callback for button click signal
269 private bool OnReleased (IntPtr data)
271 ReleasedEventArgs e = new ReleasedEventArgs();
273 e.Button = Button.GetButtonFromPtr(data);
275 if (_buttonReleasedEventHandler != null)
277 //here we send all data to user event handlers
278 return _buttonReleasedEventHandler(this, e);
284 public event DaliEventHandlerWithReturnType<object,StateChangedEventArgs,bool> StateChanged
290 // Restricted to only one listener
291 if (_buttonStateChangedEventHandler == null)
293 _buttonStateChangedEventHandler += value;
295 _buttonStateChangedCallbackDelegate = new StateChangedCallbackDelegate(OnStateChanged);
296 this.StateChangedSignal().Connect(_buttonStateChangedCallbackDelegate);
305 if (_buttonStateChangedEventHandler != null)
307 this.StateChangedSignal().Disconnect(_buttonStateChangedCallbackDelegate);
310 _buttonStateChangedEventHandler -= value;
315 // Callback for button click signal
316 private bool OnStateChanged (IntPtr data)
318 StateChangedEventArgs e = new StateChangedEventArgs();
320 e.Button = Button.GetButtonFromPtr(data);
322 if (_buttonStateChangedEventHandler != null)
324 //here we send all data to user event handlers
325 return _buttonStateChangedEventHandler(this, e);
330 internal static Button GetButtonFromPtr(global::System.IntPtr cPtr) {
331 Button ret = new Button(cPtr, false);
332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 public Dali.Property.Map UnselectedVisual
340 Dali.Property.Map temp = new Dali.Property.Map();
341 GetProperty( Button.Property.UNSELECTED_VISUAL).Get( temp );
346 SetProperty( Button.Property.UNSELECTED_VISUAL, new Dali.Property.Value( value ) );
350 public Dali.Property.Map SelectedVisual
354 Dali.Property.Map temp = new Dali.Property.Map();
355 GetProperty( Button.Property.SELECTED_VISUAL).Get( temp );
360 SetProperty( Button.Property.SELECTED_VISUAL, new Dali.Property.Value( value ) );
364 public Dali.Property.Map DisabledSelectedVisual
368 Dali.Property.Map temp = new Dali.Property.Map();
369 GetProperty( Button.Property.DISABLED_SELECTED_VISUAL).Get( temp );
374 SetProperty( Button.Property.DISABLED_SELECTED_VISUAL, new Dali.Property.Value( value ) );
378 public Dali.Property.Map DisabledUnselectedVisual
382 Dali.Property.Map temp = new Dali.Property.Map();
383 GetProperty( Button.Property.DISABLED_UNSELECTED_VISUAL).Get( temp );
388 SetProperty( Button.Property.DISABLED_UNSELECTED_VISUAL, new Dali.Property.Value( value ) );
392 public Dali.Property.Map UnselectedBackgroundVisual
396 Dali.Property.Map temp = new Dali.Property.Map();
397 GetProperty( Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get( temp );
402 SetProperty( Button.Property.UNSELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) );
406 public Dali.Property.Map SelectedBackgroundVisual
410 Dali.Property.Map temp = new Dali.Property.Map();
411 GetProperty( Button.Property.SELECTED_BACKGROUND_VISUAL).Get( temp );
416 SetProperty( Button.Property.SELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) );
420 public Dali.Property.Map DisabledUnselectedBackgroundVisual
424 Dali.Property.Map temp = new Dali.Property.Map();
425 GetProperty( Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL).Get( temp );
430 SetProperty( Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) );
434 public Dali.Property.Map DisabledSelectedBackgroundVisual
438 Dali.Property.Map temp = new Dali.Property.Map();
439 GetProperty( Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL).Get( temp );
444 SetProperty( Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL, new Dali.Property.Value( value ) );
448 public string LabelRelativeAlignment
453 GetProperty( Button.Property.LABEL_RELATIVE_ALIGNMENT).Get( out temp );
458 SetProperty( Button.Property.LABEL_RELATIVE_ALIGNMENT, new Dali.Property.Value( value ) );
462 public Vector4 LabelPadding
466 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
467 GetProperty( Button.Property.LABEL_PADDING).Get( temp );
472 SetProperty( Button.Property.LABEL_PADDING, new Dali.Property.Value( value ) );
476 public Vector4 ForegroundVisualPadding
480 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
481 GetProperty( Button.Property.FOREGROUND_VISUAL_PADDING).Get( temp );
486 SetProperty( Button.Property.FOREGROUND_VISUAL_PADDING, new Dali.Property.Value( value ) );
490 public class Property
492 public static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get();
493 public static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get();
494 public static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get();
495 public static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get();
496 public static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get();
497 public static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get();
498 public static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get();
499 public static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get();
500 public static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get();
501 public static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get();
502 public static readonly int FOREGROUND_VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get();
504 public static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get();
505 public static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get();
506 public static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get();
507 public static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get();
508 public static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get();
509 public static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get();
510 public static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get();
511 public static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get();
514 public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true) {
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518 public Button(Button button) : this(NDalicPINVOKE.new_Button__SWIG_1(Button.getCPtr(button)), true) {
519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522 public new static Button DownCast(BaseHandle handle) {
523 Button ret = new Button(NDalicPINVOKE.Button_DownCast(BaseHandle.getCPtr(handle)), true);
524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
528 internal ButtonSignal PressedSignal() {
529 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false);
530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534 internal ButtonSignal ReleasedSignal() {
535 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false);
536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
540 internal ButtonSignal ClickedSignal() {
541 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false);
542 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
546 internal ButtonSignal StateChangedSignal() {
547 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false);
548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552 public bool AutoRepeating
557 GetProperty( Button.Property.AUTO_REPEATING).Get( out temp );
562 SetProperty( Button.Property.AUTO_REPEATING, new Dali.Property.Value( value ) );
565 public float InitialAutoRepeatingDelay
570 GetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get( out temp );
575 SetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) );
578 public float NextAutoRepeatingDelay
583 GetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY).Get( out temp );
588 SetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) );
591 public bool Togglable
596 GetProperty( Button.Property.TOGGLABLE).Get( out temp );
601 SetProperty( Button.Property.TOGGLABLE, new Dali.Property.Value( value ) );
609 GetProperty( Button.Property.SELECTED).Get( out temp );
614 SetProperty( Button.Property.SELECTED, new Dali.Property.Value( value ) );
617 public Vector4 UnselectedColor
621 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
622 GetProperty( Button.Property.UNSELECTED_COLOR).Get( temp );
627 SetProperty( Button.Property.UNSELECTED_COLOR, new Dali.Property.Value( value ) );
630 public Vector4 SelectedColor
634 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
635 GetProperty( Button.Property.SELECTED_COLOR).Get( temp );
640 SetProperty( Button.Property.SELECTED_COLOR, new Dali.Property.Value( value ) );
643 public Dali.Property.Map Label
647 Dali.Property.Map temp = new Dali.Property.Map();
648 GetProperty( Button.Property.LABEL).Get( temp );
653 SetProperty( Button.Property.LABEL, new Dali.Property.Value( value ) );
656 public string LabelText
660 Dali.Property.Map map = new Dali.Property.Map();
661 GetProperty( Button.Property.LABEL).Get(map);
662 Dali.Property.Value value = map.Find( Dali.Constants.TextVisualProperty.Text, "Text");
669 SetProperty( Button.Property.LABEL, new Dali.Property.Value( value ) );