1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
10 /// <summary>Efl boolean model class</summary>
11 [Efl.BooleanModel.NativeMethods]
12 public class BooleanModel : Efl.CompositeModel
14 ///<summary>Pointer to the native class description.</summary>
15 public override System.IntPtr NativeClass
19 if (((object)this).GetType() == typeof(BooleanModel))
21 return GetEflClassStatic();
25 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
30 [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
31 efl_boolean_model_class_get();
32 /// <summary>Initializes a new instance of the <see cref="BooleanModel"/> class.</summary>
33 /// <param name="parent">Parent instance.</param>
34 /// <param name="model">Model that is/will be See <see cref="Efl.Ui.IView.SetModel"/></param>
35 /// <param name="index">Position of this object in the parent model. See <see cref="Efl.CompositeModel.SetIndex"/></param>
36 public BooleanModel(Efl.Object parent
37 , Efl.IModel model, uint? index = null) : base(efl_boolean_model_class_get(), typeof(BooleanModel), parent)
39 if (Efl.Eo.Globals.ParamHelperCheck(model))
41 SetModel(Efl.Eo.Globals.GetParamHelper(model));
44 if (Efl.Eo.Globals.ParamHelperCheck(index))
46 SetIndex(Efl.Eo.Globals.GetParamHelper(index));
49 FinishInstantiation();
52 /// <summary>Initializes a new instance of the <see cref="BooleanModel"/> class.
53 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
54 /// <param name="raw">The native pointer to be wrapped.</param>
55 protected BooleanModel(System.IntPtr raw) : base(raw)
59 /// <summary>Initializes a new instance of the <see cref="BooleanModel"/> class.
60 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
61 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
62 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
63 /// <param name="parent">The Efl.Object parent of this instance.</param>
64 protected BooleanModel(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
68 /// <summary>Add a new named boolean property with a defined default value.</summary>
69 virtual public void AddBoolean(System.String name, bool default_value) {
70 Efl.BooleanModel.NativeMethods.efl_boolean_model_boolean_add_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),name, default_value);
71 Eina.Error.RaiseIfUnhandledException();
73 /// <summary>Delete an existing named boolean property</summary>
74 virtual public void DelBoolean(System.String name) {
75 Efl.BooleanModel.NativeMethods.efl_boolean_model_boolean_del_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),name);
76 Eina.Error.RaiseIfUnhandledException();
78 /// <summary>Get an iterator that will quickly find all the index with the requested value for a specific boolean.</summary>
79 /// <returns>The iterator that is valid until any change is made on the model.</returns>
80 virtual public Eina.Iterator<ulong> GetBooleanIterator(System.String name, bool request) {
81 var _ret_var = Efl.BooleanModel.NativeMethods.efl_boolean_model_boolean_iterator_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),name, request);
82 Eina.Error.RaiseIfUnhandledException();
83 return new Eina.Iterator<ulong>(_ret_var, false, false);
85 private static IntPtr GetEflClassStatic()
87 return Efl.BooleanModel.efl_boolean_model_class_get();
89 /// <summary>Wrapper for native methods and virtual method delegates.
90 /// For internal use by generated code only.</summary>
91 public new class NativeMethods : Efl.CompositeModel.NativeMethods
93 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Ecore);
94 /// <summary>Gets the list of Eo operations to override.</summary>
95 /// <returns>The list of Eo operations to be overload.</returns>
96 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
98 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
99 var methods = Efl.Eo.Globals.GetUserMethods(type);
101 if (efl_boolean_model_boolean_add_static_delegate == null)
103 efl_boolean_model_boolean_add_static_delegate = new efl_boolean_model_boolean_add_delegate(boolean_add);
106 if (methods.FirstOrDefault(m => m.Name == "AddBoolean") != null)
108 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_boolean_model_boolean_add"), func = Marshal.GetFunctionPointerForDelegate(efl_boolean_model_boolean_add_static_delegate) });
111 if (efl_boolean_model_boolean_del_static_delegate == null)
113 efl_boolean_model_boolean_del_static_delegate = new efl_boolean_model_boolean_del_delegate(boolean_del);
116 if (methods.FirstOrDefault(m => m.Name == "DelBoolean") != null)
118 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_boolean_model_boolean_del"), func = Marshal.GetFunctionPointerForDelegate(efl_boolean_model_boolean_del_static_delegate) });
121 if (efl_boolean_model_boolean_iterator_get_static_delegate == null)
123 efl_boolean_model_boolean_iterator_get_static_delegate = new efl_boolean_model_boolean_iterator_get_delegate(boolean_iterator_get);
126 if (methods.FirstOrDefault(m => m.Name == "GetBooleanIterator") != null)
128 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_boolean_model_boolean_iterator_get"), func = Marshal.GetFunctionPointerForDelegate(efl_boolean_model_boolean_iterator_get_static_delegate) });
131 descs.AddRange(base.GetEoOps(type));
134 /// <summary>Returns the Eo class for the native methods of this class.</summary>
135 /// <returns>The native class pointer.</returns>
136 public override IntPtr GetEflClass()
138 return Efl.BooleanModel.efl_boolean_model_class_get();
141 #pragma warning disable CA1707, CS1591, SA1300, SA1600
144 private delegate void efl_boolean_model_boolean_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.U1)] bool default_value);
147 public delegate void efl_boolean_model_boolean_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.U1)] bool default_value);
149 public static Efl.Eo.FunctionWrapper<efl_boolean_model_boolean_add_api_delegate> efl_boolean_model_boolean_add_ptr = new Efl.Eo.FunctionWrapper<efl_boolean_model_boolean_add_api_delegate>(Module, "efl_boolean_model_boolean_add");
151 private static void boolean_add(System.IntPtr obj, System.IntPtr pd, System.String name, bool default_value)
153 Eina.Log.Debug("function efl_boolean_model_boolean_add was called");
154 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
160 ((BooleanModel)ws.Target).AddBoolean(name, default_value);
164 Eina.Log.Warning($"Callback error: {e.ToString()}");
165 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
172 efl_boolean_model_boolean_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name, default_value);
176 private static efl_boolean_model_boolean_add_delegate efl_boolean_model_boolean_add_static_delegate;
179 private delegate void efl_boolean_model_boolean_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name);
182 public delegate void efl_boolean_model_boolean_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name);
184 public static Efl.Eo.FunctionWrapper<efl_boolean_model_boolean_del_api_delegate> efl_boolean_model_boolean_del_ptr = new Efl.Eo.FunctionWrapper<efl_boolean_model_boolean_del_api_delegate>(Module, "efl_boolean_model_boolean_del");
186 private static void boolean_del(System.IntPtr obj, System.IntPtr pd, System.String name)
188 Eina.Log.Debug("function efl_boolean_model_boolean_del was called");
189 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
195 ((BooleanModel)ws.Target).DelBoolean(name);
199 Eina.Log.Warning($"Callback error: {e.ToString()}");
200 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
207 efl_boolean_model_boolean_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name);
211 private static efl_boolean_model_boolean_del_delegate efl_boolean_model_boolean_del_static_delegate;
214 private delegate System.IntPtr efl_boolean_model_boolean_iterator_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.U1)] bool request);
217 public delegate System.IntPtr efl_boolean_model_boolean_iterator_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.U1)] bool request);
219 public static Efl.Eo.FunctionWrapper<efl_boolean_model_boolean_iterator_get_api_delegate> efl_boolean_model_boolean_iterator_get_ptr = new Efl.Eo.FunctionWrapper<efl_boolean_model_boolean_iterator_get_api_delegate>(Module, "efl_boolean_model_boolean_iterator_get");
221 private static System.IntPtr boolean_iterator_get(System.IntPtr obj, System.IntPtr pd, System.String name, bool request)
223 Eina.Log.Debug("function efl_boolean_model_boolean_iterator_get was called");
224 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
227 Eina.Iterator<ulong> _ret_var = default(Eina.Iterator<ulong>);
230 _ret_var = ((BooleanModel)ws.Target).GetBooleanIterator(name, request);
234 Eina.Log.Warning($"Callback error: {e.ToString()}");
235 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
238 return _ret_var.Handle;
243 return efl_boolean_model_boolean_iterator_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name, request);
247 private static efl_boolean_model_boolean_iterator_get_delegate efl_boolean_model_boolean_iterator_get_static_delegate;
249 #pragma warning restore CA1707, CS1591, SA1300, SA1600