[Security] Fix PrivacyPrivilegeManager.RequestPermissions crash issue (#1651)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_pack_layout.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 /// <summary>Low-level APIs for object that can lay their children out.
12 /// Used for containers (box, grid).</summary>
13 /// <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>
14 [Efl.IPackLayoutConcrete.NativeMethods]
15 [Efl.Eo.BindingEntity]
16 public interface IPackLayout : 
17     Efl.Eo.IWrapper, IDisposable
18 {
19     /// <summary>Requests EFL to call the <see cref="Efl.IPackLayout.UpdateLayout"/> method on this object.
20 /// This <see cref="Efl.IPackLayout.UpdateLayout"/> may be called asynchronously.</summary>
21 void LayoutRequest();
22     /// <summary>Implementation of this container&apos;s layout algorithm.
23 /// EFL will call this function whenever the contents of this container need to be re-laid out on the canvas.
24 /// 
25 /// This can be overriden to implement custom layout behaviors.</summary>
26 void UpdateLayout();
27             /// <summary>Sent after the layout was updated.</summary>
28     event EventHandler LayoutUpdatedEvt;
29 }
30 /// <summary>Low-level APIs for object that can lay their children out.
31 /// Used for containers (box, grid).</summary>
32 /// <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>
33 sealed public  class IPackLayoutConcrete :
34     Efl.Eo.EoWrapper
35     , IPackLayout
36     
37 {
38     /// <summary>Pointer to the native class description.</summary>
39     public override System.IntPtr NativeClass
40     {
41         get
42         {
43             if (((object)this).GetType() == typeof(IPackLayoutConcrete))
44             {
45                 return GetEflClassStatic();
46             }
47             else
48             {
49                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
50             }
51         }
52     }
53
54     /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
55     /// Do not call this constructor directly.</summary>
56     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
57     private IPackLayoutConcrete(ConstructingHandle ch) : base(ch)
58     {
59     }
60
61     [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
62         efl_pack_layout_interface_get();
63     /// <summary>Initializes a new instance of the <see cref="IPackLayout"/> class.
64     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
65     /// <param name="wh">The native pointer to be wrapped.</param>
66     private IPackLayoutConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
67     {
68     }
69
70     /// <summary>Sent after the layout was updated.</summary>
71     public event EventHandler LayoutUpdatedEvt
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                         EventArgs args = EventArgs.Empty;
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_PACK_EVENT_LAYOUT_UPDATED";
96                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
97             }
98         }
99
100         remove
101         {
102             lock (eflBindingEventLock)
103             {
104                 string key = "_EFL_PACK_EVENT_LAYOUT_UPDATED";
105                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
106             }
107         }
108     }
109     /// <summary>Method to raise event LayoutUpdatedEvt.</summary>
110     public void OnLayoutUpdatedEvt(EventArgs e)
111     {
112         var key = "_EFL_PACK_EVENT_LAYOUT_UPDATED";
113         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
114         if (desc == IntPtr.Zero)
115         {
116             Eina.Log.Error($"Failed to get native event {key}");
117             return;
118         }
119
120         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
121     }
122     /// <summary>Requests EFL to call the <see cref="Efl.IPackLayout.UpdateLayout"/> method on this object.
123     /// This <see cref="Efl.IPackLayout.UpdateLayout"/> may be called asynchronously.</summary>
124     public void LayoutRequest() {
125          Efl.IPackLayoutConcrete.NativeMethods.efl_pack_layout_request_ptr.Value.Delegate(this.NativeHandle);
126         Eina.Error.RaiseIfUnhandledException();
127          }
128     /// <summary>Implementation of this container&apos;s layout algorithm.
129     /// EFL will call this function whenever the contents of this container need to be re-laid out on the canvas.
130     /// 
131     /// This can be overriden to implement custom layout behaviors.</summary>
132     public void UpdateLayout() {
133          Efl.IPackLayoutConcrete.NativeMethods.efl_pack_layout_update_ptr.Value.Delegate(this.NativeHandle);
134         Eina.Error.RaiseIfUnhandledException();
135          }
136     private static IntPtr GetEflClassStatic()
137     {
138         return Efl.IPackLayoutConcrete.efl_pack_layout_interface_get();
139     }
140     /// <summary>Wrapper for native methods and virtual method delegates.
141     /// For internal use by generated code only.</summary>
142     public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
143     {
144         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
145         /// <summary>Gets the list of Eo operations to override.</summary>
146         /// <returns>The list of Eo operations to be overload.</returns>
147         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
148         {
149             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
150             var methods = Efl.Eo.Globals.GetUserMethods(type);
151
152             if (efl_pack_layout_request_static_delegate == null)
153             {
154                 efl_pack_layout_request_static_delegate = new efl_pack_layout_request_delegate(layout_request);
155             }
156
157             if (methods.FirstOrDefault(m => m.Name == "LayoutRequest") != null)
158             {
159                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_pack_layout_request"), func = Marshal.GetFunctionPointerForDelegate(efl_pack_layout_request_static_delegate) });
160             }
161
162             if (efl_pack_layout_update_static_delegate == null)
163             {
164                 efl_pack_layout_update_static_delegate = new efl_pack_layout_update_delegate(layout_update);
165             }
166
167             if (methods.FirstOrDefault(m => m.Name == "UpdateLayout") != null)
168             {
169                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_pack_layout_update"), func = Marshal.GetFunctionPointerForDelegate(efl_pack_layout_update_static_delegate) });
170             }
171
172             return descs;
173         }
174         /// <summary>Returns the Eo class for the native methods of this class.</summary>
175         /// <returns>The native class pointer.</returns>
176         public override IntPtr GetEflClass()
177         {
178             return Efl.IPackLayoutConcrete.efl_pack_layout_interface_get();
179         }
180
181         #pragma warning disable CA1707, CS1591, SA1300, SA1600
182
183         
184         private delegate void efl_pack_layout_request_delegate(System.IntPtr obj, System.IntPtr pd);
185
186         
187         public delegate void efl_pack_layout_request_api_delegate(System.IntPtr obj);
188
189         public static Efl.Eo.FunctionWrapper<efl_pack_layout_request_api_delegate> efl_pack_layout_request_ptr = new Efl.Eo.FunctionWrapper<efl_pack_layout_request_api_delegate>(Module, "efl_pack_layout_request");
190
191         private static void layout_request(System.IntPtr obj, System.IntPtr pd)
192         {
193             Eina.Log.Debug("function efl_pack_layout_request was called");
194             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
195             if (ws != null)
196             {
197             
198                 try
199                 {
200                     ((IPackLayout)ws.Target).LayoutRequest();
201                 }
202                 catch (Exception e)
203                 {
204                     Eina.Log.Warning($"Callback error: {e.ToString()}");
205                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
206                 }
207
208         
209             }
210             else
211             {
212                 efl_pack_layout_request_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
213             }
214         }
215
216         private static efl_pack_layout_request_delegate efl_pack_layout_request_static_delegate;
217
218         
219         private delegate void efl_pack_layout_update_delegate(System.IntPtr obj, System.IntPtr pd);
220
221         
222         public delegate void efl_pack_layout_update_api_delegate(System.IntPtr obj);
223
224         public static Efl.Eo.FunctionWrapper<efl_pack_layout_update_api_delegate> efl_pack_layout_update_ptr = new Efl.Eo.FunctionWrapper<efl_pack_layout_update_api_delegate>(Module, "efl_pack_layout_update");
225
226         private static void layout_update(System.IntPtr obj, System.IntPtr pd)
227         {
228             Eina.Log.Debug("function efl_pack_layout_update was called");
229             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
230             if (ws != null)
231             {
232             
233                 try
234                 {
235                     ((IPackLayout)ws.Target).UpdateLayout();
236                 }
237                 catch (Exception e)
238                 {
239                     Eina.Log.Warning($"Callback error: {e.ToString()}");
240                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
241                 }
242
243         
244             }
245             else
246             {
247                 efl_pack_layout_update_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
248             }
249         }
250
251         private static efl_pack_layout_update_delegate efl_pack_layout_update_static_delegate;
252
253         #pragma warning restore CA1707, CS1591, SA1300, SA1600
254
255 }
256 }
257 }
258
259 #if EFL_BETA
260 #pragma warning disable CS1591
261 public static class EflIPackLayoutConcrete_ExtensionMethods {
262 }
263 #pragma warning restore CS1591
264 #endif