2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.ComponentModel;
19 using System.Reflection;
20 using Tizen.NUI.BaseComponents;
24 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
25 [EditorBrowsable(EditorBrowsableState.Never)]
26 public class ItemFactory : Disposable
28 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
30 /// <summary>swigCMemOwn.</summary>
31 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
32 protected bool swigCMemOwn;
34 internal ItemFactory(global::System.IntPtr cPtr, bool cMemoryOwn)
36 swigCMemOwn = cMemoryOwn;
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemFactory obj)
42 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
46 [EditorBrowsable(EditorBrowsableState.Never)]
47 protected override void Dispose(DisposeTypes type)
54 //Release your own unmanaged resources here.
55 //You should not access any managed member here except static instance.
56 //because the execution order of Finalizes is non-deterministic.
58 if (swigCPtr.Handle != global::System.IntPtr.Zero)
63 Interop.ItemFactory.delete_ItemFactory(swigCPtr);
65 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
71 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
72 [EditorBrowsable(EditorBrowsableState.Never)]
73 public virtual uint GetNumberOfItems()
75 uint ret = Interop.ItemFactory.ItemFactory_GetNumberOfItems(swigCPtr);
76 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
80 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
81 [EditorBrowsable(EditorBrowsableState.Never)]
82 public virtual View NewItem(uint itemId)
84 View ret = new View(Interop.ItemFactory.ItemFactory_NewItem(swigCPtr, itemId), true);
85 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
90 [EditorBrowsable(EditorBrowsableState.Never)]
91 public virtual void ItemReleased(uint itemId, View view)
93 if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2)) Interop.ItemFactory.ItemFactory_ItemReleasedSwigExplicitItemFactory(swigCPtr, itemId, View.getCPtr(view)); else Interop.ItemFactory.ItemFactory_ItemReleased(swigCPtr, itemId, View.getCPtr(view));
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
98 [EditorBrowsable(EditorBrowsableState.Never)]
99 public ItemFactory() : this(Interop.ItemFactory.new_ItemFactory(), true)
101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 SwigDirectorConnect();
105 private void SwigDirectorConnect()
107 if (SwigDerivedClassHasMethod("GetNumberOfItems", swigMethodTypes0))
108 swigDelegate0 = new SwigDelegateItemFactory_0(SwigDirectorGetNumberOfItems);
109 if (SwigDerivedClassHasMethod("NewItem", swigMethodTypes1))
110 swigDelegate1 = new SwigDelegateItemFactory_1(SwigDirectorNewItem);
111 if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2))
112 swigDelegate2 = new SwigDelegateItemFactory_2(SwigDirectorItemReleased);
113 Interop.ItemFactory.ItemFactory_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
116 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
118 global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, methodTypes);
119 bool hasDerivedMethod = this.GetType().GetTypeInfo().IsSubclassOf(typeof(ItemFactory));
120 NUILog.Debug("hasDerivedMethod=" + hasDerivedMethod);
121 return hasDerivedMethod && (methodInfo != null);
124 private uint SwigDirectorGetNumberOfItems()
126 return GetNumberOfItems();
129 private global::System.IntPtr SwigDirectorNewItem(uint itemId)
131 return View.getCPtr(NewItem(itemId)).Handle;
134 private void SwigDirectorItemReleased(uint itemId, global::System.IntPtr actor)
136 ItemReleased(itemId, new View(actor, true));
139 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
140 [EditorBrowsable(EditorBrowsableState.Never)]
141 public delegate uint SwigDelegateItemFactory_0();
143 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
144 [EditorBrowsable(EditorBrowsableState.Never)]
145 public delegate global::System.IntPtr SwigDelegateItemFactory_1(uint itemId);
147 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
148 [EditorBrowsable(EditorBrowsableState.Never)]
149 public delegate void SwigDelegateItemFactory_2(uint itemId, global::System.IntPtr actor);
151 private SwigDelegateItemFactory_0 swigDelegate0;
152 private SwigDelegateItemFactory_1 swigDelegate1;
153 private SwigDelegateItemFactory_2 swigDelegate2;
155 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
156 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(uint) };
157 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(uint), typeof(View) };