ec413f52da2fcdf3ea72e5a42577d5210d899d69
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_gfx_size_class.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 Gfx {
11
12 /// <summary>Efl Gfx Size Class interface</summary>
13 [Efl.Gfx.ISizeClassConcrete.NativeMethods]
14 public interface ISizeClass : 
15     Efl.Eo.IWrapper, IDisposable
16 {
17     /// <summary>Get width and height of size class.
18 /// This function gets width and height for a size class. These values will only be valid until the size class is changed or the edje object is deleted.</summary>
19 /// <param name="size_class">The name of size class</param>
20 /// <param name="minw">minimum width</param>
21 /// <param name="minh">minimum height</param>
22 /// <param name="maxw">maximum width</param>
23 /// <param name="maxh">maximum height</param>
24 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
25 bool GetSizeClass(System.String size_class, out int minw, out int minh, out int maxw, out int maxh);
26     /// <summary>Set width and height of size class.
27 /// This function sets width and height for a size class. This will make all edje parts in the specified object that have the specified size class update their size with given values.</summary>
28 /// <param name="size_class">The name of size class</param>
29 /// <param name="minw">minimum width</param>
30 /// <param name="minh">minimum height</param>
31 /// <param name="maxw">maximum width</param>
32 /// <param name="maxh">maximum height</param>
33 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
34 bool SetSizeClass(System.String size_class, int minw, int minh, int maxw, int maxh);
35     /// <summary>Delete the size class.
36 /// This function deletes any values for the specified size class.
37 /// 
38 /// Deleting the size class will revert it to the values defined by <see cref="Efl.Gfx.ISizeClass.GetSizeClass"/> or the size class defined in the theme file.</summary>
39 /// <param name="size_class">The size class to be deleted.</param>
40 void DelSizeClass(System.String size_class);
41             }
42 /// <summary>Efl Gfx Size Class interface</summary>
43 sealed public class ISizeClassConcrete : 
44
45 ISizeClass
46     
47 {
48     ///<summary>Pointer to the native class description.</summary>
49     public System.IntPtr NativeClass
50     {
51         get
52         {
53             if (((object)this).GetType() == typeof(ISizeClassConcrete))
54             {
55                 return GetEflClassStatic();
56             }
57             else
58             {
59                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
60             }
61         }
62     }
63
64     private  System.IntPtr handle;
65     ///<summary>Pointer to the native instance.</summary>
66     public System.IntPtr NativeHandle
67     {
68         get { return handle; }
69     }
70
71     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
72         efl_gfx_size_class_interface_get();
73     /// <summary>Initializes a new instance of the <see cref="ISizeClass"/> class.
74     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
75     private ISizeClassConcrete(System.IntPtr raw)
76     {
77         handle = raw;
78     }
79     ///<summary>Destructor.</summary>
80     ~ISizeClassConcrete()
81     {
82         Dispose(false);
83     }
84
85     ///<summary>Releases the underlying native instance.</summary>
86     private void Dispose(bool disposing)
87     {
88         if (handle != System.IntPtr.Zero)
89         {
90             IntPtr h = handle;
91             handle = IntPtr.Zero;
92
93             IntPtr gcHandlePtr = IntPtr.Zero;
94             if (disposing)
95             {
96                 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
97             }
98             else
99             {
100                 Monitor.Enter(Efl.All.InitLock);
101                 if (Efl.All.MainLoopInitialized)
102                 {
103                     Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
104                 }
105
106                 Monitor.Exit(Efl.All.InitLock);
107             }
108         }
109
110     }
111
112     ///<summary>Releases the underlying native instance.</summary>
113     public void Dispose()
114     {
115         Dispose(true);
116         GC.SuppressFinalize(this);
117     }
118
119     /// <summary>Verifies if the given object is equal to this one.</summary>
120     /// <param name="instance">The object to compare to.</param>
121     /// <returns>True if both objects point to the same native object.</returns>
122     public override bool Equals(object instance)
123     {
124         var other = instance as Efl.Object;
125         if (other == null)
126         {
127             return false;
128         }
129         return this.NativeHandle == other.NativeHandle;
130     }
131
132     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
133     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
134     public override int GetHashCode()
135     {
136         return this.NativeHandle.ToInt32();
137     }
138
139     /// <summary>Turns the native pointer into a string representation.</summary>
140     /// <returns>A string with the type and the native pointer for this object.</returns>
141     public override String ToString()
142     {
143         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
144     }
145
146     /// <summary>Get width and height of size class.
147     /// This function gets width and height for a size class. These values will only be valid until the size class is changed or the edje object is deleted.</summary>
148     /// <param name="size_class">The name of size class</param>
149     /// <param name="minw">minimum width</param>
150     /// <param name="minh">minimum height</param>
151     /// <param name="maxw">maximum width</param>
152     /// <param name="maxh">maximum height</param>
153     /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
154     public bool GetSizeClass(System.String size_class, out int minw, out int minh, out int maxw, out int maxh) {
155                                                                                                                                  var _ret_var = Efl.Gfx.ISizeClassConcrete.NativeMethods.efl_gfx_size_class_get_ptr.Value.Delegate(this.NativeHandle,size_class, out minw, out minh, out maxw, out maxh);
156         Eina.Error.RaiseIfUnhandledException();
157                                                                                         return _ret_var;
158  }
159     /// <summary>Set width and height of size class.
160     /// This function sets width and height for a size class. This will make all edje parts in the specified object that have the specified size class update their size with given values.</summary>
161     /// <param name="size_class">The name of size class</param>
162     /// <param name="minw">minimum width</param>
163     /// <param name="minh">minimum height</param>
164     /// <param name="maxw">maximum width</param>
165     /// <param name="maxh">maximum height</param>
166     /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
167     public bool SetSizeClass(System.String size_class, int minw, int minh, int maxw, int maxh) {
168                                                                                                                                  var _ret_var = Efl.Gfx.ISizeClassConcrete.NativeMethods.efl_gfx_size_class_set_ptr.Value.Delegate(this.NativeHandle,size_class, minw, minh, maxw, maxh);
169         Eina.Error.RaiseIfUnhandledException();
170                                                                                         return _ret_var;
171  }
172     /// <summary>Delete the size class.
173     /// This function deletes any values for the specified size class.
174     /// 
175     /// Deleting the size class will revert it to the values defined by <see cref="Efl.Gfx.ISizeClass.GetSizeClass"/> or the size class defined in the theme file.</summary>
176     /// <param name="size_class">The size class to be deleted.</param>
177     public void DelSizeClass(System.String size_class) {
178                                  Efl.Gfx.ISizeClassConcrete.NativeMethods.efl_gfx_size_class_del_ptr.Value.Delegate(this.NativeHandle,size_class);
179         Eina.Error.RaiseIfUnhandledException();
180                          }
181     private static IntPtr GetEflClassStatic()
182     {
183         return Efl.Gfx.ISizeClassConcrete.efl_gfx_size_class_interface_get();
184     }
185     /// <summary>Wrapper for native methods and virtual method delegates.
186     /// For internal use by generated code only.</summary>
187     public class NativeMethods  : Efl.Eo.NativeClass
188     {
189         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
190         /// <summary>Gets the list of Eo operations to override.</summary>
191         /// <returns>The list of Eo operations to be overload.</returns>
192         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
193         {
194             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
195             var methods = Efl.Eo.Globals.GetUserMethods(type);
196
197             if (efl_gfx_size_class_get_static_delegate == null)
198             {
199                 efl_gfx_size_class_get_static_delegate = new efl_gfx_size_class_get_delegate(size_class_get);
200             }
201
202             if (methods.FirstOrDefault(m => m.Name == "GetSizeClass") != null)
203             {
204                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_size_class_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_size_class_get_static_delegate) });
205             }
206
207             if (efl_gfx_size_class_set_static_delegate == null)
208             {
209                 efl_gfx_size_class_set_static_delegate = new efl_gfx_size_class_set_delegate(size_class_set);
210             }
211
212             if (methods.FirstOrDefault(m => m.Name == "SetSizeClass") != null)
213             {
214                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_size_class_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_size_class_set_static_delegate) });
215             }
216
217             if (efl_gfx_size_class_del_static_delegate == null)
218             {
219                 efl_gfx_size_class_del_static_delegate = new efl_gfx_size_class_del_delegate(size_class_del);
220             }
221
222             if (methods.FirstOrDefault(m => m.Name == "DelSizeClass") != null)
223             {
224                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_size_class_del"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_size_class_del_static_delegate) });
225             }
226
227             return descs;
228         }
229         /// <summary>Returns the Eo class for the native methods of this class.</summary>
230         /// <returns>The native class pointer.</returns>
231         public override IntPtr GetEflClass()
232         {
233             return Efl.Gfx.ISizeClassConcrete.efl_gfx_size_class_interface_get();
234         }
235
236         #pragma warning disable CA1707, SA1300, SA1600
237
238         [return: MarshalAs(UnmanagedType.U1)]
239         private delegate bool efl_gfx_size_class_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class,  out int minw,  out int minh,  out int maxw,  out int maxh);
240
241         [return: MarshalAs(UnmanagedType.U1)]
242         public delegate bool efl_gfx_size_class_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class,  out int minw,  out int minh,  out int maxw,  out int maxh);
243
244         public static Efl.Eo.FunctionWrapper<efl_gfx_size_class_get_api_delegate> efl_gfx_size_class_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_size_class_get_api_delegate>(Module, "efl_gfx_size_class_get");
245
246         private static bool size_class_get(System.IntPtr obj, System.IntPtr pd, System.String size_class, out int minw, out int minh, out int maxw, out int maxh)
247         {
248             Eina.Log.Debug("function efl_gfx_size_class_get was called");
249             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
250             if (wrapper != null)
251             {
252                                                         minw = default(int);        minh = default(int);        maxw = default(int);        maxh = default(int);                                                    bool _ret_var = default(bool);
253                 try
254                 {
255                     _ret_var = ((ISizeClass)wrapper).GetSizeClass(size_class, out minw, out minh, out maxw, out maxh);
256                 }
257                 catch (Exception e)
258                 {
259                     Eina.Log.Warning($"Callback error: {e.ToString()}");
260                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
261                 }
262
263                                                                                         return _ret_var;
264
265             }
266             else
267             {
268                 return efl_gfx_size_class_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size_class, out minw, out minh, out maxw, out maxh);
269             }
270         }
271
272         private static efl_gfx_size_class_get_delegate efl_gfx_size_class_get_static_delegate;
273
274         [return: MarshalAs(UnmanagedType.U1)]
275         private delegate bool efl_gfx_size_class_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class,  int minw,  int minh,  int maxw,  int maxh);
276
277         [return: MarshalAs(UnmanagedType.U1)]
278         public delegate bool efl_gfx_size_class_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class,  int minw,  int minh,  int maxw,  int maxh);
279
280         public static Efl.Eo.FunctionWrapper<efl_gfx_size_class_set_api_delegate> efl_gfx_size_class_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_size_class_set_api_delegate>(Module, "efl_gfx_size_class_set");
281
282         private static bool size_class_set(System.IntPtr obj, System.IntPtr pd, System.String size_class, int minw, int minh, int maxw, int maxh)
283         {
284             Eina.Log.Debug("function efl_gfx_size_class_set was called");
285             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
286             if (wrapper != null)
287             {
288                                                                                                                                     bool _ret_var = default(bool);
289                 try
290                 {
291                     _ret_var = ((ISizeClass)wrapper).SetSizeClass(size_class, minw, minh, maxw, maxh);
292                 }
293                 catch (Exception e)
294                 {
295                     Eina.Log.Warning($"Callback error: {e.ToString()}");
296                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
297                 }
298
299                                                                                         return _ret_var;
300
301             }
302             else
303             {
304                 return efl_gfx_size_class_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size_class, minw, minh, maxw, maxh);
305             }
306         }
307
308         private static efl_gfx_size_class_set_delegate efl_gfx_size_class_set_static_delegate;
309
310         
311         private delegate void efl_gfx_size_class_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class);
312
313         
314         public delegate void efl_gfx_size_class_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class);
315
316         public static Efl.Eo.FunctionWrapper<efl_gfx_size_class_del_api_delegate> efl_gfx_size_class_del_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_size_class_del_api_delegate>(Module, "efl_gfx_size_class_del");
317
318         private static void size_class_del(System.IntPtr obj, System.IntPtr pd, System.String size_class)
319         {
320             Eina.Log.Debug("function efl_gfx_size_class_del was called");
321             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
322             if (wrapper != null)
323             {
324                                     
325                 try
326                 {
327                     ((ISizeClass)wrapper).DelSizeClass(size_class);
328                 }
329                 catch (Exception e)
330                 {
331                     Eina.Log.Warning($"Callback error: {e.ToString()}");
332                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
333                 }
334
335                         
336             }
337             else
338             {
339                 efl_gfx_size_class_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size_class);
340             }
341         }
342
343         private static efl_gfx_size_class_del_delegate efl_gfx_size_class_del_static_delegate;
344
345         #pragma warning restore CA1707, SA1300, SA1600
346
347 }
348 }
349 }
350
351 }
352