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>Interface that contains properties regarding the displaying of a range.</summary>
9 [IRangeDisplayNativeInherit]
10 public interface IRangeDisplay :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Control the range value (in percentage) on a given range widget
14 /// Use this call to set range levels.
16 /// 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>
17 /// <returns>The range value (must be between $0.0 and 1.0)</returns>
18 double GetRangeValue();
19 /// <summary>Control the range value (in percentage) on a given range widget
20 /// Use this call to set range levels.
22 /// 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>
23 /// <param name="val">The range value (must be between $0.0 and 1.0)</param>
24 /// <returns></returns>
25 void SetRangeValue( double val);
26 /// <summary>Get the minimum and maximum values of the given range widget.
27 /// Note: If only one value is needed, the other pointer can be passed as <c>null</c>.</summary>
28 /// <param name="min">The minimum value.</param>
29 /// <param name="max">The maximum value.</param>
30 /// <returns></returns>
31 void GetRangeMinMax( out double min, out double max);
32 /// <summary>Set the minimum and maximum values for given range widget.
33 /// Define the allowed range of values to be selected by the user.
35 /// 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"/>
37 /// The minimum and maximum values may be different for each class.
39 /// Warning: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
40 /// <param name="min">The minimum value.</param>
41 /// <param name="max">The maximum value.</param>
42 /// <returns></returns>
43 void SetRangeMinMax( double min, double max);
44 /// <summary>Control the range value (in percentage) on a given range widget
45 /// Use this call to set range levels.
47 /// 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>
48 /// <value>The range value (must be between $0.0 and 1.0)</value>
54 /// <summary>Interface that contains properties regarding the displaying of a range.</summary>
55 sealed public class IRangeDisplayConcrete :
60 ///<summary>Pointer to the native class description.</summary>
61 public System.IntPtr NativeClass {
63 if (((object)this).GetType() == typeof (IRangeDisplayConcrete))
64 return Efl.Ui.IRangeDisplayNativeInherit.GetEflClassStatic();
66 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
69 private System.IntPtr handle;
70 ///<summary>Pointer to the native instance.</summary>
71 public System.IntPtr NativeHandle {
72 get { return handle; }
74 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
75 efl_ui_range_display_interface_get();
76 ///<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>
77 private IRangeDisplayConcrete(System.IntPtr raw)
80 RegisterEventProxies();
82 ///<summary>Destructor.</summary>
83 ~IRangeDisplayConcrete()
87 ///<summary>Releases the underlying native instance.</summary>
88 void Dispose(bool disposing)
90 if (handle != System.IntPtr.Zero) {
91 Efl.Eo.Globals.efl_unref(handle);
92 handle = System.IntPtr.Zero;
95 ///<summary>Releases the underlying native instance.</summary>
99 GC.SuppressFinalize(this);
101 ///<summary>Verifies if the given object is equal to this one.</summary>
102 public override bool Equals(object obj)
104 var other = obj as Efl.Object;
107 return this.NativeHandle == other.NativeHandle;
109 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
110 public override int GetHashCode()
112 return this.NativeHandle.ToInt32();
114 ///<summary>Turns the native pointer into a string representation.</summary>
115 public override String ToString()
117 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
119 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
120 void RegisterEventProxies()
123 /// <summary>Control the range value (in percentage) on a given range widget
124 /// Use this call to set range levels.
126 /// 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>
127 /// <returns>The range value (must be between $0.0 and 1.0)</returns>
128 public double GetRangeValue() {
129 var _ret_var = Efl.Ui.IRangeDisplayNativeInherit.efl_ui_range_value_get_ptr.Value.Delegate(this.NativeHandle);
130 Eina.Error.RaiseIfUnhandledException();
133 /// <summary>Control the range value (in percentage) on a given range widget
134 /// Use this call to set range levels.
136 /// 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>
137 /// <param name="val">The range value (must be between $0.0 and 1.0)</param>
138 /// <returns></returns>
139 public void SetRangeValue( double val) {
140 Efl.Ui.IRangeDisplayNativeInherit.efl_ui_range_value_set_ptr.Value.Delegate(this.NativeHandle, val);
141 Eina.Error.RaiseIfUnhandledException();
143 /// <summary>Get the minimum and maximum values of the given range widget.
144 /// Note: If only one value is needed, the other pointer can be passed as <c>null</c>.</summary>
145 /// <param name="min">The minimum value.</param>
146 /// <param name="max">The maximum value.</param>
147 /// <returns></returns>
148 public void GetRangeMinMax( out double min, out double max) {
149 Efl.Ui.IRangeDisplayNativeInherit.efl_ui_range_min_max_get_ptr.Value.Delegate(this.NativeHandle, out min, out max);
150 Eina.Error.RaiseIfUnhandledException();
152 /// <summary>Set the minimum and maximum values for given range widget.
153 /// Define the allowed range of values to be selected by the user.
155 /// 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"/>
157 /// The minimum and maximum values may be different for each class.
159 /// Warning: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
160 /// <param name="min">The minimum value.</param>
161 /// <param name="max">The maximum value.</param>
162 /// <returns></returns>
163 public void SetRangeMinMax( double min, double max) {
164 Efl.Ui.IRangeDisplayNativeInherit.efl_ui_range_min_max_set_ptr.Value.Delegate(this.NativeHandle, min, max);
165 Eina.Error.RaiseIfUnhandledException();
167 /// <summary>Control the range value (in percentage) on a given range widget
168 /// Use this call to set range levels.
170 /// 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>
171 /// <value>The range value (must be between $0.0 and 1.0)</value>
172 public double RangeValue {
173 get { return GetRangeValue(); }
174 set { SetRangeValue( value); }
176 private static IntPtr GetEflClassStatic()
178 return Efl.Ui.IRangeDisplayConcrete.efl_ui_range_display_interface_get();
181 public class IRangeDisplayNativeInherit : Efl.Eo.NativeClass{
182 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
183 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
185 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
186 var methods = Efl.Eo.Globals.GetUserMethods(type);
187 if (efl_ui_range_value_get_static_delegate == null)
188 efl_ui_range_value_get_static_delegate = new efl_ui_range_value_get_delegate(range_value_get);
189 if (methods.FirstOrDefault(m => m.Name == "GetRangeValue") != null)
190 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)});
191 if (efl_ui_range_value_set_static_delegate == null)
192 efl_ui_range_value_set_static_delegate = new efl_ui_range_value_set_delegate(range_value_set);
193 if (methods.FirstOrDefault(m => m.Name == "SetRangeValue") != null)
194 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)});
195 if (efl_ui_range_min_max_get_static_delegate == null)
196 efl_ui_range_min_max_get_static_delegate = new efl_ui_range_min_max_get_delegate(range_min_max_get);
197 if (methods.FirstOrDefault(m => m.Name == "GetRangeMinMax") != null)
198 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)});
199 if (efl_ui_range_min_max_set_static_delegate == null)
200 efl_ui_range_min_max_set_static_delegate = new efl_ui_range_min_max_set_delegate(range_min_max_set);
201 if (methods.FirstOrDefault(m => m.Name == "SetRangeMinMax") != null)
202 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)});
205 public override IntPtr GetEflClass()
207 return Efl.Ui.IRangeDisplayConcrete.efl_ui_range_display_interface_get();
209 public static IntPtr GetEflClassStatic()
211 return Efl.Ui.IRangeDisplayConcrete.efl_ui_range_display_interface_get();
215 private delegate double efl_ui_range_value_get_delegate(System.IntPtr obj, System.IntPtr pd);
218 public delegate double efl_ui_range_value_get_api_delegate(System.IntPtr obj);
219 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");
220 private static double range_value_get(System.IntPtr obj, System.IntPtr pd)
222 Eina.Log.Debug("function efl_ui_range_value_get was called");
223 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
224 if(wrapper != null) {
225 double _ret_var = default(double);
227 _ret_var = ((IRangeDisplay)wrapper).GetRangeValue();
228 } catch (Exception e) {
229 Eina.Log.Warning($"Callback error: {e.ToString()}");
230 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
234 return efl_ui_range_value_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
237 private static efl_ui_range_value_get_delegate efl_ui_range_value_get_static_delegate;
240 private delegate void efl_ui_range_value_set_delegate(System.IntPtr obj, System.IntPtr pd, double val);
243 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");
245 private static void range_value_set(System.IntPtr obj, System.IntPtr pd, double val)
247 Eina.Log.Debug("function efl_ui_range_value_set was called");
248 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
249 if(wrapper != null) {
252 ((IRangeDisplay)wrapper).SetRangeValue( val);
253 } catch (Exception e) {
254 Eina.Log.Warning($"Callback error: {e.ToString()}");
255 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
258 efl_ui_range_value_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), val);
261 private static efl_ui_range_value_set_delegate efl_ui_range_value_set_static_delegate;
264 private delegate void efl_ui_range_min_max_get_delegate(System.IntPtr obj, System.IntPtr pd, out double min, out double max);
267 public delegate void efl_ui_range_min_max_get_api_delegate(System.IntPtr obj, out double min, out double max);
268 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");
269 private static void range_min_max_get(System.IntPtr obj, System.IntPtr pd, out double min, out double max)
271 Eina.Log.Debug("function efl_ui_range_min_max_get was called");
272 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
273 if(wrapper != null) {
274 min = default(double); max = default(double);
276 ((IRangeDisplay)wrapper).GetRangeMinMax( out min, out max);
277 } catch (Exception e) {
278 Eina.Log.Warning($"Callback error: {e.ToString()}");
279 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
282 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);
285 private static efl_ui_range_min_max_get_delegate efl_ui_range_min_max_get_static_delegate;
288 private delegate void efl_ui_range_min_max_set_delegate(System.IntPtr obj, System.IntPtr pd, double min, double max);
291 public delegate void efl_ui_range_min_max_set_api_delegate(System.IntPtr obj, double min, double max);
292 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");
293 private static void range_min_max_set(System.IntPtr obj, System.IntPtr pd, double min, double max)
295 Eina.Log.Debug("function efl_ui_range_min_max_set was called");
296 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
297 if(wrapper != null) {
300 ((IRangeDisplay)wrapper).SetRangeMinMax( min, max);
301 } catch (Exception e) {
302 Eina.Log.Warning($"Callback error: {e.ToString()}");
303 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
306 efl_ui_range_min_max_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), min, max);
309 private static efl_ui_range_min_max_set_delegate efl_ui_range_min_max_set_static_delegate;