manual bind tts player for nui
[platform/core/csapi/tizenfx.git] / src / 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 {
13     using Tizen.NUI.BaseComponents;
14
15     public class ViewContainer : global::System.IDisposable, global::System.Collections.IEnumerable
16         , global::System.Collections.Generic.IEnumerable<View>
17     {
18         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19         protected bool swigCMemOwn;
20
21         internal ViewContainer(global::System.IntPtr cPtr, bool cMemoryOwn)
22         {
23             swigCMemOwn = cMemoryOwn;
24             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
25         }
26
27         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ViewContainer obj)
28         {
29             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
30         }
31
32         //A Flag to check who called Dispose(). (By User or DisposeQueue)
33         private bool isDisposeQueued = false;
34         //A Flat to check if it is already disposed.
35         protected bool disposed = false;
36
37
38         ~ViewContainer()
39         {
40             if (!isDisposeQueued)
41             {
42                 isDisposeQueued = true;
43                 DisposeQueue.Instance.Add(this);
44             }
45         }
46
47         public void Dispose()
48         {
49             //Throw excpetion if Dispose() is called in separate thread.
50             if (!Window.IsInstalled())
51             {
52                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
53             }
54
55             if (isDisposeQueued)
56             {
57                 Dispose(DisposeTypes.Implicit);
58             }
59             else
60             {
61                 Dispose(DisposeTypes.Explicit);
62                 System.GC.SuppressFinalize(this);
63             }
64         }
65
66         protected virtual void Dispose(DisposeTypes type)
67         {
68             if (disposed)
69             {
70                 return;
71             }
72
73             if (type == DisposeTypes.Explicit)
74             {
75                 //Called by User
76                 //Release your own managed resources here.
77                 //You should release all of your own disposable objects here.
78
79             }
80
81             //Release your own unmanaged resources here.
82             //You should not access any managed member here except static instance.
83             //because the execution order of Finalizes is non-deterministic.
84
85             if (swigCPtr.Handle != global::System.IntPtr.Zero)
86             {
87                 if (swigCMemOwn)
88                 {
89                     swigCMemOwn = false;
90                     NDalicPINVOKE.delete_ActorContainer(swigCPtr);
91                 }
92                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
93             }
94
95             disposed = true;
96         }
97
98
99
100         public ViewContainer(global::System.Collections.ICollection c) : this()
101         {
102             if (c == null)
103                 throw new global::System.ArgumentNullException("c");
104             foreach (View element in c)
105             {
106                 this.Add(element);
107             }
108         }
109
110         public bool IsFixedSize
111         {
112             get
113             {
114                 return false;
115             }
116         }
117
118         public bool IsReadOnly
119         {
120             get
121             {
122                 return false;
123             }
124         }
125
126         public View this[int index]
127         {
128             get
129             {
130                 return getitem(index);
131             }
132             set
133             {
134                 setitem(index, value);
135             }
136         }
137
138         public int Capacity
139         {
140             get
141             {
142                 return (int)capacity();
143             }
144             set
145             {
146                 if (value < size())
147                     throw new global::System.ArgumentOutOfRangeException("Capacity");
148                 reserve((uint)value);
149             }
150         }
151
152         public int Count
153         {
154             get
155             {
156                 return (int)size();
157             }
158         }
159
160         public bool IsSynchronized
161         {
162             get
163             {
164                 return false;
165             }
166         }
167
168         public void CopyTo(View[] array)
169         {
170             CopyTo(0, array, 0, this.Count);
171         }
172
173         public void CopyTo(View[] array, int arrayIndex)
174         {
175             CopyTo(0, array, arrayIndex, this.Count);
176         }
177
178         public void CopyTo(int index, View[] array, int arrayIndex, int count)
179         {
180             if (array == null)
181                 throw new global::System.ArgumentNullException("array");
182             if (index < 0)
183                 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
184             if (arrayIndex < 0)
185                 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
186             if (count < 0)
187                 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
188             if (array.Rank > 1)
189                 throw new global::System.ArgumentException("Multi dimensional array.", "array");
190             if (index + count > this.Count || arrayIndex + count > array.Length)
191                 throw new global::System.ArgumentException("Number of elements to copy is too large.");
192             for (int i = 0; i < count; i++)
193                 array.SetValue(getitemcopy(index + i), arrayIndex + i);
194         }
195
196         global::System.Collections.Generic.IEnumerator<View> global::System.Collections.Generic.IEnumerable<View>.GetEnumerator()
197         {
198             return new ViewContainerEnumerator(this);
199         }
200
201         global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
202         {
203             return new ViewContainerEnumerator(this);
204         }
205
206         public ViewContainerEnumerator GetEnumerator()
207         {
208             return new ViewContainerEnumerator(this);
209         }
210
211         // Type-safe enumerator
212         /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
213         /// whenever the collection is modified. This has been done for changes in the size of the
214         /// collection but not when one of the elements of the collection is modified as it is a bit
215         /// tricky to detect unmanaged code that modifies the collection under our feet.
216         public sealed class ViewContainerEnumerator : global::System.Collections.IEnumerator
217           , global::System.Collections.Generic.IEnumerator<View>
218         {
219             private ViewContainer collectionRef;
220             private int currentIndex;
221             private object currentObject;
222             private int currentSize;
223
224             public ViewContainerEnumerator(ViewContainer collection)
225             {
226                 collectionRef = collection;
227                 currentIndex = -1;
228                 currentObject = null;
229                 currentSize = collectionRef.Count;
230             }
231
232             // Type-safe iterator Current
233             public View Current
234             {
235                 get
236                 {
237                     if (currentIndex == -1)
238                         throw new global::System.InvalidOperationException("Enumeration not started.");
239                     if (currentIndex > currentSize - 1)
240                         throw new global::System.InvalidOperationException("Enumeration finished.");
241                     if (currentObject == null)
242                         throw new global::System.InvalidOperationException("Collection modified.");
243                     return (View)currentObject;
244                 }
245             }
246
247             // Type-unsafe IEnumerator.Current
248             object global::System.Collections.IEnumerator.Current
249             {
250                 get
251                 {
252                     return Current;
253                 }
254             }
255
256             public bool MoveNext()
257             {
258                 int size = collectionRef.Count;
259                 bool moveOkay = (currentIndex + 1 < size) && (size == currentSize);
260                 if (moveOkay)
261                 {
262                     currentIndex++;
263                     currentObject = collectionRef[currentIndex];
264                 }
265                 else
266                 {
267                     currentObject = null;
268                 }
269                 return moveOkay;
270             }
271
272             public void Reset()
273             {
274                 currentIndex = -1;
275                 currentObject = null;
276                 if (collectionRef.Count != currentSize)
277                 {
278                     throw new global::System.InvalidOperationException("Collection modified.");
279                 }
280             }
281
282             public void Dispose()
283             {
284                 currentIndex = -1;
285                 currentObject = null;
286             }
287         }
288
289         public void Clear()
290         {
291             NDalicPINVOKE.ActorContainer_Clear(swigCPtr);
292             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293         }
294
295         public void Add(View x)
296         {
297             NDalicPINVOKE.ActorContainer_Add(swigCPtr, View.getCPtr(x));
298             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299         }
300
301         private uint size()
302         {
303             uint ret = NDalicPINVOKE.ActorContainer_size(swigCPtr);
304             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305             return ret;
306         }
307
308         private uint capacity()
309         {
310             uint ret = NDalicPINVOKE.ActorContainer_capacity(swigCPtr);
311             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312             return ret;
313         }
314
315         private void reserve(uint n)
316         {
317             NDalicPINVOKE.ActorContainer_reserve(swigCPtr, n);
318             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319         }
320
321         public ViewContainer() : this(NDalicPINVOKE.new_ActorContainer__SWIG_0(), true)
322         {
323             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324         }
325
326         public ViewContainer(ViewContainer other) : this(NDalicPINVOKE.new_ActorContainer__SWIG_1(ViewContainer.getCPtr(other)), true)
327         {
328             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329         }
330
331         public ViewContainer(int capacity) : this(NDalicPINVOKE.new_ActorContainer__SWIG_2(capacity), true)
332         {
333             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334         }
335
336         private View getitemcopy(int index)
337         {
338             View ret = new View(NDalicPINVOKE.ActorContainer_getitemcopy(swigCPtr, index), true);
339             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340             return ret;
341         }
342
343         private View getitem(int index)
344         {
345             View ret = new View(NDalicPINVOKE.ActorContainer_getitem(swigCPtr, index), false);
346             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347             return ret;
348         }
349
350         private void setitem(int index, View val)
351         {
352             NDalicPINVOKE.ActorContainer_setitem(swigCPtr, index, View.getCPtr(val));
353             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354         }
355
356         public void AddRange(ViewContainer values)
357         {
358             NDalicPINVOKE.ActorContainer_AddRange(swigCPtr, ViewContainer.getCPtr(values));
359             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360         }
361
362         public ViewContainer GetRange(int index, int count)
363         {
364             global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_GetRange(swigCPtr, index, count);
365             ViewContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ViewContainer(cPtr, true);
366             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367             return ret;
368         }
369
370         public void Insert(int index, View x)
371         {
372             NDalicPINVOKE.ActorContainer_Insert(swigCPtr, index, View.getCPtr(x));
373             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
374         }
375
376         public void InsertRange(int index, ViewContainer values)
377         {
378             NDalicPINVOKE.ActorContainer_InsertRange(swigCPtr, index, ViewContainer.getCPtr(values));
379             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380         }
381
382         public void RemoveAt(int index)
383         {
384             NDalicPINVOKE.ActorContainer_RemoveAt(swigCPtr, index);
385             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386         }
387
388         public void RemoveRange(int index, int count)
389         {
390             NDalicPINVOKE.ActorContainer_RemoveRange(swigCPtr, index, count);
391             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392         }
393
394         public static ViewContainer Repeat(View value, int count)
395         {
396             global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_Repeat(View.getCPtr(value), count);
397             ViewContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ViewContainer(cPtr, true);
398             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399             return ret;
400         }
401
402         public void Reverse()
403         {
404             NDalicPINVOKE.ActorContainer_Reverse__SWIG_0(swigCPtr);
405             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406         }
407
408         public void Reverse(int index, int count)
409         {
410             NDalicPINVOKE.ActorContainer_Reverse__SWIG_1(swigCPtr, index, count);
411             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412         }
413
414         public void SetRange(int index, ViewContainer values)
415         {
416             NDalicPINVOKE.ActorContainer_SetRange(swigCPtr, index, ViewContainer.getCPtr(values));
417             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
418         }
419
420     }
421
422 }