1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui {
8 /// <summary>An interval slider.
9 /// This is a slider with two indicators.
11 [SliderIntervalNativeInherit]
12 public class SliderInterval : Efl.Ui.Slider, Efl.Eo.IWrapper
14 public new static System.IntPtr klass = System.IntPtr.Zero;
15 public new static Efl.Ui.SliderIntervalNativeInherit nativeInherit = new Efl.Ui.SliderIntervalNativeInherit();
16 ///<summary>Pointer to the native class description.</summary>
17 public override System.IntPtr NativeClass {
19 if (((object)this).GetType() == typeof (SliderInterval))
20 return Efl.Ui.SliderIntervalNativeInherit.GetEflClassStatic();
22 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
25 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
26 efl_ui_slider_interval_class_get();
27 ///<summary>Creates a new instance.</summary>
28 ///<param name="parent">Parent instance.</param>
29 ///<param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
30 public SliderInterval(Efl.Object parent
31 , System.String style = null) :
32 base(efl_ui_slider_interval_class_get(), typeof(SliderInterval), parent)
34 if (Efl.Eo.Globals.ParamHelperCheck(style))
35 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
36 FinishInstantiation();
38 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
39 public SliderInterval(System.IntPtr raw) : base(raw)
41 register_event_proxies();
43 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
44 protected SliderInterval(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
45 ///<summary>Casts obj into an instance of this type.</summary>
46 public new static SliderInterval static_cast(Efl.Object obj)
49 throw new System.ArgumentNullException("obj");
50 return new SliderInterval(obj.NativeHandle);
52 ///<summary>Verifies if the given object is equal to this one.</summary>
53 public override bool Equals(object obj)
55 var other = obj as Efl.Object;
58 return this.NativeHandle == other.NativeHandle;
60 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
61 public override int GetHashCode()
63 return this.NativeHandle.ToInt32();
65 ///<summary>Turns the native pointer into a string representation.</summary>
66 public override String ToString()
68 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
70 protected override void register_event_proxies()
72 base.register_event_proxies();
74 /// <summary>Sets up position of two indicators at start and end position.
76 /// <param name="from">interval minimum value
78 /// <param name="to">interval maximum value
80 /// <returns></returns>
81 virtual public void GetIntervalValue( out double from, out double to) {
82 Efl.Ui.SliderIntervalNativeInherit.efl_ui_slider_interval_value_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), out from, out to);
83 Eina.Error.RaiseIfUnhandledException();
85 /// <summary>Sets up position of two indicators at start and end position.
87 /// <param name="from">interval minimum value
89 /// <param name="to">interval maximum value
91 /// <returns></returns>
92 virtual public void SetIntervalValue( double from, double to) {
93 Efl.Ui.SliderIntervalNativeInherit.efl_ui_slider_interval_value_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), from, to);
94 Eina.Error.RaiseIfUnhandledException();
96 private static new IntPtr GetEflClassStatic()
98 return Efl.Ui.SliderInterval.efl_ui_slider_interval_class_get();
101 public class SliderIntervalNativeInherit : Efl.Ui.SliderNativeInherit{
102 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
103 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
105 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
106 if (efl_ui_slider_interval_value_get_static_delegate == null)
107 efl_ui_slider_interval_value_get_static_delegate = new efl_ui_slider_interval_value_get_delegate(interval_value_get);
108 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_slider_interval_value_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_slider_interval_value_get_static_delegate)});
109 if (efl_ui_slider_interval_value_set_static_delegate == null)
110 efl_ui_slider_interval_value_set_static_delegate = new efl_ui_slider_interval_value_set_delegate(interval_value_set);
111 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_slider_interval_value_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_slider_interval_value_set_static_delegate)});
112 descs.AddRange(base.GetEoOps(type));
115 public override IntPtr GetEflClass()
117 return Efl.Ui.SliderInterval.efl_ui_slider_interval_class_get();
119 public static new IntPtr GetEflClassStatic()
121 return Efl.Ui.SliderInterval.efl_ui_slider_interval_class_get();
125 private delegate void efl_ui_slider_interval_value_get_delegate(System.IntPtr obj, System.IntPtr pd, out double from, out double to);
128 public delegate void efl_ui_slider_interval_value_get_api_delegate(System.IntPtr obj, out double from, out double to);
129 public static Efl.Eo.FunctionWrapper<efl_ui_slider_interval_value_get_api_delegate> efl_ui_slider_interval_value_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_slider_interval_value_get_api_delegate>(_Module, "efl_ui_slider_interval_value_get");
130 private static void interval_value_get(System.IntPtr obj, System.IntPtr pd, out double from, out double to)
132 Eina.Log.Debug("function efl_ui_slider_interval_value_get was called");
133 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
134 if(wrapper != null) {
135 from = default(double); to = default(double);
137 ((SliderInterval)wrapper).GetIntervalValue( out from, out to);
138 } catch (Exception e) {
139 Eina.Log.Warning($"Callback error: {e.ToString()}");
140 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
143 efl_ui_slider_interval_value_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out from, out to);
146 private static efl_ui_slider_interval_value_get_delegate efl_ui_slider_interval_value_get_static_delegate;
149 private delegate void efl_ui_slider_interval_value_set_delegate(System.IntPtr obj, System.IntPtr pd, double from, double to);
152 public delegate void efl_ui_slider_interval_value_set_api_delegate(System.IntPtr obj, double from, double to);
153 public static Efl.Eo.FunctionWrapper<efl_ui_slider_interval_value_set_api_delegate> efl_ui_slider_interval_value_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_slider_interval_value_set_api_delegate>(_Module, "efl_ui_slider_interval_value_set");
154 private static void interval_value_set(System.IntPtr obj, System.IntPtr pd, double from, double to)
156 Eina.Log.Debug("function efl_ui_slider_interval_value_set was called");
157 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
158 if(wrapper != null) {
161 ((SliderInterval)wrapper).SetIntervalValue( from, to);
162 } catch (Exception e) {
163 Eina.Log.Warning($"Callback error: {e.ToString()}");
164 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
167 efl_ui_slider_interval_value_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), from, to);
170 private static efl_ui_slider_interval_value_set_delegate efl_ui_slider_interval_value_set_static_delegate;