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 (!Stage.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 public 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 VisualPadding
480 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
481 GetProperty( Button.Property.VISUAL_PADDING).Get( temp );
486 SetProperty( Button.Property.VISUAL_PADDING, new Dali.Property.Value( value ) );
490 public class Property : global::System.IDisposable {
491 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
492 protected bool swigCMemOwn;
494 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
495 swigCMemOwn = cMemoryOwn;
496 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
499 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
500 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
507 public virtual void Dispose() {
509 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
512 NDalicPINVOKE.delete_Button_Property(swigCPtr);
514 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
516 global::System.GC.SuppressFinalize(this);
520 public static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get();
521 public static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get();
522 public static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get();
523 public static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get();
524 public static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get();
525 public static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get();
526 public static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get();
527 public static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get();
528 public static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get();
529 public static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get();
530 public static readonly int VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get();
532 public Property() : this(NDalicPINVOKE.new_Button_Property(), true) {
533 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536 public static readonly int DISABLED = NDalicPINVOKE.Button_Property_DISABLED_get();
537 public static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get();
538 public static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get();
539 public static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get();
540 public static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get();
541 public static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get();
542 public static readonly int UNSELECTED_STATE_IMAGE = NDalicPINVOKE.Button_Property_UNSELECTED_STATE_IMAGE_get();
543 public static readonly int SELECTED_STATE_IMAGE = NDalicPINVOKE.Button_Property_SELECTED_STATE_IMAGE_get();
544 public static readonly int DISABLED_STATE_IMAGE = NDalicPINVOKE.Button_Property_DISABLED_STATE_IMAGE_get();
545 public static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get();
546 public static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get();
547 public static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get();
548 public static readonly int LABEL_TEXT = NDalicPINVOKE.Button_Property_LABEL_TEXT_get();
552 public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true) {
553 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
556 public Button(Button button) : this(NDalicPINVOKE.new_Button__SWIG_1(Button.getCPtr(button)), true) {
557 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
560 public Button Assign(Button button) {
561 Button ret = new Button(NDalicPINVOKE.Button_Assign(swigCPtr, Button.getCPtr(button)), false);
562 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566 public new static Button DownCast(BaseHandle handle) {
567 Button ret = new Button(NDalicPINVOKE.Button_DownCast(BaseHandle.getCPtr(handle)), true);
568 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572 public bool IsDisabled() {
573 bool ret = NDalicPINVOKE.Button_IsDisabled(swigCPtr);
574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
578 public bool IsAutoRepeating() {
579 bool ret = NDalicPINVOKE.Button_IsAutoRepeating(swigCPtr);
580 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584 public float GetInitialAutoRepeatingDelay() {
585 float ret = NDalicPINVOKE.Button_GetInitialAutoRepeatingDelay(swigCPtr);
586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590 public float GetNextAutoRepeatingDelay() {
591 float ret = NDalicPINVOKE.Button_GetNextAutoRepeatingDelay(swigCPtr);
592 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596 public bool IsTogglableButton() {
597 bool ret = NDalicPINVOKE.Button_IsTogglableButton(swigCPtr);
598 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602 public bool IsSelected() {
603 bool ret = NDalicPINVOKE.Button_IsSelected(swigCPtr);
604 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
608 public float GetAnimationTime() {
609 float ret = NDalicPINVOKE.Button_GetAnimationTime(swigCPtr);
610 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 public string GetLabelText() {
615 string ret = NDalicPINVOKE.Button_GetLabelText(swigCPtr);
616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
620 public void SetLabel(View label) {
621 NDalicPINVOKE.Button_SetLabel(swigCPtr, View.getCPtr(label));
622 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625 public void SetButtonImage(Image image) {
626 NDalicPINVOKE.Button_SetButtonImage(swigCPtr, Image.getCPtr(image));
627 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 public void SetSelectedImage(Image image) {
631 NDalicPINVOKE.Button_SetSelectedImage(swigCPtr, Image.getCPtr(image));
632 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
635 public View GetButtonImage() {
636 View ret = new View(NDalicPINVOKE.Button_GetButtonImage(swigCPtr), true);
637 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641 public View GetSelectedImage() {
642 View ret = new View(NDalicPINVOKE.Button_GetSelectedImage(swigCPtr), true);
643 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647 public ButtonSignal PressedSignal() {
648 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false);
649 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
653 public ButtonSignal ReleasedSignal() {
654 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false);
655 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659 public ButtonSignal ClickedSignal() {
660 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false);
661 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
665 public ButtonSignal StateChangedSignal() {
666 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false);
667 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671 public enum PropertyRange {
672 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
673 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
681 GetProperty( Button.Property.DISABLED).Get( ref temp );
686 SetProperty( Button.Property.DISABLED, new Dali.Property.Value( value ) );
689 public bool AutoRepeating
694 GetProperty( Button.Property.AUTO_REPEATING).Get( ref temp );
699 SetProperty( Button.Property.AUTO_REPEATING, new Dali.Property.Value( value ) );
702 public float InitialAutoRepeatingDelay
707 GetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get( ref temp );
712 SetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) );
715 public float NextAutoRepeatingDelay
720 GetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY).Get( ref temp );
725 SetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) );
728 public bool Togglable
733 GetProperty( Button.Property.TOGGLABLE).Get( ref temp );
738 SetProperty( Button.Property.TOGGLABLE, new Dali.Property.Value( value ) );
746 GetProperty( Button.Property.SELECTED).Get( ref temp );
751 SetProperty( Button.Property.SELECTED, new Dali.Property.Value( value ) );
754 public Dali.Property.Map UnselectedStateImage
758 Dali.Property.Map temp = new Dali.Property.Map();
759 GetProperty( Button.Property.UNSELECTED_STATE_IMAGE).Get( temp );
764 SetProperty( Button.Property.UNSELECTED_STATE_IMAGE, new Dali.Property.Value( value ) );
767 public Dali.Property.Map SelectedStateImage
771 Dali.Property.Map temp = new Dali.Property.Map();
772 GetProperty( Button.Property.SELECTED_STATE_IMAGE).Get( temp );
777 SetProperty( Button.Property.SELECTED_STATE_IMAGE, new Dali.Property.Value( value ) );
780 public Dali.Property.Map DisabledStateImage
784 Dali.Property.Map temp = new Dali.Property.Map();
785 GetProperty( Button.Property.DISABLED_STATE_IMAGE).Get( temp );
790 SetProperty( Button.Property.DISABLED_STATE_IMAGE, new Dali.Property.Value( value ) );
793 public Vector4 UnselectedColor
797 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
798 GetProperty( Button.Property.UNSELECTED_COLOR).Get( temp );
803 SetProperty( Button.Property.UNSELECTED_COLOR, new Dali.Property.Value( value ) );
806 public Vector4 SelectedColor
810 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
811 GetProperty( Button.Property.SELECTED_COLOR).Get( temp );
816 SetProperty( Button.Property.SELECTED_COLOR, new Dali.Property.Value( value ) );
819 public Dali.Property.Map Label
823 Dali.Property.Map temp = new Dali.Property.Map();
824 GetProperty( Button.Property.LABEL).Get( temp );
829 SetProperty( Button.Property.LABEL, new Dali.Property.Value( value ) );
832 public string LabelText
837 GetProperty( Button.Property.LABEL_TEXT).Get( out temp );
842 SetProperty( Button.Property.LABEL_TEXT, new Dali.Property.Value( value ) );