| 1 |
/* |
| 2 |
* Copyright (C) 2024 Zhiyi Zhang for CodeWeavers |
| 3 |
* |
| 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. |
| 8 |
* |
| 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. |
| 13 |
* |
| 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 |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifdef __WIDL__ |
| 20 |
#pragma winrt ns_prefix |
| 21 |
#endif |
| 22 |
|
| 23 |
import "inspectable.idl"; |
| 24 |
import "asyncinfo.idl"; |
| 25 |
import "eventtoken.idl"; |
| 26 |
import "windowscontracts.idl"; |
| 27 |
import "windows.foundation.idl"; |
| 28 |
import "windows.applicationmodel.activation.idl"; |
| 29 |
import "windows.storage.idl"; |
| 30 |
import "windows.system.idl"; |
| 31 |
|
| 32 |
namespace Windows.ApplicationModel.Activation { |
| 33 |
runtimeclass BackgroundActivatedEventArgs; |
| 34 |
} |
| 35 |
|
| 36 |
namespace Windows.ApplicationModel.Background { |
| 37 |
runtimeclass BackgroundTaskRegistrationGroup; |
| 38 |
} |
| 39 |
|
| 40 |
namespace Windows.ApplicationModel.Activation { |
| 41 |
declare { |
| 42 |
interface Windows.Foundation.EventHandler<Windows.ApplicationModel.Activation.BackgroundActivatedEventArgs *>; |
| 43 |
interface Windows.Foundation.TypedEventHandler<Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup *, Windows.ApplicationModel.Activation.BackgroundActivatedEventArgs *>; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
namespace Windows.ApplicationModel.Background { |
| 48 |
typedef enum BackgroundTaskCancellationReason BackgroundTaskCancellationReason; |
| 49 |
|
| 50 |
interface IBackgroundTaskCompletedEventArgs; |
| 51 |
interface IBackgroundTaskDeferral; |
| 52 |
interface IBackgroundTaskProgressEventArgs; |
| 53 |
interface IBackgroundTaskInstance; |
| 54 |
interface IBackgroundTaskRegistration; |
| 55 |
interface IBackgroundTaskRegistration2; |
| 56 |
interface IBackgroundTaskRegistration3; |
| 57 |
interface IBackgroundTaskRegistrationGroup; |
| 58 |
interface IBackgroundTaskRegistrationGroupFactory; |
| 59 |
interface IBackgroundTaskRegistrationStatics; |
| 60 |
interface IBackgroundTaskRegistrationStatics2; |
| 61 |
interface IBackgroundTrigger; |
| 62 |
|
| 63 |
runtimeclass BackgroundTaskCompletedEventArgs; |
| 64 |
runtimeclass BackgroundTaskDeferral; |
| 65 |
runtimeclass BackgroundTaskProgressEventArgs; |
| 66 |
runtimeclass BackgroundTaskRegistration; |
| 67 |
runtimeclass BackgroundTaskRegistrationGroup; |
| 68 |
|
| 69 |
declare { |
| 70 |
interface Windows.Foundation.Collections.IMapView<GUID, Windows.ApplicationModel.Background.BackgroundTaskRegistration *>; |
| 71 |
interface Windows.Foundation.Collections.IMapView<GUID, Windows.ApplicationModel.Background.IBackgroundTaskRegistration *>; |
| 72 |
interface Windows.Foundation.Collections.IMapView<HSTRING, Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup *>; |
| 73 |
} |
| 74 |
|
| 75 |
[ |
| 76 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 77 |
] |
| 78 |
enum BackgroundTaskCancellationReason |
| 79 |
{ |
| 80 |
Abort = 0, |
| 81 |
Terminating = 1, |
| 82 |
LoggingOff = 2, |
| 83 |
ServicingUpdate = 3, |
| 84 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] IdleTask = 4, |
| 85 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Uninstall = 5, |
| 86 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] ConditionLoss = 6, |
| 87 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] SystemPolicy = 7, |
| 88 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] QuietHoursEntered = 8, |
| 89 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] ExecutionTimeExceeded = 9, |
| 90 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] ResourceRevocation = 10, |
| 91 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] EnergySaver = 11 |
| 92 |
}; |
| 93 |
|
| 94 |
[ |
| 95 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 96 |
uuid(a6c4bac0-51f8-4c57-ac3f-156dd1680c4f) |
| 97 |
] |
| 98 |
delegate |
| 99 |
HRESULT BackgroundTaskCanceledEventHandler([in] Windows.ApplicationModel.Background.IBackgroundTaskInstance *sender, [in] Windows.ApplicationModel.Background.BackgroundTaskCancellationReason reason); |
| 100 |
|
| 101 |
[ |
| 102 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 103 |
uuid(5B38E929-A086-46A7-A678-439135822BCF) |
| 104 |
] |
| 105 |
delegate |
| 106 |
HRESULT BackgroundTaskCompletedEventHandler([in] Windows.ApplicationModel.Background.BackgroundTaskRegistration *sender, [in] Windows.ApplicationModel.Background.BackgroundTaskCompletedEventArgs *args); |
| 107 |
|
| 108 |
[ |
| 109 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 110 |
uuid(46e0683c-8a88-4c99-804c-76897f6277a6) |
| 111 |
] |
| 112 |
delegate |
| 113 |
HRESULT BackgroundTaskProgressEventHandler([in] Windows.ApplicationModel.Background.BackgroundTaskRegistration *sender, [in] Windows.ApplicationModel.Background.BackgroundTaskProgressEventArgs *args); |
| 114 |
|
| 115 |
[ |
| 116 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 117 |
exclusiveto(Windows.ApplicationModel.Background.BackgroundTaskCompletedEventArgs), |
| 118 |
uuid(565d25cf-f209-48f4-9967-2b184f7bfbf0) |
| 119 |
] |
| 120 |
interface IBackgroundTaskCompletedEventArgs : IInspectable |
| 121 |
{ |
| 122 |
[propget] HRESULT InstanceId([out, retval] GUID *value); |
| 123 |
HRESULT CheckResult(); |
| 124 |
} |
| 125 |
|
| 126 |
[ |
| 127 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 128 |
exclusiveto(Windows.ApplicationModel.Background.BackgroundTaskDeferral), |
| 129 |
uuid(93cc156d-af27-4dd3-846e-24ee40cadd25) |
| 130 |
] |
| 131 |
interface IBackgroundTaskDeferral : IInspectable |
| 132 |
{ |
| 133 |
HRESULT Complete(); |
| 134 |
} |
| 135 |
|
| 136 |
[ |
| 137 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 138 |
exclusiveto(Windows.ApplicationModel.Background.BackgroundTaskProgressEventArgs), |
| 139 |
uuid(fb1468ac-8332-4d0a-9532-03eae684da31) |
| 140 |
] |
| 141 |
interface IBackgroundTaskProgressEventArgs : IInspectable |
| 142 |
{ |
| 143 |
[propget] HRESULT InstanceId([out, retval] GUID *value); |
| 144 |
[propget] HRESULT Progress([out, retval] UINT32 *value); |
| 145 |
} |
| 146 |
|
| 147 |
[ |
| 148 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 149 |
uuid(865bda7a-21d8-4573-8f32-928a1b0641f6) |
| 150 |
] |
| 151 |
interface IBackgroundTaskInstance : IInspectable |
| 152 |
{ |
| 153 |
[propget] HRESULT InstanceId([out, retval] GUID *value); |
| 154 |
[propget] HRESULT Task([out, retval] Windows.ApplicationModel.Background.BackgroundTaskRegistration **task); |
| 155 |
[propget] HRESULT Progress([out, retval] UINT32 *value); |
| 156 |
[propput] HRESULT Progress([in] UINT32 value); |
| 157 |
[propget] HRESULT TriggerDetails([out, retval] IInspectable **details); |
| 158 |
[eventadd] HRESULT Canceled([in] Windows.ApplicationModel.Background.BackgroundTaskCanceledEventHandler *handler, [out, retval] EventRegistrationToken *cookie); |
| 159 |
[eventremove] HRESULT Canceled([in] EventRegistrationToken cookie); |
| 160 |
[propget] HRESULT SuspendedCount([out, retval] UINT32 *value); |
| 161 |
HRESULT GetDeferral([out, retval] Windows.ApplicationModel.Background.BackgroundTaskDeferral **deferral); |
| 162 |
} |
| 163 |
|
| 164 |
[ |
| 165 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 166 |
uuid(10654cc2-a26e-43bf-8c12-1fb40dbfbfa0) |
| 167 |
] |
| 168 |
interface IBackgroundTaskRegistration : IInspectable |
| 169 |
{ |
| 170 |
[propget] HRESULT TaskId([out, retval] GUID *value); |
| 171 |
[propget] HRESULT Name([out, retval] HSTRING *value); |
| 172 |
[eventadd] HRESULT Progress([in] Windows.ApplicationModel.Background.BackgroundTaskProgressEventHandler *handler, [out, retval] EventRegistrationToken *cookie); |
| 173 |
[eventremove] HRESULT Progress([in] EventRegistrationToken cookie); |
| 174 |
[eventadd] HRESULT Completed([in] Windows.ApplicationModel.Background.BackgroundTaskCompletedEventHandler *handler, [out, retval] EventRegistrationToken *cookie); |
| 175 |
[eventremove] HRESULT Completed([in] EventRegistrationToken cookie); |
| 176 |
HRESULT Unregister([in] boolean cancel_task); |
| 177 |
} |
| 178 |
|
| 179 |
[ |
| 180 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 181 |
uuid(6138c703-bb86-4112-afc3-7f939b166e3b) |
| 182 |
] |
| 183 |
interface IBackgroundTaskRegistration2 : IInspectable |
| 184 |
requires Windows.ApplicationModel.Background.IBackgroundTaskRegistration |
| 185 |
{ |
| 186 |
[propget] HRESULT Trigger([out, retval] Windows.ApplicationModel.Background.IBackgroundTrigger **value); |
| 187 |
} |
| 188 |
|
| 189 |
[ |
| 190 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 191 |
uuid(fe338195-9423-4d8b-830d-b1dd2c7badd5) |
| 192 |
] |
| 193 |
interface IBackgroundTaskRegistration3 : IInspectable |
| 194 |
requires Windows.ApplicationModel.Background.IBackgroundTaskRegistration |
| 195 |
{ |
| 196 |
[propget] HRESULT TaskGroup([out, retval] Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup **value); |
| 197 |
} |
| 198 |
|
| 199 |
[ |
| 200 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 201 |
exclusiveto(Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup), |
| 202 |
uuid(2ab1919a-871b-4167-8a76-055cd67b5b23) |
| 203 |
] |
| 204 |
interface IBackgroundTaskRegistrationGroup : IInspectable |
| 205 |
{ |
| 206 |
[propget] HRESULT Id([out, retval] HSTRING *value); |
| 207 |
[propget] HRESULT Name([out, retval] HSTRING *value); |
| 208 |
[eventadd] HRESULT BackgroundActivated([in] Windows.Foundation.TypedEventHandler<Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup *, Windows.ApplicationModel.Activation.BackgroundActivatedEventArgs *> *handler, [out, retval] EventRegistrationToken *token); |
| 209 |
[eventremove] HRESULT BackgroundActivated([in] EventRegistrationToken token); |
| 210 |
[propget] HRESULT AllTasks([out, retval] Windows.Foundation.Collections.IMapView<GUID, Windows.ApplicationModel.Background.BackgroundTaskRegistration *> **value); |
| 211 |
} |
| 212 |
|
| 213 |
[ |
| 214 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 215 |
exclusiveto(Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup), |
| 216 |
uuid(83d92b69-44cf-4631-9740-03c7d8741bc5) |
| 217 |
] |
| 218 |
interface IBackgroundTaskRegistrationGroupFactory : IInspectable |
| 219 |
{ |
| 220 |
HRESULT Create([in] HSTRING id, [out, retval] Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup **group); |
| 221 |
HRESULT CreateWithName([in] HSTRING id, [in] HSTRING name, [out, retval] Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup **group); |
| 222 |
} |
| 223 |
|
| 224 |
[ |
| 225 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 226 |
exclusiveto(Windows.ApplicationModel.Background.BackgroundTaskRegistration), |
| 227 |
uuid(4c542f69-b000-42ba-a093-6a563c65e3f8) |
| 228 |
] |
| 229 |
interface IBackgroundTaskRegistrationStatics : IInspectable |
| 230 |
{ |
| 231 |
[propget] HRESULT AllTasks([out, retval] Windows.Foundation.Collections.IMapView<GUID, Windows.ApplicationModel.Background.IBackgroundTaskRegistration *> **tasks); |
| 232 |
} |
| 233 |
|
| 234 |
[ |
| 235 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 236 |
exclusiveto(Windows.ApplicationModel.Background.BackgroundTaskRegistration), |
| 237 |
uuid(174b671e-b20d-4fa9-ad9a-e93ad6c71e01) |
| 238 |
] |
| 239 |
interface IBackgroundTaskRegistrationStatics2 : IInspectable |
| 240 |
{ |
| 241 |
[propget] HRESULT AllTaskGroups([out, retval] Windows.Foundation.Collections.IMapView<HSTRING, Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup *> **value); |
| 242 |
HRESULT GetTaskGroup([in] HSTRING groupId, [out, retval] Windows.ApplicationModel.Background.BackgroundTaskRegistrationGroup **value); |
| 243 |
} |
| 244 |
|
| 245 |
|
| 246 |
[ |
| 247 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 248 |
uuid(84b3a058-6027-4b87-9790-bdf3f757dbd7) |
| 249 |
] |
| 250 |
interface IBackgroundTrigger : IInspectable |
| 251 |
{ |
| 252 |
} |
| 253 |
|
| 254 |
[ |
| 255 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 256 |
marshaling_behavior(agile), |
| 257 |
threading(both) |
| 258 |
] |
| 259 |
runtimeclass BackgroundTaskCompletedEventArgs |
| 260 |
{ |
| 261 |
[default] interface Windows.ApplicationModel.Background.IBackgroundTaskCompletedEventArgs; |
| 262 |
} |
| 263 |
|
| 264 |
[ |
| 265 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 266 |
marshaling_behavior(agile), |
| 267 |
threading(mta) |
| 268 |
] |
| 269 |
runtimeclass BackgroundTaskDeferral |
| 270 |
{ |
| 271 |
[default] interface Windows.ApplicationModel.Background.IBackgroundTaskDeferral; |
| 272 |
} |
| 273 |
|
| 274 |
[ |
| 275 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 276 |
marshaling_behavior(agile), |
| 277 |
threading(both) |
| 278 |
] |
| 279 |
runtimeclass BackgroundTaskProgressEventArgs |
| 280 |
{ |
| 281 |
[default] interface Windows.ApplicationModel.Background.IBackgroundTaskProgressEventArgs; |
| 282 |
} |
| 283 |
|
| 284 |
[ |
| 285 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 286 |
marshaling_behavior(agile), |
| 287 |
static(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics, Windows.Foundation.UniversalApiContract, 1.0), |
| 288 |
static(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics2, Windows.Foundation.UniversalApiContract, 4.0), |
| 289 |
threading(both) |
| 290 |
] |
| 291 |
runtimeclass BackgroundTaskRegistration |
| 292 |
{ |
| 293 |
[default] interface Windows.ApplicationModel.Background.IBackgroundTaskRegistration; |
| 294 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.ApplicationModel.Background.IBackgroundTaskRegistration2; |
| 295 |
[contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.ApplicationModel.Background.IBackgroundTaskRegistration3; |
| 296 |
} |
| 297 |
|
| 298 |
[ |
| 299 |
activatable(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationGroupFactory, Windows.Foundation.UniversalApiContract, 4.0), |
| 300 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 301 |
marshaling_behavior(agile), |
| 302 |
threading(both) |
| 303 |
] |
| 304 |
runtimeclass BackgroundTaskRegistrationGroup |
| 305 |
{ |
| 306 |
[default] interface Windows.ApplicationModel.Background.IBackgroundTaskRegistrationGroup; |
| 307 |
} |
| 308 |
} |