@@ -236,6 +236,27 @@ pub struct IBackgroundTaskBuilder5_Vtbl {
236
236
pub base__ : windows_core:: IInspectable_Vtbl ,
237
237
pub SetTaskEntryPointClsid : unsafe extern "system" fn ( * mut core:: ffi:: c_void , windows_core:: GUID ) -> windows_core:: HRESULT ,
238
238
}
239
+ windows_core:: imp:: define_interface!( IBackgroundTaskBuilder6 , IBackgroundTaskBuilder6_Vtbl , 0x80b47b17_ec8b_5653_850b_7508a01f52e7 ) ;
240
+ impl windows_core:: RuntimeType for IBackgroundTaskBuilder6 {
241
+ const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: for_interface :: < Self > ( ) ;
242
+ }
243
+ #[ repr( C ) ]
244
+ pub struct IBackgroundTaskBuilder6_Vtbl {
245
+ pub base__ : windows_core:: IInspectable_Vtbl ,
246
+ pub AllowRunningTaskInStandby : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut bool ) -> windows_core:: HRESULT ,
247
+ pub SetAllowRunningTaskInStandby : unsafe extern "system" fn ( * mut core:: ffi:: c_void , bool ) -> windows_core:: HRESULT ,
248
+ pub Validate : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut bool ) -> windows_core:: HRESULT ,
249
+ pub Register : unsafe extern "system" fn ( * mut core:: ffi:: c_void , core:: mem:: MaybeUninit < windows_core:: HSTRING > , * mut * mut core:: ffi:: c_void ) -> windows_core:: HRESULT ,
250
+ }
251
+ windows_core:: imp:: define_interface!( IBackgroundTaskBuilderStatics , IBackgroundTaskBuilderStatics_Vtbl , 0xd1eb5046_06f2_55b4_9bb7_a6457ebf3300 ) ;
252
+ impl windows_core:: RuntimeType for IBackgroundTaskBuilderStatics {
253
+ const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: for_interface :: < Self > ( ) ;
254
+ }
255
+ #[ repr( C ) ]
256
+ pub struct IBackgroundTaskBuilderStatics_Vtbl {
257
+ pub base__ : windows_core:: IInspectable_Vtbl ,
258
+ pub IsRunningTaskInStandbySupported : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut bool ) -> windows_core:: HRESULT ,
259
+ }
239
260
windows_core:: imp:: define_interface!( IBackgroundTaskCompletedEventArgs , IBackgroundTaskCompletedEventArgs_Vtbl , 0x565d25cf_f209_48f4_9967_2b184f7bfbf0 ) ;
240
261
impl windows_core:: RuntimeType for IBackgroundTaskCompletedEventArgs {
241
262
const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: for_interface :: < Self > ( ) ;
@@ -741,6 +762,16 @@ pub struct IBackgroundTaskRegistration3_Vtbl {
741
762
pub base__ : windows_core:: IInspectable_Vtbl ,
742
763
pub TaskGroup : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut * mut core:: ffi:: c_void ) -> windows_core:: HRESULT ,
743
764
}
765
+ windows_core:: imp:: define_interface!( IBackgroundTaskRegistration4 , IBackgroundTaskRegistration4_Vtbl , 0x169c09c9_b0de_5576_a05b_a02067989879 ) ;
766
+ impl windows_core:: RuntimeType for IBackgroundTaskRegistration4 {
767
+ const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: for_interface :: < Self > ( ) ;
768
+ }
769
+ #[ repr( C ) ]
770
+ pub struct IBackgroundTaskRegistration4_Vtbl {
771
+ pub base__ : windows_core:: IInspectable_Vtbl ,
772
+ pub TaskLastThrottledInStandbyTimestamp : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut super :: super :: Foundation :: DateTime ) -> windows_core:: HRESULT ,
773
+ pub AppEnergyUsePredictionContribution : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut f64 ) -> windows_core:: HRESULT ,
774
+ }
744
775
windows_core:: imp:: define_interface!( IBackgroundTaskRegistrationGroup , IBackgroundTaskRegistrationGroup_Vtbl , 0x2ab1919a_871b_4167_8a76_055cd67b5b23 ) ;
745
776
impl windows_core:: RuntimeType for IBackgroundTaskRegistrationGroup {
746
777
const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: for_interface :: < Self > ( ) ;
@@ -820,6 +851,17 @@ pub struct IBackgroundWorkCostStatics_Vtbl {
820
851
pub base__ : windows_core:: IInspectable_Vtbl ,
821
852
pub CurrentBackgroundWorkCost : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut BackgroundWorkCostValue ) -> windows_core:: HRESULT ,
822
853
}
854
+ windows_core:: imp:: define_interface!( IBackgroundWorkCostStatics2 , IBackgroundWorkCostStatics2_Vtbl , 0xd868c976_81f6_57c8_ab2b_400b749e21d6 ) ;
855
+ impl windows_core:: RuntimeType for IBackgroundWorkCostStatics2 {
856
+ const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: for_interface :: < Self > ( ) ;
857
+ }
858
+ #[ repr( C ) ]
859
+ pub struct IBackgroundWorkCostStatics2_Vtbl {
860
+ pub base__ : windows_core:: IInspectable_Vtbl ,
861
+ pub AppEnergyUseLevel : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut EnergyUseLevel ) -> windows_core:: HRESULT ,
862
+ pub AppEnergyUsePrediction : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut EnergyUseLevel ) -> windows_core:: HRESULT ,
863
+ pub AppLastThrottledInStandbyTimestamp : unsafe extern "system" fn ( * mut core:: ffi:: c_void , * mut super :: super :: Foundation :: DateTime ) -> windows_core:: HRESULT ,
864
+ }
823
865
windows_core:: imp:: define_interface!( IBluetoothLEAdvertisementPublisherTrigger , IBluetoothLEAdvertisementPublisherTrigger_Vtbl , 0xab3e2612_25d3_48ae_8724_d81877ae6129 ) ;
824
866
impl windows_core:: RuntimeType for IBluetoothLEAdvertisementPublisherTrigger {
825
867
const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: for_interface :: < Self > ( ) ;
@@ -2005,6 +2047,42 @@ impl BackgroundTaskBuilder {
2005
2047
let this = & windows_core:: Interface :: cast :: < IBackgroundTaskBuilder5 > ( self ) ?;
2006
2048
unsafe { ( windows_core:: Interface :: vtable ( this) . SetTaskEntryPointClsid ) ( windows_core:: Interface :: as_raw ( this) , taskentrypoint) . ok ( ) }
2007
2049
}
2050
+ pub fn AllowRunningTaskInStandby ( & self ) -> windows_core:: Result < bool > {
2051
+ let this = & windows_core:: Interface :: cast :: < IBackgroundTaskBuilder6 > ( self ) ?;
2052
+ unsafe {
2053
+ let mut result__ = core:: mem:: zeroed ( ) ;
2054
+ ( windows_core:: Interface :: vtable ( this) . AllowRunningTaskInStandby ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2055
+ }
2056
+ }
2057
+ pub fn SetAllowRunningTaskInStandby ( & self , value : bool ) -> windows_core:: Result < ( ) > {
2058
+ let this = & windows_core:: Interface :: cast :: < IBackgroundTaskBuilder6 > ( self ) ?;
2059
+ unsafe { ( windows_core:: Interface :: vtable ( this) . SetAllowRunningTaskInStandby ) ( windows_core:: Interface :: as_raw ( this) , value) . ok ( ) }
2060
+ }
2061
+ pub fn Validate ( & self ) -> windows_core:: Result < bool > {
2062
+ let this = & windows_core:: Interface :: cast :: < IBackgroundTaskBuilder6 > ( self ) ?;
2063
+ unsafe {
2064
+ let mut result__ = core:: mem:: zeroed ( ) ;
2065
+ ( windows_core:: Interface :: vtable ( this) . Validate ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2066
+ }
2067
+ }
2068
+ pub fn Register2 ( & self , taskname : & windows_core:: HSTRING ) -> windows_core:: Result < BackgroundTaskRegistration > {
2069
+ let this = & windows_core:: Interface :: cast :: < IBackgroundTaskBuilder6 > ( self ) ?;
2070
+ unsafe {
2071
+ let mut result__ = core:: mem:: zeroed ( ) ;
2072
+ ( windows_core:: Interface :: vtable ( this) . Register ) ( windows_core:: Interface :: as_raw ( this) , core:: mem:: transmute_copy ( taskname) , & mut result__) . and_then ( || windows_core:: Type :: from_abi ( result__) )
2073
+ }
2074
+ }
2075
+ pub fn IsRunningTaskInStandbySupported ( ) -> windows_core:: Result < bool > {
2076
+ Self :: IBackgroundTaskBuilderStatics ( |this| unsafe {
2077
+ let mut result__ = core:: mem:: zeroed ( ) ;
2078
+ ( windows_core:: Interface :: vtable ( this) . IsRunningTaskInStandbySupported ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2079
+ } )
2080
+ }
2081
+ #[ doc( hidden) ]
2082
+ pub fn IBackgroundTaskBuilderStatics < R , F : FnOnce ( & IBackgroundTaskBuilderStatics ) -> windows_core:: Result < R > > ( callback : F ) -> windows_core:: Result < R > {
2083
+ static SHARED : windows_core:: imp:: FactoryCache < BackgroundTaskBuilder , IBackgroundTaskBuilderStatics > = windows_core:: imp:: FactoryCache :: new ( ) ;
2084
+ SHARED . call ( callback)
2085
+ }
2008
2086
}
2009
2087
impl windows_core:: RuntimeType for BackgroundTaskBuilder {
2010
2088
const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: for_class :: < Self , IBackgroundTaskBuilder > ( ) ;
@@ -2165,6 +2243,20 @@ impl BackgroundTaskRegistration {
2165
2243
( windows_core:: Interface :: vtable ( this) . TaskGroup ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . and_then ( || windows_core:: Type :: from_abi ( result__) )
2166
2244
}
2167
2245
}
2246
+ pub fn TaskLastThrottledInStandbyTimestamp ( & self ) -> windows_core:: Result < super :: super :: Foundation :: DateTime > {
2247
+ let this = & windows_core:: Interface :: cast :: < IBackgroundTaskRegistration4 > ( self ) ?;
2248
+ unsafe {
2249
+ let mut result__ = core:: mem:: zeroed ( ) ;
2250
+ ( windows_core:: Interface :: vtable ( this) . TaskLastThrottledInStandbyTimestamp ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2251
+ }
2252
+ }
2253
+ pub fn AppEnergyUsePredictionContribution ( & self ) -> windows_core:: Result < f64 > {
2254
+ let this = & windows_core:: Interface :: cast :: < IBackgroundTaskRegistration4 > ( self ) ?;
2255
+ unsafe {
2256
+ let mut result__ = core:: mem:: zeroed ( ) ;
2257
+ ( windows_core:: Interface :: vtable ( this) . AppEnergyUsePredictionContribution ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2258
+ }
2259
+ }
2168
2260
#[ cfg( feature = "Foundation_Collections" ) ]
2169
2261
pub fn AllTasks ( ) -> windows_core:: Result < super :: super :: Foundation :: Collections :: IMapView < windows_core:: GUID , IBackgroundTaskRegistration > > {
2170
2262
Self :: IBackgroundTaskRegistrationStatics ( |this| unsafe {
@@ -2288,11 +2380,34 @@ impl BackgroundWorkCost {
2288
2380
( windows_core:: Interface :: vtable ( this) . CurrentBackgroundWorkCost ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2289
2381
} )
2290
2382
}
2383
+ pub fn AppEnergyUseLevel ( ) -> windows_core:: Result < EnergyUseLevel > {
2384
+ Self :: IBackgroundWorkCostStatics2 ( |this| unsafe {
2385
+ let mut result__ = core:: mem:: zeroed ( ) ;
2386
+ ( windows_core:: Interface :: vtable ( this) . AppEnergyUseLevel ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2387
+ } )
2388
+ }
2389
+ pub fn AppEnergyUsePrediction ( ) -> windows_core:: Result < EnergyUseLevel > {
2390
+ Self :: IBackgroundWorkCostStatics2 ( |this| unsafe {
2391
+ let mut result__ = core:: mem:: zeroed ( ) ;
2392
+ ( windows_core:: Interface :: vtable ( this) . AppEnergyUsePrediction ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2393
+ } )
2394
+ }
2395
+ pub fn AppLastThrottledInStandbyTimestamp ( ) -> windows_core:: Result < super :: super :: Foundation :: DateTime > {
2396
+ Self :: IBackgroundWorkCostStatics2 ( |this| unsafe {
2397
+ let mut result__ = core:: mem:: zeroed ( ) ;
2398
+ ( windows_core:: Interface :: vtable ( this) . AppLastThrottledInStandbyTimestamp ) ( windows_core:: Interface :: as_raw ( this) , & mut result__) . map ( || result__)
2399
+ } )
2400
+ }
2291
2401
#[ doc( hidden) ]
2292
2402
pub fn IBackgroundWorkCostStatics < R , F : FnOnce ( & IBackgroundWorkCostStatics ) -> windows_core:: Result < R > > ( callback : F ) -> windows_core:: Result < R > {
2293
2403
static SHARED : windows_core:: imp:: FactoryCache < BackgroundWorkCost , IBackgroundWorkCostStatics > = windows_core:: imp:: FactoryCache :: new ( ) ;
2294
2404
SHARED . call ( callback)
2295
2405
}
2406
+ #[ doc( hidden) ]
2407
+ pub fn IBackgroundWorkCostStatics2 < R , F : FnOnce ( & IBackgroundWorkCostStatics2 ) -> windows_core:: Result < R > > ( callback : F ) -> windows_core:: Result < R > {
2408
+ static SHARED : windows_core:: imp:: FactoryCache < BackgroundWorkCost , IBackgroundWorkCostStatics2 > = windows_core:: imp:: FactoryCache :: new ( ) ;
2409
+ SHARED . call ( callback)
2410
+ }
2296
2411
}
2297
2412
impl windows_core:: RuntimeName for BackgroundWorkCost {
2298
2413
const NAME : & ' static str = "Windows.ApplicationModel.Background.BackgroundWorkCost" ;
@@ -4470,6 +4585,26 @@ impl windows_core::RuntimeType for DeviceTriggerResult {
4470
4585
}
4471
4586
#[ repr( transparent) ]
4472
4587
#[ derive( PartialEq , Eq , Copy , Clone , Default ) ]
4588
+ pub struct EnergyUseLevel ( pub i32 ) ;
4589
+ impl EnergyUseLevel {
4590
+ pub const Unknown : Self = Self ( 0i32 ) ;
4591
+ pub const UnderHalfOfBudget : Self = Self ( 1i32 ) ;
4592
+ pub const OverHalfOfBudget : Self = Self ( 2i32 ) ;
4593
+ pub const OverBudget : Self = Self ( 3i32 ) ;
4594
+ }
4595
+ impl windows_core:: TypeKind for EnergyUseLevel {
4596
+ type TypeKind = windows_core:: CopyType ;
4597
+ }
4598
+ impl core:: fmt:: Debug for EnergyUseLevel {
4599
+ fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
4600
+ f. debug_tuple ( "EnergyUseLevel" ) . field ( & self . 0 ) . finish ( )
4601
+ }
4602
+ }
4603
+ impl windows_core:: RuntimeType for EnergyUseLevel {
4604
+ const SIGNATURE : windows_core:: imp:: ConstBuffer = windows_core:: imp:: ConstBuffer :: from_slice ( b"enum(Windows.ApplicationModel.Background.EnergyUseLevel;i4)" ) ;
4605
+ }
4606
+ #[ repr( transparent) ]
4607
+ #[ derive( PartialEq , Eq , Copy , Clone , Default ) ]
4473
4608
pub struct LocationTriggerType ( pub i32 ) ;
4474
4609
impl LocationTriggerType {
4475
4610
pub const Geofence : Self = Self ( 0i32 ) ;
0 commit comments