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