[EflSharp] Update Circle and efl cs files (#945)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_container.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 /// <summary>Common interface for objects (containers) that can have multiple contents (sub-objects).
11 /// APIs in this interface deal with containers of multiple sub-objects, not with individual parts.
12 /// (Since EFL 1.22)</summary>
13 [Efl.IContainerConcrete.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public interface IContainer : 
16     Efl.Eo.IWrapper, IDisposable
17 {
18     /// <summary>Begin iterating over this object&apos;s contents.
19 /// (Since EFL 1.22)</summary>
20 /// <returns>Iterator on object&apos;s content.</returns>
21 Eina.Iterator<Efl.Gfx.IEntity> ContentIterate();
22     /// <summary>Returns the number of contained sub-objects.
23 /// (Since EFL 1.22)</summary>
24 /// <returns>Number of sub-objects.</returns>
25 int ContentCount();
26             /// <summary>Sent after a new sub-object was added.
27     /// (Since EFL 1.22)</summary>
28     event EventHandler<Efl.IContainerContentAddedEvt_Args> ContentAddedEvt;
29     /// <summary>Sent after a sub-object was removed, before unref.
30     /// (Since EFL 1.22)</summary>
31     event EventHandler<Efl.IContainerContentRemovedEvt_Args> ContentRemovedEvt;
32 }
33 ///<summary>Event argument wrapper for event <see cref="Efl.IContainer.ContentAddedEvt"/>.</summary>
34 [Efl.Eo.BindingEntity]
35 public class IContainerContentAddedEvt_Args : EventArgs {
36     ///<summary>Actual event payload.</summary>
37     public Efl.Gfx.IEntity arg { get; set; }
38 }
39 ///<summary>Event argument wrapper for event <see cref="Efl.IContainer.ContentRemovedEvt"/>.</summary>
40 [Efl.Eo.BindingEntity]
41 public class IContainerContentRemovedEvt_Args : EventArgs {
42     ///<summary>Actual event payload.</summary>
43     public Efl.Gfx.IEntity arg { get; set; }
44 }
45 /// <summary>Common interface for objects (containers) that can have multiple contents (sub-objects).
46 /// APIs in this interface deal with containers of multiple sub-objects, not with individual parts.
47 /// (Since EFL 1.22)</summary>
48 sealed public class IContainerConcrete :
49     Efl.Eo.EoWrapper
50     , IContainer
51     
52 {
53     ///<summary>Pointer to the native class description.</summary>
54     public override System.IntPtr NativeClass
55     {
56         get
57         {
58             if (((object)this).GetType() == typeof(IContainerConcrete))
59             {
60                 return GetEflClassStatic();
61             }
62             else
63             {
64                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
65             }
66         }
67     }
68
69     /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
70     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
71     private IContainerConcrete(ConstructingHandle ch) : base(ch)
72     {
73     }
74
75     [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
76         efl_container_interface_get();
77     /// <summary>Initializes a new instance of the <see cref="IContainer"/> class.
78     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
79     /// <param name="wh">The native pointer to be wrapped.</param>
80     private IContainerConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
81     {
82     }
83
84     /// <summary>Sent after a new sub-object was added.
85     /// (Since EFL 1.22)</summary>
86     public event EventHandler<Efl.IContainerContentAddedEvt_Args> ContentAddedEvt
87     {
88         add
89         {
90             lock (eflBindingEventLock)
91             {
92                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
93                 {
94                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
95                     if (obj != null)
96                     {
97                         Efl.IContainerContentAddedEvt_Args args = new Efl.IContainerContentAddedEvt_Args();
98                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
99                         try
100                         {
101                             value?.Invoke(obj, args);
102                         }
103                         catch (Exception e)
104                         {
105                             Eina.Log.Error(e.ToString());
106                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
107                         }
108                     }
109                 };
110
111                 string key = "_EFL_CONTAINER_EVENT_CONTENT_ADDED";
112                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
113             }
114         }
115
116         remove
117         {
118             lock (eflBindingEventLock)
119             {
120                 string key = "_EFL_CONTAINER_EVENT_CONTENT_ADDED";
121                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
122             }
123         }
124     }
125     ///<summary>Method to raise event ContentAddedEvt.</summary>
126     public void OnContentAddedEvt(Efl.IContainerContentAddedEvt_Args e)
127     {
128         var key = "_EFL_CONTAINER_EVENT_CONTENT_ADDED";
129         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
130         if (desc == IntPtr.Zero)
131         {
132             Eina.Log.Error($"Failed to get native event {key}");
133             return;
134         }
135
136         IntPtr info = e.arg.NativeHandle;
137         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
138     }
139     /// <summary>Sent after a sub-object was removed, before unref.
140     /// (Since EFL 1.22)</summary>
141     public event EventHandler<Efl.IContainerContentRemovedEvt_Args> ContentRemovedEvt
142     {
143         add
144         {
145             lock (eflBindingEventLock)
146             {
147                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
148                 {
149                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
150                     if (obj != null)
151                     {
152                         Efl.IContainerContentRemovedEvt_Args args = new Efl.IContainerContentRemovedEvt_Args();
153                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
154                         try
155                         {
156                             value?.Invoke(obj, args);
157                         }
158                         catch (Exception e)
159                         {
160                             Eina.Log.Error(e.ToString());
161                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
162                         }
163                     }
164                 };
165
166                 string key = "_EFL_CONTAINER_EVENT_CONTENT_REMOVED";
167                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
168             }
169         }
170
171         remove
172         {
173             lock (eflBindingEventLock)
174             {
175                 string key = "_EFL_CONTAINER_EVENT_CONTENT_REMOVED";
176                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
177             }
178         }
179     }
180     ///<summary>Method to raise event ContentRemovedEvt.</summary>
181     public void OnContentRemovedEvt(Efl.IContainerContentRemovedEvt_Args e)
182     {
183         var key = "_EFL_CONTAINER_EVENT_CONTENT_REMOVED";
184         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
185         if (desc == IntPtr.Zero)
186         {
187             Eina.Log.Error($"Failed to get native event {key}");
188             return;
189         }
190
191         IntPtr info = e.arg.NativeHandle;
192         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
193     }
194     /// <summary>Begin iterating over this object&apos;s contents.
195     /// (Since EFL 1.22)</summary>
196     /// <returns>Iterator on object&apos;s content.</returns>
197     public Eina.Iterator<Efl.Gfx.IEntity> ContentIterate() {
198          var _ret_var = Efl.IContainerConcrete.NativeMethods.efl_content_iterate_ptr.Value.Delegate(this.NativeHandle);
199         Eina.Error.RaiseIfUnhandledException();
200         return new Eina.Iterator<Efl.Gfx.IEntity>(_ret_var, true);
201  }
202     /// <summary>Returns the number of contained sub-objects.
203     /// (Since EFL 1.22)</summary>
204     /// <returns>Number of sub-objects.</returns>
205     public int ContentCount() {
206          var _ret_var = Efl.IContainerConcrete.NativeMethods.efl_content_count_ptr.Value.Delegate(this.NativeHandle);
207         Eina.Error.RaiseIfUnhandledException();
208         return _ret_var;
209  }
210     private static IntPtr GetEflClassStatic()
211     {
212         return Efl.IContainerConcrete.efl_container_interface_get();
213     }
214     /// <summary>Wrapper for native methods and virtual method delegates.
215     /// For internal use by generated code only.</summary>
216     public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
217     {
218         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
219         /// <summary>Gets the list of Eo operations to override.</summary>
220         /// <returns>The list of Eo operations to be overload.</returns>
221         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
222         {
223             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
224             var methods = Efl.Eo.Globals.GetUserMethods(type);
225
226             if (efl_content_iterate_static_delegate == null)
227             {
228                 efl_content_iterate_static_delegate = new efl_content_iterate_delegate(content_iterate);
229             }
230
231             if (methods.FirstOrDefault(m => m.Name == "ContentIterate") != null)
232             {
233                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_iterate"), func = Marshal.GetFunctionPointerForDelegate(efl_content_iterate_static_delegate) });
234             }
235
236             if (efl_content_count_static_delegate == null)
237             {
238                 efl_content_count_static_delegate = new efl_content_count_delegate(content_count);
239             }
240
241             if (methods.FirstOrDefault(m => m.Name == "ContentCount") != null)
242             {
243                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_count"), func = Marshal.GetFunctionPointerForDelegate(efl_content_count_static_delegate) });
244             }
245
246             return descs;
247         }
248         /// <summary>Returns the Eo class for the native methods of this class.</summary>
249         /// <returns>The native class pointer.</returns>
250         public override IntPtr GetEflClass()
251         {
252             return Efl.IContainerConcrete.efl_container_interface_get();
253         }
254
255         #pragma warning disable CA1707, CS1591, SA1300, SA1600
256
257         
258         private delegate System.IntPtr efl_content_iterate_delegate(System.IntPtr obj, System.IntPtr pd);
259
260         
261         public delegate System.IntPtr efl_content_iterate_api_delegate(System.IntPtr obj);
262
263         public static Efl.Eo.FunctionWrapper<efl_content_iterate_api_delegate> efl_content_iterate_ptr = new Efl.Eo.FunctionWrapper<efl_content_iterate_api_delegate>(Module, "efl_content_iterate");
264
265         private static System.IntPtr content_iterate(System.IntPtr obj, System.IntPtr pd)
266         {
267             Eina.Log.Debug("function efl_content_iterate was called");
268             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
269             if (ws != null)
270             {
271             Eina.Iterator<Efl.Gfx.IEntity> _ret_var = default(Eina.Iterator<Efl.Gfx.IEntity>);
272                 try
273                 {
274                     _ret_var = ((IContainer)ws.Target).ContentIterate();
275                 }
276                 catch (Exception e)
277                 {
278                     Eina.Log.Warning($"Callback error: {e.ToString()}");
279                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
280                 }
281
282         _ret_var.Own = false; return _ret_var.Handle;
283
284             }
285             else
286             {
287                 return efl_content_iterate_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
288             }
289         }
290
291         private static efl_content_iterate_delegate efl_content_iterate_static_delegate;
292
293         
294         private delegate int efl_content_count_delegate(System.IntPtr obj, System.IntPtr pd);
295
296         
297         public delegate int efl_content_count_api_delegate(System.IntPtr obj);
298
299         public static Efl.Eo.FunctionWrapper<efl_content_count_api_delegate> efl_content_count_ptr = new Efl.Eo.FunctionWrapper<efl_content_count_api_delegate>(Module, "efl_content_count");
300
301         private static int content_count(System.IntPtr obj, System.IntPtr pd)
302         {
303             Eina.Log.Debug("function efl_content_count was called");
304             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
305             if (ws != null)
306             {
307             int _ret_var = default(int);
308                 try
309                 {
310                     _ret_var = ((IContainer)ws.Target).ContentCount();
311                 }
312                 catch (Exception e)
313                 {
314                     Eina.Log.Warning($"Callback error: {e.ToString()}");
315                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
316                 }
317
318         return _ret_var;
319
320             }
321             else
322             {
323                 return efl_content_count_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
324             }
325         }
326
327         private static efl_content_count_delegate efl_content_count_static_delegate;
328
329         #pragma warning restore CA1707, CS1591, SA1300, SA1600
330
331 }
332 }
333 }
334