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