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;
22 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 Item : global::System.IDisposable
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 Item(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(Item obj)
42 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45 /// <summary>A Flag to check who called Dispose(). (By User or DisposeQueue)</summary>
46 private bool isDisposeQueued = false;
48 /// <summary>A Flag to check if it is already disposed.</summary>
49 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
50 protected bool disposed = false;
53 /// <summary>Destructor.</summary>
54 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
59 isDisposeQueued = true;
60 DisposeQueue.Instance.Add(this);
64 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
65 [EditorBrowsable(EditorBrowsableState.Never)]
68 //Throw excpetion if Dispose() is called in separate thread.
69 if (!Window.IsInstalled())
71 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
76 Dispose(DisposeTypes.Implicit);
80 Dispose(DisposeTypes.Explicit);
81 System.GC.SuppressFinalize(this);
85 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
86 [EditorBrowsable(EditorBrowsableState.Never)]
87 protected virtual void Dispose(DisposeTypes type)
94 if (type == DisposeTypes.Explicit)
97 //Release your own managed resources here.
98 //You should release all of your own disposable objects here.
102 //Release your own unmanaged resources here.
103 //You should not access any managed member here except static instance.
104 //because the execution order of Finalizes is non-deterministic.
106 if (swigCPtr.Handle != global::System.IntPtr.Zero)
111 Interop.Item.delete_Item(swigCPtr);
113 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
119 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
120 [EditorBrowsable(EditorBrowsableState.Never)]
121 public Item() : this(Interop.Item.new_Item__SWIG_0(), true)
123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
127 [EditorBrowsable(EditorBrowsableState.Never)]
128 public Item(uint t, View u) : this(Interop.Item.new_Item__SWIG_1(t, View.getCPtr(u)), true)
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
134 [EditorBrowsable(EditorBrowsableState.Never)]
135 public Item(Item p) : this(Interop.Item.new_Item__SWIG_2(Item.getCPtr(p)), true)
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
141 [EditorBrowsable(EditorBrowsableState.Never)]
146 Interop.Item.Item_first_set(swigCPtr, value);
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 uint ret = Interop.Item.Item_first_get(swigCPtr);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
158 [EditorBrowsable(EditorBrowsableState.Never)]
163 Interop.Item.Item_second_set(swigCPtr, View.getCPtr(value));
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 global::System.IntPtr cPtr = Interop.Item.Item_second_get(swigCPtr);
169 View ret = (cPtr == global::System.IntPtr.Zero) ? null : new View(cPtr, false);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();