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;
32 public override void Dispose() {
34 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
37 NDalicPINVOKE.delete_Button(swigCPtr);
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
41 global::System.GC.SuppressFinalize(this);
47 public class ClickedEventArgs : EventArgs
49 private Button _button;
64 public class PressedEventArgs : EventArgs
66 private Button _button;
81 public class ReleasedEventArgs : EventArgs
83 private Button _button;
98 public class StateChangedEventArgs : EventArgs
100 private Button _button;
116 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
117 private delegate bool ClickedCallbackDelegate(global::System.IntPtr data);
118 private DaliEventHandlerWithReturnType<object,ClickedEventArgs,bool> _buttonClickedEventHandler;
119 private ClickedCallbackDelegate _buttonClickedCallbackDelegate;
121 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
122 private delegate bool PressedCallbackDelegate(global::System.IntPtr data);
123 private DaliEventHandlerWithReturnType<object,PressedEventArgs,bool> _buttonPressedEventHandler;
124 private PressedCallbackDelegate _buttonPressedCallbackDelegate;
126 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
127 private delegate bool ReleasedCallbackDelegate(global::System.IntPtr data);
128 private DaliEventHandlerWithReturnType<object,ReleasedEventArgs,bool> _buttonReleasedEventHandler;
129 private ReleasedCallbackDelegate _buttonReleasedCallbackDelegate;
131 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
132 private delegate bool StateChangedCallbackDelegate(global::System.IntPtr data);
133 private DaliEventHandlerWithReturnType<object,StateChangedEventArgs,bool> _buttonStateChangedEventHandler;
134 private StateChangedCallbackDelegate _buttonStateChangedCallbackDelegate;
137 public event DaliEventHandlerWithReturnType<object,ClickedEventArgs,bool> Clicked
143 // Restricted to only one listener
144 if (_buttonClickedEventHandler == null)
146 _buttonClickedEventHandler += value;
148 _buttonClickedCallbackDelegate = new ClickedCallbackDelegate(OnClicked);
149 this.ClickedSignal().Connect(_buttonClickedCallbackDelegate);
158 if (_buttonClickedEventHandler != null)
160 this.ClickedSignal().Disconnect(_buttonClickedCallbackDelegate);
163 _buttonClickedEventHandler -= value;
168 // Callback for button click signal
169 private bool OnClicked (IntPtr data)
171 ClickedEventArgs e = new ClickedEventArgs();
173 e.Button = Button.GetButtonFromPtr(data);
175 if (_buttonClickedEventHandler != null)
177 //here we send all data to user event handlers
178 return _buttonClickedEventHandler(this, e,true);
184 public event DaliEventHandlerWithReturnType<object,PressedEventArgs,bool> Pressed
190 // Restricted to only one listener
191 if (_buttonPressedEventHandler == null)
193 _buttonPressedEventHandler += value;
195 _buttonPressedCallbackDelegate = new PressedCallbackDelegate(OnPressed);
196 this.PressedSignal().Connect(_buttonPressedCallbackDelegate);
205 if (_buttonPressedEventHandler != null)
207 this.PressedSignal().Disconnect(_buttonPressedCallbackDelegate);
210 _buttonPressedEventHandler -= value;
215 // Callback for button click signal
216 private bool OnPressed (IntPtr data)
218 PressedEventArgs e = new PressedEventArgs();
220 e.Button = Button.GetButtonFromPtr(data);
222 if (_buttonPressedEventHandler != null)
224 //here we send all data to user event handlers
225 return _buttonPressedEventHandler(this, e,true);
231 public event DaliEventHandlerWithReturnType<object,ReleasedEventArgs,bool> Released
237 // Restricted to only one listener
238 if (_buttonReleasedEventHandler == null)
240 _buttonReleasedEventHandler += value;
242 _buttonReleasedCallbackDelegate = new ReleasedCallbackDelegate(OnReleased);
243 this.ReleasedSignal().Connect(_buttonReleasedCallbackDelegate);
252 if (_buttonReleasedEventHandler != null)
254 this.ReleasedSignal().Disconnect(_buttonReleasedCallbackDelegate);
257 _buttonReleasedEventHandler -= value;
262 // Callback for button click signal
263 private bool OnReleased (IntPtr data)
265 ReleasedEventArgs e = new ReleasedEventArgs();
267 e.Button = Button.GetButtonFromPtr(data);
269 if (_buttonReleasedEventHandler != null)
271 //here we send all data to user event handlers
272 return _buttonReleasedEventHandler(this, e, true);
278 public event DaliEventHandlerWithReturnType<object,StateChangedEventArgs,bool> StateChanged
284 // Restricted to only one listener
285 if (_buttonStateChangedEventHandler == null)
287 _buttonStateChangedEventHandler += value;
289 _buttonStateChangedCallbackDelegate = new StateChangedCallbackDelegate(OnStateChanged);
290 this.StateChangedSignal().Connect(_buttonStateChangedCallbackDelegate);
299 if (_buttonStateChangedEventHandler != null)
301 this.StateChangedSignal().Disconnect(_buttonStateChangedCallbackDelegate);
304 _buttonStateChangedEventHandler -= value;
309 // Callback for button click signal
310 private bool OnStateChanged (IntPtr data)
312 StateChangedEventArgs e = new StateChangedEventArgs();
314 e.Button = Button.GetButtonFromPtr(data);
316 if (_buttonStateChangedEventHandler != null)
318 //here we send all data to user event handlers
319 return _buttonStateChangedEventHandler(this, e, true);
324 public static Button GetButtonFromPtr(global::System.IntPtr cPtr) {
325 Button ret = new Button(cPtr, false);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331 public class Property : global::System.IDisposable {
332 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
333 protected bool swigCMemOwn;
335 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
336 swigCMemOwn = cMemoryOwn;
337 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
340 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
341 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
348 public virtual void Dispose() {
350 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
353 NDalicPINVOKE.delete_Button_Property(swigCPtr);
355 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
357 global::System.GC.SuppressFinalize(this);
361 public Property() : this(NDalicPINVOKE.new_Button_Property(), true) {
362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
365 public static readonly int DISABLED = NDalicPINVOKE.Button_Property_DISABLED_get();
366 public static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get();
367 public static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get();
368 public static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get();
369 public static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get();
370 public static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get();
371 public static readonly int UNSELECTED_STATE_IMAGE = NDalicPINVOKE.Button_Property_UNSELECTED_STATE_IMAGE_get();
372 public static readonly int SELECTED_STATE_IMAGE = NDalicPINVOKE.Button_Property_SELECTED_STATE_IMAGE_get();
373 public static readonly int DISABLED_STATE_IMAGE = NDalicPINVOKE.Button_Property_DISABLED_STATE_IMAGE_get();
374 public static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get();
375 public static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get();
376 public static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get();
377 public static readonly int LABEL_TEXT = NDalicPINVOKE.Button_Property_LABEL_TEXT_get();
381 public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true) {
382 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385 public Button(Button button) : this(NDalicPINVOKE.new_Button__SWIG_1(Button.getCPtr(button)), true) {
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389 public Button Assign(Button button) {
390 Button ret = new Button(NDalicPINVOKE.Button_Assign(swigCPtr, Button.getCPtr(button)), false);
391 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
395 public new static Button DownCast(BaseHandle handle) {
396 Button ret = new Button(NDalicPINVOKE.Button_DownCast(BaseHandle.getCPtr(handle)), true);
397 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 public bool IsDisabled() {
402 bool ret = NDalicPINVOKE.Button_IsDisabled(swigCPtr);
403 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
407 public bool IsAutoRepeating() {
408 bool ret = NDalicPINVOKE.Button_IsAutoRepeating(swigCPtr);
409 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
413 public float GetInitialAutoRepeatingDelay() {
414 float ret = NDalicPINVOKE.Button_GetInitialAutoRepeatingDelay(swigCPtr);
415 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
419 public float GetNextAutoRepeatingDelay() {
420 float ret = NDalicPINVOKE.Button_GetNextAutoRepeatingDelay(swigCPtr);
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425 public bool IsTogglableButton() {
426 bool ret = NDalicPINVOKE.Button_IsTogglableButton(swigCPtr);
427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 public bool IsSelected() {
432 bool ret = NDalicPINVOKE.Button_IsSelected(swigCPtr);
433 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
437 public float GetAnimationTime() {
438 float ret = NDalicPINVOKE.Button_GetAnimationTime(swigCPtr);
439 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
443 public string GetLabelText() {
444 string ret = NDalicPINVOKE.Button_GetLabelText(swigCPtr);
445 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449 public void SetLabel(Actor label) {
450 NDalicPINVOKE.Button_SetLabel(swigCPtr, Actor.getCPtr(label));
451 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454 public void SetButtonImage(Image image) {
455 NDalicPINVOKE.Button_SetButtonImage(swigCPtr, Image.getCPtr(image));
456 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
459 public void SetSelectedImage(Image image) {
460 NDalicPINVOKE.Button_SetSelectedImage(swigCPtr, Image.getCPtr(image));
461 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
464 public Actor GetButtonImage() {
465 Actor ret = new Actor(NDalicPINVOKE.Button_GetButtonImage(swigCPtr), true);
466 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470 public Actor GetSelectedImage() {
471 Actor ret = new Actor(NDalicPINVOKE.Button_GetSelectedImage(swigCPtr), true);
472 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 public ButtonSignal PressedSignal() {
477 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false);
478 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
482 public ButtonSignal ReleasedSignal() {
483 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false);
484 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
488 public ButtonSignal ClickedSignal() {
489 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false);
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 public ButtonSignal StateChangedSignal() {
495 ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false);
496 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
500 public enum PropertyRange {
501 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
502 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX+1000
510 GetProperty( Button.Property.DISABLED).Get( ref temp );
515 SetProperty( Button.Property.DISABLED, new Dali.Property.Value( value ) );
518 public bool AutoRepeating
523 GetProperty( Button.Property.AUTO_REPEATING).Get( ref temp );
528 SetProperty( Button.Property.AUTO_REPEATING, new Dali.Property.Value( value ) );
531 public float InitialAutoRepeatingDelay
536 GetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get( ref temp );
541 SetProperty( Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) );
544 public float NextAutoRepeatingDelay
549 GetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY).Get( ref temp );
554 SetProperty( Button.Property.NEXT_AUTO_REPEATING_DELAY, new Dali.Property.Value( value ) );
557 public bool Togglable
562 GetProperty( Button.Property.TOGGLABLE).Get( ref temp );
567 SetProperty( Button.Property.TOGGLABLE, new Dali.Property.Value( value ) );
575 GetProperty( Button.Property.SELECTED).Get( ref temp );
580 SetProperty( Button.Property.SELECTED, new Dali.Property.Value( value ) );
583 public string UnselectedStateImage
588 GetProperty( Button.Property.UNSELECTED_STATE_IMAGE).Get( out temp );
593 SetProperty( Button.Property.UNSELECTED_STATE_IMAGE, new Dali.Property.Value( value ) );
596 public string SelectedStateImage
601 GetProperty( Button.Property.SELECTED_STATE_IMAGE).Get( out temp );
606 SetProperty( Button.Property.SELECTED_STATE_IMAGE, new Dali.Property.Value( value ) );
609 public string DisabledStateImage
614 GetProperty( Button.Property.DISABLED_STATE_IMAGE).Get( out temp );
619 SetProperty( Button.Property.DISABLED_STATE_IMAGE, new Dali.Property.Value( value ) );
622 public Vector4 UnselectedColor
626 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
627 GetProperty( Button.Property.UNSELECTED_COLOR).Get( temp );
632 SetProperty( Button.Property.UNSELECTED_COLOR, new Dali.Property.Value( value ) );
635 public Vector4 SelectedColor
639 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
640 GetProperty( Button.Property.SELECTED_COLOR).Get( temp );
645 SetProperty( Button.Property.SELECTED_COLOR, new Dali.Property.Value( value ) );
648 public Dali.Property.Map Label
652 Dali.Property.Map temp = new Dali.Property.Map();
653 GetProperty( Button.Property.LABEL).Get( temp );
658 SetProperty( Button.Property.LABEL, new Dali.Property.Value( value ) );
661 public string LabelText
666 GetProperty( Button.Property.LABEL_TEXT).Get( out temp );
671 SetProperty( Button.Property.LABEL_TEXT, new Dali.Property.Value( value ) );