2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
13 /// <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>
14 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
15 [Efl.Ui.IFactoryBindConcrete.NativeMethods]
16 [Efl.Eo.BindingEntity]
17 public interface IFactoryBind :
18 Efl.Eo.IWrapper, IDisposable
20 /// <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>
21 /// <param name="key">Key string for bind model property data</param>
22 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
23 void FactoryBind(System.String key, Efl.Ui.IFactory factory);
25 /// <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>
26 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
27 sealed public class IFactoryBindConcrete :
32 /// <summary>Pointer to the native class description.</summary>
33 public override System.IntPtr NativeClass
37 if (((object)this).GetType() == typeof(IFactoryBindConcrete))
39 return GetEflClassStatic();
43 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
48 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
49 /// Do not call this constructor directly.</summary>
50 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
51 private IFactoryBindConcrete(ConstructingHandle ch) : base(ch)
55 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
56 efl_ui_factory_bind_interface_get();
57 /// <summary>Initializes a new instance of the <see cref="IFactoryBind"/> class.
58 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
59 /// <param name="wh">The native pointer to be wrapped.</param>
60 private IFactoryBindConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
64 /// <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>
65 /// <param name="key">Key string for bind model property data</param>
66 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
67 public void FactoryBind(System.String key, Efl.Ui.IFactory factory) {
68 Efl.Ui.IFactoryBindConcrete.NativeMethods.efl_ui_factory_bind_ptr.Value.Delegate(this.NativeHandle,key, factory);
69 Eina.Error.RaiseIfUnhandledException();
71 private static IntPtr GetEflClassStatic()
73 return Efl.Ui.IFactoryBindConcrete.efl_ui_factory_bind_interface_get();
75 /// <summary>Wrapper for native methods and virtual method delegates.
76 /// For internal use by generated code only.</summary>
77 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
79 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
80 /// <summary>Gets the list of Eo operations to override.</summary>
81 /// <returns>The list of Eo operations to be overload.</returns>
82 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
84 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
85 var methods = Efl.Eo.Globals.GetUserMethods(type);
87 if (efl_ui_factory_bind_static_delegate == null)
89 efl_ui_factory_bind_static_delegate = new efl_ui_factory_bind_delegate(factory_bind);
92 if (methods.FirstOrDefault(m => m.Name == "FactoryBind") != null)
94 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) });
99 /// <summary>Returns the Eo class for the native methods of this class.</summary>
100 /// <returns>The native class pointer.</returns>
101 public override IntPtr GetEflClass()
103 return Efl.Ui.IFactoryBindConcrete.efl_ui_factory_bind_interface_get();
106 #pragma warning disable CA1707, CS1591, SA1300, SA1600
109 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);
112 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);
114 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");
116 private static void factory_bind(System.IntPtr obj, System.IntPtr pd, System.String key, Efl.Ui.IFactory factory)
118 Eina.Log.Debug("function efl_ui_factory_bind was called");
119 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
125 ((IFactoryBind)ws.Target).FactoryBind(key, factory);
129 Eina.Log.Warning($"Callback error: {e.ToString()}");
130 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
137 efl_ui_factory_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, factory);
141 private static efl_ui_factory_bind_delegate efl_ui_factory_bind_static_delegate;
143 #pragma warning restore CA1707, CS1591, SA1300, SA1600
152 #pragma warning disable CS1591
153 public static class Efl_UiIFactoryBindConcrete_ExtensionMethods {
155 #pragma warning restore CS1591