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.</summary>
10 [SliderIntervalNativeInherit]
11 public class SliderInterval : Efl.Ui.Slider, Efl.Eo.IWrapper
13 ///<summary>Pointer to the native class description.</summary>
14 public override System.IntPtr NativeClass {
16 if (((object)this).GetType() == typeof (SliderInterval))
17 return Efl.Ui.SliderIntervalNativeInherit.GetEflClassStatic();
19 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
22 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
23 efl_ui_slider_interval_class_get();
24 ///<summary>Creates a new instance.</summary>
25 ///<param name="parent">Parent instance.</param>
26 ///<param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
27 public SliderInterval(Efl.Object parent
28 , System.String style = null) :
29 base(efl_ui_slider_interval_class_get(), typeof(SliderInterval), parent)
31 if (Efl.Eo.Globals.ParamHelperCheck(style))
32 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
33 FinishInstantiation();
35 ///<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>
36 protected SliderInterval(System.IntPtr raw) : base(raw)
38 RegisterEventProxies();
40 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
41 protected SliderInterval(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
42 ///<summary>Verifies if the given object is equal to this one.</summary>
43 public override bool Equals(object obj)
45 var other = obj as Efl.Object;
48 return this.NativeHandle == other.NativeHandle;
50 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
51 public override int GetHashCode()
53 return this.NativeHandle.ToInt32();
55 ///<summary>Turns the native pointer into a string representation.</summary>
56 public override String ToString()
58 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
60 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
61 protected override void RegisterEventProxies()
63 base.RegisterEventProxies();
65 /// <summary>Sets up position of two indicators at start and end position.</summary>
66 /// <param name="from">interval minimum value</param>
67 /// <param name="to">interval maximum value</param>
68 /// <returns></returns>
69 virtual public void GetIntervalValue( out double from, out double to) {
70 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);
71 Eina.Error.RaiseIfUnhandledException();
73 /// <summary>Sets up position of two indicators at start and end position.</summary>
74 /// <param name="from">interval minimum value</param>
75 /// <param name="to">interval maximum value</param>
76 /// <returns></returns>
77 virtual public void SetIntervalValue( double from, double to) {
78 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);
79 Eina.Error.RaiseIfUnhandledException();
81 private static IntPtr GetEflClassStatic()
83 return Efl.Ui.SliderInterval.efl_ui_slider_interval_class_get();
86 public class SliderIntervalNativeInherit : Efl.Ui.SliderNativeInherit{
87 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
88 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
90 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
91 var methods = Efl.Eo.Globals.GetUserMethods(type);
92 if (efl_ui_slider_interval_value_get_static_delegate == null)
93 efl_ui_slider_interval_value_get_static_delegate = new efl_ui_slider_interval_value_get_delegate(interval_value_get);
94 if (methods.FirstOrDefault(m => m.Name == "GetIntervalValue") != null)
95 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)});
96 if (efl_ui_slider_interval_value_set_static_delegate == null)
97 efl_ui_slider_interval_value_set_static_delegate = new efl_ui_slider_interval_value_set_delegate(interval_value_set);
98 if (methods.FirstOrDefault(m => m.Name == "SetIntervalValue") != null)
99 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)});
100 descs.AddRange(base.GetEoOps(type));
103 public override IntPtr GetEflClass()
105 return Efl.Ui.SliderInterval.efl_ui_slider_interval_class_get();
107 public static new IntPtr GetEflClassStatic()
109 return Efl.Ui.SliderInterval.efl_ui_slider_interval_class_get();
113 private delegate void efl_ui_slider_interval_value_get_delegate(System.IntPtr obj, System.IntPtr pd, out double from, out double to);
116 public delegate void efl_ui_slider_interval_value_get_api_delegate(System.IntPtr obj, out double from, out double to);
117 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");
118 private static void interval_value_get(System.IntPtr obj, System.IntPtr pd, out double from, out double to)
120 Eina.Log.Debug("function efl_ui_slider_interval_value_get was called");
121 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
122 if(wrapper != null) {
123 from = default(double); to = default(double);
125 ((SliderInterval)wrapper).GetIntervalValue( out from, out to);
126 } catch (Exception e) {
127 Eina.Log.Warning($"Callback error: {e.ToString()}");
128 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
131 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);
134 private static efl_ui_slider_interval_value_get_delegate efl_ui_slider_interval_value_get_static_delegate;
137 private delegate void efl_ui_slider_interval_value_set_delegate(System.IntPtr obj, System.IntPtr pd, double from, double to);
140 public delegate void efl_ui_slider_interval_value_set_api_delegate(System.IntPtr obj, double from, double to);
141 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");
142 private static void interval_value_set(System.IntPtr obj, System.IntPtr pd, double from, double to)
144 Eina.Log.Debug("function efl_ui_slider_interval_value_set was called");
145 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
146 if(wrapper != null) {
149 ((SliderInterval)wrapper).SetIntervalValue( from, to);
150 } catch (Exception e) {
151 Eina.Log.Warning($"Callback error: {e.ToString()}");
152 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
155 efl_ui_slider_interval_value_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), from, to);
158 private static efl_ui_slider_interval_value_set_delegate efl_ui_slider_interval_value_set_static_delegate;