[EflSharp] Update Circle and efl cs files (#916)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_config.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>A generic configuration interface, that holds key-value pairs.</summary>
11 [Efl.IConfigConcrete.NativeMethods]
12 public interface IConfig : 
13     Efl.Eo.IWrapper, IDisposable
14 {
15     /// <summary>A generic configuration value, referred to by name.</summary>
16 /// <param name="name">Configuration option name.</param>
17 /// <returns>The value. It will be empty if it doesn&apos;t exist. The caller must free it after use (using <c>eina_value_free</c>() in C).</returns>
18 Eina.Value GetConfig(System.String name);
19     /// <summary>A generic configuration value, referred to by name.</summary>
20 /// <param name="name">Configuration option name.</param>
21 /// <param name="value">Configuration option value. May be <c>null</c> if not found.</param>
22 /// <returns><c>false</c> in case of error: value type was invalid, the config can&apos;t be changed, config does not exist...</returns>
23 bool SetConfig(System.String name, Eina.Value value);
24         }
25 /// <summary>A generic configuration interface, that holds key-value pairs.</summary>
26 sealed public class IConfigConcrete :
27     Efl.Eo.EoWrapper
28     , IConfig
29     
30 {
31     ///<summary>Pointer to the native class description.</summary>
32     public override System.IntPtr NativeClass
33     {
34         get
35         {
36             if (((object)this).GetType() == typeof(IConfigConcrete))
37             {
38                 return GetEflClassStatic();
39             }
40             else
41             {
42                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
43             }
44         }
45     }
46
47     [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
48         efl_config_interface_get();
49     /// <summary>Initializes a new instance of the <see cref="IConfig"/> class.
50     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
51     private IConfigConcrete(System.IntPtr raw) : base(raw)
52     {
53     }
54
55     /// <summary>A generic configuration value, referred to by name.</summary>
56     /// <param name="name">Configuration option name.</param>
57     /// <returns>The value. It will be empty if it doesn&apos;t exist. The caller must free it after use (using <c>eina_value_free</c>() in C).</returns>
58     public Eina.Value GetConfig(System.String name) {
59                                  var _ret_var = Efl.IConfigConcrete.NativeMethods.efl_config_get_ptr.Value.Delegate(this.NativeHandle,name);
60         Eina.Error.RaiseIfUnhandledException();
61                         return _ret_var;
62  }
63     /// <summary>A generic configuration value, referred to by name.</summary>
64     /// <param name="name">Configuration option name.</param>
65     /// <param name="value">Configuration option value. May be <c>null</c> if not found.</param>
66     /// <returns><c>false</c> in case of error: value type was invalid, the config can&apos;t be changed, config does not exist...</returns>
67     public bool SetConfig(System.String name, Eina.Value value) {
68                                                          var _ret_var = Efl.IConfigConcrete.NativeMethods.efl_config_set_ptr.Value.Delegate(this.NativeHandle,name, value);
69         Eina.Error.RaiseIfUnhandledException();
70                                         return _ret_var;
71  }
72     private static IntPtr GetEflClassStatic()
73     {
74         return Efl.IConfigConcrete.efl_config_interface_get();
75     }
76     /// <summary>Wrapper for native methods and virtual method delegates.
77     /// For internal use by generated code only.</summary>
78     public class NativeMethods  : Efl.Eo.NativeClass
79     {
80         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
81         /// <summary>Gets the list of Eo operations to override.</summary>
82         /// <returns>The list of Eo operations to be overload.</returns>
83         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
84         {
85             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
86             var methods = Efl.Eo.Globals.GetUserMethods(type);
87
88             if (efl_config_get_static_delegate == null)
89             {
90                 efl_config_get_static_delegate = new efl_config_get_delegate(config_get);
91             }
92
93             if (methods.FirstOrDefault(m => m.Name == "GetConfig") != null)
94             {
95                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_config_get"), func = Marshal.GetFunctionPointerForDelegate(efl_config_get_static_delegate) });
96             }
97
98             if (efl_config_set_static_delegate == null)
99             {
100                 efl_config_set_static_delegate = new efl_config_set_delegate(config_set);
101             }
102
103             if (methods.FirstOrDefault(m => m.Name == "SetConfig") != null)
104             {
105                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_config_set"), func = Marshal.GetFunctionPointerForDelegate(efl_config_set_static_delegate) });
106             }
107
108             return descs;
109         }
110         /// <summary>Returns the Eo class for the native methods of this class.</summary>
111         /// <returns>The native class pointer.</returns>
112         public override IntPtr GetEflClass()
113         {
114             return Efl.IConfigConcrete.efl_config_interface_get();
115         }
116
117         #pragma warning disable CA1707, CS1591, SA1300, SA1600
118
119         [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]
120         private delegate Eina.Value efl_config_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name);
121
122         [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]
123         public delegate Eina.Value efl_config_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name);
124
125         public static Efl.Eo.FunctionWrapper<efl_config_get_api_delegate> efl_config_get_ptr = new Efl.Eo.FunctionWrapper<efl_config_get_api_delegate>(Module, "efl_config_get");
126
127         private static Eina.Value config_get(System.IntPtr obj, System.IntPtr pd, System.String name)
128         {
129             Eina.Log.Debug("function efl_config_get was called");
130             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
131             if (ws != null)
132             {
133                                     Eina.Value _ret_var = default(Eina.Value);
134                 try
135                 {
136                     _ret_var = ((IConfig)ws.Target).GetConfig(name);
137                 }
138                 catch (Exception e)
139                 {
140                     Eina.Log.Warning($"Callback error: {e.ToString()}");
141                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
142                 }
143
144                         return _ret_var;
145
146             }
147             else
148             {
149                 return efl_config_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name);
150             }
151         }
152
153         private static efl_config_get_delegate efl_config_get_static_delegate;
154
155         [return: MarshalAs(UnmanagedType.U1)]
156         private delegate bool efl_config_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))] Eina.Value value);
157
158         [return: MarshalAs(UnmanagedType.U1)]
159         public delegate bool efl_config_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))] Eina.Value value);
160
161         public static Efl.Eo.FunctionWrapper<efl_config_set_api_delegate> efl_config_set_ptr = new Efl.Eo.FunctionWrapper<efl_config_set_api_delegate>(Module, "efl_config_set");
162
163         private static bool config_set(System.IntPtr obj, System.IntPtr pd, System.String name, Eina.Value value)
164         {
165             Eina.Log.Debug("function efl_config_set was called");
166             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
167             if (ws != null)
168             {
169                                                             bool _ret_var = default(bool);
170                 try
171                 {
172                     _ret_var = ((IConfig)ws.Target).SetConfig(name, value);
173                 }
174                 catch (Exception e)
175                 {
176                     Eina.Log.Warning($"Callback error: {e.ToString()}");
177                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
178                 }
179
180                                         return _ret_var;
181
182             }
183             else
184             {
185                 return efl_config_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name, value);
186             }
187         }
188
189         private static efl_config_set_delegate efl_config_set_static_delegate;
190
191         #pragma warning restore CA1707, CS1591, SA1300, SA1600
192
193 }
194 }
195 }
196