dd5b67bffceabe3c346e6d504be214c17004e95e
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_duplicate.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>An interface for duplication of objects.
11 /// Objects implementing this interface can be duplicated with <see cref="Efl.IDuplicate.Duplicate"/>.</summary>
12 [Efl.IDuplicateConcrete.NativeMethods]
13 public interface IDuplicate : 
14     Efl.Eo.IWrapper, IDisposable
15 {
16     /// <summary>Creates a carbon copy of this object and returns it.
17 /// The newly created object will have no event handlers or anything of the sort.</summary>
18 /// <returns>Returned carbon copy</returns>
19 Efl.IDuplicate Duplicate();
20     }
21 /// <summary>An interface for duplication of objects.
22 /// Objects implementing this interface can be duplicated with <see cref="Efl.IDuplicate.Duplicate"/>.</summary>
23 sealed public class IDuplicateConcrete :
24     Efl.Eo.EoWrapper
25     , IDuplicate
26     
27 {
28     ///<summary>Pointer to the native class description.</summary>
29     public override System.IntPtr NativeClass
30     {
31         get
32         {
33             if (((object)this).GetType() == typeof(IDuplicateConcrete))
34             {
35                 return GetEflClassStatic();
36             }
37             else
38             {
39                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
40             }
41         }
42     }
43
44     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
45         efl_duplicate_interface_get();
46     /// <summary>Initializes a new instance of the <see cref="IDuplicate"/> class.
47     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
48     private IDuplicateConcrete(System.IntPtr raw) : base(raw)
49     {
50     }
51
52     /// <summary>Creates a carbon copy of this object and returns it.
53     /// The newly created object will have no event handlers or anything of the sort.</summary>
54     /// <returns>Returned carbon copy</returns>
55     public Efl.IDuplicate Duplicate() {
56          var _ret_var = Efl.IDuplicateConcrete.NativeMethods.efl_duplicate_ptr.Value.Delegate(this.NativeHandle);
57         Eina.Error.RaiseIfUnhandledException();
58         return _ret_var;
59  }
60     private static IntPtr GetEflClassStatic()
61     {
62         return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
63     }
64     /// <summary>Wrapper for native methods and virtual method delegates.
65     /// For internal use by generated code only.</summary>
66     public class NativeMethods  : Efl.Eo.NativeClass
67     {
68         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
69         /// <summary>Gets the list of Eo operations to override.</summary>
70         /// <returns>The list of Eo operations to be overload.</returns>
71         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
72         {
73             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
74             var methods = Efl.Eo.Globals.GetUserMethods(type);
75
76             if (efl_duplicate_static_delegate == null)
77             {
78                 efl_duplicate_static_delegate = new efl_duplicate_delegate(duplicate);
79             }
80
81             if (methods.FirstOrDefault(m => m.Name == "Duplicate") != null)
82             {
83                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_duplicate"), func = Marshal.GetFunctionPointerForDelegate(efl_duplicate_static_delegate) });
84             }
85
86             return descs;
87         }
88         /// <summary>Returns the Eo class for the native methods of this class.</summary>
89         /// <returns>The native class pointer.</returns>
90         public override IntPtr GetEflClass()
91         {
92             return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
93         }
94
95         #pragma warning disable CA1707, CS1591, SA1300, SA1600
96
97         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
98         private delegate Efl.IDuplicate efl_duplicate_delegate(System.IntPtr obj, System.IntPtr pd);
99
100         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
101         public delegate Efl.IDuplicate efl_duplicate_api_delegate(System.IntPtr obj);
102
103         public static Efl.Eo.FunctionWrapper<efl_duplicate_api_delegate> efl_duplicate_ptr = new Efl.Eo.FunctionWrapper<efl_duplicate_api_delegate>(Module, "efl_duplicate");
104
105         private static Efl.IDuplicate duplicate(System.IntPtr obj, System.IntPtr pd)
106         {
107             Eina.Log.Debug("function efl_duplicate was called");
108             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
109             if (ws != null)
110             {
111             Efl.IDuplicate _ret_var = default(Efl.IDuplicate);
112                 try
113                 {
114                     _ret_var = ((IDuplicate)ws.Target).Duplicate();
115                 }
116                 catch (Exception e)
117                 {
118                     Eina.Log.Warning($"Callback error: {e.ToString()}");
119                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
120                 }
121
122         return _ret_var;
123
124             }
125             else
126             {
127                 return efl_duplicate_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
128             }
129         }
130
131         private static efl_duplicate_delegate efl_duplicate_static_delegate;
132
133         #pragma warning restore CA1707, CS1591, SA1300, SA1600
134
135 }
136 }
137 }
138