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>Efl UI Property interface. view object can have <see cref="Efl.IModel"/> and need to set cotent with those model stored data. the interface can help binding the factory to create object with model property data. see <see cref="Efl.IModel"/> see <see cref="Efl.Ui.IFactory"/></summary>
13 [Efl.Ui.IFactoryBindConcrete.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public interface IFactoryBind :
16 Efl.Eo.IWrapper, IDisposable
18 /// <summary>bind the factory with the given key string. when the data is ready or changed, factory create the object and bind the data to the key action and process promised work. Note: the input <see cref="Efl.Ui.IFactory"/> need to be <see cref="Efl.Ui.IPropertyBind.PropertyBind"/> at least once.</summary>
19 /// <param name="key">Key string for bind model property data</param>
20 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
21 void FactoryBind(System.String key, Efl.Ui.IFactory factory);
23 /// <summary>Efl UI Property interface. view object can have <see cref="Efl.IModel"/> and need to set cotent with those model stored data. the interface can help binding the factory to create object with model property data. see <see cref="Efl.IModel"/> see <see cref="Efl.Ui.IFactory"/></summary>
24 sealed public class IFactoryBindConcrete :
29 ///<summary>Pointer to the native class description.</summary>
30 public override System.IntPtr NativeClass
34 if (((object)this).GetType() == typeof(IFactoryBindConcrete))
36 return GetEflClassStatic();
40 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
45 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
46 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
47 private IFactoryBindConcrete(ConstructingHandle ch) : base(ch)
51 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
52 efl_ui_factory_bind_interface_get();
53 /// <summary>Initializes a new instance of the <see cref="IFactoryBind"/> class.
54 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
55 /// <param name="wh">The native pointer to be wrapped.</param>
56 private IFactoryBindConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
60 /// <summary>bind the factory with the given key string. when the data is ready or changed, factory create the object and bind the data to the key action and process promised work. Note: the input <see cref="Efl.Ui.IFactory"/> need to be <see cref="Efl.Ui.IPropertyBind.PropertyBind"/> at least once.</summary>
61 /// <param name="key">Key string for bind model property data</param>
62 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
63 public void FactoryBind(System.String key, Efl.Ui.IFactory factory) {
64 Efl.Ui.IFactoryBindConcrete.NativeMethods.efl_ui_factory_bind_ptr.Value.Delegate(this.NativeHandle,key, factory);
65 Eina.Error.RaiseIfUnhandledException();
67 private static IntPtr GetEflClassStatic()
69 return Efl.Ui.IFactoryBindConcrete.efl_ui_factory_bind_interface_get();
71 /// <summary>Wrapper for native methods and virtual method delegates.
72 /// For internal use by generated code only.</summary>
73 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
75 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
76 /// <summary>Gets the list of Eo operations to override.</summary>
77 /// <returns>The list of Eo operations to be overload.</returns>
78 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
80 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
81 var methods = Efl.Eo.Globals.GetUserMethods(type);
83 if (efl_ui_factory_bind_static_delegate == null)
85 efl_ui_factory_bind_static_delegate = new efl_ui_factory_bind_delegate(factory_bind);
88 if (methods.FirstOrDefault(m => m.Name == "FactoryBind") != null)
90 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_factory_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_factory_bind_static_delegate) });
95 /// <summary>Returns the Eo class for the native methods of this class.</summary>
96 /// <returns>The native class pointer.</returns>
97 public override IntPtr GetEflClass()
99 return Efl.Ui.IFactoryBindConcrete.efl_ui_factory_bind_interface_get();
102 #pragma warning disable CA1707, CS1591, SA1300, SA1600
105 private delegate void efl_ui_factory_bind_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.IFactory factory);
108 public delegate void efl_ui_factory_bind_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.IFactory factory);
110 public static Efl.Eo.FunctionWrapper<efl_ui_factory_bind_api_delegate> efl_ui_factory_bind_ptr = new Efl.Eo.FunctionWrapper<efl_ui_factory_bind_api_delegate>(Module, "efl_ui_factory_bind");
112 private static void factory_bind(System.IntPtr obj, System.IntPtr pd, System.String key, Efl.Ui.IFactory factory)
114 Eina.Log.Debug("function efl_ui_factory_bind was called");
115 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
121 ((IFactoryBind)ws.Target).FactoryBind(key, factory);
125 Eina.Log.Warning($"Callback error: {e.ToString()}");
126 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
133 efl_ui_factory_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, factory);
137 private static efl_ui_factory_bind_delegate efl_ui_factory_bind_static_delegate;
139 #pragma warning restore CA1707, CS1591, SA1300, SA1600