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