2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.ComponentModel;
22 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
23 [EditorBrowsable(EditorBrowsableState.Never)]
24 public class ItemIdContainer : Disposable, global::System.Collections.IEnumerable,
25 global::System.Collections.Generic.IList<uint>
27 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
29 /// <summary>swigCMemOwn.</summary>
30 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
31 protected bool swigCMemOwn;
33 internal ItemIdContainer(global::System.IntPtr cPtr, bool cMemoryOwn)
35 swigCMemOwn = cMemoryOwn;
36 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemIdContainer obj)
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
45 [EditorBrowsable(EditorBrowsableState.Never)]
46 protected override void Dispose(DisposeTypes type)
53 //Release your own unmanaged resources here.
54 //You should not access any managed member here except static instance.
55 //because the execution order of Finalizes is non-deterministic.
57 if (swigCPtr.Handle != global::System.IntPtr.Zero)
62 Interop.ItemIdContainer.delete_ItemIdContainer(swigCPtr);
64 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
71 [EditorBrowsable(EditorBrowsableState.Never)]
72 public ItemIdContainer(global::System.Collections.ICollection c) : this()
75 throw new global::System.ArgumentNullException("c");
76 foreach (uint element in c)
82 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
83 [EditorBrowsable(EditorBrowsableState.Never)]
84 public bool IsFixedSize
92 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public bool IsReadOnly
102 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
103 [EditorBrowsable(EditorBrowsableState.Never)]
104 public uint this[int index]
108 return getitem(index);
112 setitem(index, value);
116 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
117 [EditorBrowsable(EditorBrowsableState.Never)]
122 return (int)capacity();
127 throw new global::System.ArgumentOutOfRangeException("Capacity");
128 reserve((uint)value);
132 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
133 [EditorBrowsable(EditorBrowsableState.Never)]
142 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
143 [EditorBrowsable(EditorBrowsableState.Never)]
144 public bool IsSynchronized
152 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
153 [EditorBrowsable(EditorBrowsableState.Never)]
154 public void CopyTo(uint[] array)
156 CopyTo(0, array, 0, this.Count);
159 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
160 [EditorBrowsable(EditorBrowsableState.Never)]
161 public void CopyTo(uint[] array, int arrayIndex)
163 CopyTo(0, array, arrayIndex, this.Count);
166 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
167 [EditorBrowsable(EditorBrowsableState.Never)]
168 public void CopyTo(int index, uint[] array, int arrayIndex, int count)
171 throw new global::System.ArgumentNullException("array");
173 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
175 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
177 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
179 throw new global::System.ArgumentException("Multi dimensional array.", "array");
180 if (index + count > this.Count || arrayIndex + count > array.Length)
181 throw new global::System.ArgumentException("Number of elements to copy is too large.");
182 for (int i = 0; i < count; i++)
183 array.SetValue(getitemcopy(index + i), arrayIndex + i);
186 global::System.Collections.Generic.IEnumerator<uint> global::System.Collections.Generic.IEnumerable<uint>.GetEnumerator()
188 return new ItemIdContainerEnumerator(this);
191 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
193 return new ItemIdContainerEnumerator(this);
196 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
197 [EditorBrowsable(EditorBrowsableState.Never)]
198 public ItemIdContainerEnumerator GetEnumerator()
200 return new ItemIdContainerEnumerator(this);
203 // The type-safe enumerator.
204 /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
205 /// whenever the collection is modified. This has been done for changes in the size of the
206 /// collection, but not when one of the elements of the collection is modified as it is a bit
207 /// tricky to detect unmanaged code that modifies the collection under our feet.
208 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
209 [EditorBrowsable(EditorBrowsableState.Never)]
210 public sealed class ItemIdContainerEnumerator : global::System.Collections.IEnumerator
211 , global::System.Collections.Generic.IEnumerator<uint>
213 private ItemIdContainer collectionRef;
214 private int currentIndex;
215 private object currentObject;
216 private int currentSize;
218 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
219 [EditorBrowsable(EditorBrowsableState.Never)]
220 public ItemIdContainerEnumerator(ItemIdContainer collection)
222 collectionRef = collection;
224 currentObject = null;
225 currentSize = collectionRef.Count;
228 // Type-safe iterator Current
229 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
230 [EditorBrowsable(EditorBrowsableState.Never)]
235 if (currentIndex == -1)
236 throw new global::System.InvalidOperationException("Enumeration not started.");
237 if (currentIndex > currentSize - 1)
238 throw new global::System.InvalidOperationException("Enumeration finished.");
239 if (currentObject == null)
240 throw new global::System.InvalidOperationException("Collection modified.");
241 return (uint)currentObject;
245 // Type-unsafe IEnumerator.Current
246 object global::System.Collections.IEnumerator.Current
254 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
255 [EditorBrowsable(EditorBrowsableState.Never)]
256 public bool MoveNext()
258 int size = collectionRef.Count;
259 bool moveOkay = (currentIndex + 1 < size) && (size == currentSize);
263 currentObject = collectionRef[currentIndex];
267 currentObject = null;
272 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
273 [EditorBrowsable(EditorBrowsableState.Never)]
277 currentObject = null;
278 if (collectionRef.Count != currentSize)
280 throw new global::System.InvalidOperationException("Collection modified.");
284 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
285 [EditorBrowsable(EditorBrowsableState.Never)]
286 public void Dispose()
289 currentObject = null;
293 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
294 [EditorBrowsable(EditorBrowsableState.Never)]
297 Interop.ItemIdContainer.ItemIdContainer_Clear(swigCPtr);
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
302 [EditorBrowsable(EditorBrowsableState.Never)]
303 public void Add(uint x)
305 Interop.ItemIdContainer.ItemIdContainer_Add(swigCPtr, x);
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311 uint ret = Interop.ItemIdContainer.ItemIdContainer_size(swigCPtr);
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 private uint capacity()
318 uint ret = Interop.ItemIdContainer.ItemIdContainer_capacity(swigCPtr);
319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323 private void reserve(uint n)
325 Interop.ItemIdContainer.ItemIdContainer_reserve(swigCPtr, n);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
330 [EditorBrowsable(EditorBrowsableState.Never)]
331 public ItemIdContainer() : this(Interop.ItemIdContainer.new_ItemIdContainer__SWIG_0(), true)
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
337 [EditorBrowsable(EditorBrowsableState.Never)]
338 public ItemIdContainer(ItemIdContainer other) : this(Interop.ItemIdContainer.new_ItemIdContainer__SWIG_1(ItemIdContainer.getCPtr(other)), true)
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
344 [EditorBrowsable(EditorBrowsableState.Never)]
345 public ItemIdContainer(int capacity) : this(Interop.ItemIdContainer.new_ItemIdContainer__SWIG_2(capacity), true)
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
350 private uint getitemcopy(int index)
352 uint ret = Interop.ItemIdContainer.ItemIdContainer_getitemcopy(swigCPtr, index);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 private uint getitem(int index)
359 uint ret = Interop.ItemIdContainer.ItemIdContainer_getitem(swigCPtr, index);
360 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364 private void setitem(int index, uint val)
366 Interop.ItemIdContainer.ItemIdContainer_setitem(swigCPtr, index, val);
367 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
371 [EditorBrowsable(EditorBrowsableState.Never)]
372 public void AddRange(ItemIdContainer values)
374 Interop.ItemIdContainer.ItemIdContainer_AddRange(swigCPtr, ItemIdContainer.getCPtr(values));
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
379 [EditorBrowsable(EditorBrowsableState.Never)]
380 public ItemIdContainer GetRange(int index, int count)
382 global::System.IntPtr cPtr = Interop.ItemIdContainer.ItemIdContainer_GetRange(swigCPtr, index, count);
383 ItemIdContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ItemIdContainer(cPtr, true);
384 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
388 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
389 [EditorBrowsable(EditorBrowsableState.Never)]
390 public void Insert(int index, uint x)
392 Interop.ItemIdContainer.ItemIdContainer_Insert(swigCPtr, index, x);
393 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
396 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
397 [EditorBrowsable(EditorBrowsableState.Never)]
398 public void InsertRange(int index, ItemIdContainer values)
400 Interop.ItemIdContainer.ItemIdContainer_InsertRange(swigCPtr, index, ItemIdContainer.getCPtr(values));
401 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
405 [EditorBrowsable(EditorBrowsableState.Never)]
406 public void RemoveAt(int index)
408 Interop.ItemIdContainer.ItemIdContainer_RemoveAt(swigCPtr, index);
409 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
413 [EditorBrowsable(EditorBrowsableState.Never)]
414 public void RemoveRange(int index, int count)
416 Interop.ItemIdContainer.ItemIdContainer_RemoveRange(swigCPtr, index, count);
417 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
420 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
421 [EditorBrowsable(EditorBrowsableState.Never)]
422 public static ItemIdContainer Repeat(uint value, int count)
424 global::System.IntPtr cPtr = Interop.ItemIdContainer.ItemIdContainer_Repeat(value, count);
425 ItemIdContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ItemIdContainer(cPtr, true);
426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
430 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
431 [EditorBrowsable(EditorBrowsableState.Never)]
432 public void Reverse()
434 Interop.ItemIdContainer.ItemIdContainer_Reverse__SWIG_0(swigCPtr);
435 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
438 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
439 [EditorBrowsable(EditorBrowsableState.Never)]
440 public void Reverse(int index, int count)
442 Interop.ItemIdContainer.ItemIdContainer_Reverse__SWIG_1(swigCPtr, index, count);
443 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
447 [EditorBrowsable(EditorBrowsableState.Never)]
448 public void SetRange(int index, ItemIdContainer values)
450 Interop.ItemIdContainer.ItemIdContainer_SetRange(swigCPtr, index, ItemIdContainer.getCPtr(values));
451 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
455 [EditorBrowsable(EditorBrowsableState.Never)]
456 public bool Contains(uint value)
458 bool ret = Interop.ItemIdContainer.ItemIdContainer_Contains(swigCPtr, value);
459 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
463 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
464 [EditorBrowsable(EditorBrowsableState.Never)]
465 public int IndexOf(uint value)
467 int ret = Interop.ItemIdContainer.ItemIdContainer_IndexOf(swigCPtr, value);
468 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
472 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
473 [EditorBrowsable(EditorBrowsableState.Never)]
474 public int LastIndexOf(uint value)
476 int ret = Interop.ItemIdContainer.ItemIdContainer_LastIndexOf(swigCPtr, value);
477 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
481 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
482 [EditorBrowsable(EditorBrowsableState.Never)]
483 public bool Remove(uint value)
485 bool ret = Interop.ItemIdContainer.ItemIdContainer_Remove(swigCPtr, value);
486 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();