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.
4 /*============================================================
6 ** Header: winrtdispatcherqueue.h
8 ===========================================================*/
10 #ifndef _WINRTDISPATCHERQUEUE_H
11 #define _WINRTDISPATCHERQUEUE_H
13 #include <inspectable.h>
15 // The following definitions were taken from windows.system.h.
16 // Use windows.system.h from the RS3 SDK instead of this when that SDK is available.
20 enum DispatcherQueuePriority
22 DispatcherQueuePriority_Low = -10,
23 DispatcherQueuePriority_Normal = 0,
24 DispatcherQueuePriority_High = 10
27 MIDL_INTERFACE("DFA2DC9C-1A2D-4917-98F2-939AF1D6E0C8")
28 IDispatcherQueueHandler : public IUnknown
31 virtual HRESULT STDMETHODCALLTYPE Invoke( void) = 0;
34 MIDL_INTERFACE("5FEABB1D-A31C-4727-B1AC-37454649D56A")
35 IDispatcherQueueTimer : public IInspectable
38 virtual HRESULT STDMETHODCALLTYPE Start( void) = 0;
40 virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0;
42 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Interval(
43 /* [out][retval] */ __RPC__out ABI::Windows::Foundation::TimeSpan *value) = 0;
45 virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Interval(
46 /* [in] */ ABI::Windows::Foundation::TimeSpan value) = 0;
48 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsStarted(
49 /* [out][retval] */ __RPC__out boolean *value) = 0;
51 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsRepeating(
52 /* [out][retval] */ __RPC__out boolean *value) = 0;
54 virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_IsRepeating(
55 /* [in] */ boolean value) = 0;
57 #if 0 // We don't use these functions
58 virtual HRESULT STDMETHODCALLTYPE add_Tick(
59 /* [in] */ __RPC__in_opt __FITypedEventHandler_2_Windows__CSystem__CDispatcherQueueTimer_IInspectable *handler,
60 /* [out][retval] */ __RPC__out EventRegistrationToken *token) = 0;
62 virtual HRESULT STDMETHODCALLTYPE remove_Tick(
63 /* [in] */ EventRegistrationToken token) = 0;
67 MIDL_INTERFACE("603E88E4-A338-4FFE-A457-A5CFB9CEB899")
68 IDispatcherQueue : public IInspectable
71 virtual HRESULT STDMETHODCALLTYPE CreateTimer(
72 /* [out][retval] */ __RPC__deref_out_opt Windows::System::IDispatcherQueueTimer **result) = 0;
74 virtual HRESULT STDMETHODCALLTYPE TryEnqueue(
75 /* [in] */ __RPC__in_opt Windows::System::IDispatcherQueueHandler *callback,
76 /* [out][retval] */ __RPC__out boolean *result) = 0;
78 virtual HRESULT STDMETHODCALLTYPE TryEnqueueWithPriority(
79 /* [in] */ Windows::System::DispatcherQueuePriority priority,
80 /* [in] */ __RPC__in_opt Windows::System::IDispatcherQueueHandler *callback,
81 /* [out][retval] */ __RPC__out boolean *result) = 0;
84 MIDL_INTERFACE("A96D83D7-9371-4517-9245-D0824AC12C74")
85 IDispatcherQueueStatics : public IInspectable
88 virtual HRESULT STDMETHODCALLTYPE GetForCurrentThread(
89 /* [out][retval] */ __RPC__deref_out_opt Windows::System::IDispatcherQueue **result) = 0;
92 extern const __declspec(selectany) IID & IID_IDispatcherQueueStatics = __uuidof(IDispatcherQueueStatics);
96 #ifndef RUNTIMECLASS_Windows_System_DispatcherQueue_DEFINED
97 #define RUNTIMECLASS_Windows_System_DispatcherQueue_DEFINED
98 extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_System_DispatcherQueue[] = L"Windows.System.DispatcherQueue";
101 #endif // _WINRTDISPATCHERQUEUE_H