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 [Efl.Eo.BindingEntity]
15 public interface IRangeDisplay :
16 Efl.Eo.IWrapper, IDisposable
18 /// <summary>Control the range value (in percentage) on a given range widget
19 /// Use this call to set range levels.
21 /// 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>
22 /// <returns>The range value (must be between $0.0 and 1.0)</returns>
23 double GetRangeValue();
24 /// <summary>Control the range value (in percentage) on a given range widget
25 /// Use this call to set range levels.
27 /// 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>
28 /// <param name="val">The range value (must be between $0.0 and 1.0)</param>
29 void SetRangeValue(double val);
30 /// <summary>Get the minimum and maximum values of the given range widget.
31 /// Note: If only one value is needed, the other pointer can be passed as <c>null</c>.</summary>
32 /// <param name="min">The minimum value.</param>
33 /// <param name="max">The maximum value.</param>
34 void GetRangeLimits(out double min, out double max);
35 /// <summary>Set the minimum and maximum values for given range widget.
36 /// Define the allowed range of values to be selected by the user.
38 /// 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"/>
40 /// The minimum and maximum values may be different for each class.
42 /// Warning: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
43 /// <param name="min">The minimum value.</param>
44 /// <param name="max">The maximum value.</param>
45 void SetRangeLimits(double min, double max);
46 /// <summary>Control the range value (in percentage) on a given range widget
47 /// Use this call to set range levels.
49 /// 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>
50 /// <value>The range value (must be between $0.0 and 1.0)</value>
56 /// <summary>Interface that contains properties regarding the displaying of a range.</summary>
57 sealed public class IRangeDisplayConcrete :
62 ///<summary>Pointer to the native class description.</summary>
63 public override System.IntPtr NativeClass
67 if (((object)this).GetType() == typeof(IRangeDisplayConcrete))
69 return GetEflClassStatic();
73 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
78 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
79 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
80 private IRangeDisplayConcrete(ConstructingHandle ch) : base(ch)
84 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
85 efl_ui_range_display_interface_get();
86 /// <summary>Initializes a new instance of the <see cref="IRangeDisplay"/> class.
87 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
88 /// <param name="wh">The native pointer to be wrapped.</param>
89 private IRangeDisplayConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
93 /// <summary>Control the range value (in percentage) on a given range widget
94 /// Use this call to set range levels.
96 /// 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>
97 /// <returns>The range value (must be between $0.0 and 1.0)</returns>
98 public double GetRangeValue() {
99 var _ret_var = Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_value_get_ptr.Value.Delegate(this.NativeHandle);
100 Eina.Error.RaiseIfUnhandledException();
103 /// <summary>Control the range value (in percentage) on a given range widget
104 /// Use this call to set range levels.
106 /// 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>
107 /// <param name="val">The range value (must be between $0.0 and 1.0)</param>
108 public void SetRangeValue(double val) {
109 Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_value_set_ptr.Value.Delegate(this.NativeHandle,val);
110 Eina.Error.RaiseIfUnhandledException();
112 /// <summary>Get the minimum and maximum values of the given range widget.
113 /// Note: If only one value is needed, the other pointer can be passed as <c>null</c>.</summary>
114 /// <param name="min">The minimum value.</param>
115 /// <param name="max">The maximum value.</param>
116 public void GetRangeLimits(out double min, out double max) {
117 Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_limits_get_ptr.Value.Delegate(this.NativeHandle,out min, out max);
118 Eina.Error.RaiseIfUnhandledException();
120 /// <summary>Set the minimum and maximum values for given range widget.
121 /// Define the allowed range of values to be selected by the user.
123 /// 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"/>
125 /// The minimum and maximum values may be different for each class.
127 /// Warning: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
128 /// <param name="min">The minimum value.</param>
129 /// <param name="max">The maximum value.</param>
130 public void SetRangeLimits(double min, double max) {
131 Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_limits_set_ptr.Value.Delegate(this.NativeHandle,min, max);
132 Eina.Error.RaiseIfUnhandledException();
134 /// <summary>Control the range value (in percentage) on a given range widget
135 /// Use this call to set range levels.
137 /// 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>
138 /// <value>The range value (must be between $0.0 and 1.0)</value>
139 public double RangeValue {
140 get { return GetRangeValue(); }
141 set { SetRangeValue(value); }
143 private static IntPtr GetEflClassStatic()
145 return Efl.Ui.IRangeDisplayConcrete.efl_ui_range_display_interface_get();
147 /// <summary>Wrapper for native methods and virtual method delegates.
148 /// For internal use by generated code only.</summary>
149 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
151 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
152 /// <summary>Gets the list of Eo operations to override.</summary>
153 /// <returns>The list of Eo operations to be overload.</returns>
154 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
156 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
157 var methods = Efl.Eo.Globals.GetUserMethods(type);
159 if (efl_ui_range_value_get_static_delegate == null)
161 efl_ui_range_value_get_static_delegate = new efl_ui_range_value_get_delegate(range_value_get);
164 if (methods.FirstOrDefault(m => m.Name == "GetRangeValue") != null)
166 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) });
169 if (efl_ui_range_value_set_static_delegate == null)
171 efl_ui_range_value_set_static_delegate = new efl_ui_range_value_set_delegate(range_value_set);
174 if (methods.FirstOrDefault(m => m.Name == "SetRangeValue") != null)
176 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) });
179 if (efl_ui_range_limits_get_static_delegate == null)
181 efl_ui_range_limits_get_static_delegate = new efl_ui_range_limits_get_delegate(range_limits_get);
184 if (methods.FirstOrDefault(m => m.Name == "GetRangeLimits") != null)
186 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_range_limits_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_range_limits_get_static_delegate) });
189 if (efl_ui_range_limits_set_static_delegate == null)
191 efl_ui_range_limits_set_static_delegate = new efl_ui_range_limits_set_delegate(range_limits_set);
194 if (methods.FirstOrDefault(m => m.Name == "SetRangeLimits") != null)
196 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_range_limits_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_range_limits_set_static_delegate) });
201 /// <summary>Returns the Eo class for the native methods of this class.</summary>
202 /// <returns>The native class pointer.</returns>
203 public override IntPtr GetEflClass()
205 return Efl.Ui.IRangeDisplayConcrete.efl_ui_range_display_interface_get();
208 #pragma warning disable CA1707, CS1591, SA1300, SA1600
211 private delegate double efl_ui_range_value_get_delegate(System.IntPtr obj, System.IntPtr pd);
214 public delegate double efl_ui_range_value_get_api_delegate(System.IntPtr obj);
216 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");
218 private static double range_value_get(System.IntPtr obj, System.IntPtr pd)
220 Eina.Log.Debug("function efl_ui_range_value_get was called");
221 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
224 double _ret_var = default(double);
227 _ret_var = ((IRangeDisplay)ws.Target).GetRangeValue();
231 Eina.Log.Warning($"Callback error: {e.ToString()}");
232 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
240 return efl_ui_range_value_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
244 private static efl_ui_range_value_get_delegate efl_ui_range_value_get_static_delegate;
247 private delegate void efl_ui_range_value_set_delegate(System.IntPtr obj, System.IntPtr pd, double val);
250 public delegate void efl_ui_range_value_set_api_delegate(System.IntPtr obj, double val);
252 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");
254 private static void range_value_set(System.IntPtr obj, System.IntPtr pd, double val)
256 Eina.Log.Debug("function efl_ui_range_value_set was called");
257 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
263 ((IRangeDisplay)ws.Target).SetRangeValue(val);
267 Eina.Log.Warning($"Callback error: {e.ToString()}");
268 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
275 efl_ui_range_value_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), val);
279 private static efl_ui_range_value_set_delegate efl_ui_range_value_set_static_delegate;
282 private delegate void efl_ui_range_limits_get_delegate(System.IntPtr obj, System.IntPtr pd, out double min, out double max);
285 public delegate void efl_ui_range_limits_get_api_delegate(System.IntPtr obj, out double min, out double max);
287 public static Efl.Eo.FunctionWrapper<efl_ui_range_limits_get_api_delegate> efl_ui_range_limits_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_range_limits_get_api_delegate>(Module, "efl_ui_range_limits_get");
289 private static void range_limits_get(System.IntPtr obj, System.IntPtr pd, out double min, out double max)
291 Eina.Log.Debug("function efl_ui_range_limits_get was called");
292 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
295 min = default(double); max = default(double);
298 ((IRangeDisplay)ws.Target).GetRangeLimits(out min, out max);
302 Eina.Log.Warning($"Callback error: {e.ToString()}");
303 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
310 efl_ui_range_limits_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out min, out max);
314 private static efl_ui_range_limits_get_delegate efl_ui_range_limits_get_static_delegate;
317 private delegate void efl_ui_range_limits_set_delegate(System.IntPtr obj, System.IntPtr pd, double min, double max);
320 public delegate void efl_ui_range_limits_set_api_delegate(System.IntPtr obj, double min, double max);
322 public static Efl.Eo.FunctionWrapper<efl_ui_range_limits_set_api_delegate> efl_ui_range_limits_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_range_limits_set_api_delegate>(Module, "efl_ui_range_limits_set");
324 private static void range_limits_set(System.IntPtr obj, System.IntPtr pd, double min, double max)
326 Eina.Log.Debug("function efl_ui_range_limits_set was called");
327 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
333 ((IRangeDisplay)ws.Target).SetRangeLimits(min, max);
337 Eina.Log.Warning($"Callback error: {e.ToString()}");
338 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
345 efl_ui_range_limits_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), min, max);
349 private static efl_ui_range_limits_set_delegate efl_ui_range_limits_set_static_delegate;
351 #pragma warning restore CA1707, CS1591, SA1300, SA1600