1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
6 using System.Collections.Generic;
8 // Windows.Foundation.Collections.IVector`1 and IVectorView`1 cannot be referenced from managed
9 // code because they're hidden by the metadata adapter. We redeclare the interfaces manually
10 // to be able to talk to native WinRT objects.
12 namespace System.Runtime.InteropServices.WindowsRuntime
15 [Guid("913337e9-11a1-4345-a3a2-4e7f956e222d")]
16 [WindowsRuntimeImport]
17 internal interface IVector<T> : IIterable<T>
21 IReadOnlyList<T> GetView(); // Really an IVectorView<T>.
22 bool IndexOf(T value, out uint index);
23 void SetAt(uint index, T value);
24 void InsertAt(uint index, T value);
25 void RemoveAt(uint index);
29 uint GetMany(uint startIndex, [Out] T[] items);
30 void ReplaceAll(T[] items);
33 // Same as IVector - the only difference is that GetView returns IVectorView<T>
35 [Guid("913337e9-11a1-4345-a3a2-4e7f956e222d")]
36 [WindowsRuntimeImport]
37 internal interface IVector_Raw<T> : IIterable<T>
41 IVectorView<T> GetView();
42 bool IndexOf(T value, out uint index);
43 void SetAt(uint index, T value);
44 void InsertAt(uint index, T value);
45 void RemoveAt(uint index);
52 [Guid("bbe1fa4c-b0e3-4583-baef-1f1b2e483e56")]
53 [WindowsRuntimeImport]
54 internal interface IVectorView<T> : IIterable<T>
58 bool IndexOf(T value, out uint index);
59 uint GetMany(uint startIndex, [Out] T[] items);
63 [Guid("393de7de-6fd0-4c0d-bb71-47244a113e93")]
64 [WindowsRuntimeImport]
65 internal interface IBindableVector : IBindableIterable
67 object? GetAt(uint index);
69 IBindableVectorView GetView();
70 bool IndexOf(object value, out uint index);
71 void SetAt(uint index, object value);
72 void InsertAt(uint index, object value);
73 void RemoveAt(uint index);
74 void Append(object value);
80 [Guid("346dd6e7-976e-4bc3-815d-ece243bc0f33")]
81 [WindowsRuntimeImport]
82 internal interface IBindableVectorView : IBindableIterable
84 object? GetAt(uint index);
86 bool IndexOf(object value, out uint index);