1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 /// <summary>Interface that contains properties regarding the displaying of a range.</summary>
13 [Efl.Ui.IRangeDisplayConcrete.NativeMethods]
14 public interface IRangeDisplay :
15 Efl.Eo.IWrapper, IDisposable
17 /// <summary>Control the range value (in percentage) on a given range widget
18 /// Use this call to set range levels.
20 /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
21 /// <returns>The range value (must be between $0.0 and 1.0)</returns>
22 double GetRangeValue();
23 /// <summary>Control the range value (in percentage) on a given range widget
24 /// Use this call to set range levels.
26 /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
27 /// <param name="val">The range value (must be between $0.0 and 1.0)</param>
28 void SetRangeValue(double val);
29 /// <summary>Get the minimum and maximum values of the given range widget.
30 /// Note: If only one value is needed, the other pointer can be passed as <c>null</c>.</summary>
31 /// <param name="min">The minimum value.</param>
32 /// <param name="max">The maximum value.</param>
33 void GetRangeMinMax(out double min, out double max);
34 /// <summary>Set the minimum and maximum values for given range widget.
35 /// Define the allowed range of values to be selected by the user.
37 /// If actual value is less than <c>min</c>, it will be updated to <c>min</c>. If it is bigger then <c>max</c>, will be updated to <c>max</c>. The actual value can be obtained with <see cref="Efl.Ui.IRangeDisplay.GetRangeValue"/>
39 /// The minimum and maximum values may be different for each class.
41 /// Warning: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
42 /// <param name="min">The minimum value.</param>
43 /// <param name="max">The maximum value.</param>
44 void SetRangeMinMax(double min, double max);
45 /// <summary>Control the range value (in percentage) on a given range widget
46 /// Use this call to set range levels.
48 /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
49 /// <value>The range value (must be between $0.0 and 1.0)</value>
55 /// <summary>Interface that contains properties regarding the displaying of a range.</summary>
56 sealed public class IRangeDisplayConcrete :
61 ///<summary>Pointer to the native class description.</summary>
62 public override System.IntPtr NativeClass
66 if (((object)this).GetType() == typeof(IRangeDisplayConcrete))
68 return GetEflClassStatic();
72 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
77 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
78 efl_ui_range_display_interface_get();
79 /// <summary>Initializes a new instance of the <see cref="IRangeDisplay"/> class.
80 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
81 private IRangeDisplayConcrete(System.IntPtr raw) : base(raw)
85 /// <summary>Control the range value (in percentage) on a given range widget
86 /// Use this call to set range levels.
88 /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
89 /// <returns>The range value (must be between $0.0 and 1.0)</returns>
90 public double GetRangeValue() {
91 var _ret_var = Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_value_get_ptr.Value.Delegate(this.NativeHandle);
92 Eina.Error.RaiseIfUnhandledException();
95 /// <summary>Control the range value (in percentage) on a given range widget
96 /// Use this call to set range levels.
98 /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
99 /// <param name="val">The range value (must be between $0.0 and 1.0)</param>
100 public void SetRangeValue(double val) {
101 Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_value_set_ptr.Value.Delegate(this.NativeHandle,val);
102 Eina.Error.RaiseIfUnhandledException();
104 /// <summary>Get the minimum and maximum values of the given range widget.
105 /// Note: If only one value is needed, the other pointer can be passed as <c>null</c>.</summary>
106 /// <param name="min">The minimum value.</param>
107 /// <param name="max">The maximum value.</param>
108 public void GetRangeMinMax(out double min, out double max) {
109 Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_min_max_get_ptr.Value.Delegate(this.NativeHandle,out min, out max);
110 Eina.Error.RaiseIfUnhandledException();
112 /// <summary>Set the minimum and maximum values for given range widget.
113 /// Define the allowed range of values to be selected by the user.
115 /// If actual value is less than <c>min</c>, it will be updated to <c>min</c>. If it is bigger then <c>max</c>, will be updated to <c>max</c>. The actual value can be obtained with <see cref="Efl.Ui.IRangeDisplay.GetRangeValue"/>
117 /// The minimum and maximum values may be different for each class.
119 /// Warning: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
120 /// <param name="min">The minimum value.</param>
121 /// <param name="max">The maximum value.</param>
122 public void SetRangeMinMax(double min, double max) {
123 Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_min_max_set_ptr.Value.Delegate(this.NativeHandle,min, max);
124 Eina.Error.RaiseIfUnhandledException();
126 /// <summary>Control the range value (in percentage) on a given range widget
127 /// Use this call to set range levels.
129 /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
130 /// <value>The range value (must be between $0.0 and 1.0)</value>
131 public double RangeValue {
132 get { return GetRangeValue(); }
133 set { SetRangeValue(value); }
135 private static IntPtr GetEflClassStatic()
137 return Efl.Ui.IRangeDisplayConcrete.efl_ui_range_display_interface_get();
139 /// <summary>Wrapper for native methods and virtual method delegates.
140 /// For internal use by generated code only.</summary>
141 public class NativeMethods : Efl.Eo.NativeClass
143 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
144 /// <summary>Gets the list of Eo operations to override.</summary>
145 /// <returns>The list of Eo operations to be overload.</returns>
146 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
148 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
149 var methods = Efl.Eo.Globals.GetUserMethods(type);
151 if (efl_ui_range_value_get_static_delegate == null)
153 efl_ui_range_value_get_static_delegate = new efl_ui_range_value_get_delegate(range_value_get);
156 if (methods.FirstOrDefault(m => m.Name == "GetRangeValue") != null)
158 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_range_value_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_range_value_get_static_delegate) });
161 if (efl_ui_range_value_set_static_delegate == null)
163 efl_ui_range_value_set_static_delegate = new efl_ui_range_value_set_delegate(range_value_set);
166 if (methods.FirstOrDefault(m => m.Name == "SetRangeValue") != null)
168 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_range_value_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_range_value_set_static_delegate) });
171 if (efl_ui_range_min_max_get_static_delegate == null)
173 efl_ui_range_min_max_get_static_delegate = new efl_ui_range_min_max_get_delegate(range_min_max_get);
176 if (methods.FirstOrDefault(m => m.Name == "GetRangeMinMax") != null)
178 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_range_min_max_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_range_min_max_get_static_delegate) });
181 if (efl_ui_range_min_max_set_static_delegate == null)
183 efl_ui_range_min_max_set_static_delegate = new efl_ui_range_min_max_set_delegate(range_min_max_set);
186 if (methods.FirstOrDefault(m => m.Name == "SetRangeMinMax") != null)
188 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_range_min_max_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_range_min_max_set_static_delegate) });
193 /// <summary>Returns the Eo class for the native methods of this class.</summary>
194 /// <returns>The native class pointer.</returns>
195 public override IntPtr GetEflClass()
197 return Efl.Ui.IRangeDisplayConcrete.efl_ui_range_display_interface_get();
200 #pragma warning disable CA1707, CS1591, SA1300, SA1600
203 private delegate double efl_ui_range_value_get_delegate(System.IntPtr obj, System.IntPtr pd);
206 public delegate double efl_ui_range_value_get_api_delegate(System.IntPtr obj);
208 public static Efl.Eo.FunctionWrapper<efl_ui_range_value_get_api_delegate> efl_ui_range_value_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_range_value_get_api_delegate>(Module, "efl_ui_range_value_get");
210 private static double range_value_get(System.IntPtr obj, System.IntPtr pd)
212 Eina.Log.Debug("function efl_ui_range_value_get was called");
213 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
216 double _ret_var = default(double);
219 _ret_var = ((IRangeDisplay)ws.Target).GetRangeValue();
223 Eina.Log.Warning($"Callback error: {e.ToString()}");
224 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
232 return efl_ui_range_value_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
236 private static efl_ui_range_value_get_delegate efl_ui_range_value_get_static_delegate;
239 private delegate void efl_ui_range_value_set_delegate(System.IntPtr obj, System.IntPtr pd, double val);
242 public delegate void efl_ui_range_value_set_api_delegate(System.IntPtr obj, double val);
244 public static Efl.Eo.FunctionWrapper<efl_ui_range_value_set_api_delegate> efl_ui_range_value_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_range_value_set_api_delegate>(Module, "efl_ui_range_value_set");
246 private static void range_value_set(System.IntPtr obj, System.IntPtr pd, double val)
248 Eina.Log.Debug("function efl_ui_range_value_set was called");
249 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
255 ((IRangeDisplay)ws.Target).SetRangeValue(val);
259 Eina.Log.Warning($"Callback error: {e.ToString()}");
260 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
267 efl_ui_range_value_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), val);
271 private static efl_ui_range_value_set_delegate efl_ui_range_value_set_static_delegate;
274 private delegate void efl_ui_range_min_max_get_delegate(System.IntPtr obj, System.IntPtr pd, out double min, out double max);
277 public delegate void efl_ui_range_min_max_get_api_delegate(System.IntPtr obj, out double min, out double max);
279 public static Efl.Eo.FunctionWrapper<efl_ui_range_min_max_get_api_delegate> efl_ui_range_min_max_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_range_min_max_get_api_delegate>(Module, "efl_ui_range_min_max_get");
281 private static void range_min_max_get(System.IntPtr obj, System.IntPtr pd, out double min, out double max)
283 Eina.Log.Debug("function efl_ui_range_min_max_get was called");
284 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
287 min = default(double); max = default(double);
290 ((IRangeDisplay)ws.Target).GetRangeMinMax(out min, out max);
294 Eina.Log.Warning($"Callback error: {e.ToString()}");
295 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
302 efl_ui_range_min_max_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out min, out max);
306 private static efl_ui_range_min_max_get_delegate efl_ui_range_min_max_get_static_delegate;
309 private delegate void efl_ui_range_min_max_set_delegate(System.IntPtr obj, System.IntPtr pd, double min, double max);
312 public delegate void efl_ui_range_min_max_set_api_delegate(System.IntPtr obj, double min, double max);
314 public static Efl.Eo.FunctionWrapper<efl_ui_range_min_max_set_api_delegate> efl_ui_range_min_max_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_range_min_max_set_api_delegate>(Module, "efl_ui_range_min_max_set");
316 private static void range_min_max_set(System.IntPtr obj, System.IntPtr pd, double min, double max)
318 Eina.Log.Debug("function efl_ui_range_min_max_set was called");
319 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
325 ((IRangeDisplay)ws.Target).SetRangeMinMax(min, max);
329 Eina.Log.Warning($"Callback error: {e.ToString()}");
330 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
337 efl_ui_range_min_max_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), min, max);
341 private static efl_ui_range_min_max_set_delegate efl_ui_range_min_max_set_static_delegate;
343 #pragma warning restore CA1707, CS1591, SA1300, SA1600