Fixed CustomAlgorithmInterface crash issue in dotnet core
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / ItemFactory.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 #define DOT_NET_CORE
12 #if (DOT_NET_CORE)
13 using System.Reflection;
14 #endif
15
16 namespace Tizen.NUI
17 {
18
19     internal class ItemFactory : global::System.IDisposable
20     {
21         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22         protected bool swigCMemOwn;
23
24         internal ItemFactory(global::System.IntPtr cPtr, bool cMemoryOwn)
25         {
26             swigCMemOwn = cMemoryOwn;
27             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
28         }
29
30         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemFactory obj)
31         {
32             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
33         }
34
35         ~ItemFactory()
36         {
37             DisposeQueue.Instance.Add(this);
38         }
39
40         public virtual void Dispose()
41         {
42             if (!Stage.IsInstalled())
43             {
44                 DisposeQueue.Instance.Add(this);
45                 return;
46             }
47
48             lock (this)
49             {
50                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
51                 {
52                     if (swigCMemOwn)
53                     {
54                         swigCMemOwn = false;
55                         NDalicPINVOKE.delete_ItemFactory(swigCPtr);
56                     }
57                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58                 }
59                 global::System.GC.SuppressFinalize(this);
60             }
61         }
62
63
64         public virtual uint GetNumberOfItems()
65         {
66             uint ret = NDalicPINVOKE.ItemFactory_GetNumberOfItems(swigCPtr);
67             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
68             return ret;
69         }
70
71         public virtual Actor NewItem(uint itemId)
72         {
73             Actor ret = new Actor(NDalicPINVOKE.ItemFactory_NewItem(swigCPtr, itemId), true);
74             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75             return ret;
76         }
77
78         public virtual void ItemReleased(uint itemId, Actor actor)
79         {
80             if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2)) NDalicPINVOKE.ItemFactory_ItemReleasedSwigExplicitItemFactory(swigCPtr, itemId, Actor.getCPtr(actor)); else NDalicPINVOKE.ItemFactory_ItemReleased(swigCPtr, itemId, Actor.getCPtr(actor));
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82         }
83
84         public ItemFactory() : this(NDalicPINVOKE.new_ItemFactory(), true)
85         {
86             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87             SwigDirectorConnect();
88         }
89
90         private void SwigDirectorConnect()
91         {
92             if (SwigDerivedClassHasMethod("GetNumberOfItems", swigMethodTypes0))
93                 swigDelegate0 = new SwigDelegateItemFactory_0(SwigDirectorGetNumberOfItems);
94             if (SwigDerivedClassHasMethod("NewItem", swigMethodTypes1))
95                 swigDelegate1 = new SwigDelegateItemFactory_1(SwigDirectorNewItem);
96             if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2))
97                 swigDelegate2 = new SwigDelegateItemFactory_2(SwigDirectorItemReleased);
98             NDalicPINVOKE.ItemFactory_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
99         }
100
101 #if (DOT_NET_CORE)
102         private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
103         {
104             global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, methodTypes);
105             bool hasDerivedMethod = this.GetType().GetTypeInfo().IsSubclassOf(typeof(ItemFactory));
106             Tizen.Log.Debug("NUI-APP", "hasDerivedMethod=" + hasDerivedMethod);
107             return hasDerivedMethod && (methodInfo != null);
108         }
109 #else
110         private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
111         {
112             global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
113             bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(ItemFactory));
114             return hasDerivedMethod;
115         }
116 #endif
117
118         private uint SwigDirectorGetNumberOfItems()
119         {
120             return GetNumberOfItems();
121         }
122
123         private global::System.IntPtr SwigDirectorNewItem(uint itemId)
124         {
125             return Actor.getCPtr(NewItem(itemId)).Handle;
126         }
127
128         private void SwigDirectorItemReleased(uint itemId, global::System.IntPtr actor)
129         {
130             ItemReleased(itemId, new Actor(actor, true));
131         }
132
133         public delegate uint SwigDelegateItemFactory_0();
134         public delegate global::System.IntPtr SwigDelegateItemFactory_1(uint itemId);
135         public delegate void SwigDelegateItemFactory_2(uint itemId, global::System.IntPtr actor);
136
137         private SwigDelegateItemFactory_0 swigDelegate0;
138         private SwigDelegateItemFactory_1 swigDelegate1;
139         private SwigDelegateItemFactory_2 swigDelegate2;
140
141         private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
142         private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(uint) };
143         private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(uint), typeof(Actor) };
144     }
145
146 }