[EflSharp] Separate efl and Circle cs files and Update cs files (#786)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_factory.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui { 
8 /// <summary>Efl UI factory interface</summary>
9 [IFactoryNativeInherit]
10 public interface IFactory : 
11     Efl.Ui.IFactoryBind ,
12     Efl.Ui.IPropertyBind ,
13     Efl.Eo.IWrapper, IDisposable
14 {
15     /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
16 /// <param name="model">Efl model</param>
17 /// <param name="parent">Efl canvas</param>
18 /// <returns>Created UI object</returns>
19  Eina.Future Create( Efl.IModel model,  Efl.Gfx.IEntity parent);
20     /// <summary>Release a UI object and disconnect from models.</summary>
21 /// <param name="ui_view">Efl canvas</param>
22 /// <returns></returns>
23 void Release( Efl.Gfx.IEntity ui_view);
24         System.Threading.Tasks.Task<Eina.Value> CreateAsync( Efl.IModel model, Efl.Gfx.IEntity parent, System.Threading.CancellationToken token=default(System.Threading.CancellationToken));
25         /// <summary>Event triggered when an item has been successfully created.</summary>
26     event EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> CreatedEvt;
27 }
28 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.IFactory.CreatedEvt"/>.</summary>
29 public class IFactoryCreatedEvt_Args : EventArgs {
30     ///<summary>Actual event payload.</summary>
31     public Efl.Ui.FactoryItemCreatedEvent arg { get; set; }
32 }
33 /// <summary>Efl UI factory interface</summary>
34 sealed public class IFactoryConcrete : 
35
36 IFactory
37     , Efl.Ui.IFactoryBind, Efl.Ui.IPropertyBind
38 {
39     ///<summary>Pointer to the native class description.</summary>
40     public System.IntPtr NativeClass {
41         get {
42             if (((object)this).GetType() == typeof (IFactoryConcrete))
43                 return Efl.Ui.IFactoryNativeInherit.GetEflClassStatic();
44             else
45                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
46         }
47     }
48     private EventHandlerList eventHandlers = new EventHandlerList();
49     private  System.IntPtr handle;
50     ///<summary>Pointer to the native instance.</summary>
51     public System.IntPtr NativeHandle {
52         get { return handle; }
53     }
54     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
55         efl_ui_factory_interface_get();
56     ///<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>
57     private IFactoryConcrete(System.IntPtr raw)
58     {
59         handle = raw;
60         RegisterEventProxies();
61     }
62     ///<summary>Destructor.</summary>
63     ~IFactoryConcrete()
64     {
65         Dispose(false);
66     }
67     ///<summary>Releases the underlying native instance.</summary>
68     void Dispose(bool disposing)
69     {
70         if (handle != System.IntPtr.Zero) {
71             Efl.Eo.Globals.efl_unref(handle);
72             handle = System.IntPtr.Zero;
73         }
74     }
75     ///<summary>Releases the underlying native instance.</summary>
76     public void Dispose()
77     {
78         Dispose(true);
79         GC.SuppressFinalize(this);
80     }
81     ///<summary>Verifies if the given object is equal to this one.</summary>
82     public override bool Equals(object obj)
83     {
84         var other = obj as Efl.Object;
85         if (other == null)
86             return false;
87         return this.NativeHandle == other.NativeHandle;
88     }
89     ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
90     public override int GetHashCode()
91     {
92         return this.NativeHandle.ToInt32();
93     }
94     ///<summary>Turns the native pointer into a string representation.</summary>
95     public override String ToString()
96     {
97         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
98     }
99     private readonly object eventLock = new object();
100     private Dictionary<string, int> event_cb_count = new Dictionary<string, int>();
101     ///<summary>Adds a new event handler, registering it to the native event. For internal use only.</summary>
102     ///<param name="lib">The name of the native library definining the event.</param>
103     ///<param name="key">The name of the native event.</param>
104     ///<param name="evt_delegate">The delegate to be called on event raising.</param>
105     ///<returns>True if the delegate was successfully registered.</returns>
106     private bool AddNativeEventHandler(string lib, string key, Efl.EventCb evt_delegate) {
107         int event_count = 0;
108         if (!event_cb_count.TryGetValue(key, out event_count))
109             event_cb_count[key] = event_count;
110         if (event_count == 0) {
111             IntPtr desc = Efl.EventDescription.GetNative(lib, key);
112             if (desc == IntPtr.Zero) {
113                 Eina.Log.Error($"Failed to get native event {key}");
114                 return false;
115             }
116              bool result = Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);
117             if (!result) {
118                 Eina.Log.Error($"Failed to add event proxy for event {key}");
119                 return false;
120             }
121             Eina.Error.RaiseIfUnhandledException();
122         } 
123         event_cb_count[key]++;
124         return true;
125     }
126     ///<summary>Removes the given event handler for the given event. For internal use only.</summary>
127     ///<param name="key">The name of the native event.</param>
128     ///<param name="evt_delegate">The delegate to be removed.</param>
129     ///<returns>True if the delegate was successfully registered.</returns>
130     private bool RemoveNativeEventHandler(string key, Efl.EventCb evt_delegate) {
131         int event_count = 0;
132         if (!event_cb_count.TryGetValue(key, out event_count))
133             event_cb_count[key] = event_count;
134         if (event_count == 1) {
135             IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
136             if (desc == IntPtr.Zero) {
137                 Eina.Log.Error($"Failed to get native event {key}");
138                 return false;
139             }
140             bool result = Efl.Eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);
141             if (!result) {
142                 Eina.Log.Error($"Failed to remove event proxy for event {key}");
143                 return false;
144             }
145             Eina.Error.RaiseIfUnhandledException();
146         } else if (event_count == 0) {
147             Eina.Log.Error($"Trying to remove proxy for event {key} when there is nothing registered.");
148             return false;
149         } 
150         event_cb_count[key]--;
151         return true;
152     }
153 private static object CreatedEvtKey = new object();
154     /// <summary>Event triggered when an item has been successfully created.</summary>
155     public event EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> CreatedEvt
156     {
157         add {
158             lock (eventLock) {
159                 string key = "_EFL_UI_FACTORY_EVENT_CREATED";
160                 if (AddNativeEventHandler(efl.Libs.Efl, key, this.evt_CreatedEvt_delegate)) {
161                     eventHandlers.AddHandler(CreatedEvtKey , value);
162                 } else
163                     Eina.Log.Error($"Error adding proxy for event {key}");
164             }
165         }
166         remove {
167             lock (eventLock) {
168                 string key = "_EFL_UI_FACTORY_EVENT_CREATED";
169                 if (RemoveNativeEventHandler(key, this.evt_CreatedEvt_delegate)) { 
170                     eventHandlers.RemoveHandler(CreatedEvtKey , value);
171                 } else
172                     Eina.Log.Error($"Error removing proxy for event {key}");
173             }
174         }
175     }
176     ///<summary>Method to raise event CreatedEvt.</summary>
177     public void On_CreatedEvt(Efl.Ui.IFactoryCreatedEvt_Args e)
178     {
179         EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> evt;
180         lock (eventLock) {
181         evt = (EventHandler<Efl.Ui.IFactoryCreatedEvt_Args>)eventHandlers[CreatedEvtKey];
182         }
183         evt?.Invoke(this, e);
184     }
185     Efl.EventCb evt_CreatedEvt_delegate;
186     private void on_CreatedEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
187     {
188         Efl.Ui.IFactoryCreatedEvt_Args args = new Efl.Ui.IFactoryCreatedEvt_Args();
189       args.arg =  evt.Info;;
190         try {
191             On_CreatedEvt(args);
192         } catch (Exception e) {
193             Eina.Log.Error(e.ToString());
194             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
195         }
196     }
197
198 private static object PropertiesChangedEvtKey = new object();
199     /// <summary>Event dispatched when a property on the object has changed due to an user interaction on the object that a model could be interested in.</summary>
200     public event EventHandler<Efl.Ui.IPropertyBindPropertiesChangedEvt_Args> PropertiesChangedEvt
201     {
202         add {
203             lock (eventLock) {
204                 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
205                 if (AddNativeEventHandler(efl.Libs.Efl, key, this.evt_PropertiesChangedEvt_delegate)) {
206                     eventHandlers.AddHandler(PropertiesChangedEvtKey , value);
207                 } else
208                     Eina.Log.Error($"Error adding proxy for event {key}");
209             }
210         }
211         remove {
212             lock (eventLock) {
213                 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
214                 if (RemoveNativeEventHandler(key, this.evt_PropertiesChangedEvt_delegate)) { 
215                     eventHandlers.RemoveHandler(PropertiesChangedEvtKey , value);
216                 } else
217                     Eina.Log.Error($"Error removing proxy for event {key}");
218             }
219         }
220     }
221     ///<summary>Method to raise event PropertiesChangedEvt.</summary>
222     public void On_PropertiesChangedEvt(Efl.Ui.IPropertyBindPropertiesChangedEvt_Args e)
223     {
224         EventHandler<Efl.Ui.IPropertyBindPropertiesChangedEvt_Args> evt;
225         lock (eventLock) {
226         evt = (EventHandler<Efl.Ui.IPropertyBindPropertiesChangedEvt_Args>)eventHandlers[PropertiesChangedEvtKey];
227         }
228         evt?.Invoke(this, e);
229     }
230     Efl.EventCb evt_PropertiesChangedEvt_delegate;
231     private void on_PropertiesChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
232     {
233         Efl.Ui.IPropertyBindPropertiesChangedEvt_Args args = new Efl.Ui.IPropertyBindPropertiesChangedEvt_Args();
234       args.arg =  evt.Info;;
235         try {
236             On_PropertiesChangedEvt(args);
237         } catch (Exception e) {
238             Eina.Log.Error(e.ToString());
239             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
240         }
241     }
242
243 private static object PropertyBoundEvtKey = new object();
244     /// <summary>Event dispatched when a property on the object is bound to a model. This is useful to not overgenerate event.</summary>
245     public event EventHandler<Efl.Ui.IPropertyBindPropertyBoundEvt_Args> PropertyBoundEvt
246     {
247         add {
248             lock (eventLock) {
249                 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
250                 if (AddNativeEventHandler(efl.Libs.Efl, key, this.evt_PropertyBoundEvt_delegate)) {
251                     eventHandlers.AddHandler(PropertyBoundEvtKey , value);
252                 } else
253                     Eina.Log.Error($"Error adding proxy for event {key}");
254             }
255         }
256         remove {
257             lock (eventLock) {
258                 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
259                 if (RemoveNativeEventHandler(key, this.evt_PropertyBoundEvt_delegate)) { 
260                     eventHandlers.RemoveHandler(PropertyBoundEvtKey , value);
261                 } else
262                     Eina.Log.Error($"Error removing proxy for event {key}");
263             }
264         }
265     }
266     ///<summary>Method to raise event PropertyBoundEvt.</summary>
267     public void On_PropertyBoundEvt(Efl.Ui.IPropertyBindPropertyBoundEvt_Args e)
268     {
269         EventHandler<Efl.Ui.IPropertyBindPropertyBoundEvt_Args> evt;
270         lock (eventLock) {
271         evt = (EventHandler<Efl.Ui.IPropertyBindPropertyBoundEvt_Args>)eventHandlers[PropertyBoundEvtKey];
272         }
273         evt?.Invoke(this, e);
274     }
275     Efl.EventCb evt_PropertyBoundEvt_delegate;
276     private void on_PropertyBoundEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
277     {
278         Efl.Ui.IPropertyBindPropertyBoundEvt_Args args = new Efl.Ui.IPropertyBindPropertyBoundEvt_Args();
279       args.arg = Eina.StringConversion.NativeUtf8ToManagedString(evt.Info);
280         try {
281             On_PropertyBoundEvt(args);
282         } catch (Exception e) {
283             Eina.Log.Error(e.ToString());
284             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
285         }
286     }
287
288     ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
289      void RegisterEventProxies()
290     {
291         evt_CreatedEvt_delegate = new Efl.EventCb(on_CreatedEvt_NativeCallback);
292         evt_PropertiesChangedEvt_delegate = new Efl.EventCb(on_PropertiesChangedEvt_NativeCallback);
293         evt_PropertyBoundEvt_delegate = new Efl.EventCb(on_PropertyBoundEvt_NativeCallback);
294     }
295     /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
296     /// <param name="model">Efl model</param>
297     /// <param name="parent">Efl canvas</param>
298     /// <returns>Created UI object</returns>
299     public  Eina.Future Create( Efl.IModel model,  Efl.Gfx.IEntity parent) {
300                                                          var _ret_var = Efl.Ui.IFactoryNativeInherit.efl_ui_factory_create_ptr.Value.Delegate(this.NativeHandle, model,  parent);
301         Eina.Error.RaiseIfUnhandledException();
302                                         return _ret_var;
303  }
304     /// <summary>Release a UI object and disconnect from models.</summary>
305     /// <param name="ui_view">Efl canvas</param>
306     /// <returns></returns>
307     public void Release( Efl.Gfx.IEntity ui_view) {
308                                  Efl.Ui.IFactoryNativeInherit.efl_ui_factory_release_ptr.Value.Delegate(this.NativeHandle, ui_view);
309         Eina.Error.RaiseIfUnhandledException();
310                          }
311     /// <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>
312     /// <param name="key">Key string for bind model property data</param>
313     /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
314     /// <returns></returns>
315     public void FactoryBind( System.String key,  Efl.Ui.IFactory factory) {
316                                                          Efl.Ui.IFactoryBindNativeInherit.efl_ui_factory_bind_ptr.Value.Delegate(this.NativeHandle, key,  factory);
317         Eina.Error.RaiseIfUnhandledException();
318                                          }
319     /// <summary>bind property data with the given key string. when the data is ready or changed, bind the data to the key action and process promised work.</summary>
320     /// <param name="key">key string for bind model property data</param>
321     /// <param name="property">Model property name</param>
322     /// <returns>0 when it succeed, an error code otherwise.</returns>
323     public Eina.Error PropertyBind( System.String key,  System.String property) {
324                                                          var _ret_var = Efl.Ui.IPropertyBindNativeInherit.efl_ui_property_bind_ptr.Value.Delegate(this.NativeHandle, key,  property);
325         Eina.Error.RaiseIfUnhandledException();
326                                         return _ret_var;
327  }
328     public System.Threading.Tasks.Task<Eina.Value> CreateAsync( Efl.IModel model, Efl.Gfx.IEntity parent, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
329     {
330         Eina.Future future = Create(  model,  parent);
331         return Efl.Eo.Globals.WrapAsync(future, token);
332     }
333     private static IntPtr GetEflClassStatic()
334     {
335         return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
336     }
337 }
338 public class IFactoryNativeInherit  : Efl.Eo.NativeClass{
339     public  static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
340     public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
341     {
342         var descs = new System.Collections.Generic.List<Efl_Op_Description>();
343         var methods = Efl.Eo.Globals.GetUserMethods(type);
344         if (efl_ui_factory_create_static_delegate == null)
345             efl_ui_factory_create_static_delegate = new efl_ui_factory_create_delegate(create);
346         if (methods.FirstOrDefault(m => m.Name == "Create") != null)
347             descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_factory_create"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_factory_create_static_delegate)});
348         if (efl_ui_factory_release_static_delegate == null)
349             efl_ui_factory_release_static_delegate = new efl_ui_factory_release_delegate(release);
350         if (methods.FirstOrDefault(m => m.Name == "Release") != null)
351             descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_factory_release"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_factory_release_static_delegate)});
352         if (efl_ui_factory_bind_static_delegate == null)
353             efl_ui_factory_bind_static_delegate = new efl_ui_factory_bind_delegate(factory_bind);
354         if (methods.FirstOrDefault(m => m.Name == "FactoryBind") != null)
355             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)});
356         if (efl_ui_property_bind_static_delegate == null)
357             efl_ui_property_bind_static_delegate = new efl_ui_property_bind_delegate(property_bind);
358         if (methods.FirstOrDefault(m => m.Name == "PropertyBind") != null)
359             descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_property_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_property_bind_static_delegate)});
360         return descs;
361     }
362     public override IntPtr GetEflClass()
363     {
364         return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
365     }
366     public static  IntPtr GetEflClassStatic()
367     {
368         return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
369     }
370
371
372     [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] private delegate  Eina.Future efl_ui_factory_create_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.IModelConcrete, Efl.Eo.NonOwnTag>))]  Efl.IModel model, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))]  Efl.Gfx.IEntity parent);
373
374
375     [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] public delegate  Eina.Future efl_ui_factory_create_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.IModelConcrete, Efl.Eo.NonOwnTag>))]  Efl.IModel model, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))]  Efl.Gfx.IEntity parent);
376      public static Efl.Eo.FunctionWrapper<efl_ui_factory_create_api_delegate> efl_ui_factory_create_ptr = new Efl.Eo.FunctionWrapper<efl_ui_factory_create_api_delegate>(_Module, "efl_ui_factory_create");
377      private static  Eina.Future create(System.IntPtr obj, System.IntPtr pd,  Efl.IModel model,  Efl.Gfx.IEntity parent)
378     {
379         Eina.Log.Debug("function efl_ui_factory_create was called");
380         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
381         if(wrapper != null) {
382                                                                          Eina.Future _ret_var = default( Eina.Future);
383             try {
384                 _ret_var = ((IFactory)wrapper).Create( model,  parent);
385             } catch (Exception e) {
386                 Eina.Log.Warning($"Callback error: {e.ToString()}");
387                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
388             }
389                                         return _ret_var;
390         } else {
391             return efl_ui_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  model,  parent);
392         }
393     }
394     private static efl_ui_factory_create_delegate efl_ui_factory_create_static_delegate;
395
396
397      private delegate void efl_ui_factory_release_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))]  Efl.Gfx.IEntity ui_view);
398
399
400      public delegate void efl_ui_factory_release_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))]  Efl.Gfx.IEntity ui_view);
401      public static Efl.Eo.FunctionWrapper<efl_ui_factory_release_api_delegate> efl_ui_factory_release_ptr = new Efl.Eo.FunctionWrapper<efl_ui_factory_release_api_delegate>(_Module, "efl_ui_factory_release");
402      private static void release(System.IntPtr obj, System.IntPtr pd,  Efl.Gfx.IEntity ui_view)
403     {
404         Eina.Log.Debug("function efl_ui_factory_release was called");
405         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
406         if(wrapper != null) {
407                                                 
408             try {
409                 ((IFactory)wrapper).Release( ui_view);
410             } catch (Exception e) {
411                 Eina.Log.Warning($"Callback error: {e.ToString()}");
412                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
413             }
414                                 } else {
415             efl_ui_factory_release_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  ui_view);
416         }
417     }
418     private static efl_ui_factory_release_delegate efl_ui_factory_release_static_delegate;
419
420
421      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.MarshalTest<Efl.Ui.IFactoryConcrete, Efl.Eo.NonOwnTag>))]  Efl.Ui.IFactory factory);
422
423
424      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.MarshalTest<Efl.Ui.IFactoryConcrete, Efl.Eo.NonOwnTag>))]  Efl.Ui.IFactory factory);
425      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");
426      private static void factory_bind(System.IntPtr obj, System.IntPtr pd,  System.String key,  Efl.Ui.IFactory factory)
427     {
428         Eina.Log.Debug("function efl_ui_factory_bind was called");
429         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
430         if(wrapper != null) {
431                                                                         
432             try {
433                 ((IFactory)wrapper).FactoryBind( key,  factory);
434             } catch (Exception e) {
435                 Eina.Log.Warning($"Callback error: {e.ToString()}");
436                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
437             }
438                                                 } else {
439             efl_ui_factory_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  key,  factory);
440         }
441     }
442     private static efl_ui_factory_bind_delegate efl_ui_factory_bind_static_delegate;
443
444
445      private delegate Eina.Error efl_ui_property_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.StringKeepOwnershipMarshaler))]  System.String property);
446
447
448      public delegate Eina.Error efl_ui_property_bind_api_delegate(System.IntPtr obj,  [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]  System.String key,  [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]  System.String property);
449      public static Efl.Eo.FunctionWrapper<efl_ui_property_bind_api_delegate> efl_ui_property_bind_ptr = new Efl.Eo.FunctionWrapper<efl_ui_property_bind_api_delegate>(_Module, "efl_ui_property_bind");
450      private static Eina.Error property_bind(System.IntPtr obj, System.IntPtr pd,  System.String key,  System.String property)
451     {
452         Eina.Log.Debug("function efl_ui_property_bind was called");
453         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
454         if(wrapper != null) {
455                                                                         Eina.Error _ret_var = default(Eina.Error);
456             try {
457                 _ret_var = ((IFactory)wrapper).PropertyBind( key,  property);
458             } catch (Exception e) {
459                 Eina.Log.Warning($"Callback error: {e.ToString()}");
460                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
461             }
462                                         return _ret_var;
463         } else {
464             return efl_ui_property_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  key,  property);
465         }
466     }
467     private static efl_ui_property_bind_delegate efl_ui_property_bind_static_delegate;
468 }
469 } } 
470 namespace Efl { namespace Ui { 
471 /// <summary>EFL Ui Factory event structure provided when an item was just created.</summary>
472 [StructLayout(LayoutKind.Sequential)]
473 public struct FactoryItemCreatedEvent
474 {
475     /// <summary>The model already set on the new item.</summary>
476     public Efl.IModel Model;
477     /// <summary>The item that was just created.</summary>
478     public Efl.Gfx.IEntity Item;
479     ///<summary>Constructor for FactoryItemCreatedEvent.</summary>
480     public FactoryItemCreatedEvent(
481         Efl.IModel Model=default(Efl.IModel),
482         Efl.Gfx.IEntity Item=default(Efl.Gfx.IEntity)    )
483     {
484         this.Model = Model;
485         this.Item = Item;
486     }
487
488     public static implicit operator FactoryItemCreatedEvent(IntPtr ptr)
489     {
490         var tmp = (FactoryItemCreatedEvent.NativeStruct)Marshal.PtrToStructure(ptr, typeof(FactoryItemCreatedEvent.NativeStruct));
491         return tmp;
492     }
493
494     ///<summary>Internal wrapper for struct FactoryItemCreatedEvent.</summary>
495     [StructLayout(LayoutKind.Sequential)]
496     public struct NativeStruct
497     {
498         ///<summary>Internal wrapper for field Model</summary>
499         public System.IntPtr Model;
500         ///<summary>Internal wrapper for field Item</summary>
501         public System.IntPtr Item;
502         ///<summary>Implicit conversion to the internal/marshalling representation.</summary>
503         public static implicit operator FactoryItemCreatedEvent.NativeStruct(FactoryItemCreatedEvent _external_struct)
504         {
505             var _internal_struct = new FactoryItemCreatedEvent.NativeStruct();
506             _internal_struct.Model = _external_struct.Model?.NativeHandle ?? System.IntPtr.Zero;
507             _internal_struct.Item = _external_struct.Item?.NativeHandle ?? System.IntPtr.Zero;
508             return _internal_struct;
509         }
510
511         ///<summary>Implicit conversion to the managed representation.</summary>
512         public static implicit operator FactoryItemCreatedEvent(FactoryItemCreatedEvent.NativeStruct _internal_struct)
513         {
514             var _external_struct = new FactoryItemCreatedEvent();
515
516             _external_struct.Model = (Efl.IModelConcrete) Efl.Eo.Globals.CreateWrapperFor(_internal_struct.Model);
517
518             _external_struct.Item = (Efl.Gfx.IEntityConcrete) Efl.Eo.Globals.CreateWrapperFor(_internal_struct.Item);
519             return _external_struct;
520         }
521
522     }
523
524 }
525
526 } }