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 //------------------------------------------------------------------------------
12 using Tizen.NUI.BaseComponents;
14 public class ViewContainer : global::System.IDisposable, global::System.Collections.IEnumerable
15 , global::System.Collections.Generic.IEnumerable<View>
17 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
18 protected bool swigCMemOwn;
20 internal ViewContainer(global::System.IntPtr cPtr, bool cMemoryOwn) {
21 swigCMemOwn = cMemoryOwn;
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ViewContainer obj) {
26 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
30 DisposeQueue.Instance.Add(this);
33 public virtual void Dispose() {
34 if (!Window.IsInstalled()) {
35 DisposeQueue.Instance.Add(this);
40 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
43 NDalicPINVOKE.delete_ActorContainer(swigCPtr);
45 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
47 global::System.GC.SuppressFinalize(this);
52 public ViewContainer(global::System.Collections.ICollection c) : this() {
54 throw new global::System.ArgumentNullException("c");
55 foreach (View element in c) {
60 public bool IsFixedSize {
66 public bool IsReadOnly {
72 public View this[int index] {
74 return getitem(index);
77 setitem(index, value);
83 return (int)capacity();
87 throw new global::System.ArgumentOutOfRangeException("Capacity");
98 public bool IsSynchronized {
104 public void CopyTo(View[] array)
106 CopyTo(0, array, 0, this.Count);
109 public void CopyTo(View[] array, int arrayIndex)
111 CopyTo(0, array, arrayIndex, this.Count);
114 public void CopyTo(int index, View[] array, int arrayIndex, int count)
117 throw new global::System.ArgumentNullException("array");
119 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
121 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
123 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
125 throw new global::System.ArgumentException("Multi dimensional array.", "array");
126 if (index+count > this.Count || arrayIndex+count > array.Length)
127 throw new global::System.ArgumentException("Number of elements to copy is too large.");
128 for (int i=0; i<count; i++)
129 array.SetValue(getitemcopy(index+i), arrayIndex+i);
132 global::System.Collections.Generic.IEnumerator<View> global::System.Collections.Generic.IEnumerable<View>.GetEnumerator() {
133 return new ViewContainerEnumerator(this);
136 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
137 return new ViewContainerEnumerator(this);
140 public ViewContainerEnumerator GetEnumerator() {
141 return new ViewContainerEnumerator(this);
144 // Type-safe enumerator
145 /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
146 /// whenever the collection is modified. This has been done for changes in the size of the
147 /// collection but not when one of the elements of the collection is modified as it is a bit
148 /// tricky to detect unmanaged code that modifies the collection under our feet.
149 public sealed class ViewContainerEnumerator : global::System.Collections.IEnumerator
150 , global::System.Collections.Generic.IEnumerator<View>
152 private ViewContainer collectionRef;
153 private int currentIndex;
154 private object currentObject;
155 private int currentSize;
157 public ViewContainerEnumerator(ViewContainer collection) {
158 collectionRef = collection;
160 currentObject = null;
161 currentSize = collectionRef.Count;
164 // Type-safe iterator Current
165 public View Current {
167 if (currentIndex == -1)
168 throw new global::System.InvalidOperationException("Enumeration not started.");
169 if (currentIndex > currentSize - 1)
170 throw new global::System.InvalidOperationException("Enumeration finished.");
171 if (currentObject == null)
172 throw new global::System.InvalidOperationException("Collection modified.");
173 return (View)currentObject;
177 // Type-unsafe IEnumerator.Current
178 object global::System.Collections.IEnumerator.Current {
184 public bool MoveNext() {
185 int size = collectionRef.Count;
186 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
189 currentObject = collectionRef[currentIndex];
191 currentObject = null;
196 public void Reset() {
198 currentObject = null;
199 if (collectionRef.Count != currentSize) {
200 throw new global::System.InvalidOperationException("Collection modified.");
204 public void Dispose() {
206 currentObject = null;
210 public void Clear() {
211 NDalicPINVOKE.ActorContainer_Clear(swigCPtr);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 public void Add(View x) {
216 NDalicPINVOKE.ActorContainer_Add(swigCPtr, View.getCPtr(x));
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 private uint size() {
221 uint ret = NDalicPINVOKE.ActorContainer_size(swigCPtr);
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 private uint capacity() {
227 uint ret = NDalicPINVOKE.ActorContainer_capacity(swigCPtr);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 private void reserve(uint n) {
233 NDalicPINVOKE.ActorContainer_reserve(swigCPtr, n);
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237 public ViewContainer() : this(NDalicPINVOKE.new_ActorContainer__SWIG_0(), true) {
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 public ViewContainer(ViewContainer other) : this(NDalicPINVOKE.new_ActorContainer__SWIG_1(ViewContainer.getCPtr(other)), true) {
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 public ViewContainer(int capacity) : this(NDalicPINVOKE.new_ActorContainer__SWIG_2(capacity), true) {
246 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 private View getitemcopy(int index) {
250 View ret = new View(NDalicPINVOKE.ActorContainer_getitemcopy(swigCPtr, index), true);
251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 private View getitem(int index) {
256 View ret = new View(NDalicPINVOKE.ActorContainer_getitem(swigCPtr, index), false);
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 private void setitem(int index, View val) {
262 NDalicPINVOKE.ActorContainer_setitem(swigCPtr, index, View.getCPtr(val));
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 public void AddRange(ViewContainer values) {
267 NDalicPINVOKE.ActorContainer_AddRange(swigCPtr, ViewContainer.getCPtr(values));
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 public ViewContainer GetRange(int index, int count) {
272 global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_GetRange(swigCPtr, index, count);
273 ViewContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ViewContainer(cPtr, true);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 public void Insert(int index, View x) {
279 NDalicPINVOKE.ActorContainer_Insert(swigCPtr, index, View.getCPtr(x));
280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 public void InsertRange(int index, ViewContainer values) {
284 NDalicPINVOKE.ActorContainer_InsertRange(swigCPtr, index, ViewContainer.getCPtr(values));
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 public void RemoveAt(int index) {
289 NDalicPINVOKE.ActorContainer_RemoveAt(swigCPtr, index);
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293 public void RemoveRange(int index, int count) {
294 NDalicPINVOKE.ActorContainer_RemoveRange(swigCPtr, index, count);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 public static ViewContainer Repeat(View value, int count) {
299 global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_Repeat(View.getCPtr(value), count);
300 ViewContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ViewContainer(cPtr, true);
301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305 public void Reverse() {
306 NDalicPINVOKE.ActorContainer_Reverse__SWIG_0(swigCPtr);
307 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310 public void Reverse(int index, int count) {
311 NDalicPINVOKE.ActorContainer_Reverse__SWIG_1(swigCPtr, index, count);
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 public void SetRange(int index, ViewContainer values) {
316 NDalicPINVOKE.ActorContainer_SetRange(swigCPtr, index, ViewContainer.getCPtr(values));
317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();