3668b44129452f621104015ba4644ed752d9853b
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_format.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.ComponentModel;
7 namespace Efl { namespace Ui { 
8 /// <summary></summary>
9 /// <param name="str">the formated string to be appended by user.</param>
10 /// <param name="value">The <see cref="Eina.Value"/> passed by <c>obj</c>.</param>
11 /// <returns></returns>
12 public delegate void FormatFuncCb( Eina.Strbuf str,  Eina.Value value);
13 public delegate void FormatFuncCbInternal(IntPtr data,  [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]  Eina.Strbuf str,   Eina.ValueNative value);
14 internal class FormatFuncCbWrapper
15 {
16
17     private FormatFuncCbInternal _cb;
18     private IntPtr _cb_data;
19     private EinaFreeCb _cb_free_cb;
20
21     internal FormatFuncCbWrapper (FormatFuncCbInternal _cb, IntPtr _cb_data, EinaFreeCb _cb_free_cb)
22     {
23         this._cb = _cb;
24         this._cb_data = _cb_data;
25         this._cb_free_cb = _cb_free_cb;
26     }
27
28     ~FormatFuncCbWrapper()
29     {
30         if (this._cb_free_cb != null)
31             this._cb_free_cb(this._cb_data);
32     }
33
34     internal void ManagedCb( Eina.Strbuf str, Eina.Value value)
35     {
36                                                         _cb(_cb_data,  str,  value);
37         Eina.Error.RaiseIfUnhandledException();
38                                             }
39
40         internal static void Cb(IntPtr cb_data,  [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]  Eina.Strbuf str,   Eina.ValueNative value)
41     {
42         GCHandle handle = GCHandle.FromIntPtr(cb_data);
43         FormatFuncCb cb = (FormatFuncCb)handle.Target;
44                                                             
45         try {
46             cb( str,  value);
47         } catch (Exception e) {
48             Eina.Log.Warning($"Callback error: {e.ToString()}");
49             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
50         }
51                                             }
52 }
53 } } 
54 namespace Efl { namespace Ui { 
55 /// <summary>interface class for format_func</summary>
56 [IFormatNativeInherit]
57 public interface IFormat : 
58     Efl.Eo.IWrapper, IDisposable
59 {
60     /// <summary>Set the format function pointer to format the string.</summary>
61 /// <param name="func">The format function callback</param>
62 /// <returns></returns>
63 void SetFormatCb( Efl.Ui.FormatFuncCb func);
64     /// <summary>Control the format string for a given units label
65 /// If <c>NULL</c> is passed to <c>format</c>, it will hide <c>obj</c>&apos;s units area completely. If not, it&apos;ll set the &lt;b&gt;format string&lt;/b&gt; for the units label text. The units label is provided as a floating point value, so the units text can display at most one floating point value. Note that the units label is optional. Use a format string such as &quot;%1.2f meters&quot; for example.
66 /// 
67 /// Note: The default format string is an integer percentage, as in $&quot;%.0f %%&quot;.</summary>
68 /// <returns>The format string for <c>obj</c>&apos;s units label.</returns>
69 System.String GetFormatString();
70     /// <summary>Control the format string for a given units label
71 /// If <c>NULL</c> is passed to <c>format</c>, it will hide <c>obj</c>&apos;s units area completely. If not, it&apos;ll set the &lt;b&gt;format string&lt;/b&gt; for the units label text. The units label is provided as a floating point value, so the units text can display at most one floating point value. Note that the units label is optional. Use a format string such as &quot;%1.2f meters&quot; for example.
72 /// 
73 /// Note: The default format string is an integer percentage, as in $&quot;%.0f %%&quot;.</summary>
74 /// <param name="units">The format string for <c>obj</c>&apos;s units label.</param>
75 /// <returns></returns>
76 void SetFormatString( System.String units);
77                 /// <summary>Set the format function pointer to format the string.</summary>
78 /// <value>The format function callback</value>
79     Efl.Ui.FormatFuncCb FormatCb {
80         set ;
81     }
82     /// <summary>Control the format string for a given units label
83 /// If <c>NULL</c> is passed to <c>format</c>, it will hide <c>obj</c>&apos;s units area completely. If not, it&apos;ll set the &lt;b&gt;format string&lt;/b&gt; for the units label text. The units label is provided as a floating point value, so the units text can display at most one floating point value. Note that the units label is optional. Use a format string such as &quot;%1.2f meters&quot; for example.
84 /// 
85 /// Note: The default format string is an integer percentage, as in $&quot;%.0f %%&quot;.</summary>
86 /// <value>The format string for <c>obj</c>&apos;s units label.</value>
87     System.String FormatString {
88         get ;
89         set ;
90     }
91 }
92 /// <summary>interface class for format_func</summary>
93 sealed public class IFormatConcrete : 
94
95 IFormat
96     
97 {
98     ///<summary>Pointer to the native class description.</summary>
99     public System.IntPtr NativeClass {
100         get {
101             if (((object)this).GetType() == typeof (IFormatConcrete))
102                 return Efl.Ui.IFormatNativeInherit.GetEflClassStatic();
103             else
104                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
105         }
106     }
107     private  System.IntPtr handle;
108     ///<summary>Pointer to the native instance.</summary>
109     public System.IntPtr NativeHandle {
110         get { return handle; }
111     }
112     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
113         efl_ui_format_mixin_get();
114     ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
115     private IFormatConcrete(System.IntPtr raw)
116     {
117         handle = raw;
118         RegisterEventProxies();
119     }
120     ///<summary>Destructor.</summary>
121     ~IFormatConcrete()
122     {
123         Dispose(false);
124     }
125     ///<summary>Releases the underlying native instance.</summary>
126     void Dispose(bool disposing)
127     {
128         if (handle != System.IntPtr.Zero) {
129             Efl.Eo.Globals.efl_unref(handle);
130             handle = System.IntPtr.Zero;
131         }
132     }
133     ///<summary>Releases the underlying native instance.</summary>
134     public void Dispose()
135     {
136         Dispose(true);
137         GC.SuppressFinalize(this);
138     }
139     ///<summary>Verifies if the given object is equal to this one.</summary>
140     public override bool Equals(object obj)
141     {
142         var other = obj as Efl.Object;
143         if (other == null)
144             return false;
145         return this.NativeHandle == other.NativeHandle;
146     }
147     ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
148     public override int GetHashCode()
149     {
150         return this.NativeHandle.ToInt32();
151     }
152     ///<summary>Turns the native pointer into a string representation.</summary>
153     public override String ToString()
154     {
155         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
156     }
157     ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
158      void RegisterEventProxies()
159     {
160     }
161     /// <summary>Set the format function pointer to format the string.</summary>
162     /// <param name="func">The format function callback</param>
163     /// <returns></returns>
164     public void SetFormatCb( Efl.Ui.FormatFuncCb func) {
165                          GCHandle func_handle = GCHandle.Alloc(func);
166         Efl.Ui.IFormatNativeInherit.efl_ui_format_cb_set_ptr.Value.Delegate(this.NativeHandle,GCHandle.ToIntPtr(func_handle), Efl.Ui.FormatFuncCbWrapper.Cb, Efl.Eo.Globals.free_gchandle);
167         Eina.Error.RaiseIfUnhandledException();
168                          }
169     /// <summary>Control the format string for a given units label
170     /// If <c>NULL</c> is passed to <c>format</c>, it will hide <c>obj</c>&apos;s units area completely. If not, it&apos;ll set the &lt;b&gt;format string&lt;/b&gt; for the units label text. The units label is provided as a floating point value, so the units text can display at most one floating point value. Note that the units label is optional. Use a format string such as &quot;%1.2f meters&quot; for example.
171     /// 
172     /// Note: The default format string is an integer percentage, as in $&quot;%.0f %%&quot;.</summary>
173     /// <returns>The format string for <c>obj</c>&apos;s units label.</returns>
174     public System.String GetFormatString() {
175          var _ret_var = Efl.Ui.IFormatNativeInherit.efl_ui_format_string_get_ptr.Value.Delegate(this.NativeHandle);
176         Eina.Error.RaiseIfUnhandledException();
177         return _ret_var;
178  }
179     /// <summary>Control the format string for a given units label
180     /// If <c>NULL</c> is passed to <c>format</c>, it will hide <c>obj</c>&apos;s units area completely. If not, it&apos;ll set the &lt;b&gt;format string&lt;/b&gt; for the units label text. The units label is provided as a floating point value, so the units text can display at most one floating point value. Note that the units label is optional. Use a format string such as &quot;%1.2f meters&quot; for example.
181     /// 
182     /// Note: The default format string is an integer percentage, as in $&quot;%.0f %%&quot;.</summary>
183     /// <param name="units">The format string for <c>obj</c>&apos;s units label.</param>
184     /// <returns></returns>
185     public void SetFormatString( System.String units) {
186                                  Efl.Ui.IFormatNativeInherit.efl_ui_format_string_set_ptr.Value.Delegate(this.NativeHandle, units);
187         Eina.Error.RaiseIfUnhandledException();
188                          }
189     /// <summary>Set the format function pointer to format the string.</summary>
190 /// <value>The format function callback</value>
191     public Efl.Ui.FormatFuncCb FormatCb {
192         set { SetFormatCb( value); }
193     }
194     /// <summary>Control the format string for a given units label
195 /// If <c>NULL</c> is passed to <c>format</c>, it will hide <c>obj</c>&apos;s units area completely. If not, it&apos;ll set the &lt;b&gt;format string&lt;/b&gt; for the units label text. The units label is provided as a floating point value, so the units text can display at most one floating point value. Note that the units label is optional. Use a format string such as &quot;%1.2f meters&quot; for example.
196 /// 
197 /// Note: The default format string is an integer percentage, as in $&quot;%.0f %%&quot;.</summary>
198 /// <value>The format string for <c>obj</c>&apos;s units label.</value>
199     public System.String FormatString {
200         get { return GetFormatString(); }
201         set { SetFormatString( value); }
202     }
203     private static IntPtr GetEflClassStatic()
204     {
205         return Efl.Ui.IFormatConcrete.efl_ui_format_mixin_get();
206     }
207 }
208 public class IFormatNativeInherit  : Efl.Eo.NativeClass{
209     public  static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
210     public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
211     {
212         var descs = new System.Collections.Generic.List<Efl_Op_Description>();
213         var methods = Efl.Eo.Globals.GetUserMethods(type);
214         if (efl_ui_format_cb_set_static_delegate == null)
215             efl_ui_format_cb_set_static_delegate = new efl_ui_format_cb_set_delegate(format_cb_set);
216         if (methods.FirstOrDefault(m => m.Name == "SetFormatCb") != null)
217             descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_format_cb_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_cb_set_static_delegate)});
218         if (efl_ui_format_string_get_static_delegate == null)
219             efl_ui_format_string_get_static_delegate = new efl_ui_format_string_get_delegate(format_string_get);
220         if (methods.FirstOrDefault(m => m.Name == "GetFormatString") != null)
221             descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_format_string_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_string_get_static_delegate)});
222         if (efl_ui_format_string_set_static_delegate == null)
223             efl_ui_format_string_set_static_delegate = new efl_ui_format_string_set_delegate(format_string_set);
224         if (methods.FirstOrDefault(m => m.Name == "SetFormatString") != null)
225             descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_format_string_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_string_set_static_delegate)});
226         return descs;
227     }
228     public override IntPtr GetEflClass()
229     {
230         return Efl.Ui.IFormatConcrete.efl_ui_format_mixin_get();
231     }
232     public static  IntPtr GetEflClassStatic()
233     {
234         return Efl.Ui.IFormatConcrete.efl_ui_format_mixin_get();
235     }
236
237
238      private delegate void efl_ui_format_cb_set_delegate(System.IntPtr obj, System.IntPtr pd,  IntPtr func_data, Efl.Ui.FormatFuncCbInternal func, EinaFreeCb func_free_cb);
239
240
241      public delegate void efl_ui_format_cb_set_api_delegate(System.IntPtr obj,  IntPtr func_data, Efl.Ui.FormatFuncCbInternal func, EinaFreeCb func_free_cb);
242      public static Efl.Eo.FunctionWrapper<efl_ui_format_cb_set_api_delegate> efl_ui_format_cb_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_format_cb_set_api_delegate>(_Module, "efl_ui_format_cb_set");
243      private static void format_cb_set(System.IntPtr obj, System.IntPtr pd, IntPtr func_data, Efl.Ui.FormatFuncCbInternal func, EinaFreeCb func_free_cb)
244     {
245         Eina.Log.Debug("function efl_ui_format_cb_set was called");
246         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
247         if(wrapper != null) {
248                                         Efl.Ui.FormatFuncCbWrapper func_wrapper = new Efl.Ui.FormatFuncCbWrapper(func, func_data, func_free_cb);
249             
250             try {
251                 ((IFormatConcrete)wrapper).SetFormatCb( func_wrapper.ManagedCb);
252             } catch (Exception e) {
253                 Eina.Log.Warning($"Callback error: {e.ToString()}");
254                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
255             }
256                                 } else {
257             efl_ui_format_cb_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), func_data, func, func_free_cb);
258         }
259     }
260     private static efl_ui_format_cb_set_delegate efl_ui_format_cb_set_static_delegate;
261
262
263      [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] private delegate System.String efl_ui_format_string_get_delegate(System.IntPtr obj, System.IntPtr pd);
264
265
266      [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] public delegate System.String efl_ui_format_string_get_api_delegate(System.IntPtr obj);
267      public static Efl.Eo.FunctionWrapper<efl_ui_format_string_get_api_delegate> efl_ui_format_string_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_format_string_get_api_delegate>(_Module, "efl_ui_format_string_get");
268      private static System.String format_string_get(System.IntPtr obj, System.IntPtr pd)
269     {
270         Eina.Log.Debug("function efl_ui_format_string_get was called");
271         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
272         if(wrapper != null) {
273                         System.String _ret_var = default(System.String);
274             try {
275                 _ret_var = ((IFormatConcrete)wrapper).GetFormatString();
276             } catch (Exception e) {
277                 Eina.Log.Warning($"Callback error: {e.ToString()}");
278                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
279             }
280         return _ret_var;
281         } else {
282             return efl_ui_format_string_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
283         }
284     }
285     private static efl_ui_format_string_get_delegate efl_ui_format_string_get_static_delegate;
286
287
288      private delegate void efl_ui_format_string_set_delegate(System.IntPtr obj, System.IntPtr pd,  [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]  System.String units);
289
290
291      public delegate void efl_ui_format_string_set_api_delegate(System.IntPtr obj,  [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]  System.String units);
292      public static Efl.Eo.FunctionWrapper<efl_ui_format_string_set_api_delegate> efl_ui_format_string_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_format_string_set_api_delegate>(_Module, "efl_ui_format_string_set");
293      private static void format_string_set(System.IntPtr obj, System.IntPtr pd,  System.String units)
294     {
295         Eina.Log.Debug("function efl_ui_format_string_set was called");
296         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
297         if(wrapper != null) {
298                                                 
299             try {
300                 ((IFormatConcrete)wrapper).SetFormatString( units);
301             } catch (Exception e) {
302                 Eina.Log.Warning($"Callback error: {e.ToString()}");
303                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
304             }
305                                 } else {
306             efl_ui_format_string_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  units);
307         }
308     }
309     private static efl_ui_format_string_set_delegate efl_ui_format_string_set_static_delegate;
310 }
311 } }