1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
11 //#define DOT_NET_CORE
13 using System.Reflection;
18 using Tizen.NUI.BaseComponents;
19 internal class ItemFactory : global::System.IDisposable
21 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22 protected bool swigCMemOwn;
24 internal ItemFactory(global::System.IntPtr cPtr, bool cMemoryOwn)
26 swigCMemOwn = cMemoryOwn;
27 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
30 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemFactory obj)
32 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
35 //A Flag to check who called Dispose(). (By User or DisposeQueue)
36 private bool isDisposeQueued = false;
37 //A Flat to check if it is already disposed.
38 protected bool disposed = false;
45 isDisposeQueued = true;
46 DisposeQueue.Instance.Add(this);
52 //Throw excpetion if Dispose() is called in separate thread.
53 if (!Window.IsInstalled())
55 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
60 Dispose(DisposeTypes.Implicit);
64 Dispose(DisposeTypes.Explicit);
65 System.GC.SuppressFinalize(this);
69 protected virtual void Dispose(DisposeTypes type)
76 if (type == DisposeTypes.Explicit)
79 //Release your own managed resources here.
80 //You should release all of your own disposable objects here.
84 //Release your own unmanaged resources here.
85 //You should not access any managed member here except static instance.
86 //because the execution order of Finalizes is non-deterministic.
88 if (swigCPtr.Handle != global::System.IntPtr.Zero)
93 NDalicPINVOKE.delete_ItemFactory(swigCPtr);
95 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
101 public virtual uint GetNumberOfItems()
103 uint ret = NDalicPINVOKE.ItemFactory_GetNumberOfItems(swigCPtr);
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 public virtual View NewItem(uint itemId)
110 View ret = new View(NDalicPINVOKE.ItemFactory_NewItem(swigCPtr, itemId), true);
111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 public virtual void ItemReleased(uint itemId, View view)
117 if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2)) NDalicPINVOKE.ItemFactory_ItemReleasedSwigExplicitItemFactory(swigCPtr, itemId, View.getCPtr(view)); else NDalicPINVOKE.ItemFactory_ItemReleased(swigCPtr, itemId, View.getCPtr(view));
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 public ItemFactory() : this(NDalicPINVOKE.new_ItemFactory(), true)
123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 SwigDirectorConnect();
127 private void SwigDirectorConnect()
129 if (SwigDerivedClassHasMethod("GetNumberOfItems", swigMethodTypes0))
130 swigDelegate0 = new SwigDelegateItemFactory_0(SwigDirectorGetNumberOfItems);
131 if (SwigDerivedClassHasMethod("NewItem", swigMethodTypes1))
132 swigDelegate1 = new SwigDelegateItemFactory_1(SwigDirectorNewItem);
133 if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2))
134 swigDelegate2 = new SwigDelegateItemFactory_2(SwigDirectorItemReleased);
135 NDalicPINVOKE.ItemFactory_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
139 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
141 global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, methodTypes);
142 bool hasDerivedMethod = this.GetType().GetTypeInfo().IsSubclassOf(typeof(ItemFactory));
144 Tizen.Log.Debug("NUI-APP", "hasDerivedMethod=" + hasDerivedMethod);
146 return hasDerivedMethod && (methodInfo != null);
149 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
151 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);
152 bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(ItemFactory));
153 return hasDerivedMethod;
157 private uint SwigDirectorGetNumberOfItems()
159 return GetNumberOfItems();
162 private global::System.IntPtr SwigDirectorNewItem(uint itemId)
164 return View.getCPtr(NewItem(itemId)).Handle;
167 private void SwigDirectorItemReleased(uint itemId, global::System.IntPtr actor)
169 ItemReleased(itemId, new View(actor, true));
172 public delegate uint SwigDelegateItemFactory_0();
173 public delegate global::System.IntPtr SwigDelegateItemFactory_1(uint itemId);
174 public delegate void SwigDelegateItemFactory_2(uint itemId, global::System.IntPtr actor);
176 private SwigDelegateItemFactory_0 swigDelegate0;
177 private SwigDelegateItemFactory_1 swigDelegate1;
178 private SwigDelegateItemFactory_2 swigDelegate2;
180 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
181 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(uint) };
182 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(uint), typeof(View) };