[EflSharp] Separate efl and Circle cs files and Update cs files (#786)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_class.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>Abstract Efl class
9 /// (Since EFL 1.22)</summary>
10 [ClassNativeInherit]
11 public abstract class Class :  Efl.Eo.IWrapper, IDisposable
12 {
13     ///<summary>Pointer to the native class description.</summary>
14     public virtual System.IntPtr NativeClass {
15         get {
16             if (((object)this).GetType() == typeof (Class))
17                 return Efl.ClassNativeInherit.GetEflClassStatic();
18             else
19                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
20         }
21     }
22     protected bool inherited;
23     protected  System.IntPtr handle;
24     ///<summary>Pointer to the native instance.</summary>
25     public System.IntPtr NativeHandle {
26         get { return handle; }
27     }
28     [System.Runtime.InteropServices.DllImport(efl.Libs.Eo)] internal static extern System.IntPtr
29         efl_class_class_get();
30     ///<summary>Creates a new instance.</summary>
31     ///<param name="parent">Parent instance.</param>
32     public Class(Efl.Object parent= null
33             ) :
34         this(efl_class_class_get(), typeof(Class), parent)
35     {
36         FinishInstantiation();
37     }
38     ///<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>
39     protected Class(System.IntPtr raw)
40     {
41         handle = raw;
42         RegisterEventProxies();
43     }
44     [Efl.Eo.PrivateNativeClass]
45     private class ClassRealized : Class
46     {
47         private ClassRealized(IntPtr ptr) : base(ptr)
48         {
49         }
50     }
51     protected Class(IntPtr base_klass, System.Type managed_type, Efl.Object parent)
52     {
53         inherited = ((object)this).GetType() != managed_type;
54         IntPtr actual_klass = base_klass;
55         if (inherited) {
56             actual_klass = Efl.Eo.ClassRegister.GetInheritKlassOrRegister(base_klass, ((object)this).GetType());
57         }
58         handle = Efl.Eo.Globals.instantiate_start(actual_klass, parent);
59         RegisterEventProxies();
60         if (inherited)
61         {
62             Efl.Eo.Globals.PrivateDataSet(this);
63         }
64     }
65     protected void FinishInstantiation()
66     {
67         handle = Efl.Eo.Globals.instantiate_end(handle);
68         Eina.Error.RaiseIfUnhandledException();
69     }
70     ///<summary>Destructor.</summary>
71     ~Class()
72     {
73         Dispose(false);
74     }
75     ///<summary>Releases the underlying native instance.</summary>
76     protected virtual void Dispose(bool disposing)
77     {
78         if (handle != System.IntPtr.Zero) {
79             Efl.Eo.Globals.efl_unref(handle);
80             handle = System.IntPtr.Zero;
81         }
82     }
83     ///<summary>Releases the underlying native instance.</summary>
84     public void Dispose()
85     {
86         Dispose(true);
87         GC.SuppressFinalize(this);
88     }
89     ///<summary>Verifies if the given object is equal to this one.</summary>
90     public override bool Equals(object obj)
91     {
92         var other = obj as Efl.Object;
93         if (other == null)
94             return false;
95         return this.NativeHandle == other.NativeHandle;
96     }
97     ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
98     public override int GetHashCode()
99     {
100         return this.NativeHandle.ToInt32();
101     }
102     ///<summary>Turns the native pointer into a string representation.</summary>
103     public override String ToString()
104     {
105         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
106     }
107     ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
108     protected virtual void RegisterEventProxies()
109     {
110     }
111     private static IntPtr GetEflClassStatic()
112     {
113         return Efl.Class.efl_class_class_get();
114     }
115 }
116 public class ClassNativeInherit  : Efl.Eo.NativeClass{
117     public  static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Eo);
118     public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
119     {
120         var descs = new System.Collections.Generic.List<Efl_Op_Description>();
121         var methods = Efl.Eo.Globals.GetUserMethods(type);
122         return descs;
123     }
124     public override IntPtr GetEflClass()
125     {
126         return Efl.Class.efl_class_class_get();
127     }
128     public static  IntPtr GetEflClassStatic()
129     {
130         return Efl.Class.efl_class_class_get();
131     }
132 }
133