f66df502fb42e3b8108d72e403350a109caa0234
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_control.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 /// <summary>Efl control interface</summary>
11 [Efl.IControlConcrete.NativeMethods]
12 public interface IControl : 
13     Efl.Eo.IWrapper, IDisposable
14 {
15     /// <summary>Control the priority of the object.</summary>
16 /// <returns>The priority of the object</returns>
17 int GetPriority();
18     /// <summary>Control the priority of the object.</summary>
19 /// <param name="priority">The priority of the object</param>
20 void SetPriority(int priority);
21     /// <summary>Controls whether the object is suspended or not.</summary>
22 /// <returns>Controls whether the object is suspended or not.</returns>
23 bool GetSuspend();
24     /// <summary>Controls whether the object is suspended or not.</summary>
25 /// <param name="suspend">Controls whether the object is suspended or not.</param>
26 void SetSuspend(bool suspend);
27                     /// <summary>Control the priority of the object.</summary>
28 /// <value>The priority of the object</value>
29     int Priority {
30         get ;
31         set ;
32     }
33     /// <summary>Controls whether the object is suspended or not.</summary>
34 /// <value>Controls whether the object is suspended or not.</value>
35     bool Suspend {
36         get ;
37         set ;
38     }
39 }
40 /// <summary>Efl control interface</summary>
41 sealed public class IControlConcrete : 
42
43 IControl
44     
45 {
46     ///<summary>Pointer to the native class description.</summary>
47     public System.IntPtr NativeClass
48     {
49         get
50         {
51             if (((object)this).GetType() == typeof(IControlConcrete))
52             {
53                 return GetEflClassStatic();
54             }
55             else
56             {
57                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
58             }
59         }
60     }
61
62     private  System.IntPtr handle;
63     ///<summary>Pointer to the native instance.</summary>
64     public System.IntPtr NativeHandle
65     {
66         get { return handle; }
67     }
68
69     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
70         efl_control_interface_get();
71     /// <summary>Initializes a new instance of the <see cref="IControl"/> class.
72     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
73     private IControlConcrete(System.IntPtr raw)
74     {
75         handle = raw;
76     }
77     ///<summary>Destructor.</summary>
78     ~IControlConcrete()
79     {
80         Dispose(false);
81     }
82
83     ///<summary>Releases the underlying native instance.</summary>
84     private void Dispose(bool disposing)
85     {
86         if (handle != System.IntPtr.Zero)
87         {
88             IntPtr h = handle;
89             handle = IntPtr.Zero;
90
91             IntPtr gcHandlePtr = IntPtr.Zero;
92             if (disposing)
93             {
94                 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
95             }
96             else
97             {
98                 Monitor.Enter(Efl.All.InitLock);
99                 if (Efl.All.MainLoopInitialized)
100                 {
101                     Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
102                 }
103
104                 Monitor.Exit(Efl.All.InitLock);
105             }
106         }
107
108     }
109
110     ///<summary>Releases the underlying native instance.</summary>
111     public void Dispose()
112     {
113         Dispose(true);
114         GC.SuppressFinalize(this);
115     }
116
117     /// <summary>Verifies if the given object is equal to this one.</summary>
118     /// <param name="instance">The object to compare to.</param>
119     /// <returns>True if both objects point to the same native object.</returns>
120     public override bool Equals(object instance)
121     {
122         var other = instance as Efl.Object;
123         if (other == null)
124         {
125             return false;
126         }
127         return this.NativeHandle == other.NativeHandle;
128     }
129
130     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
131     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
132     public override int GetHashCode()
133     {
134         return this.NativeHandle.ToInt32();
135     }
136
137     /// <summary>Turns the native pointer into a string representation.</summary>
138     /// <returns>A string with the type and the native pointer for this object.</returns>
139     public override String ToString()
140     {
141         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
142     }
143
144     /// <summary>Control the priority of the object.</summary>
145     /// <returns>The priority of the object</returns>
146     public int GetPriority() {
147          var _ret_var = Efl.IControlConcrete.NativeMethods.efl_control_priority_get_ptr.Value.Delegate(this.NativeHandle);
148         Eina.Error.RaiseIfUnhandledException();
149         return _ret_var;
150  }
151     /// <summary>Control the priority of the object.</summary>
152     /// <param name="priority">The priority of the object</param>
153     public void SetPriority(int priority) {
154                                  Efl.IControlConcrete.NativeMethods.efl_control_priority_set_ptr.Value.Delegate(this.NativeHandle,priority);
155         Eina.Error.RaiseIfUnhandledException();
156                          }
157     /// <summary>Controls whether the object is suspended or not.</summary>
158     /// <returns>Controls whether the object is suspended or not.</returns>
159     public bool GetSuspend() {
160          var _ret_var = Efl.IControlConcrete.NativeMethods.efl_control_suspend_get_ptr.Value.Delegate(this.NativeHandle);
161         Eina.Error.RaiseIfUnhandledException();
162         return _ret_var;
163  }
164     /// <summary>Controls whether the object is suspended or not.</summary>
165     /// <param name="suspend">Controls whether the object is suspended or not.</param>
166     public void SetSuspend(bool suspend) {
167                                  Efl.IControlConcrete.NativeMethods.efl_control_suspend_set_ptr.Value.Delegate(this.NativeHandle,suspend);
168         Eina.Error.RaiseIfUnhandledException();
169                          }
170     /// <summary>Control the priority of the object.</summary>
171 /// <value>The priority of the object</value>
172     public int Priority {
173         get { return GetPriority(); }
174         set { SetPriority(value); }
175     }
176     /// <summary>Controls whether the object is suspended or not.</summary>
177 /// <value>Controls whether the object is suspended or not.</value>
178     public bool Suspend {
179         get { return GetSuspend(); }
180         set { SetSuspend(value); }
181     }
182     private static IntPtr GetEflClassStatic()
183     {
184         return Efl.IControlConcrete.efl_control_interface_get();
185     }
186     /// <summary>Wrapper for native methods and virtual method delegates.
187     /// For internal use by generated code only.</summary>
188     public class NativeMethods  : Efl.Eo.NativeClass
189     {
190         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
191         /// <summary>Gets the list of Eo operations to override.</summary>
192         /// <returns>The list of Eo operations to be overload.</returns>
193         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
194         {
195             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
196             var methods = Efl.Eo.Globals.GetUserMethods(type);
197
198             if (efl_control_priority_get_static_delegate == null)
199             {
200                 efl_control_priority_get_static_delegate = new efl_control_priority_get_delegate(priority_get);
201             }
202
203             if (methods.FirstOrDefault(m => m.Name == "GetPriority") != null)
204             {
205                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_control_priority_get"), func = Marshal.GetFunctionPointerForDelegate(efl_control_priority_get_static_delegate) });
206             }
207
208             if (efl_control_priority_set_static_delegate == null)
209             {
210                 efl_control_priority_set_static_delegate = new efl_control_priority_set_delegate(priority_set);
211             }
212
213             if (methods.FirstOrDefault(m => m.Name == "SetPriority") != null)
214             {
215                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_control_priority_set"), func = Marshal.GetFunctionPointerForDelegate(efl_control_priority_set_static_delegate) });
216             }
217
218             if (efl_control_suspend_get_static_delegate == null)
219             {
220                 efl_control_suspend_get_static_delegate = new efl_control_suspend_get_delegate(suspend_get);
221             }
222
223             if (methods.FirstOrDefault(m => m.Name == "GetSuspend") != null)
224             {
225                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_control_suspend_get"), func = Marshal.GetFunctionPointerForDelegate(efl_control_suspend_get_static_delegate) });
226             }
227
228             if (efl_control_suspend_set_static_delegate == null)
229             {
230                 efl_control_suspend_set_static_delegate = new efl_control_suspend_set_delegate(suspend_set);
231             }
232
233             if (methods.FirstOrDefault(m => m.Name == "SetSuspend") != null)
234             {
235                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_control_suspend_set"), func = Marshal.GetFunctionPointerForDelegate(efl_control_suspend_set_static_delegate) });
236             }
237
238             return descs;
239         }
240         /// <summary>Returns the Eo class for the native methods of this class.</summary>
241         /// <returns>The native class pointer.</returns>
242         public override IntPtr GetEflClass()
243         {
244             return Efl.IControlConcrete.efl_control_interface_get();
245         }
246
247         #pragma warning disable CA1707, SA1300, SA1600
248
249         
250         private delegate int efl_control_priority_get_delegate(System.IntPtr obj, System.IntPtr pd);
251
252         
253         public delegate int efl_control_priority_get_api_delegate(System.IntPtr obj);
254
255         public static Efl.Eo.FunctionWrapper<efl_control_priority_get_api_delegate> efl_control_priority_get_ptr = new Efl.Eo.FunctionWrapper<efl_control_priority_get_api_delegate>(Module, "efl_control_priority_get");
256
257         private static int priority_get(System.IntPtr obj, System.IntPtr pd)
258         {
259             Eina.Log.Debug("function efl_control_priority_get was called");
260             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
261             if (wrapper != null)
262             {
263             int _ret_var = default(int);
264                 try
265                 {
266                     _ret_var = ((IControl)wrapper).GetPriority();
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_control_priority_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
280             }
281         }
282
283         private static efl_control_priority_get_delegate efl_control_priority_get_static_delegate;
284
285         
286         private delegate void efl_control_priority_set_delegate(System.IntPtr obj, System.IntPtr pd,  int priority);
287
288         
289         public delegate void efl_control_priority_set_api_delegate(System.IntPtr obj,  int priority);
290
291         public static Efl.Eo.FunctionWrapper<efl_control_priority_set_api_delegate> efl_control_priority_set_ptr = new Efl.Eo.FunctionWrapper<efl_control_priority_set_api_delegate>(Module, "efl_control_priority_set");
292
293         private static void priority_set(System.IntPtr obj, System.IntPtr pd, int priority)
294         {
295             Eina.Log.Debug("function efl_control_priority_set was called");
296             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
297             if (wrapper != null)
298             {
299                                     
300                 try
301                 {
302                     ((IControl)wrapper).SetPriority(priority);
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                         
311             }
312             else
313             {
314                 efl_control_priority_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), priority);
315             }
316         }
317
318         private static efl_control_priority_set_delegate efl_control_priority_set_static_delegate;
319
320         [return: MarshalAs(UnmanagedType.U1)]
321         private delegate bool efl_control_suspend_get_delegate(System.IntPtr obj, System.IntPtr pd);
322
323         [return: MarshalAs(UnmanagedType.U1)]
324         public delegate bool efl_control_suspend_get_api_delegate(System.IntPtr obj);
325
326         public static Efl.Eo.FunctionWrapper<efl_control_suspend_get_api_delegate> efl_control_suspend_get_ptr = new Efl.Eo.FunctionWrapper<efl_control_suspend_get_api_delegate>(Module, "efl_control_suspend_get");
327
328         private static bool suspend_get(System.IntPtr obj, System.IntPtr pd)
329         {
330             Eina.Log.Debug("function efl_control_suspend_get was called");
331             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
332             if (wrapper != null)
333             {
334             bool _ret_var = default(bool);
335                 try
336                 {
337                     _ret_var = ((IControl)wrapper).GetSuspend();
338                 }
339                 catch (Exception e)
340                 {
341                     Eina.Log.Warning($"Callback error: {e.ToString()}");
342                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
343                 }
344
345         return _ret_var;
346
347             }
348             else
349             {
350                 return efl_control_suspend_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
351             }
352         }
353
354         private static efl_control_suspend_get_delegate efl_control_suspend_get_static_delegate;
355
356         
357         private delegate void efl_control_suspend_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool suspend);
358
359         
360         public delegate void efl_control_suspend_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool suspend);
361
362         public static Efl.Eo.FunctionWrapper<efl_control_suspend_set_api_delegate> efl_control_suspend_set_ptr = new Efl.Eo.FunctionWrapper<efl_control_suspend_set_api_delegate>(Module, "efl_control_suspend_set");
363
364         private static void suspend_set(System.IntPtr obj, System.IntPtr pd, bool suspend)
365         {
366             Eina.Log.Debug("function efl_control_suspend_set was called");
367             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
368             if (wrapper != null)
369             {
370                                     
371                 try
372                 {
373                     ((IControl)wrapper).SetSuspend(suspend);
374                 }
375                 catch (Exception e)
376                 {
377                     Eina.Log.Warning($"Callback error: {e.ToString()}");
378                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
379                 }
380
381                         
382             }
383             else
384             {
385                 efl_control_suspend_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), suspend);
386             }
387         }
388
389         private static efl_control_suspend_set_delegate efl_control_suspend_set_static_delegate;
390
391         #pragma warning restore CA1707, SA1300, SA1600
392
393 }
394 }
395 }
396