windows.media.speech: Add IIterable<IInspectable*> stubs.
[wine.git] / dlls / windows.media.speech / private.h
blobba790c361aa8fe47776accba49bbba39af9b4e2a
1 /* WinRT Windows.Media.Speech private header
3 * Copyright 2022 Bernhard Kölbl
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __WINE_WINDOWS_MEDIA_SPEECH_PRIVATE_H
21 #define __WINE_WINDOWS_MEDIA_SPEECH_PRIVATE_H
23 #include <stdarg.h>
25 #define COBJMACROS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winstring.h"
29 #include "objbase.h"
31 #include "activation.h"
33 #define WIDL_using_Windows_Foundation
34 #define WIDL_using_Windows_Foundation_Collections
35 #include "windows.foundation.h"
36 #define WIDL_using_Windows_Globalization
37 #include "windows.globalization.h"
38 #define WIDL_using_Windows_Media_SpeechSynthesis
39 #include "windows.media.speechsynthesis.h"
40 #define WIDL_using_Windows_Media_SpeechRecognition
41 #include "windows.media.speechrecognition.h"
43 #include "wine/list.h"
47 * Windows.Media.SpeechRecognition
51 extern IActivationFactory *listconstraint_factory;
52 extern IActivationFactory *recognizer_factory;
56 * Windows.Media.SpeechSynthesis
60 extern IActivationFactory *synthesizer_factory;
64 struct vector_iids
66 const GUID *iterable;
67 const GUID *vector;
68 const GUID *view;
71 HRESULT typed_event_handlers_append( struct list *list, ITypedEventHandler_IInspectable_IInspectable *handler, EventRegistrationToken *token );
72 HRESULT typed_event_handlers_remove( struct list *list, EventRegistrationToken *token );
73 HRESULT typed_event_handlers_notify( struct list *list, IInspectable *sender, IInspectable *args );
74 HRESULT typed_event_handlers_clear( struct list* list );
76 HRESULT vector_hstring_create( IVector_HSTRING **out );
77 HRESULT vector_hstring_create_copy( IIterable_HSTRING *iterable, IVector_HSTRING **out );
78 HRESULT vector_inspectable_create( const struct vector_iids *iids, IVector_IInspectable **out );
80 #define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \
81 static inline impl_type *impl_from( iface_type *iface ) \
82 { \
83 return CONTAINING_RECORD( iface, impl_type, iface_mem ); \
84 } \
85 static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \
86 { \
87 impl_type *impl = impl_from( iface ); \
88 return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \
89 } \
90 static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \
91 { \
92 impl_type *impl = impl_from( iface ); \
93 return IInspectable_AddRef( (IInspectable *)(expr) ); \
94 } \
95 static ULONG WINAPI pfx##_Release( iface_type *iface ) \
96 { \
97 impl_type *impl = impl_from( iface ); \
98 return IInspectable_Release( (IInspectable *)(expr) ); \
99 } \
100 static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \
102 impl_type *impl = impl_from( iface ); \
103 return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \
105 static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \
107 impl_type *impl = impl_from( iface ); \
108 return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \
110 static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \
112 impl_type *impl = impl_from( iface ); \
113 return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \
115 #define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \
116 DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface )
117 #define DEFINE_IINSPECTABLE_OUTER( pfx, iface_type, impl_type, outer_iface ) \
118 DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, impl->outer_iface )
120 #endif