manual nui merge 0.2.38
[platform/core/csapi/nui.git] / Tizen.NUI / src / internal / ViewContainer.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.10
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 namespace Tizen.NUI {
12     using Tizen.NUI.BaseComponents;
13
14 public class ViewContainer : global::System.IDisposable, global::System.Collections.IEnumerable
15     , global::System.Collections.Generic.IEnumerable<View>
16  {
17   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
18   protected bool swigCMemOwn;
19
20   internal ViewContainer(global::System.IntPtr cPtr, bool cMemoryOwn) {
21     swigCMemOwn = cMemoryOwn;
22     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23   }
24
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;
27   }
28
29   ~ViewContainer() {
30     DisposeQueue.Instance.Add(this);
31   }
32
33   public virtual void Dispose() {
34     if (!Window.IsInstalled()) {
35       DisposeQueue.Instance.Add(this);
36       return;
37     }
38
39     lock(this) {
40       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
41         if (swigCMemOwn) {
42           swigCMemOwn = false;
43           NDalicPINVOKE.delete_ActorContainer(swigCPtr);
44         }
45         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
46       }
47       global::System.GC.SuppressFinalize(this);
48     }
49   }
50
51
52   public ViewContainer(global::System.Collections.ICollection c) : this() {
53     if (c == null)
54       throw new global::System.ArgumentNullException("c");
55     foreach (View element in c) {
56       this.Add(element);
57     }
58   }
59
60   public bool IsFixedSize {
61     get {
62       return false;
63     }
64   }
65
66   public bool IsReadOnly {
67     get {
68       return false;
69     }
70   }
71
72   public View this[int index]  {
73     get {
74       return getitem(index);
75     }
76     set {
77       setitem(index, value);
78     }
79   }
80
81   public int Capacity {
82     get {
83       return (int)capacity();
84     }
85     set {
86       if (value < size())
87         throw new global::System.ArgumentOutOfRangeException("Capacity");
88       reserve((uint)value);
89     }
90   }
91
92   public int Count {
93     get {
94       return (int)size();
95     }
96   }
97
98   public bool IsSynchronized {
99     get {
100       return false;
101     }
102   }
103
104   public void CopyTo(View[] array)
105   {
106     CopyTo(0, array, 0, this.Count);
107   }
108
109   public void CopyTo(View[] array, int arrayIndex)
110   {
111     CopyTo(0, array, arrayIndex, this.Count);
112   }
113
114   public void CopyTo(int index, View[] array, int arrayIndex, int count)
115   {
116     if (array == null)
117       throw new global::System.ArgumentNullException("array");
118     if (index < 0)
119       throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
120     if (arrayIndex < 0)
121       throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
122     if (count < 0)
123       throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
124     if (array.Rank > 1)
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);
130   }
131
132   global::System.Collections.Generic.IEnumerator<View> global::System.Collections.Generic.IEnumerable<View>.GetEnumerator() {
133     return new ViewContainerEnumerator(this);
134   }
135
136   global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
137     return new ViewContainerEnumerator(this);
138   }
139
140   public ViewContainerEnumerator GetEnumerator() {
141     return new ViewContainerEnumerator(this);
142   }
143
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>
151   {
152     private ViewContainer collectionRef;
153     private int currentIndex;
154     private object currentObject;
155     private int currentSize;
156
157     public ViewContainerEnumerator(ViewContainer collection) {
158       collectionRef = collection;
159       currentIndex = -1;
160       currentObject = null;
161       currentSize = collectionRef.Count;
162     }
163
164     // Type-safe iterator Current
165     public View Current {
166       get {
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;
174       }
175     }
176
177     // Type-unsafe IEnumerator.Current
178     object global::System.Collections.IEnumerator.Current {
179       get {
180         return Current;
181       }
182     }
183
184     public bool MoveNext() {
185       int size = collectionRef.Count;
186       bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
187       if (moveOkay) {
188         currentIndex++;
189         currentObject = collectionRef[currentIndex];
190       } else {
191         currentObject = null;
192       }
193       return moveOkay;
194     }
195
196     public void Reset() {
197       currentIndex = -1;
198       currentObject = null;
199       if (collectionRef.Count != currentSize) {
200         throw new global::System.InvalidOperationException("Collection modified.");
201       }
202     }
203
204     public void Dispose() {
205         currentIndex = -1;
206         currentObject = null;
207     }
208   }
209
210   public void Clear() {
211     NDalicPINVOKE.ActorContainer_Clear(swigCPtr);
212     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213   }
214
215   public void Add(View x) {
216     NDalicPINVOKE.ActorContainer_Add(swigCPtr, View.getCPtr(x));
217     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218   }
219
220   private uint size() {
221     uint ret = NDalicPINVOKE.ActorContainer_size(swigCPtr);
222     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223     return ret;
224   }
225
226   private uint capacity() {
227     uint ret = NDalicPINVOKE.ActorContainer_capacity(swigCPtr);
228     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229     return ret;
230   }
231
232   private void reserve(uint n) {
233     NDalicPINVOKE.ActorContainer_reserve(swigCPtr, n);
234     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235   }
236
237   public ViewContainer() : this(NDalicPINVOKE.new_ActorContainer__SWIG_0(), true) {
238     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239   }
240
241   public ViewContainer(ViewContainer other) : this(NDalicPINVOKE.new_ActorContainer__SWIG_1(ViewContainer.getCPtr(other)), true) {
242     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243   }
244
245   public ViewContainer(int capacity) : this(NDalicPINVOKE.new_ActorContainer__SWIG_2(capacity), true) {
246     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247   }
248
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();
252     return ret;
253   }
254
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();
258     return ret;
259   }
260
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();
264   }
265
266   public void AddRange(ViewContainer values) {
267     NDalicPINVOKE.ActorContainer_AddRange(swigCPtr, ViewContainer.getCPtr(values));
268     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269   }
270
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();
275     return ret;
276   }
277
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();
281   }
282
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();
286   }
287
288   public void RemoveAt(int index) {
289     NDalicPINVOKE.ActorContainer_RemoveAt(swigCPtr, index);
290     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291   }
292
293   public void RemoveRange(int index, int count) {
294     NDalicPINVOKE.ActorContainer_RemoveRange(swigCPtr, index, count);
295     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296   }
297
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();
302     return ret;
303   }
304
305   public void Reverse() {
306     NDalicPINVOKE.ActorContainer_Reverse__SWIG_0(swigCPtr);
307     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308   }
309
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();
313   }
314
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();
318   }
319
320 }
321
322 }