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