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