/******************************************************************************* ** ** ** windows.foundation.collections.h - Common collection-related types. ** ** ** ** Copyright (c) Microsoft Corporation. All rights reserved. ** ** ** ** Contains definitions of C++ class templates used by ** ** MIDL for generating parameter interface instances. ** ** ** ** Known Limitations ** ** Midl does not import other IDL files that the IObservable* ** ** interfaces depend on. If you instantiate either IObservableMap or ** ** IObservableVector in your IDL file, you will need to explicitly ** ** import "eventtoken.idl" at the top of your IDL file. ** ** ** ** Notes on design: ** ** The bodies of each of these interface templates are each ** ** defined once, with the postfix "_impl", defining each of ** ** the members. MIDL will then hook up the "_impl" with ** ** the method definitions to the real template, and assign it ** ** a guid. ** ** ** ** For instance, it might generate: ** ** ** ** template <> ** ** struct ** ** __declspec(uuid("77e5b300-6a88-4f63-b490-e25b414bed4e")) ** ** IVectorView : IVectorView_impl ** ** { ** ** }; ** ** ** ** In this fashion, IVectorView is assigned an IID. ** ** As well, for each parameterized type, the original template is ** ** not just forward declared, but defined and derives from the "_impl" ** ** form. This is done as it was found to generate usable autocomplete ** ** in IDEs. ** ** The original unspecialized template also is made to static_assert ** ** if the user attempts to use it. This is to avoid ODR violations, ** ** and the scenario that the user forgot to mention a 'declare' ** ** clause in the MIDL input. ** *******************************************************************************/ #ifndef WINDOWS_FOUNDATION_COLLECTIONS_H #define WINDOWS_FOUNDATION_COLLECTIONS_H #ifdef _MSC_VER #pragma once #endif /* _MSC_VER */ #include #include // used for boolean #include // used for EventRegistrationToken #include // needed for WindowsDeleteString /* Use of templates and namespaces */ #if defined(__cplusplus) && !defined(CINTERFACE) #include // metafunctions for handling Interface Groups and Runtime Types in parameterized interfaces namespace ABI { namespace Windows { namespace Foundation { namespace Internal { // LogicalType - the Windows Runtime type (eg, runtime class, inteface group, etc) // being provided as an argument to an _impl template, when that type // cannot be represented at the ABI. // AbiType - the type used for marshalling, ie "at the ABI", for the logical type. template struct AggregateType { }; // Gets the ABI type. See AggregateType for description. template struct GetAbiType { typedef T type; }; template struct GetAbiType > { typedef A type; }; // Gets the LogicalType. See AggregateType for description. template struct GetLogicalType { typedef T type; }; template struct GetLogicalType > { typedef L type; }; }}} // namespace Windows::Foundation::Internal } // ABI namespace ABI { namespace Windows { namespace Foundation { //forward delcare the known structs struct DateTime; struct TimeSpan; struct Point; struct Size; struct Rect; } } } // ABI namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template struct is_pointer { enum { value = false };}; template struct is_pointer { enum { value = true};}; template struct is_foundation_struct { enum {value = false};}; template <> struct is_foundation_struct { enum { value = true};}; template <> struct is_foundation_struct { enum { value = true};}; template <> struct is_foundation_struct { enum { value = true};}; template <> struct is_foundation_struct { enum { value = true};}; template <> struct is_foundation_struct { enum { value = true};}; template <> struct is_foundation_struct { enum { value = true};}; template struct supports_cleanup { typedef typename Windows::Foundation::Internal::GetAbiType::type _abi_type; enum { value = is_pointer< _abi_type >::value || is_foundation_struct< _abi_type >::value || !__is_class(_abi_type) }; }; template ::value> struct IIterator_impl; template struct IIterable_impl; template ::value> struct IVectorView_impl; template ::value> struct IVector_impl; template struct IKeyValuePair_impl; template struct IMapView_impl; template struct IMap_impl; enum CollectionsChange : int; struct IVectorChangedEventArgs; template /*delegate*/ struct VectorChangedEventHandler_impl; template struct IObservableVector_impl; template struct IMapChangedEventArgs_impl; template struct /*delegate*/ MapChangedEventHandler_impl; template struct IObservableMap_impl; namespace detail { template struct not_yet_specialized_placeholder { enum { value = false }; }; template struct not_yet_specialized { static_assert( not_yet_specialized_placeholder::value, "This interface instance has not been specialized by MIDL." " This may be caused by forgetting a '*' pointer on an interface" " type, by omitting a necessary 'declare' clause in your idl" " file, by forgetting to include one of the necessary MIDL" " generated headers."); }; } template struct IIterator : IIterator_impl , detail::not_yet_specialized> { }; template struct IIterable : IIterable_impl , detail::not_yet_specialized> { }; template struct IVectorView : IVectorView_impl , detail::not_yet_specialized> { }; template struct IVector : IVector_impl , detail::not_yet_specialized> { }; template struct IKeyValuePair : IKeyValuePair_impl , detail::not_yet_specialized> { }; template struct IMapView : IMapView_impl , detail::not_yet_specialized> { }; template struct IMap : IMap_impl , detail::not_yet_specialized> { }; template /*delegate*/ struct VectorChangedEventHandler : VectorChangedEventHandler_impl , detail::not_yet_specialized> { }; template struct IObservableVector : IObservableVector_impl , detail::not_yet_specialized> { }; template struct IMapChangedEventArgs : IMapChangedEventArgs_impl , detail::not_yet_specialized> { }; template /*delegate*/ struct MapChangedEventHandler : MapChangedEventHandler_impl , detail::not_yet_specialized> { }; template struct IObservableMap : IObservableMap_impl , detail::not_yet_specialized> { }; // Template definitions duplicate the members that MIDL generates, without the name redirection. template struct IIterable_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef T T_complex; virtual HRESULT STDMETHODCALLTYPE First(_Outptr_result_maybenull_ IIterator **first) = 0; }; namespace Detail { // known struct types get no-op cleanup #define XWINRT_DEF_CLEANUP(type) \ inline void _Cleanup(type * /* values[] */, unsigned /* actual */) {} XWINRT_DEF_CLEANUP(GUID); XWINRT_DEF_CLEANUP(Windows::Foundation::DateTime); XWINRT_DEF_CLEANUP(Windows::Foundation::TimeSpan); XWINRT_DEF_CLEANUP(Windows::Foundation::Point); XWINRT_DEF_CLEANUP(Windows::Foundation::Size); XWINRT_DEF_CLEANUP(Windows::Foundation::Rect); #undef XWINRT_DEF_CLEANUP // Template magic for number and enums template struct enable_if { }; template struct enable_if { typedef T type;}; // numbers, enums get no-op cleanup. template void _Cleanup(T* /*values*/, unsigned /*actual*/, typename enable_if::value)>::type = 0) {} template void _Cleanup(_Inout_updates_(actual) I* values[], Number actual) { for (unsigned i = 0; i < actual; ++i) { values[i]->Release(); values[i] = nullptr; } } // make this a template so that we don't deptend on WindowsDeleteString in this file template inline void _Cleanup(_Inout_updates_(actual) HSTRING* values, Number actual) { for (unsigned i = 0; i < actual; ++i) { ::WindowsDeleteString(values[i]); values[i] = nullptr; } } // Note: Because structs require custom cleanup, the default implementation will not be // available to custom collections of structs. They will need to provide their own // implementations. template HRESULT _VectorGetMany( _In_ U* pThis, _In_ unsigned startIndex, _In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T *value, _Out_ unsigned *actual) { unsigned index = 0; HRESULT hr = S_OK; unsigned size = 0; unsigned copied = 0; ZeroMemory(value, sizeof(*value) * capacity); *actual = 0; // Get the size of the vector so that we can do bounds checking hr = pThis->get_Size(&size); if (SUCCEEDED(hr)) { if (startIndex > size) { // If we are more than one past the end, then we return E_BOUNDS; hr = E_BOUNDS; } else { // we are guarenteed to be one past the end or less. If we are one past the end // we won't enter the for loop, and we'll get S_OK but nothing returned. // If we are at the end or earlier, we'll actually get something in the output for (index = 0; (index < capacity) && (index + startIndex < size) ; index++) { hr = pThis->GetAt(index + startIndex, &value[index] ); if (SUCCEEDED(hr)) { copied += 1; } else { break; } } } } if (SUCCEEDED(hr)) { *actual = index; } if (FAILED(hr)) { Detail::_Cleanup(value, copied); } return hr; } template HRESULT _IteratorGetMany(_In_ U* pThis, _In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T *value, _Out_ unsigned *actual) { HRESULT hr = S_OK; ::boolean fHasCurrent = false; unsigned count = 0; ZeroMemory(value, sizeof(*value) * capacity); *actual = 0; hr = pThis->get_HasCurrent(&fHasCurrent); while (SUCCEEDED(hr) && (fHasCurrent) && (count < capacity)) { hr = pThis->get_Current(&value[count]); if (SUCCEEDED(hr)) { count++; hr = pThis->MoveNext(&fHasCurrent); } } if (SUCCEEDED(hr)) { *actual = count; } else { // cleanup output paremeters on failure // no need to zero out *actual as it is still // initialized to zero. Detail::_Cleanup(value, *actual); } return hr; } template HRESULT _VectorReplaceAll(_In_ U* pThis, _In_ unsigned count, _In_reads_(count) T *value) { HRESULT hr = S_OK; hr = pThis->Clear(); if (SUCCEEDED(hr)) { for(unsigned index = 0; index < count; index++) { hr = pThis->Append(value[index]); if (FAILED(hr)) { // intentionally ignoring the return value here so that hr // can be passed through; pThis->Clear(); break; } } } return hr; } } // Note: There are two versions of this template. The second will compile where T is a struct and the // first will compile in all other cases. This approach is used to ensure that if T is a struct that // GetMany will be pure virtual (and must be overloaded), but in the other cases GetMany will // be handed by the default implementation. // Important Note!: Both of these templates must have the same vtable!!! Change one and you // must change the other template struct IIterator_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: typedef T T_complex; virtual /* propget */ HRESULT STDMETHODCALLTYPE get_Current(_Out_ T_abi *current) = 0; virtual /* propget */ HRESULT STDMETHODCALLTYPE get_HasCurrent(_Out_ boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE MoveNext(_Out_ boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany(_In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T_abi *value, _Out_ unsigned *actual) { return Detail::_IteratorGetMany(this, capacity, value, actual); } }; template struct IIterator_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: typedef T T_complex; virtual /* propget */ HRESULT STDMETHODCALLTYPE get_Current(_Out_ T_abi *current) = 0; virtual /* propget */ HRESULT STDMETHODCALLTYPE get_HasCurrent(_Out_ boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE MoveNext(_Out_ boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany(_In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T_abi *value, _Out_ unsigned *actual) = 0; }; // Note: There are two versions of this template. The second will compile where T is a struct and the // first will compile in all other cases. This approach is used to ensure that if T is a struct that // GetMany will be pure virtual (and must be overloaded), but in the other cases GetMany will // be handed by the default implementation. // Important Note!: Both of these templates must have the same vtable!!! Change one and you // must change the other template struct IVectorView_impl : IInspectable /* requires IIterable */ { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: typedef T T_complex; virtual HRESULT STDMETHODCALLTYPE GetAt(_In_ unsigned index, _Out_ T_abi *item) = 0; virtual /* propget */ HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned *size) = 0; virtual HRESULT STDMETHODCALLTYPE IndexOf(_In_opt_ T_abi value, _Out_ unsigned *index, _Out_ boolean *found) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany(_In_ unsigned startIndex, _In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T_abi *value, _Out_ unsigned *actual) { return Detail::_VectorGetMany(this, startIndex, capacity, value, actual); } }; template struct IVectorView_impl : IInspectable /* requires IIterable */ { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: typedef T T_complex; virtual HRESULT STDMETHODCALLTYPE GetAt(_In_ unsigned index, _Out_ T_abi *item) = 0; virtual /* propget */ HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned *size) = 0; virtual HRESULT STDMETHODCALLTYPE IndexOf(_In_opt_ T_abi value, _Out_ unsigned *index, _Out_ boolean *found) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany(_In_ unsigned startIndex, _In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T_abi *value, _Out_ unsigned *actual) = 0; }; // Note: There are two versions of this template. The second will compile where T is a struct and the // first will compile in all other cases. This approach is used to ensure that if T is a struct that // GetMany and ReplaceAllwill be pure virtual (and must be overloaded), but in the other cases GetMany will // be handed by the default implementation. // Important Note!: Both of these templates must have the same vtable!!! Change one and you // must change the other template struct IVector_impl : IInspectable /* requires IIterable */ { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: typedef T T_complex; // read methods virtual HRESULT STDMETHODCALLTYPE GetAt(_In_opt_ unsigned index, _Out_ T_abi *item) = 0; virtual /* propget */ HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned *size) = 0; virtual HRESULT STDMETHODCALLTYPE GetView(_Outptr_result_maybenull_ IVectorView **view) = 0; virtual HRESULT STDMETHODCALLTYPE IndexOf(_In_opt_ T_abi value, _Out_ unsigned *index, _Out_ boolean *found) = 0; // write methods virtual HRESULT STDMETHODCALLTYPE SetAt(_In_ unsigned index, _In_opt_ T_abi item) = 0; virtual HRESULT STDMETHODCALLTYPE InsertAt(_In_ unsigned index, _In_opt_ T_abi item) = 0; virtual HRESULT STDMETHODCALLTYPE RemoveAt(_In_ unsigned index) = 0; virtual HRESULT STDMETHODCALLTYPE Append(_In_opt_ T_abi item) = 0; virtual HRESULT STDMETHODCALLTYPE RemoveAtEnd() = 0; virtual HRESULT STDMETHODCALLTYPE Clear() = 0; // bulk transfer methods virtual HRESULT STDMETHODCALLTYPE GetMany(_In_ unsigned startIndex, _In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T_abi *value, _Out_ unsigned *actual) { return Detail::_VectorGetMany(this, startIndex, capacity, value, actual); } virtual HRESULT STDMETHODCALLTYPE ReplaceAll(_In_ unsigned count, _In_reads_(count) T_abi *value) { return Detail::_VectorReplaceAll(this, count, value); } }; template struct IVector_impl : IInspectable /* requires IIterable */ { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: typedef T T_complex; // read methods virtual HRESULT STDMETHODCALLTYPE GetAt(_In_opt_ unsigned index, _Out_ T_abi *item) = 0; virtual /* propget */ HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned *size) = 0; virtual HRESULT STDMETHODCALLTYPE GetView(_Outptr_result_maybenull_ IVectorView **view) = 0; virtual HRESULT STDMETHODCALLTYPE IndexOf(_In_opt_ T_abi value, _Out_ unsigned *index, _Out_ boolean *found) = 0; // write methods virtual HRESULT STDMETHODCALLTYPE SetAt(_In_ unsigned index, _In_opt_ T_abi item) = 0; virtual HRESULT STDMETHODCALLTYPE InsertAt(_In_ unsigned index, _In_opt_ T_abi item) = 0; virtual HRESULT STDMETHODCALLTYPE RemoveAt(_In_ unsigned index) = 0; virtual HRESULT STDMETHODCALLTYPE Append(_In_opt_ T_abi item) = 0; virtual HRESULT STDMETHODCALLTYPE RemoveAtEnd() = 0; virtual HRESULT STDMETHODCALLTYPE Clear() = 0; // bulk transfer methods virtual HRESULT STDMETHODCALLTYPE GetMany(_In_ unsigned startIndex, _In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T_abi *value, _Out_ unsigned *actual) = 0; virtual HRESULT STDMETHODCALLTYPE ReplaceAll(_In_ unsigned count, _In_reads_(count) T_abi *value) = 0; }; template struct IKeyValuePair_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type K_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type K_logical; typedef typename Windows::Foundation::Internal::GetAbiType::type V_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type V_logical; public: typedef K K_complex; typedef V V_complex; virtual HRESULT STDMETHODCALLTYPE get_Key(_Out_ K_abi *key) = 0; virtual HRESULT STDMETHODCALLTYPE get_Value(_Out_ V_abi *value) = 0; }; template struct IMapView_impl : IInspectable /* requires IIterable< IKeyValuePair::type,GetLogicalType::type> *> */ { private: typedef typename Windows::Foundation::Internal::GetAbiType::type K_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type K_logical; typedef typename Windows::Foundation::Internal::GetAbiType::type V_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type V_logical; public: typedef K K_complex; typedef V V_complex; virtual HRESULT STDMETHODCALLTYPE Lookup(_In_opt_ K_abi key, _Out_ V_abi *value) = 0; virtual/*propget*/ HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned int *size) = 0; virtual HRESULT STDMETHODCALLTYPE HasKey(_In_opt_ K_abi key, _Out_ boolean *found) = 0; virtual HRESULT STDMETHODCALLTYPE Split(_Outptr_result_maybenull_ IMapView **firstPartition, _Outptr_result_maybenull_ IMapView **secondPartition) = 0; }; template struct IMap_impl : IInspectable /* requires IIterable< IKeyValuePair *> */ { private: typedef typename Windows::Foundation::Internal::GetAbiType::type K_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type K_logical; typedef typename Windows::Foundation::Internal::GetAbiType::type V_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type V_logical; public: typedef K K_complex; typedef V V_complex; // read methods virtual HRESULT STDMETHODCALLTYPE Lookup(_In_opt_ K_abi key, _Out_ V_abi *value) = 0; virtual /*propget*/ HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned int *size) = 0; virtual HRESULT STDMETHODCALLTYPE HasKey(_In_opt_ K_abi key, _Out_ boolean *found) = 0; virtual HRESULT STDMETHODCALLTYPE GetView(_Outptr_result_maybenull_ IMapView **view) = 0; // write methods virtual HRESULT STDMETHODCALLTYPE Insert(_In_opt_ K_abi key, _In_opt_ V_abi value, _Out_ boolean *replaced) = 0; virtual HRESULT STDMETHODCALLTYPE Remove(_In_opt_ K_abi key) = 0; virtual HRESULT STDMETHODCALLTYPE Clear() = 0; }; }}} // namespace Windows::Foundation::Collections namespace Windows { namespace Foundation { template struct IAsyncOperationProgressHandler_impl; template struct IAsyncOperationWithProgressCompletedHandler_impl; template struct IAsyncOperationCompletedHandler_impl; template struct IAsyncOperationWithProgress_impl; template struct IAsyncActionWithProgress_impl; template struct IAsyncOperation_impl; template struct IAsyncActionProgressHandler_impl; template struct IAsyncActionWithProgressCompletedHandler_impl; template struct IReference_impl; template struct IReferenceArray_impl; template struct IEventHandler_impl; template struct ITypedEventHandler_impl; template struct IAsyncOperationProgressHandler : IAsyncOperationProgressHandler_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IAsyncOperationCompletedHandler : IAsyncOperationCompletedHandler_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IAsyncOperationWithProgressCompletedHandler : IAsyncOperationWithProgressCompletedHandler_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IAsyncActionProgressHandler : IAsyncActionProgressHandler_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IAsyncActionWithProgressCompletedHandler : IAsyncActionWithProgressCompletedHandler_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IAsyncOperation : IAsyncOperation_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IAsyncOperationWithProgress : IAsyncOperationWithProgress_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IAsyncActionWithProgress : IAsyncActionWithProgress_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IReference : IReference_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IReferenceArray : IReferenceArray_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IEventHandler : IEventHandler_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct ITypedEventHandler : ITypedEventHandler_impl , Windows::Foundation::Collections::detail::not_yet_specialized> { }; template struct IAsyncOperationProgressHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TProgress_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TProgress_logical; typedef typename Windows::Foundation::Internal::GetAbiType::type TResult_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TResult_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TProgress TProgress_complex; typedef TResult TResult_complex; virtual HRESULT STDMETHODCALLTYPE Invoke(IAsyncOperationWithProgress *asyncInfo, TProgress_abi progressInfo) = 0; }; template struct IAsyncOperationWithProgressCompletedHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TProgress_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TProgress_logical; typedef typename Windows::Foundation::Internal::GetAbiType::type TResult_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TResult_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TProgress TProgress_complex; typedef TResult TResult_complex; virtual HRESULT STDMETHODCALLTYPE Invoke(IAsyncOperationWithProgress *asyncInfo, Windows::Foundation::AsyncStatus status) = 0; }; template struct IAsyncOperationCompletedHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TResult_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TResult_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TResult TResult_complex; virtual HRESULT STDMETHODCALLTYPE Invoke(IAsyncOperation *asyncInfo, Windows::Foundation::AsyncStatus status) = 0; }; template struct IAsyncActionProgressHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TProgress_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TProgress_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TProgress TProgress_complex; virtual HRESULT STDMETHODCALLTYPE Invoke(IAsyncActionWithProgress *asyncInfo, TProgress_abi progressInfo) = 0; }; template struct IAsyncActionWithProgressCompletedHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TProgress_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TProgress_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TProgress TProgress_complex; virtual HRESULT STDMETHODCALLTYPE Invoke(IAsyncActionWithProgress *asyncInfo, Windows::Foundation::AsyncStatus status) = 0; }; template struct IAsyncOperationWithProgress_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TProgress_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TProgress_logical; typedef typename Windows::Foundation::Internal::GetAbiType::type TResult_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TResult_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TProgress TProgress_complex; typedef TResult TResult_complex; virtual HRESULT STDMETHODCALLTYPE put_Progress( IAsyncOperationProgressHandler *handler) = 0; virtual HRESULT STDMETHODCALLTYPE get_Progress( IAsyncOperationProgressHandler **handler) = 0; virtual HRESULT STDMETHODCALLTYPE put_Completed( IAsyncOperationWithProgressCompletedHandler *handler) = 0; virtual HRESULT STDMETHODCALLTYPE get_Completed( IAsyncOperationWithProgressCompletedHandler **handler) = 0; virtual HRESULT STDMETHODCALLTYPE GetResults( TResult_abi *results) = 0; }; template struct IAsyncOperation_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TResult_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TResult_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TResult TResult_complex; virtual HRESULT STDMETHODCALLTYPE put_Completed( IAsyncOperationCompletedHandler *handler) = 0; virtual HRESULT STDMETHODCALLTYPE get_Completed( IAsyncOperationCompletedHandler **handler) = 0; virtual HRESULT STDMETHODCALLTYPE GetResults( TResult_abi *results) = 0; }; template struct IAsyncActionWithProgress_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TProgress_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TProgress_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TProgress TProgress_complex; virtual HRESULT STDMETHODCALLTYPE put_Progress( IAsyncActionProgressHandler *handler) = 0; virtual HRESULT STDMETHODCALLTYPE get_Progress( IAsyncActionProgressHandler **handler) = 0; virtual HRESULT STDMETHODCALLTYPE put_Completed( IAsyncActionWithProgressCompletedHandler *handler) = 0; virtual HRESULT STDMETHODCALLTYPE get_Completed( IAsyncActionWithProgressCompletedHandler **handler) = 0; virtual HRESULT STDMETHODCALLTYPE GetResults( ) = 0; }; template struct IReference_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef T T_complex; virtual HRESULT STDMETHODCALLTYPE get_Value( _Out_ T_abi *value) = 0; }; template struct IReferenceArray_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef T T_complex; virtual HRESULT STDMETHODCALLTYPE get_Value(_Out_ UINT32 *length, _Outptr_result_buffer_(*length) T_abi **value) = 0; }; template struct IEventHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetAbiType::type T_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef T T_complex; virtual HRESULT STDMETHODCALLTYPE Invoke( _In_ IInspectable *sender, _In_ T_abi args) = 0; }; template struct ITypedEventHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetAbiType::type TSender_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TSender_logical; typedef typename Windows::Foundation::Internal::GetAbiType::type TArgs_abi; typedef typename Windows::Foundation::Internal::GetLogicalType::type TArgs_logical; public: // For all types which are neither InterfaceGroups nor RuntimeClasses, the // following three typedefs are synonyms for a single C++ type. But for // InterfaceGroups and RuntimeClasses, they are different types: // T_logical: The C++ Type for the InterfaceGroup or RuntimeClass, when // used as a template parameter. Eg "RCFoo*" // T_abi: The C++ type for the default interface used to represent the // InterfaceGroup or RuntimeClass when passed as a method parameter. // Eg "IFoo*" // T_complex: An instantiation of the Internal "AggregateType" template that // combines T_logical with T_abi. Eg "AggregateType" // See the declaration above of Windows::Foundation::Internal::AggregateType // for more details. typedef TSender TSender_complex; typedef TArgs TArgs_complex; virtual HRESULT STDMETHODCALLTYPE Invoke( _In_ TSender_abi sender, _In_ TArgs_abi args) = 0; }; }} // namespace Windows::Foundation } // namespace ABI #endif /* #if defined(__cplusplus) && !defined(CINTERFACE) */ // Definitions of the CollectionChange enum and IVectorChangedEventArgs // interface. #include #if defined(__cplusplus) && !defined(CINTERFACE) namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template /*delegate*/ struct VectorChangedEventHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: typedef T T_complex; virtual HRESULT STDMETHODCALLTYPE Invoke(_In_opt_ IObservableVector* sender, _In_opt_ IVectorChangedEventArgs* e) = 0; }; template struct IObservableVector_impl : IInspectable /* requires IVector */ { private: typedef typename Windows::Foundation::Internal::GetLogicalType::type T_logical; public: typedef T T_complex; virtual /*eventadd*/ HRESULT STDMETHODCALLTYPE add_VectorChanged (_In_opt_ VectorChangedEventHandler* handler, _Out_ EventRegistrationToken* token) = 0; virtual /*eventremove*/ HRESULT STDMETHODCALLTYPE remove_VectorChanged(_In_ EventRegistrationToken token) = 0; }; template struct IMapChangedEventArgs_impl : IInspectable { private: typedef typename Windows::Foundation::Internal::GetAbiType::type K_abi; public: typedef K K_complex; virtual /*propget*/ HRESULT STDMETHODCALLTYPE get_CollectionChange (_Out_ CollectionChange* value) = 0; virtual /*propget*/ HRESULT STDMETHODCALLTYPE get_Key (_Out_ K_abi* value) = 0; }; template /*delegate*/ struct MapChangedEventHandler_impl : IUnknown { private: typedef typename Windows::Foundation::Internal::GetLogicalType::type K_logical; typedef typename Windows::Foundation::Internal::GetLogicalType::type V_logical; public: typedef K K_complex; typedef V V_complex; virtual HRESULT STDMETHODCALLTYPE Invoke(_In_opt_ IObservableMap* sender, _In_opt_ IMapChangedEventArgs* e) = 0; }; template struct IObservableMap_impl : IInspectable /* requires IMap */ { private: typedef typename Windows::Foundation::Internal::GetLogicalType::type K_logical; typedef typename Windows::Foundation::Internal::GetLogicalType::type V_logical; public: typedef K K_complex; typedef V V_complex; virtual /*eventadd*/ HRESULT STDMETHODCALLTYPE add_MapChanged (_In_opt_ MapChangedEventHandler* handler, _Out_ EventRegistrationToken* token) = 0; virtual /*eventremove*/ HRESULT STDMETHODCALLTYPE remove_MapChanged(_In_ EventRegistrationToken token) = 0; }; }}} // namespace Windows::Foundation::Collections } // namespace ABI #endif /* #if defined(__cplusplus) && !defined(CINTERFACE) */ #endif /* WINDOWS_FOUNDATION_COLLECTIONS_H */