[EflSharp] Update Circle and efl cs files (#819)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_composite_model.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 model for all composite class which provide a unified API to set source of data.
11 /// This class also provide an <see cref="Efl.IModel.GetProperty"/> &quot;<c>child</c>.index&quot; that match the value of <see cref="Efl.CompositeModel.Index"/>.</summary>
12 [Efl.CompositeModel.NativeMethods]
13 public class CompositeModel : Efl.LoopModel, Efl.Eo.IWrapper,Efl.Ui.IView
14 {
15     ///<summary>Pointer to the native class description.</summary>
16     public override System.IntPtr NativeClass
17     {
18         get
19         {
20             if (((object)this).GetType() == typeof(CompositeModel))
21             {
22                 return GetEflClassStatic();
23             }
24             else
25             {
26                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
27             }
28         }
29     }
30
31     [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
32         efl_composite_model_class_get();
33     /// <summary>Initializes a new instance of the <see cref="CompositeModel"/> class.</summary>
34     /// <param name="parent">Parent instance.</param>
35     /// <param name="model">Model that is/will be See <see cref="Efl.Ui.IView.SetModel"/></param>
36     /// <param name="index">Position of this object in the parent model. See <see cref="Efl.CompositeModel.SetIndex"/></param>
37     public CompositeModel(Efl.Object parent
38             , Efl.IModel model, uint? index = null) : base(efl_composite_model_class_get(), typeof(CompositeModel), parent)
39     {
40         if (Efl.Eo.Globals.ParamHelperCheck(model))
41         {
42             SetModel(Efl.Eo.Globals.GetParamHelper(model));
43         }
44
45         if (Efl.Eo.Globals.ParamHelperCheck(index))
46         {
47             SetIndex(Efl.Eo.Globals.GetParamHelper(index));
48         }
49
50         FinishInstantiation();
51     }
52
53     /// <summary>Initializes a new instance of the <see cref="CompositeModel"/> class.
54     /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
55     /// <param name="raw">The native pointer to be wrapped.</param>
56     protected CompositeModel(System.IntPtr raw) : base(raw)
57     {
58             }
59
60     /// <summary>Initializes a new instance of the <see cref="CompositeModel"/> class.
61     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
62     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
63     /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
64     /// <param name="parent">The Efl.Object parent of this instance.</param>
65     protected CompositeModel(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
66     {
67     }
68
69     /// <summary>Verifies if the given object is equal to this one.</summary>
70     /// <param name="instance">The object to compare to.</param>
71     /// <returns>True if both objects point to the same native object.</returns>
72     public override bool Equals(object instance)
73     {
74         var other = instance as Efl.Object;
75         if (other == null)
76         {
77             return false;
78         }
79         return this.NativeHandle == other.NativeHandle;
80     }
81
82     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
83     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
84     public override int GetHashCode()
85     {
86         return this.NativeHandle.ToInt32();
87     }
88
89     /// <summary>Turns the native pointer into a string representation.</summary>
90     /// <returns>A string with the type and the native pointer for this object.</returns>
91     public override String ToString()
92     {
93         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
94     }
95
96     /// <summary>Get the index. It will only work after the object has been finalized.</summary>
97     /// <returns>Index of the object in the parent model. The index is uniq and start from zero.</returns>
98     virtual public uint GetIndex() {
99          var _ret_var = Efl.CompositeModel.NativeMethods.efl_composite_model_index_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
100         Eina.Error.RaiseIfUnhandledException();
101         return _ret_var;
102  }
103     /// <summary>Set the index. It can only be set before the object is finalized, but after the Model it compose is set and only if that Model does not provide an index already.</summary>
104     /// <param name="index">Index of the object in the parent model. The index is uniq and start from zero.</param>
105     virtual public void SetIndex(uint index) {
106                                  Efl.CompositeModel.NativeMethods.efl_composite_model_index_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),index);
107         Eina.Error.RaiseIfUnhandledException();
108                          }
109     /// <summary>Model that is/will be</summary>
110     /// <returns>Efl model</returns>
111     virtual public Efl.IModel GetModel() {
112          var _ret_var = Efl.Ui.IViewConcrete.NativeMethods.efl_ui_view_model_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
113         Eina.Error.RaiseIfUnhandledException();
114         return _ret_var;
115  }
116     /// <summary>Model that is/will be</summary>
117     /// <param name="model">Efl model</param>
118     virtual public void SetModel(Efl.IModel model) {
119                                  Efl.Ui.IViewConcrete.NativeMethods.efl_ui_view_model_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),model);
120         Eina.Error.RaiseIfUnhandledException();
121                          }
122     /// <summary>Position of this object in the parent model.</summary>
123 /// <value>Index of the object in the parent model. The index is uniq and start from zero.</value>
124     public uint Index {
125         get { return GetIndex(); }
126         set { SetIndex(value); }
127     }
128     /// <summary>Model that is/will be</summary>
129 /// <value>Efl model</value>
130     public Efl.IModel Model {
131         get { return GetModel(); }
132         set { SetModel(value); }
133     }
134     private static IntPtr GetEflClassStatic()
135     {
136         return Efl.CompositeModel.efl_composite_model_class_get();
137     }
138     /// <summary>Wrapper for native methods and virtual method delegates.
139     /// For internal use by generated code only.</summary>
140     public new class NativeMethods : Efl.LoopModel.NativeMethods
141     {
142         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Ecore);
143         /// <summary>Gets the list of Eo operations to override.</summary>
144         /// <returns>The list of Eo operations to be overload.</returns>
145         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
146         {
147             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
148             var methods = Efl.Eo.Globals.GetUserMethods(type);
149
150             if (efl_composite_model_index_get_static_delegate == null)
151             {
152                 efl_composite_model_index_get_static_delegate = new efl_composite_model_index_get_delegate(index_get);
153             }
154
155             if (methods.FirstOrDefault(m => m.Name == "GetIndex") != null)
156             {
157                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_composite_model_index_get"), func = Marshal.GetFunctionPointerForDelegate(efl_composite_model_index_get_static_delegate) });
158             }
159
160             if (efl_composite_model_index_set_static_delegate == null)
161             {
162                 efl_composite_model_index_set_static_delegate = new efl_composite_model_index_set_delegate(index_set);
163             }
164
165             if (methods.FirstOrDefault(m => m.Name == "SetIndex") != null)
166             {
167                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_composite_model_index_set"), func = Marshal.GetFunctionPointerForDelegate(efl_composite_model_index_set_static_delegate) });
168             }
169
170             if (efl_ui_view_model_get_static_delegate == null)
171             {
172                 efl_ui_view_model_get_static_delegate = new efl_ui_view_model_get_delegate(model_get);
173             }
174
175             if (methods.FirstOrDefault(m => m.Name == "GetModel") != null)
176             {
177                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_view_model_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_view_model_get_static_delegate) });
178             }
179
180             if (efl_ui_view_model_set_static_delegate == null)
181             {
182                 efl_ui_view_model_set_static_delegate = new efl_ui_view_model_set_delegate(model_set);
183             }
184
185             if (methods.FirstOrDefault(m => m.Name == "SetModel") != null)
186             {
187                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_view_model_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_view_model_set_static_delegate) });
188             }
189
190             descs.AddRange(base.GetEoOps(type));
191             return descs;
192         }
193         /// <summary>Returns the Eo class for the native methods of this class.</summary>
194         /// <returns>The native class pointer.</returns>
195         public override IntPtr GetEflClass()
196         {
197             return Efl.CompositeModel.efl_composite_model_class_get();
198         }
199
200         #pragma warning disable CA1707, SA1300, SA1600
201
202         
203         private delegate uint efl_composite_model_index_get_delegate(System.IntPtr obj, System.IntPtr pd);
204
205         
206         public delegate uint efl_composite_model_index_get_api_delegate(System.IntPtr obj);
207
208         public static Efl.Eo.FunctionWrapper<efl_composite_model_index_get_api_delegate> efl_composite_model_index_get_ptr = new Efl.Eo.FunctionWrapper<efl_composite_model_index_get_api_delegate>(Module, "efl_composite_model_index_get");
209
210         private static uint index_get(System.IntPtr obj, System.IntPtr pd)
211         {
212             Eina.Log.Debug("function efl_composite_model_index_get was called");
213             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
214             if (wrapper != null)
215             {
216             uint _ret_var = default(uint);
217                 try
218                 {
219                     _ret_var = ((CompositeModel)wrapper).GetIndex();
220                 }
221                 catch (Exception e)
222                 {
223                     Eina.Log.Warning($"Callback error: {e.ToString()}");
224                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
225                 }
226
227         return _ret_var;
228
229             }
230             else
231             {
232                 return efl_composite_model_index_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
233             }
234         }
235
236         private static efl_composite_model_index_get_delegate efl_composite_model_index_get_static_delegate;
237
238         
239         private delegate void efl_composite_model_index_set_delegate(System.IntPtr obj, System.IntPtr pd,  uint index);
240
241         
242         public delegate void efl_composite_model_index_set_api_delegate(System.IntPtr obj,  uint index);
243
244         public static Efl.Eo.FunctionWrapper<efl_composite_model_index_set_api_delegate> efl_composite_model_index_set_ptr = new Efl.Eo.FunctionWrapper<efl_composite_model_index_set_api_delegate>(Module, "efl_composite_model_index_set");
245
246         private static void index_set(System.IntPtr obj, System.IntPtr pd, uint index)
247         {
248             Eina.Log.Debug("function efl_composite_model_index_set was called");
249             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
250             if (wrapper != null)
251             {
252                                     
253                 try
254                 {
255                     ((CompositeModel)wrapper).SetIndex(index);
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                         
264             }
265             else
266             {
267                 efl_composite_model_index_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), index);
268             }
269         }
270
271         private static efl_composite_model_index_set_delegate efl_composite_model_index_set_static_delegate;
272
273         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
274         private delegate Efl.IModel efl_ui_view_model_get_delegate(System.IntPtr obj, System.IntPtr pd);
275
276         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
277         public delegate Efl.IModel efl_ui_view_model_get_api_delegate(System.IntPtr obj);
278
279         public static Efl.Eo.FunctionWrapper<efl_ui_view_model_get_api_delegate> efl_ui_view_model_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_view_model_get_api_delegate>(Module, "efl_ui_view_model_get");
280
281         private static Efl.IModel model_get(System.IntPtr obj, System.IntPtr pd)
282         {
283             Eina.Log.Debug("function efl_ui_view_model_get was called");
284             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
285             if (wrapper != null)
286             {
287             Efl.IModel _ret_var = default(Efl.IModel);
288                 try
289                 {
290                     _ret_var = ((CompositeModel)wrapper).GetModel();
291                 }
292                 catch (Exception e)
293                 {
294                     Eina.Log.Warning($"Callback error: {e.ToString()}");
295                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
296                 }
297
298         return _ret_var;
299
300             }
301             else
302             {
303                 return efl_ui_view_model_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
304             }
305         }
306
307         private static efl_ui_view_model_get_delegate efl_ui_view_model_get_static_delegate;
308
309         
310         private delegate void efl_ui_view_model_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.IModel model);
311
312         
313         public delegate void efl_ui_view_model_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.IModel model);
314
315         public static Efl.Eo.FunctionWrapper<efl_ui_view_model_set_api_delegate> efl_ui_view_model_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_view_model_set_api_delegate>(Module, "efl_ui_view_model_set");
316
317         private static void model_set(System.IntPtr obj, System.IntPtr pd, Efl.IModel model)
318         {
319             Eina.Log.Debug("function efl_ui_view_model_set was called");
320             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
321             if (wrapper != null)
322             {
323                                     
324                 try
325                 {
326                     ((CompositeModel)wrapper).SetModel(model);
327                 }
328                 catch (Exception e)
329                 {
330                     Eina.Log.Warning($"Callback error: {e.ToString()}");
331                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
332                 }
333
334                         
335             }
336             else
337             {
338                 efl_ui_view_model_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), model);
339             }
340         }
341
342         private static efl_ui_view_model_set_delegate efl_ui_view_model_set_static_delegate;
343
344         #pragma warning restore CA1707, SA1300, SA1600
345
346 }
347 }
348 }
349