877ac54b5133bcba336b1fac7d4918e7ad4ee1a2
[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.ComponentModel;
7 namespace Efl { 
8 /// <summary>An interface for duplication of objects.
9 /// Objects implementing this interface can be duplicated with <see cref="Efl.IDuplicate.DoDuplicate"/>.</summary>
10 [IDuplicateNativeInherit]
11 public interface IDuplicate : 
12     Efl.Eo.IWrapper, IDisposable
13 {
14     /// <summary>Creates a carbon copy of this object and returns it.
15 /// The newly created object will have no event handlers or anything of the sort.</summary>
16 /// <returns>Returned carbon copy</returns>
17 Efl.IDuplicate DoDuplicate();
18     }
19 /// <summary>An interface for duplication of objects.
20 /// Objects implementing this interface can be duplicated with <see cref="Efl.IDuplicate.DoDuplicate"/>.</summary>
21 sealed public class IDuplicateConcrete : 
22
23 IDuplicate
24     
25 {
26     ///<summary>Pointer to the native class description.</summary>
27     public System.IntPtr NativeClass {
28         get {
29             if (((object)this).GetType() == typeof (IDuplicateConcrete))
30                 return Efl.IDuplicateNativeInherit.GetEflClassStatic();
31             else
32                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33         }
34     }
35     private  System.IntPtr handle;
36     ///<summary>Pointer to the native instance.</summary>
37     public System.IntPtr NativeHandle {
38         get { return handle; }
39     }
40     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
41         efl_duplicate_interface_get();
42     ///<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>
43     private IDuplicateConcrete(System.IntPtr raw)
44     {
45         handle = raw;
46         RegisterEventProxies();
47     }
48     ///<summary>Destructor.</summary>
49     ~IDuplicateConcrete()
50     {
51         Dispose(false);
52     }
53     ///<summary>Releases the underlying native instance.</summary>
54     void Dispose(bool disposing)
55     {
56         if (handle != System.IntPtr.Zero) {
57             Efl.Eo.Globals.efl_unref(handle);
58             handle = System.IntPtr.Zero;
59         }
60     }
61     ///<summary>Releases the underlying native instance.</summary>
62     public void Dispose()
63     {
64         Dispose(true);
65         GC.SuppressFinalize(this);
66     }
67     ///<summary>Verifies if the given object is equal to this one.</summary>
68     public override bool Equals(object obj)
69     {
70         var other = obj as Efl.Object;
71         if (other == null)
72             return false;
73         return this.NativeHandle == other.NativeHandle;
74     }
75     ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
76     public override int GetHashCode()
77     {
78         return this.NativeHandle.ToInt32();
79     }
80     ///<summary>Turns the native pointer into a string representation.</summary>
81     public override String ToString()
82     {
83         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
84     }
85     ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
86      void RegisterEventProxies()
87     {
88     }
89     /// <summary>Creates a carbon copy of this object and returns it.
90     /// The newly created object will have no event handlers or anything of the sort.</summary>
91     /// <returns>Returned carbon copy</returns>
92     public Efl.IDuplicate DoDuplicate() {
93          var _ret_var = Efl.IDuplicateNativeInherit.efl_duplicate_ptr.Value.Delegate(this.NativeHandle);
94         Eina.Error.RaiseIfUnhandledException();
95         return _ret_var;
96  }
97     private static IntPtr GetEflClassStatic()
98     {
99         return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
100     }
101 }
102 public class IDuplicateNativeInherit  : Efl.Eo.NativeClass{
103     public  static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
104     public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
105     {
106         var descs = new System.Collections.Generic.List<Efl_Op_Description>();
107         var methods = Efl.Eo.Globals.GetUserMethods(type);
108         if (efl_duplicate_static_delegate == null)
109             efl_duplicate_static_delegate = new efl_duplicate_delegate(duplicate);
110         if (methods.FirstOrDefault(m => m.Name == "DoDuplicate") != null)
111             descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_duplicate"), func = Marshal.GetFunctionPointerForDelegate(efl_duplicate_static_delegate)});
112         return descs;
113     }
114     public override IntPtr GetEflClass()
115     {
116         return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
117     }
118     public static  IntPtr GetEflClassStatic()
119     {
120         return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
121     }
122
123
124     [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.IDuplicateConcrete, Efl.Eo.OwnTag>))] private delegate Efl.IDuplicate efl_duplicate_delegate(System.IntPtr obj, System.IntPtr pd);
125
126
127     [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.IDuplicateConcrete, Efl.Eo.OwnTag>))] public delegate Efl.IDuplicate efl_duplicate_api_delegate(System.IntPtr obj);
128      public static Efl.Eo.FunctionWrapper<efl_duplicate_api_delegate> efl_duplicate_ptr = new Efl.Eo.FunctionWrapper<efl_duplicate_api_delegate>(_Module, "efl_duplicate");
129      private static Efl.IDuplicate duplicate(System.IntPtr obj, System.IntPtr pd)
130     {
131         Eina.Log.Debug("function efl_duplicate was called");
132         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
133         if(wrapper != null) {
134                         Efl.IDuplicate _ret_var = default(Efl.IDuplicate);
135             try {
136                 _ret_var = ((IDuplicate)wrapper).DoDuplicate();
137             } catch (Exception e) {
138                 Eina.Log.Warning($"Callback error: {e.ToString()}");
139                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
140             }
141         return _ret_var;
142         } else {
143             return efl_duplicate_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
144         }
145     }
146     private static efl_duplicate_delegate efl_duplicate_static_delegate;
147 }
148