0765882349bc8776d504ca0ea302024f995ea777
[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.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 namespace Ui {
11
12 /// <summary>Efl UI factory interface</summary>
13 [Efl.Ui.IFactoryConcrete.NativeMethods]
14 public interface IFactory : 
15     Efl.Ui.IFactoryBind ,
16     Efl.Ui.IPropertyBind ,
17     Efl.Eo.IWrapper, IDisposable
18 {
19     /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
20 /// <param name="model">Efl model</param>
21 /// <param name="parent">Efl canvas</param>
22 /// <returns>Created UI object</returns>
23  Eina.Future Create(Efl.IModel model, Efl.Gfx.IEntity parent);
24     /// <summary>Release a UI object and disconnect from models.</summary>
25 /// <param name="ui_view">Efl canvas</param>
26 void Release(Efl.Gfx.IEntity ui_view);
27         System.Threading.Tasks.Task<Eina.Value> CreateAsync(Efl.IModel model,Efl.Gfx.IEntity parent, System.Threading.CancellationToken token = default(System.Threading.CancellationToken));
28         /// <summary>Event triggered when an item has been successfully created.</summary>
29     event EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> CreatedEvt;
30 }
31 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.IFactory.CreatedEvt"/>.</summary>
32 public class IFactoryCreatedEvt_Args : EventArgs {
33     ///<summary>Actual event payload.</summary>
34     public Efl.Ui.FactoryItemCreatedEvent arg { get; set; }
35 }
36 /// <summary>Efl UI factory interface</summary>
37 sealed public class IFactoryConcrete : 
38
39 IFactory
40     , Efl.Ui.IFactoryBind, Efl.Ui.IPropertyBind
41 {
42     ///<summary>Pointer to the native class description.</summary>
43     public System.IntPtr NativeClass
44     {
45         get
46         {
47             if (((object)this).GetType() == typeof(IFactoryConcrete))
48             {
49                 return GetEflClassStatic();
50             }
51             else
52             {
53                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
54             }
55         }
56     }
57
58     private Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)> eoEvents = new Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)>();
59     private readonly object eventLock = new object();
60     private  System.IntPtr handle;
61     ///<summary>Pointer to the native instance.</summary>
62     public System.IntPtr NativeHandle
63     {
64         get { return handle; }
65     }
66
67     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
68         efl_ui_factory_interface_get();
69     /// <summary>Initializes a new instance of the <see cref="IFactory"/> class.
70     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
71     private IFactoryConcrete(System.IntPtr raw)
72     {
73         handle = raw;
74     }
75     ///<summary>Destructor.</summary>
76     ~IFactoryConcrete()
77     {
78         Dispose(false);
79     }
80
81     ///<summary>Releases the underlying native instance.</summary>
82     private void Dispose(bool disposing)
83     {
84         if (handle != System.IntPtr.Zero)
85         {
86             IntPtr h = handle;
87             handle = IntPtr.Zero;
88
89             IntPtr gcHandlePtr = IntPtr.Zero;
90             if (eoEvents.Count != 0)
91             {
92                 GCHandle gcHandle = GCHandle.Alloc(eoEvents);
93                 gcHandlePtr = GCHandle.ToIntPtr(gcHandle);
94             }
95
96             if (disposing)
97             {
98                 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
99             }
100             else
101             {
102                 Monitor.Enter(Efl.All.InitLock);
103                 if (Efl.All.MainLoopInitialized)
104                 {
105                     Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
106                 }
107
108                 Monitor.Exit(Efl.All.InitLock);
109             }
110         }
111
112     }
113
114     ///<summary>Releases the underlying native instance.</summary>
115     public void Dispose()
116     {
117         Dispose(true);
118         GC.SuppressFinalize(this);
119     }
120
121     /// <summary>Verifies if the given object is equal to this one.</summary>
122     /// <param name="instance">The object to compare to.</param>
123     /// <returns>True if both objects point to the same native object.</returns>
124     public override bool Equals(object instance)
125     {
126         var other = instance as Efl.Object;
127         if (other == null)
128         {
129             return false;
130         }
131         return this.NativeHandle == other.NativeHandle;
132     }
133
134     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
135     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
136     public override int GetHashCode()
137     {
138         return this.NativeHandle.ToInt32();
139     }
140
141     /// <summary>Turns the native pointer into a string representation.</summary>
142     /// <returns>A string with the type and the native pointer for this object.</returns>
143     public override String ToString()
144     {
145         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
146     }
147
148     ///<summary>Adds a new event handler, registering it to the native event. For internal use only.</summary>
149     ///<param name="lib">The name of the native library definining the event.</param>
150     ///<param name="key">The name of the native event.</param>
151     ///<param name="evtCaller">Delegate to be called by native code on event raising.</param>
152     ///<param name="evtDelegate">Managed delegate that will be called by evtCaller on event raising.</param>
153     private void AddNativeEventHandler(string lib, string key, Efl.EventCb evtCaller, object evtDelegate)
154     {
155         IntPtr desc = Efl.EventDescription.GetNative(lib, key);
156         if (desc == IntPtr.Zero)
157         {
158             Eina.Log.Error($"Failed to get native event {key}");
159         }
160
161         if (eoEvents.ContainsKey((desc, evtDelegate)))
162         {
163             Eina.Log.Warning($"Event proxy for event {key} already registered!");
164             return;
165         }
166
167         IntPtr evtCallerPtr = Marshal.GetFunctionPointerForDelegate(evtCaller);
168         if (!Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evtCallerPtr, IntPtr.Zero))
169         {
170             Eina.Log.Error($"Failed to add event proxy for event {key}");
171             return;
172         }
173
174         eoEvents[(desc, evtDelegate)] = (evtCallerPtr, evtCaller);
175         Eina.Error.RaiseIfUnhandledException();
176     }
177
178     ///<summary>Removes the given event handler for the given event. For internal use only.</summary>
179     ///<param name="lib">The name of the native library definining the event.</param>
180     ///<param name="key">The name of the native event.</param>
181     ///<param name="evtDelegate">The delegate to be removed.</param>
182     private void RemoveNativeEventHandler(string lib, string key, object evtDelegate)
183     {
184         IntPtr desc = Efl.EventDescription.GetNative(lib, key);
185         if (desc == IntPtr.Zero)
186         {
187             Eina.Log.Error($"Failed to get native event {key}");
188             return;
189         }
190
191         var evtPair = (desc, evtDelegate);
192         if (eoEvents.TryGetValue(evtPair, out var caller))
193         {
194             if (!Efl.Eo.Globals.efl_event_callback_del(handle, desc, caller.evtCallerPtr, IntPtr.Zero))
195             {
196                 Eina.Log.Error($"Failed to remove event proxy for event {key}");
197                 return;
198             }
199
200             eoEvents.Remove(evtPair);
201             Eina.Error.RaiseIfUnhandledException();
202         }
203         else
204         {
205             Eina.Log.Error($"Trying to remove proxy for event {key} when it is nothing registered.");
206         }
207     }
208
209     /// <summary>Event triggered when an item has been successfully created.</summary>
210     public event EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> CreatedEvt
211     {
212         add
213         {
214             lock (eventLock)
215             {
216                 var wRef = new WeakReference(this);
217                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
218                 {
219                     var obj = wRef.Target as Efl.Eo.IWrapper;
220                     if (obj != null)
221                     {
222                                                 Efl.Ui.IFactoryCreatedEvt_Args args = new Efl.Ui.IFactoryCreatedEvt_Args();
223                         args.arg =  evt.Info;
224                         try
225                         {
226                             value?.Invoke(obj, args);
227                         }
228                         catch (Exception e)
229                         {
230                             Eina.Log.Error(e.ToString());
231                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
232                         }
233                     }
234                 };
235
236                 string key = "_EFL_UI_FACTORY_EVENT_CREATED";
237                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
238             }
239         }
240
241         remove
242         {
243             lock (eventLock)
244             {
245                 string key = "_EFL_UI_FACTORY_EVENT_CREATED";
246                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
247             }
248         }
249     }
250     ///<summary>Method to raise event CreatedEvt.</summary>
251     public void OnCreatedEvt(Efl.Ui.IFactoryCreatedEvt_Args e)
252     {
253         var key = "_EFL_UI_FACTORY_EVENT_CREATED";
254         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
255         if (desc == IntPtr.Zero)
256         {
257             Eina.Log.Error($"Failed to get native event {key}");
258             return;
259         }
260
261         IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
262         try
263         {
264             Marshal.StructureToPtr(e.arg, info, false);
265             Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
266         }
267         finally
268         {
269             Marshal.FreeHGlobal(info);
270         }
271     }
272     /// <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>
273     public event EventHandler<Efl.Ui.IPropertyBindPropertiesChangedEvt_Args> PropertiesChangedEvt
274     {
275         add
276         {
277             lock (eventLock)
278             {
279                 var wRef = new WeakReference(this);
280                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
281                 {
282                     var obj = wRef.Target as Efl.Eo.IWrapper;
283                     if (obj != null)
284                     {
285                                                 Efl.Ui.IPropertyBindPropertiesChangedEvt_Args args = new Efl.Ui.IPropertyBindPropertiesChangedEvt_Args();
286                         args.arg =  evt.Info;
287                         try
288                         {
289                             value?.Invoke(obj, args);
290                         }
291                         catch (Exception e)
292                         {
293                             Eina.Log.Error(e.ToString());
294                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
295                         }
296                     }
297                 };
298
299                 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
300                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
301             }
302         }
303
304         remove
305         {
306             lock (eventLock)
307             {
308                 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
309                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
310             }
311         }
312     }
313     ///<summary>Method to raise event PropertiesChangedEvt.</summary>
314     public void OnPropertiesChangedEvt(Efl.Ui.IPropertyBindPropertiesChangedEvt_Args e)
315     {
316         var key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
317         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
318         if (desc == IntPtr.Zero)
319         {
320             Eina.Log.Error($"Failed to get native event {key}");
321             return;
322         }
323
324         IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
325         try
326         {
327             Marshal.StructureToPtr(e.arg, info, false);
328             Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
329         }
330         finally
331         {
332             Marshal.FreeHGlobal(info);
333         }
334     }
335     /// <summary>Event dispatched when a property on the object is bound to a model. This is useful to not overgenerate event.</summary>
336     public event EventHandler<Efl.Ui.IPropertyBindPropertyBoundEvt_Args> PropertyBoundEvt
337     {
338         add
339         {
340             lock (eventLock)
341             {
342                 var wRef = new WeakReference(this);
343                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
344                 {
345                     var obj = wRef.Target as Efl.Eo.IWrapper;
346                     if (obj != null)
347                     {
348                                                 Efl.Ui.IPropertyBindPropertyBoundEvt_Args args = new Efl.Ui.IPropertyBindPropertyBoundEvt_Args();
349                         args.arg = Eina.StringConversion.NativeUtf8ToManagedString(evt.Info);
350                         try
351                         {
352                             value?.Invoke(obj, args);
353                         }
354                         catch (Exception e)
355                         {
356                             Eina.Log.Error(e.ToString());
357                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
358                         }
359                     }
360                 };
361
362                 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
363                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
364             }
365         }
366
367         remove
368         {
369             lock (eventLock)
370             {
371                 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
372                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
373             }
374         }
375     }
376     ///<summary>Method to raise event PropertyBoundEvt.</summary>
377     public void OnPropertyBoundEvt(Efl.Ui.IPropertyBindPropertyBoundEvt_Args e)
378     {
379         var key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
380         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
381         if (desc == IntPtr.Zero)
382         {
383             Eina.Log.Error($"Failed to get native event {key}");
384             return;
385         }
386
387         IntPtr info = Eina.StringConversion.ManagedStringToNativeUtf8Alloc(e.arg);
388         try
389         {
390             Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
391         }
392         finally
393         {
394             Eina.MemoryNative.Free(info);
395         }
396     }
397     /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
398     /// <param name="model">Efl model</param>
399     /// <param name="parent">Efl canvas</param>
400     /// <returns>Created UI object</returns>
401     public  Eina.Future Create(Efl.IModel model, Efl.Gfx.IEntity parent) {
402                                                          var _ret_var = Efl.Ui.IFactoryConcrete.NativeMethods.efl_ui_factory_create_ptr.Value.Delegate(this.NativeHandle,model, parent);
403         Eina.Error.RaiseIfUnhandledException();
404                                         return _ret_var;
405  }
406     /// <summary>Release a UI object and disconnect from models.</summary>
407     /// <param name="ui_view">Efl canvas</param>
408     public void Release(Efl.Gfx.IEntity ui_view) {
409                                  Efl.Ui.IFactoryConcrete.NativeMethods.efl_ui_factory_release_ptr.Value.Delegate(this.NativeHandle,ui_view);
410         Eina.Error.RaiseIfUnhandledException();
411                          }
412     /// <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>
413     /// <param name="key">Key string for bind model property data</param>
414     /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
415     public void FactoryBind(System.String key, Efl.Ui.IFactory factory) {
416                                                          Efl.Ui.IFactoryBindConcrete.NativeMethods.efl_ui_factory_bind_ptr.Value.Delegate(this.NativeHandle,key, factory);
417         Eina.Error.RaiseIfUnhandledException();
418                                          }
419     /// <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>
420     /// <param name="key">key string for bind model property data</param>
421     /// <param name="property">Model property name</param>
422     /// <returns>0 when it succeed, an error code otherwise.</returns>
423     public Eina.Error PropertyBind(System.String key, System.String property) {
424                                                          var _ret_var = Efl.Ui.IPropertyBindConcrete.NativeMethods.efl_ui_property_bind_ptr.Value.Delegate(this.NativeHandle,key, property);
425         Eina.Error.RaiseIfUnhandledException();
426                                         return _ret_var;
427  }
428     public System.Threading.Tasks.Task<Eina.Value> CreateAsync(Efl.IModel model,Efl.Gfx.IEntity parent, System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
429     {
430         Eina.Future future = Create( model, parent);
431         return Efl.Eo.Globals.WrapAsync(future, token);
432     }
433     private static IntPtr GetEflClassStatic()
434     {
435         return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
436     }
437     /// <summary>Wrapper for native methods and virtual method delegates.
438     /// For internal use by generated code only.</summary>
439     public class NativeMethods  : Efl.Eo.NativeClass
440     {
441         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
442         /// <summary>Gets the list of Eo operations to override.</summary>
443         /// <returns>The list of Eo operations to be overload.</returns>
444         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
445         {
446             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
447             var methods = Efl.Eo.Globals.GetUserMethods(type);
448
449             if (efl_ui_factory_create_static_delegate == null)
450             {
451                 efl_ui_factory_create_static_delegate = new efl_ui_factory_create_delegate(create);
452             }
453
454             if (methods.FirstOrDefault(m => m.Name == "Create") != null)
455             {
456                 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) });
457             }
458
459             if (efl_ui_factory_release_static_delegate == null)
460             {
461                 efl_ui_factory_release_static_delegate = new efl_ui_factory_release_delegate(release);
462             }
463
464             if (methods.FirstOrDefault(m => m.Name == "Release") != null)
465             {
466                 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) });
467             }
468
469             if (efl_ui_factory_bind_static_delegate == null)
470             {
471                 efl_ui_factory_bind_static_delegate = new efl_ui_factory_bind_delegate(factory_bind);
472             }
473
474             if (methods.FirstOrDefault(m => m.Name == "FactoryBind") != null)
475             {
476                 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) });
477             }
478
479             if (efl_ui_property_bind_static_delegate == null)
480             {
481                 efl_ui_property_bind_static_delegate = new efl_ui_property_bind_delegate(property_bind);
482             }
483
484             if (methods.FirstOrDefault(m => m.Name == "PropertyBind") != null)
485             {
486                 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) });
487             }
488
489             return descs;
490         }
491         /// <summary>Returns the Eo class for the native methods of this class.</summary>
492         /// <returns>The native class pointer.</returns>
493         public override IntPtr GetEflClass()
494         {
495             return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
496         }
497
498         #pragma warning disable CA1707, SA1300, SA1600
499
500         [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
501         private delegate  Eina.Future efl_ui_factory_create_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.IModel model, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity parent);
502
503         [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
504         public delegate  Eina.Future efl_ui_factory_create_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.IModel model, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity parent);
505
506         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");
507
508         private static  Eina.Future create(System.IntPtr obj, System.IntPtr pd, Efl.IModel model, Efl.Gfx.IEntity parent)
509         {
510             Eina.Log.Debug("function efl_ui_factory_create was called");
511             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
512             if (wrapper != null)
513             {
514                                                              Eina.Future _ret_var = default( Eina.Future);
515                 try
516                 {
517                     _ret_var = ((IFactory)wrapper).Create(model, parent);
518                 }
519                 catch (Exception e)
520                 {
521                     Eina.Log.Warning($"Callback error: {e.ToString()}");
522                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
523                 }
524
525                                         return _ret_var;
526
527             }
528             else
529             {
530                 return efl_ui_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), model, parent);
531             }
532         }
533
534         private static efl_ui_factory_create_delegate efl_ui_factory_create_static_delegate;
535
536         
537         private delegate void efl_ui_factory_release_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity ui_view);
538
539         
540         public delegate void efl_ui_factory_release_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity ui_view);
541
542         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");
543
544         private static void release(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity ui_view)
545         {
546             Eina.Log.Debug("function efl_ui_factory_release was called");
547             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
548             if (wrapper != null)
549             {
550                                     
551                 try
552                 {
553                     ((IFactory)wrapper).Release(ui_view);
554                 }
555                 catch (Exception e)
556                 {
557                     Eina.Log.Warning($"Callback error: {e.ToString()}");
558                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
559                 }
560
561                         
562             }
563             else
564             {
565                 efl_ui_factory_release_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ui_view);
566             }
567         }
568
569         private static efl_ui_factory_release_delegate efl_ui_factory_release_static_delegate;
570
571         
572         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);
573
574         
575         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);
576
577         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");
578
579         private static void factory_bind(System.IntPtr obj, System.IntPtr pd, System.String key, Efl.Ui.IFactory factory)
580         {
581             Eina.Log.Debug("function efl_ui_factory_bind was called");
582             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
583             if (wrapper != null)
584             {
585                                                             
586                 try
587                 {
588                     ((IFactory)wrapper).FactoryBind(key, factory);
589                 }
590                 catch (Exception e)
591                 {
592                     Eina.Log.Warning($"Callback error: {e.ToString()}");
593                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
594                 }
595
596                                         
597             }
598             else
599             {
600                 efl_ui_factory_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, factory);
601             }
602         }
603
604         private static efl_ui_factory_bind_delegate efl_ui_factory_bind_static_delegate;
605
606         
607         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);
608
609         
610         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);
611
612         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");
613
614         private static Eina.Error property_bind(System.IntPtr obj, System.IntPtr pd, System.String key, System.String property)
615         {
616             Eina.Log.Debug("function efl_ui_property_bind was called");
617             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
618             if (wrapper != null)
619             {
620                                                             Eina.Error _ret_var = default(Eina.Error);
621                 try
622                 {
623                     _ret_var = ((IFactory)wrapper).PropertyBind(key, property);
624                 }
625                 catch (Exception e)
626                 {
627                     Eina.Log.Warning($"Callback error: {e.ToString()}");
628                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
629                 }
630
631                                         return _ret_var;
632
633             }
634             else
635             {
636                 return efl_ui_property_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, property);
637             }
638         }
639
640         private static efl_ui_property_bind_delegate efl_ui_property_bind_static_delegate;
641
642         #pragma warning restore CA1707, SA1300, SA1600
643
644 }
645 }
646 }
647
648 }
649
650 namespace Efl {
651
652 namespace Ui {
653
654 /// <summary>EFL Ui Factory event structure provided when an item was just created.</summary>
655 [StructLayout(LayoutKind.Sequential)]
656 public struct FactoryItemCreatedEvent
657 {
658     /// <summary>The model already set on the new item.</summary>
659     public Efl.IModel Model;
660     /// <summary>The item that was just created.</summary>
661     public Efl.Gfx.IEntity Item;
662     ///<summary>Constructor for FactoryItemCreatedEvent.</summary>
663     public FactoryItemCreatedEvent(
664         Efl.IModel Model = default(Efl.IModel),
665         Efl.Gfx.IEntity Item = default(Efl.Gfx.IEntity)    )
666     {
667         this.Model = Model;
668         this.Item = Item;
669     }
670
671     public static implicit operator FactoryItemCreatedEvent(IntPtr ptr)
672     {
673         var tmp = (FactoryItemCreatedEvent.NativeStruct)Marshal.PtrToStructure(ptr, typeof(FactoryItemCreatedEvent.NativeStruct));
674         return tmp;
675     }
676
677     ///<summary>Internal wrapper for struct FactoryItemCreatedEvent.</summary>
678     [StructLayout(LayoutKind.Sequential)]
679     public struct NativeStruct
680     {
681         ///<summary>Internal wrapper for field Model</summary>
682         public System.IntPtr Model;
683         ///<summary>Internal wrapper for field Item</summary>
684         public System.IntPtr Item;
685         ///<summary>Implicit conversion to the internal/marshalling representation.</summary>
686         public static implicit operator FactoryItemCreatedEvent.NativeStruct(FactoryItemCreatedEvent _external_struct)
687         {
688             var _internal_struct = new FactoryItemCreatedEvent.NativeStruct();
689             _internal_struct.Model = _external_struct.Model?.NativeHandle ?? System.IntPtr.Zero;
690             _internal_struct.Item = _external_struct.Item?.NativeHandle ?? System.IntPtr.Zero;
691             return _internal_struct;
692         }
693
694         ///<summary>Implicit conversion to the managed representation.</summary>
695         public static implicit operator FactoryItemCreatedEvent(FactoryItemCreatedEvent.NativeStruct _internal_struct)
696         {
697             var _external_struct = new FactoryItemCreatedEvent();
698
699             _external_struct.Model = (Efl.IModelConcrete) Efl.Eo.Globals.CreateWrapperFor(_internal_struct.Model);
700
701             _external_struct.Item = (Efl.Gfx.IEntityConcrete) Efl.Eo.Globals.CreateWrapperFor(_internal_struct.Item);
702             return _external_struct;
703         }
704
705     }
706
707 }
708
709 }
710
711 }
712