po: Update Lithuanian translation.
[wine.git] / include / windows.foundation.collections.idl
blob395adad27aa88373ab08f3cb06bfde5bc08d4935
1 /*
2 * Copyright 2021 RĂ©mi Bernon for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifdef __WIDL__
20 #pragma winrt ns_prefix
21 #endif
23 import "inspectable.idl";
24 import "asyncinfo.idl";
25 import "windowscontracts.idl";
26 /* import "eventtoken.idl"; */
28 namespace Windows {
29 namespace Foundation {
31 cpp_quote("#ifdef __cplusplus")
32 cpp_quote("} /* extern \"C\" */")
33 cpp_quote("namespace ABI { namespace Windows { namespace Foundation { namespace Internal {")
34 cpp_quote("template <class T> struct GetAbiType { typedef T type; };")
35 cpp_quote("template <class T> struct GetLogicalType { typedef T type; };")
36 cpp_quote("template <class L, class A> struct AggregateType {};")
37 cpp_quote("template <class L, class A> struct GetAbiType<AggregateType<L, A> > { typedef A type; };")
38 cpp_quote("template <class L, class A> struct GetLogicalType<AggregateType<L, A> > { typedef L type; };")
39 cpp_quote("}}}}")
40 cpp_quote("extern \"C\" {")
41 cpp_quote("#endif")
43 #ifdef __WIDL__
45 contract(Windows.Foundation.FoundationContract, 1.0),
46 uuid(9de1c535-6ae1-11e0-84e1-18a905bcc53f)
48 delegate HRESULT EventHandler<T>([in] IInspectable *sender, [in] T args);
50 interface IAsyncOperation<TResult>;
53 contract(Windows.Foundation.FoundationContract, 1.0),
54 uuid(fcdcf02c-e5d8-4478-915a-4d90b74b83a5)
56 delegate HRESULT AsyncOperationCompletedHandler<TResult>([in] Windows.Foundation.IAsyncOperation<TResult> *info,
57 [in] AsyncStatus status);
60 contract(Windows.Foundation.FoundationContract, 1.0),
61 uuid(9fc2b0bb-e446-44e2-aa61-9cab8f636af2)
63 interface IAsyncOperation<TResult> : IInspectable
65 [propput] HRESULT Completed([in] Windows.Foundation.AsyncOperationCompletedHandler<TResult> *handler);
66 [propget] HRESULT Completed([out, retval] Windows.Foundation.AsyncOperationCompletedHandler<TResult> **handler);
67 HRESULT GetResults([out, retval] TResult *results);
71 contract(Windows.Foundation.FoundationContract, 1.0),
72 uuid(9de1c534-6ae1-11e0-84e1-18a905bcc53f)
74 delegate HRESULT TypedEventHandler<TSender, TArgs>([in] TSender sender, [in] TArgs args);
77 contract(Windows.Foundation.FoundationContract, 1.0),
78 uuid(61c17706-2d65-11e0-9ae8-d48564015472)
80 interface IReference<T> : IInspectable
82 [propget] HRESULT Value([out, retval] T *value);
85 namespace Collections
88 contract(Windows.Foundation.FoundationContract, 1.0),
89 uuid(6a79e863-4300-459a-9966-cbb660963ee1)
91 interface IIterator<T> : IInspectable
93 [propget] HRESULT Current([out, retval] T *value);
94 [propget] HRESULT HasCurrent([out, retval] BOOL *value);
95 HRESULT MoveNext([out, retval] BOOL *value);
96 HRESULT GetMany([in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value);
100 contract(Windows.Foundation.FoundationContract, 1.0),
101 uuid(faa585ea-6214-4217-afda-7f46de5869b3)
103 interface IIterable<T> : IInspectable
105 HRESULT First([out, retval] Windows.Foundation.Collections.IIterator<T> **value);
109 contract(Windows.Foundation.FoundationContract, 1.0),
110 uuid(02b51929-c1c4-4a7e-8940-0312b5c18500)
112 interface IKeyValuePair<K, V> : IInspectable
114 [propget] HRESULT Key([out, retval] K *key);
115 [propget] HRESULT Value([out, retval] V *value);
119 contract(Windows.Foundation.FoundationContract, 1.0),
120 uuid(e480ce40-a338-4ada-adcf-272272e48cb9)
122 interface IMapView<K, V> : IInspectable
123 requires Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IKeyValuePair<K, V> *>
125 HRESULT Lookup([in] K key, [out, retval] V *value);
126 [propget] HRESULT Size([out, retval] unsigned int *size);
127 HRESULT HasKey([in] K key, [out, retval] boolean *found);
128 HRESULT Split([out] Windows.Foundation.Collections.IMapView<K, V> **first,
129 [out] Windows.Foundation.Collections.IMapView<K, V> **second);
133 contract(Windows.Foundation.FoundationContract, 1.0),
134 uuid(bbe1fa4c-b0e3-4583-baef-1f1b2e483e56)
136 interface IVectorView<T> : IInspectable
137 requires Windows.Foundation.Collections.IIterable<T>
139 HRESULT GetAt([in] UINT32 index, [out, retval] T *value);
140 [propget] HRESULT Size([out, retval] UINT32 *value);
141 HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value);
142 HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value);
146 contract(Windows.Foundation.FoundationContract, 1.0),
147 uuid(913337e9-11a1-4345-a3a2-4e7f956e222d)
149 interface IVector<T> : IInspectable
150 requires Windows.Foundation.Collections.IIterable<T>
152 HRESULT GetAt([in, optional] UINT32 index, [out, retval] T *value);
153 [propget] HRESULT Size([out, retval] UINT32 *value);
154 HRESULT GetView([out, retval] Windows.Foundation.Collections.IVectorView<T> **value);
155 HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value);
156 HRESULT SetAt([in] UINT32 index, [in, optional] T value);
157 HRESULT InsertAt([in] UINT32 index, [in, optional] T value);
158 HRESULT RemoveAt([in] UINT32 index);
159 HRESULT Append([in, optional] T value);
160 HRESULT RemoveAtEnd();
161 HRESULT Clear();
162 HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value);
163 HRESULT ReplaceAll([in] UINT32 count, [in] T *items);
166 #endif