[EflSharp] Update Circle and efl cs files (#819)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_canvas_layout_part_swallow.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 Canvas {
11
12 /// <summary>Represents a SWALLOW part of an Edje object.
13 /// Its lifetime is limited to one function call only, unless an extra reference is explicitely held.</summary>
14 [Efl.Canvas.LayoutPartSwallow.NativeMethods]
15 public class LayoutPartSwallow : Efl.Canvas.LayoutPart, Efl.Eo.IWrapper,Efl.IContent
16 {
17     ///<summary>Pointer to the native class description.</summary>
18     public override System.IntPtr NativeClass
19     {
20         get
21         {
22             if (((object)this).GetType() == typeof(LayoutPartSwallow))
23             {
24                 return GetEflClassStatic();
25             }
26             else
27             {
28                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
29             }
30         }
31     }
32
33     [System.Runtime.InteropServices.DllImport(efl.Libs.Edje)] internal static extern System.IntPtr
34         efl_canvas_layout_part_swallow_class_get();
35     /// <summary>Initializes a new instance of the <see cref="LayoutPartSwallow"/> class.</summary>
36     /// <param name="parent">Parent instance.</param>
37     public LayoutPartSwallow(Efl.Object parent= null
38             ) : base(efl_canvas_layout_part_swallow_class_get(), typeof(LayoutPartSwallow), parent)
39     {
40         FinishInstantiation();
41     }
42
43     /// <summary>Initializes a new instance of the <see cref="LayoutPartSwallow"/> class.
44     /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
45     /// <param name="raw">The native pointer to be wrapped.</param>
46     protected LayoutPartSwallow(System.IntPtr raw) : base(raw)
47     {
48             }
49
50     /// <summary>Initializes a new instance of the <see cref="LayoutPartSwallow"/> class.
51     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
52     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
53     /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
54     /// <param name="parent">The Efl.Object parent of this instance.</param>
55     protected LayoutPartSwallow(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
56     {
57     }
58
59     /// <summary>Verifies if the given object is equal to this one.</summary>
60     /// <param name="instance">The object to compare to.</param>
61     /// <returns>True if both objects point to the same native object.</returns>
62     public override bool Equals(object instance)
63     {
64         var other = instance as Efl.Object;
65         if (other == null)
66         {
67             return false;
68         }
69         return this.NativeHandle == other.NativeHandle;
70     }
71
72     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
73     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
74     public override int GetHashCode()
75     {
76         return this.NativeHandle.ToInt32();
77     }
78
79     /// <summary>Turns the native pointer into a string representation.</summary>
80     /// <returns>A string with the type and the native pointer for this object.</returns>
81     public override String ToString()
82     {
83         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
84     }
85
86     /// <summary>Sent after the content is set or unset using the current content object.
87     /// (Since EFL 1.22)</summary>
88     public event EventHandler<Efl.IContentContentChangedEvt_Args> ContentChangedEvt
89     {
90         add
91         {
92             lock (eventLock)
93             {
94                 var wRef = new WeakReference(this);
95                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
96                 {
97                     var obj = wRef.Target as Efl.Eo.IWrapper;
98                     if (obj != null)
99                     {
100                                                 Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
101                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
102                         try
103                         {
104                             value?.Invoke(obj, args);
105                         }
106                         catch (Exception e)
107                         {
108                             Eina.Log.Error(e.ToString());
109                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
110                         }
111                     }
112                 };
113
114                 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
115                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
116             }
117         }
118
119         remove
120         {
121             lock (eventLock)
122             {
123                 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
124                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
125             }
126         }
127     }
128     ///<summary>Method to raise event ContentChangedEvt.</summary>
129     public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
130     {
131         var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
132         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
133         if (desc == IntPtr.Zero)
134         {
135             Eina.Log.Error($"Failed to get native event {key}");
136             return;
137         }
138
139         IntPtr info = e.arg.NativeHandle;
140         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
141     }
142     /// <summary>Sub-object currently set as this object&apos;s single content.
143     /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
144     /// (Since EFL 1.22)</summary>
145     /// <returns>The sub-object.</returns>
146     virtual public Efl.Gfx.IEntity GetContent() {
147          var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
148         Eina.Error.RaiseIfUnhandledException();
149         return _ret_var;
150  }
151     /// <summary>Sub-object currently set as this object&apos;s single content.
152     /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
153     /// (Since EFL 1.22)</summary>
154     /// <param name="content">The sub-object.</param>
155     /// <returns><c>true</c> if <c>content</c> was successfully swallowed.</returns>
156     virtual public bool SetContent(Efl.Gfx.IEntity content) {
157                                  var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),content);
158         Eina.Error.RaiseIfUnhandledException();
159                         return _ret_var;
160  }
161     /// <summary>Remove the sub-object currently set as content of this object and return it. This object becomes empty.
162     /// (Since EFL 1.22)</summary>
163     /// <returns>Unswallowed object</returns>
164     virtual public Efl.Gfx.IEntity UnsetContent() {
165          var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
166         Eina.Error.RaiseIfUnhandledException();
167         return _ret_var;
168  }
169     /// <summary>Sub-object currently set as this object&apos;s single content.
170 /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
171 /// (Since EFL 1.22)</summary>
172 /// <value>The sub-object.</value>
173     public Efl.Gfx.IEntity Content {
174         get { return GetContent(); }
175         set { SetContent(value); }
176     }
177     private static IntPtr GetEflClassStatic()
178     {
179         return Efl.Canvas.LayoutPartSwallow.efl_canvas_layout_part_swallow_class_get();
180     }
181     /// <summary>Wrapper for native methods and virtual method delegates.
182     /// For internal use by generated code only.</summary>
183     public new class NativeMethods : Efl.Canvas.LayoutPart.NativeMethods
184     {
185         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Edje);
186         /// <summary>Gets the list of Eo operations to override.</summary>
187         /// <returns>The list of Eo operations to be overload.</returns>
188         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
189         {
190             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
191             var methods = Efl.Eo.Globals.GetUserMethods(type);
192
193             if (efl_content_get_static_delegate == null)
194             {
195                 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
196             }
197
198             if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
199             {
200                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_get"), func = Marshal.GetFunctionPointerForDelegate(efl_content_get_static_delegate) });
201             }
202
203             if (efl_content_set_static_delegate == null)
204             {
205                 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
206             }
207
208             if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
209             {
210                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_set"), func = Marshal.GetFunctionPointerForDelegate(efl_content_set_static_delegate) });
211             }
212
213             if (efl_content_unset_static_delegate == null)
214             {
215                 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
216             }
217
218             if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
219             {
220                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_unset"), func = Marshal.GetFunctionPointerForDelegate(efl_content_unset_static_delegate) });
221             }
222
223             descs.AddRange(base.GetEoOps(type));
224             return descs;
225         }
226         /// <summary>Returns the Eo class for the native methods of this class.</summary>
227         /// <returns>The native class pointer.</returns>
228         public override IntPtr GetEflClass()
229         {
230             return Efl.Canvas.LayoutPartSwallow.efl_canvas_layout_part_swallow_class_get();
231         }
232
233         #pragma warning disable CA1707, SA1300, SA1600
234
235         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
236         private delegate Efl.Gfx.IEntity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
237
238         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
239         public delegate Efl.Gfx.IEntity efl_content_get_api_delegate(System.IntPtr obj);
240
241         public static Efl.Eo.FunctionWrapper<efl_content_get_api_delegate> efl_content_get_ptr = new Efl.Eo.FunctionWrapper<efl_content_get_api_delegate>(Module, "efl_content_get");
242
243         private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
244         {
245             Eina.Log.Debug("function efl_content_get was called");
246             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
247             if (wrapper != null)
248             {
249             Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
250                 try
251                 {
252                     _ret_var = ((LayoutPartSwallow)wrapper).GetContent();
253                 }
254                 catch (Exception e)
255                 {
256                     Eina.Log.Warning($"Callback error: {e.ToString()}");
257                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
258                 }
259
260         return _ret_var;
261
262             }
263             else
264             {
265                 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
266             }
267         }
268
269         private static efl_content_get_delegate efl_content_get_static_delegate;
270
271         [return: MarshalAs(UnmanagedType.U1)]
272         private delegate bool efl_content_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
273
274         [return: MarshalAs(UnmanagedType.U1)]
275         public delegate bool efl_content_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
276
277         public static Efl.Eo.FunctionWrapper<efl_content_set_api_delegate> efl_content_set_ptr = new Efl.Eo.FunctionWrapper<efl_content_set_api_delegate>(Module, "efl_content_set");
278
279         private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
280         {
281             Eina.Log.Debug("function efl_content_set was called");
282             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
283             if (wrapper != null)
284             {
285                                     bool _ret_var = default(bool);
286                 try
287                 {
288                     _ret_var = ((LayoutPartSwallow)wrapper).SetContent(content);
289                 }
290                 catch (Exception e)
291                 {
292                     Eina.Log.Warning($"Callback error: {e.ToString()}");
293                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
294                 }
295
296                         return _ret_var;
297
298             }
299             else
300             {
301                 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
302             }
303         }
304
305         private static efl_content_set_delegate efl_content_set_static_delegate;
306
307         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
308         private delegate Efl.Gfx.IEntity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
309
310         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
311         public delegate Efl.Gfx.IEntity efl_content_unset_api_delegate(System.IntPtr obj);
312
313         public static Efl.Eo.FunctionWrapper<efl_content_unset_api_delegate> efl_content_unset_ptr = new Efl.Eo.FunctionWrapper<efl_content_unset_api_delegate>(Module, "efl_content_unset");
314
315         private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
316         {
317             Eina.Log.Debug("function efl_content_unset was called");
318             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
319             if (wrapper != null)
320             {
321             Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
322                 try
323                 {
324                     _ret_var = ((LayoutPartSwallow)wrapper).UnsetContent();
325                 }
326                 catch (Exception e)
327                 {
328                     Eina.Log.Warning($"Callback error: {e.ToString()}");
329                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
330                 }
331
332         return _ret_var;
333
334             }
335             else
336             {
337                 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
338             }
339         }
340
341         private static efl_content_unset_delegate efl_content_unset_static_delegate;
342
343         #pragma warning restore CA1707, SA1300, SA1600
344
345 }
346 }
347 }
348
349 }
350