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