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