6e978696b734035b6be83f6f147e7219cc58e4a4
[platform/core/csapi/nui.git] / 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 using System.Reflection;
12
13 namespace Tizen.NUI\r
14 {\r
15 \r
16     internal class ItemFactory : global::System.IDisposable\r
17     {\r
18         private global::System.Runtime.InteropServices.HandleRef swigCPtr;\r
19         protected bool swigCMemOwn;\r
20 \r
21         internal ItemFactory(global::System.IntPtr cPtr, bool cMemoryOwn)\r
22         {\r
23             swigCMemOwn = cMemoryOwn;\r
24             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);\r
25         }\r
26 \r
27         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemFactory obj)\r
28         {\r
29             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;\r
30         }\r
31 \r
32         ~ItemFactory()\r
33         {\r
34             DisposeQueue.Instance.Add(this);\r
35         }\r
36 \r
37         public virtual void Dispose()\r
38         {\r
39             if (!Stage.IsInstalled())\r
40             {\r
41                 DisposeQueue.Instance.Add(this);\r
42                 return;\r
43             }\r
44 \r
45             lock (this)\r
46             {\r
47                 if (swigCPtr.Handle != global::System.IntPtr.Zero)\r
48                 {\r
49                     if (swigCMemOwn)\r
50                     {\r
51                         swigCMemOwn = false;\r
52                         NDalicPINVOKE.delete_ItemFactory(swigCPtr);\r
53                     }\r
54                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);\r
55                 }\r
56                 global::System.GC.SuppressFinalize(this);\r
57             }\r
58         }\r
59 \r
60 \r
61         public virtual uint GetNumberOfItems()\r
62         {\r
63             uint ret = NDalicPINVOKE.ItemFactory_GetNumberOfItems(swigCPtr);\r
64             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
65             return ret;\r
66         }\r
67 \r
68         public virtual Actor NewItem(uint itemId)\r
69         {\r
70             Actor ret = new Actor(NDalicPINVOKE.ItemFactory_NewItem(swigCPtr, itemId), true);\r
71             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
72             return ret;\r
73         }\r
74 \r
75         public virtual void ItemReleased(uint itemId, Actor actor)\r
76         {\r
77             if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2)) NDalicPINVOKE.ItemFactory_ItemReleasedSwigExplicitItemFactory(swigCPtr, itemId, Actor.getCPtr(actor)); else NDalicPINVOKE.ItemFactory_ItemReleased(swigCPtr, itemId, Actor.getCPtr(actor));\r
78             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
79         }\r
80 \r
81         public ItemFactory() : this(NDalicPINVOKE.new_ItemFactory(), true)\r
82         {\r
83             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
84             SwigDirectorConnect();\r
85         }\r
86 \r
87         private void SwigDirectorConnect()\r
88         {\r
89             if (SwigDerivedClassHasMethod("GetNumberOfItems", swigMethodTypes0))\r
90                 swigDelegate0 = new SwigDelegateItemFactory_0(SwigDirectorGetNumberOfItems);\r
91             if (SwigDerivedClassHasMethod("NewItem", swigMethodTypes1))\r
92                 swigDelegate1 = new SwigDelegateItemFactory_1(SwigDirectorNewItem);\r
93             if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2))\r
94                 swigDelegate2 = new SwigDelegateItemFactory_2(SwigDirectorItemReleased);\r
95             NDalicPINVOKE.ItemFactory_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);\r
96         }\r
97 \r
98 \r
99         private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)\r
100         {\r
101             global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, methodTypes);\r
102             bool hasDerivedMethod = methodInfo.GetType().GetTypeInfo().IsSubclassOf(typeof(ItemFactory));\r
103             return hasDerivedMethod;\r
104         }\r
105 \r
106         private uint SwigDirectorGetNumberOfItems()\r
107         {\r
108             return GetNumberOfItems();\r
109         }\r
110 \r
111         private global::System.IntPtr SwigDirectorNewItem(uint itemId)\r
112         {\r
113             return Actor.getCPtr(NewItem(itemId)).Handle;\r
114         }\r
115 \r
116         private void SwigDirectorItemReleased(uint itemId, global::System.IntPtr actor)\r
117         {\r
118             ItemReleased(itemId, new Actor(actor, true));\r
119         }\r
120 \r
121         public delegate uint SwigDelegateItemFactory_0();\r
122         public delegate global::System.IntPtr SwigDelegateItemFactory_1(uint itemId);\r
123         public delegate void SwigDelegateItemFactory_2(uint itemId, global::System.IntPtr actor);\r
124 \r
125         private SwigDelegateItemFactory_0 swigDelegate0;\r
126         private SwigDelegateItemFactory_1 swigDelegate1;\r
127         private SwigDelegateItemFactory_2 swigDelegate2;\r
128 \r
129         private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };\r
130         private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(uint) };\r
131         private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(uint), typeof(Actor) };\r
132     }
133
134 }