windows.system.threading.idl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifdef __WIDL__
  7. #pragma winrt ns_prefix
  8. #endif
  9. import "inspectable.idl";
  10. import "windows.foundation.idl";
  11. namespace Windows {
  12. namespace Foundation {
  13. interface IAsyncAction;
  14. }
  15. namespace System {
  16. namespace Threading {
  17. typedef enum WorkItemPriority WorkItemPriority;
  18. typedef enum WorkItemOptions WorkItemOptions;
  19. interface TimerElapsedHandler; //delegate
  20. interface TimerDestroyedHandler; //delegate
  21. interface WorkItemHandler; //delegate
  22. interface IThreadPoolStatics;
  23. interface IThreadPoolTimer;
  24. interface IThreadPoolTimerStatics;
  25. }
  26. }
  27. }
  28. namespace Windows {
  29. namespace System {
  30. namespace Threading
  31. {
  32. enum WorkItemPriority {
  33. Low = -1,
  34. Normal = 0,
  35. High = 1
  36. };
  37. enum WorkItemOptions {
  38. None = 0,
  39. TimeSliced = 1
  40. };
  41. [uuid(FAAEA667-FBEB-49CB-ADB2-71184C556E43)]
  42. interface TimerElapsedHandler : IUnknown {
  43. HRESULT Invoke(IThreadPoolTimer* timer);
  44. }
  45. [uuid(34ED19FA-8384-4EB9-8209-FB5094EEEC35)]
  46. interface TimerDestroyedHandler : IUnknown {
  47. HRESULT Invoke(IThreadPoolTimer* timer);
  48. }
  49. [uuid(1D1A8B8B-FA66-414F-9CBD-B65FC99D17FA)]
  50. interface WorkItemHandler : IUnknown {
  51. HRESULT Invoke(
  52. Windows.Foundation.IAsyncAction* operation);
  53. }
  54. [uuid(B6BF67DD-84BD-44F8-AC1C-93EBCB9DBA91)]
  55. interface IThreadPoolStatics : IInspectable
  56. {
  57. HRESULT RunAsync(
  58. WorkItemHandler* handler,
  59. Windows.Foundation.IAsyncAction** operation);
  60. HRESULT RunWithPriorityAsync(
  61. WorkItemHandler* handler,
  62. WorkItemPriority priority,
  63. Windows.Foundation.IAsyncAction** operation);
  64. HRESULT RunWithPriorityAndOptionsAsync(
  65. WorkItemHandler* handler,
  66. WorkItemPriority priority,
  67. WorkItemOptions options,
  68. Windows.Foundation.IAsyncAction** operation);
  69. }
  70. [uuid(594EBE78-55EA-4A88-A50D-3402AE1F9CF2)]
  71. interface IThreadPoolTimer : IInspectable
  72. {
  73. [propget] HRESULT Period(Windows.Foundation.TimeSpan* value);
  74. [propget] HRESULT Delay(Windows.Foundation.TimeSpan* value);
  75. HRESULT Cancel();
  76. }
  77. [uuid(1A8A9D02-E482-461B-B8C7-8EFAD1CCE590)]
  78. interface IThreadPoolTimerStatics : IInspectable
  79. {
  80. HRESULT CreatePeriodicTimer(
  81. TimerElapsedHandler* handler,
  82. Windows.Foundation.TimeSpan period,
  83. IThreadPoolTimer** timer);
  84. HRESULT CreateTimer(
  85. TimerElapsedHandler* handler,
  86. Windows.Foundation.TimeSpan delay,
  87. IThreadPoolTimer** timer);
  88. HRESULT CreatePeriodicTimerWithCompletion(
  89. TimerElapsedHandler* handler,
  90. Windows.Foundation.TimeSpan period,
  91. TimerDestroyedHandler* destroyed,
  92. IThreadPoolTimer** timer);
  93. HRESULT CreateTimerWithCompletion(
  94. TimerElapsedHandler* handler,
  95. Windows.Foundation.TimeSpan delay,
  96. TimerDestroyedHandler* destroyed,
  97. IThreadPoolTimer** timer);
  98. }
  99. }
  100. }
  101. }