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
20 #pragma winrt ns_prefix
23 import
"inspectable.idl";
24 import
"asyncinfo.idl";
25 import
"windowscontracts.idl";
26 /* import "eventtoken.idl"; */
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; };")
40 cpp_quote
("extern \"C\" {")
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] IAsyncOperation
<TResult
> *info
, [in] AsyncStatus status
);
59 contract
(Windows.Foundation.FoundationContract
, 1.0),
60 uuid(9fc2b0bb
-e446
-44e2
-aa61
-9cab8f636af2
)
62 interface IAsyncOperation
<TResult
> : IInspectable
64 [propput] HRESULT Completed
([in] AsyncOperationCompletedHandler
<TResult
> *handler
);
65 [propget] HRESULT Completed
([out, retval] AsyncOperationCompletedHandler
<TResult
> **handler
);
66 HRESULT GetResults
([out, retval] TResult
**results
);
70 contract
(Windows.Foundation.FoundationContract
, 1.0),
71 uuid(9de1c534
-6ae1
-11e0
-84e1
-18a905bcc53f
)
73 delegate
HRESULT TypedEventHandler
<TSender
, TArgs
>([in] TSender sender
, [in] TArgs args
);
78 contract
(Windows.Foundation.FoundationContract
, 1.0),
79 uuid(6a79e863
-4300-459a
-9966-cbb660963ee1
)
81 interface IIterator
<T
> : IInspectable
83 [propget] HRESULT Current
([out, retval] T
*value
);
84 [propget] HRESULT HasCurrent
([out, retval] BOOL
*value
);
85 HRESULT MoveNext
([out, retval] BOOL
*value
);
86 HRESULT GetMany
([in] UINT32 count
, [in] UINT32 items_size
, [out] T
*items
, [out, retval] UINT32
*value
);
90 contract
(Windows.Foundation.FoundationContract
, 1.0),
91 uuid(faa585ea
-6214-4217-afda
-7f46de5869b3
)
93 interface IIterable
<T
> : IInspectable
95 HRESULT First
([out, retval] Windows.Foundation.Collections.IIterator
<T
> **value
);
99 contract
(Windows.Foundation.FoundationContract
, 1.0),
100 uuid(bbe1fa4c
-b0e3
-4583-baef
-1f1b2e483e56
)
102 interface IVectorView
<T
> : IInspectable
104 HRESULT GetAt
([in] UINT32 index
, [out, retval] T
*value
);
105 [propget] HRESULT Size
([out, retval] UINT32
*value
);
106 HRESULT IndexOf
([in, optional] T element
, [out] UINT32
*index
, [out, retval] BOOLEAN *value
);
107 HRESULT GetMany
([in] UINT32 start_index
, [in] UINT32 items_size
, [out] T
*items
, [out, retval] UINT32
*value
);