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