Merge "C# CustomView Implementation (C++ wrappers, manual bindings, C# wrappers)...
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / ActorContainer.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
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 Dali {
12
13 public class ActorContainer : global::System.IDisposable, global::System.Collections.IEnumerable
14     , global::System.Collections.Generic.IEnumerable<Actor>
15  {
16   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17   protected bool swigCMemOwn;
18
19   internal ActorContainer(global::System.IntPtr cPtr, bool cMemoryOwn) {
20     swigCMemOwn = cMemoryOwn;
21     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
22   }
23
24   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ActorContainer obj) {
25     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
26   }
27
28   ~ActorContainer() {
29     Dispose();
30   }
31
32   public virtual void Dispose() {
33     lock(this) {
34       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
35         if (swigCMemOwn) {
36           swigCMemOwn = false;
37           NDalicPINVOKE.delete_ActorContainer(swigCPtr);
38         }
39         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
40       }
41       global::System.GC.SuppressFinalize(this);
42     }
43   }
44
45   public ActorContainer(global::System.Collections.ICollection c) : this() {
46     if (c == null)
47       throw new global::System.ArgumentNullException("c");
48     foreach (Actor element in c) {
49       this.Add(element);
50     }
51   }
52
53   public bool IsFixedSize {
54     get {
55       return false;
56     }
57   }
58
59   public bool IsReadOnly {
60     get {
61       return false;
62     }
63   }
64
65   public Actor this[int index]  {
66     get {
67       return getitem(index);
68     }
69     set {
70       setitem(index, value);
71     }
72   }
73
74   public int Capacity {
75     get {
76       return (int)capacity();
77     }
78     set {
79       if (value < size())
80         throw new global::System.ArgumentOutOfRangeException("Capacity");
81       reserve((uint)value);
82     }
83   }
84
85   public int Count {
86     get {
87       return (int)size();
88     }
89   }
90
91   public bool IsSynchronized {
92     get {
93       return false;
94     }
95   }
96
97   public void CopyTo(Actor[] array)
98   {
99     CopyTo(0, array, 0, this.Count);
100   }
101
102   public void CopyTo(Actor[] array, int arrayIndex)
103   {
104     CopyTo(0, array, arrayIndex, this.Count);
105   }
106
107   public void CopyTo(int index, Actor[] array, int arrayIndex, int count)
108   {
109     if (array == null)
110       throw new global::System.ArgumentNullException("array");
111     if (index < 0)
112       throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
113     if (arrayIndex < 0)
114       throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
115     if (count < 0)
116       throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
117     if (array.Rank > 1)
118       throw new global::System.ArgumentException("Multi dimensional array.", "array");
119     if (index+count > this.Count || arrayIndex+count > array.Length)
120       throw new global::System.ArgumentException("Number of elements to copy is too large.");
121     for (int i=0; i<count; i++)
122       array.SetValue(getitemcopy(index+i), arrayIndex+i);
123   }
124
125   global::System.Collections.Generic.IEnumerator<Actor> global::System.Collections.Generic.IEnumerable<Actor>.GetEnumerator() {
126     return new ActorContainerEnumerator(this);
127   }
128
129   global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
130     return new ActorContainerEnumerator(this);
131   }
132
133   public ActorContainerEnumerator GetEnumerator() {
134     return new ActorContainerEnumerator(this);
135   }
136
137   // Type-safe enumerator
138   /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
139   /// whenever the collection is modified. This has been done for changes in the size of the
140   /// collection but not when one of the elements of the collection is modified as it is a bit
141   /// tricky to detect unmanaged code that modifies the collection under our feet.
142   public sealed class ActorContainerEnumerator : global::System.Collections.IEnumerator
143     , global::System.Collections.Generic.IEnumerator<Actor>
144   {
145     private ActorContainer collectionRef;
146     private int currentIndex;
147     private object currentObject;
148     private int currentSize;
149
150     public ActorContainerEnumerator(ActorContainer collection) {
151       collectionRef = collection;
152       currentIndex = -1;
153       currentObject = null;
154       currentSize = collectionRef.Count;
155     }
156
157     // Type-safe iterator Current
158     public Actor Current {
159       get {
160         if (currentIndex == -1)
161           throw new global::System.InvalidOperationException("Enumeration not started.");
162         if (currentIndex > currentSize - 1)
163           throw new global::System.InvalidOperationException("Enumeration finished.");
164         if (currentObject == null)
165           throw new global::System.InvalidOperationException("Collection modified.");
166         return (Actor)currentObject;
167       }
168     }
169
170     // Type-unsafe IEnumerator.Current
171     object global::System.Collections.IEnumerator.Current {
172       get {
173         return Current;
174       }
175     }
176
177     public bool MoveNext() {
178       int size = collectionRef.Count;
179       bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
180       if (moveOkay) {
181         currentIndex++;
182         currentObject = collectionRef[currentIndex];
183       } else {
184         currentObject = null;
185       }
186       return moveOkay;
187     }
188
189     public void Reset() {
190       currentIndex = -1;
191       currentObject = null;
192       if (collectionRef.Count != currentSize) {
193         throw new global::System.InvalidOperationException("Collection modified.");
194       }
195     }
196
197     public void Dispose() {
198         currentIndex = -1;
199         currentObject = null;
200     }
201   }
202
203   public void Clear() {
204     NDalicPINVOKE.ActorContainer_Clear(swigCPtr);
205     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206   }
207
208   public void Add(Actor x) {
209     NDalicPINVOKE.ActorContainer_Add(swigCPtr, Actor.getCPtr(x));
210     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211   }
212
213   private uint size() {
214     uint ret = NDalicPINVOKE.ActorContainer_size(swigCPtr);
215     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216     return ret;
217   }
218
219   private uint capacity() {
220     uint ret = NDalicPINVOKE.ActorContainer_capacity(swigCPtr);
221     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222     return ret;
223   }
224
225   private void reserve(uint n) {
226     NDalicPINVOKE.ActorContainer_reserve(swigCPtr, n);
227     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228   }
229
230   public ActorContainer() : this(NDalicPINVOKE.new_ActorContainer__SWIG_0(), true) {
231     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232   }
233
234   public ActorContainer(ActorContainer other) : this(NDalicPINVOKE.new_ActorContainer__SWIG_1(ActorContainer.getCPtr(other)), true) {
235     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236   }
237
238   public ActorContainer(int capacity) : this(NDalicPINVOKE.new_ActorContainer__SWIG_2(capacity), true) {
239     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240   }
241
242   private Actor getitemcopy(int index) {
243     Actor ret = new Actor(NDalicPINVOKE.ActorContainer_getitemcopy(swigCPtr, index), true);
244     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245     return ret;
246   }
247
248   private Actor getitem(int index) {
249     Actor ret = new Actor(NDalicPINVOKE.ActorContainer_getitem(swigCPtr, index), false);
250     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251     return ret;
252   }
253
254   private void setitem(int index, Actor val) {
255     NDalicPINVOKE.ActorContainer_setitem(swigCPtr, index, Actor.getCPtr(val));
256     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
257   }
258
259   public void AddRange(ActorContainer values) {
260     NDalicPINVOKE.ActorContainer_AddRange(swigCPtr, ActorContainer.getCPtr(values));
261     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262   }
263
264   public ActorContainer GetRange(int index, int count) {
265     global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_GetRange(swigCPtr, index, count);
266     ActorContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ActorContainer(cPtr, true);
267     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268     return ret;
269   }
270
271   public void Insert(int index, Actor x) {
272     NDalicPINVOKE.ActorContainer_Insert(swigCPtr, index, Actor.getCPtr(x));
273     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274   }
275
276   public void InsertRange(int index, ActorContainer values) {
277     NDalicPINVOKE.ActorContainer_InsertRange(swigCPtr, index, ActorContainer.getCPtr(values));
278     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279   }
280
281   public void RemoveAt(int index) {
282     NDalicPINVOKE.ActorContainer_RemoveAt(swigCPtr, index);
283     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
284   }
285
286   public void RemoveRange(int index, int count) {
287     NDalicPINVOKE.ActorContainer_RemoveRange(swigCPtr, index, count);
288     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289   }
290
291   public static ActorContainer Repeat(Actor value, int count) {
292     global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_Repeat(Actor.getCPtr(value), count);
293     ActorContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ActorContainer(cPtr, true);
294     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295     return ret;
296   }
297
298   public void Reverse() {
299     NDalicPINVOKE.ActorContainer_Reverse__SWIG_0(swigCPtr);
300     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301   }
302
303   public void Reverse(int index, int count) {
304     NDalicPINVOKE.ActorContainer_Reverse__SWIG_1(swigCPtr, index, count);
305     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306   }
307
308   public void SetRange(int index, ActorContainer values) {
309     NDalicPINVOKE.ActorContainer_SetRange(swigCPtr, index, ActorContainer.getCPtr(values));
310     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311   }
312
313 }
314
315 }