]> git.proxmox.com Git - rustc.git/blame - vendor/windows/src/Windows/ApplicationModel/ExtendedExecution/Foreground/mod.rs
Update upstream source from tag 'upstream/1.70.0+dfsg1'
[rustc.git] / vendor / windows / src / Windows / ApplicationModel / ExtendedExecution / Foreground / mod.rs
CommitLineData
353b0b11
FG
1#[doc(hidden)]
2#[repr(transparent)]
3pub struct IExtendedExecutionForegroundRevokedEventArgs(::windows::core::IUnknown);
4unsafe impl ::windows::core::Interface for IExtendedExecutionForegroundRevokedEventArgs {
5 type Vtable = IExtendedExecutionForegroundRevokedEventArgs_Vtbl;
6}
7impl ::core::clone::Clone for IExtendedExecutionForegroundRevokedEventArgs {
8 fn clone(&self) -> Self {
9 Self(self.0.clone())
10 }
11}
12unsafe impl ::windows::core::ComInterface for IExtendedExecutionForegroundRevokedEventArgs {
13 const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb07cd940_9557_aea4_2c99_bdd56d9be461);
14}
15#[repr(C)]
16#[doc(hidden)]
17pub struct IExtendedExecutionForegroundRevokedEventArgs_Vtbl {
18 pub base__: ::windows::core::IInspectable_Vtbl,
19 pub Reason: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ExtendedExecutionForegroundRevokedReason) -> ::windows::core::HRESULT,
20}
21#[doc(hidden)]
22#[repr(transparent)]
23pub struct IExtendedExecutionForegroundSession(::windows::core::IUnknown);
24unsafe impl ::windows::core::Interface for IExtendedExecutionForegroundSession {
25 type Vtable = IExtendedExecutionForegroundSession_Vtbl;
26}
27impl ::core::clone::Clone for IExtendedExecutionForegroundSession {
28 fn clone(&self) -> Self {
29 Self(self.0.clone())
30 }
31}
32unsafe impl ::windows::core::ComInterface for IExtendedExecutionForegroundSession {
33 const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfbf440e1_9d10_4201_b01e_c83275296f2e);
34}
35#[repr(C)]
36#[doc(hidden)]
37pub struct IExtendedExecutionForegroundSession_Vtbl {
38 pub base__: ::windows::core::IInspectable_Vtbl,
39 pub Description: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows::core::HSTRING>) -> ::windows::core::HRESULT,
40 pub SetDescription: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::std::mem::MaybeUninit<::windows::core::HSTRING>) -> ::windows::core::HRESULT,
41 #[cfg(feature = "Foundation")]
42 pub Revoked: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, handler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
43 #[cfg(not(feature = "Foundation"))]
44 Revoked: usize,
45 #[cfg(feature = "Foundation")]
46 pub RemoveRevoked: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
47 #[cfg(not(feature = "Foundation"))]
48 RemoveRevoked: usize,
49 #[cfg(feature = "Foundation")]
50 pub RequestExtensionAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
51 #[cfg(not(feature = "Foundation"))]
52 RequestExtensionAsync: usize,
53 pub Reason: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ExtendedExecutionForegroundReason) -> ::windows::core::HRESULT,
54 pub SetReason: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ExtendedExecutionForegroundReason) -> ::windows::core::HRESULT,
55}
56#[doc = "*Required features: `\"ApplicationModel_ExtendedExecution_Foreground\"`*"]
57#[repr(transparent)]
58pub struct ExtendedExecutionForegroundRevokedEventArgs(::windows::core::IUnknown);
59impl ExtendedExecutionForegroundRevokedEventArgs {
60 pub fn Reason(&self) -> ::windows::core::Result<ExtendedExecutionForegroundRevokedReason> {
61 let this = self;
62 unsafe {
63 let mut result__ = ::windows::core::zeroed::<ExtendedExecutionForegroundRevokedReason>();
64 (::windows::core::Interface::vtable(this).Reason)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
65 }
66 }
67}
68impl ::core::cmp::PartialEq for ExtendedExecutionForegroundRevokedEventArgs {
69 fn eq(&self, other: &Self) -> bool {
70 self.0 == other.0
71 }
72}
73impl ::core::cmp::Eq for ExtendedExecutionForegroundRevokedEventArgs {}
74impl ::core::fmt::Debug for ExtendedExecutionForegroundRevokedEventArgs {
75 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
76 f.debug_tuple("ExtendedExecutionForegroundRevokedEventArgs").field(&self.0).finish()
77 }
78}
79impl ::windows::core::RuntimeType for ExtendedExecutionForegroundRevokedEventArgs {
80 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundRevokedEventArgs;{b07cd940-9557-aea4-2c99-bdd56d9be461})");
81}
82impl ::core::clone::Clone for ExtendedExecutionForegroundRevokedEventArgs {
83 fn clone(&self) -> Self {
84 Self(self.0.clone())
85 }
86}
87unsafe impl ::windows::core::Interface for ExtendedExecutionForegroundRevokedEventArgs {
88 type Vtable = IExtendedExecutionForegroundRevokedEventArgs_Vtbl;
89}
90unsafe impl ::windows::core::ComInterface for ExtendedExecutionForegroundRevokedEventArgs {
91 const IID: ::windows::core::GUID = <IExtendedExecutionForegroundRevokedEventArgs as ::windows::core::ComInterface>::IID;
92}
93impl ::windows::core::RuntimeName for ExtendedExecutionForegroundRevokedEventArgs {
94 const NAME: &'static str = "Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundRevokedEventArgs";
95}
96::windows::imp::interface_hierarchy!(ExtendedExecutionForegroundRevokedEventArgs, ::windows::core::IUnknown, ::windows::core::IInspectable);
97unsafe impl ::core::marker::Send for ExtendedExecutionForegroundRevokedEventArgs {}
98unsafe impl ::core::marker::Sync for ExtendedExecutionForegroundRevokedEventArgs {}
99#[doc = "*Required features: `\"ApplicationModel_ExtendedExecution_Foreground\"`*"]
100#[repr(transparent)]
101pub struct ExtendedExecutionForegroundSession(::windows::core::IUnknown);
102impl ExtendedExecutionForegroundSession {
103 pub fn new() -> ::windows::core::Result<Self> {
104 Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
105 }
106 fn IActivationFactory<R, F: FnOnce(&::windows::imp::IGenericFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> {
107 static SHARED: ::windows::imp::FactoryCache<ExtendedExecutionForegroundSession, ::windows::imp::IGenericFactory> = ::windows::imp::FactoryCache::new();
108 SHARED.call(callback)
109 }
110 #[doc = "*Required features: `\"Foundation\"`*"]
111 #[cfg(feature = "Foundation")]
112 pub fn Close(&self) -> ::windows::core::Result<()> {
113 let this = &::windows::core::ComInterface::cast::<super::super::super::Foundation::IClosable>(self)?;
114 unsafe { (::windows::core::Interface::vtable(this).Close)(::windows::core::Interface::as_raw(this)).ok() }
115 }
116 pub fn Description(&self) -> ::windows::core::Result<::windows::core::HSTRING> {
117 let this = self;
118 unsafe {
119 let mut result__ = ::windows::core::zeroed::<::windows::core::HSTRING>();
120 (::windows::core::Interface::vtable(this).Description)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
121 }
122 }
123 pub fn SetDescription(&self, value: &::windows::core::HSTRING) -> ::windows::core::Result<()> {
124 let this = self;
125 unsafe { (::windows::core::Interface::vtable(this).SetDescription)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(value)).ok() }
126 }
127 #[doc = "*Required features: `\"Foundation\"`*"]
128 #[cfg(feature = "Foundation")]
129 pub fn Revoked(&self, handler: &super::super::super::Foundation::TypedEventHandler<::windows::core::IInspectable, ExtendedExecutionForegroundRevokedEventArgs>) -> ::windows::core::Result<super::super::super::Foundation::EventRegistrationToken> {
130 let this = self;
131 unsafe {
132 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::EventRegistrationToken>();
133 (::windows::core::Interface::vtable(this).Revoked)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(handler), &mut result__).from_abi(result__)
134 }
135 }
136 #[doc = "*Required features: `\"Foundation\"`*"]
137 #[cfg(feature = "Foundation")]
138 pub fn RemoveRevoked(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::Result<()> {
139 let this = self;
140 unsafe { (::windows::core::Interface::vtable(this).RemoveRevoked)(::windows::core::Interface::as_raw(this), token).ok() }
141 }
142 #[doc = "*Required features: `\"Foundation\"`*"]
143 #[cfg(feature = "Foundation")]
144 pub fn RequestExtensionAsync(&self) -> ::windows::core::Result<super::super::super::Foundation::IAsyncOperation<ExtendedExecutionForegroundResult>> {
145 let this = self;
146 unsafe {
147 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::IAsyncOperation<ExtendedExecutionForegroundResult>>();
148 (::windows::core::Interface::vtable(this).RequestExtensionAsync)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
149 }
150 }
151 pub fn Reason(&self) -> ::windows::core::Result<ExtendedExecutionForegroundReason> {
152 let this = self;
153 unsafe {
154 let mut result__ = ::windows::core::zeroed::<ExtendedExecutionForegroundReason>();
155 (::windows::core::Interface::vtable(this).Reason)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
156 }
157 }
158 pub fn SetReason(&self, value: ExtendedExecutionForegroundReason) -> ::windows::core::Result<()> {
159 let this = self;
160 unsafe { (::windows::core::Interface::vtable(this).SetReason)(::windows::core::Interface::as_raw(this), value).ok() }
161 }
162}
163impl ::core::cmp::PartialEq for ExtendedExecutionForegroundSession {
164 fn eq(&self, other: &Self) -> bool {
165 self.0 == other.0
166 }
167}
168impl ::core::cmp::Eq for ExtendedExecutionForegroundSession {}
169impl ::core::fmt::Debug for ExtendedExecutionForegroundSession {
170 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
171 f.debug_tuple("ExtendedExecutionForegroundSession").field(&self.0).finish()
172 }
173}
174impl ::windows::core::RuntimeType for ExtendedExecutionForegroundSession {
175 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundSession;{fbf440e1-9d10-4201-b01e-c83275296f2e})");
176}
177impl ::core::clone::Clone for ExtendedExecutionForegroundSession {
178 fn clone(&self) -> Self {
179 Self(self.0.clone())
180 }
181}
182unsafe impl ::windows::core::Interface for ExtendedExecutionForegroundSession {
183 type Vtable = IExtendedExecutionForegroundSession_Vtbl;
184}
185unsafe impl ::windows::core::ComInterface for ExtendedExecutionForegroundSession {
186 const IID: ::windows::core::GUID = <IExtendedExecutionForegroundSession as ::windows::core::ComInterface>::IID;
187}
188impl ::windows::core::RuntimeName for ExtendedExecutionForegroundSession {
189 const NAME: &'static str = "Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundSession";
190}
191::windows::imp::interface_hierarchy!(ExtendedExecutionForegroundSession, ::windows::core::IUnknown, ::windows::core::IInspectable);
192#[cfg(feature = "Foundation")]
193impl ::windows::core::CanTryInto<super::super::super::Foundation::IClosable> for ExtendedExecutionForegroundSession {}
194unsafe impl ::core::marker::Send for ExtendedExecutionForegroundSession {}
195unsafe impl ::core::marker::Sync for ExtendedExecutionForegroundSession {}
196#[doc = "*Required features: `\"ApplicationModel_ExtendedExecution_Foreground\"`*"]
197#[repr(transparent)]
198#[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
199pub struct ExtendedExecutionForegroundReason(pub i32);
200impl ExtendedExecutionForegroundReason {
201 pub const Unspecified: Self = Self(0i32);
202 pub const SavingData: Self = Self(1i32);
203 pub const BackgroundAudio: Self = Self(2i32);
204 pub const Unconstrained: Self = Self(3i32);
205}
206impl ::core::marker::Copy for ExtendedExecutionForegroundReason {}
207impl ::core::clone::Clone for ExtendedExecutionForegroundReason {
208 fn clone(&self) -> Self {
209 *self
210 }
211}
212impl ::core::default::Default for ExtendedExecutionForegroundReason {
213 fn default() -> Self {
214 Self(0)
215 }
216}
217impl ::windows::core::TypeKind for ExtendedExecutionForegroundReason {
218 type TypeKind = ::windows::core::CopyType;
219}
220impl ::core::fmt::Debug for ExtendedExecutionForegroundReason {
221 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
222 f.debug_tuple("ExtendedExecutionForegroundReason").field(&self.0).finish()
223 }
224}
225impl ::windows::core::RuntimeType for ExtendedExecutionForegroundReason {
226 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"enum(Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundReason;i4)");
227}
228#[doc = "*Required features: `\"ApplicationModel_ExtendedExecution_Foreground\"`*"]
229#[repr(transparent)]
230#[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
231pub struct ExtendedExecutionForegroundResult(pub i32);
232impl ExtendedExecutionForegroundResult {
233 pub const Allowed: Self = Self(0i32);
234 pub const Denied: Self = Self(1i32);
235}
236impl ::core::marker::Copy for ExtendedExecutionForegroundResult {}
237impl ::core::clone::Clone for ExtendedExecutionForegroundResult {
238 fn clone(&self) -> Self {
239 *self
240 }
241}
242impl ::core::default::Default for ExtendedExecutionForegroundResult {
243 fn default() -> Self {
244 Self(0)
245 }
246}
247impl ::windows::core::TypeKind for ExtendedExecutionForegroundResult {
248 type TypeKind = ::windows::core::CopyType;
249}
250impl ::core::fmt::Debug for ExtendedExecutionForegroundResult {
251 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
252 f.debug_tuple("ExtendedExecutionForegroundResult").field(&self.0).finish()
253 }
254}
255impl ::windows::core::RuntimeType for ExtendedExecutionForegroundResult {
256 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"enum(Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundResult;i4)");
257}
258#[doc = "*Required features: `\"ApplicationModel_ExtendedExecution_Foreground\"`*"]
259#[repr(transparent)]
260#[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
261pub struct ExtendedExecutionForegroundRevokedReason(pub i32);
262impl ExtendedExecutionForegroundRevokedReason {
263 pub const Resumed: Self = Self(0i32);
264 pub const SystemPolicy: Self = Self(1i32);
265}
266impl ::core::marker::Copy for ExtendedExecutionForegroundRevokedReason {}
267impl ::core::clone::Clone for ExtendedExecutionForegroundRevokedReason {
268 fn clone(&self) -> Self {
269 *self
270 }
271}
272impl ::core::default::Default for ExtendedExecutionForegroundRevokedReason {
273 fn default() -> Self {
274 Self(0)
275 }
276}
277impl ::windows::core::TypeKind for ExtendedExecutionForegroundRevokedReason {
278 type TypeKind = ::windows::core::CopyType;
279}
280impl ::core::fmt::Debug for ExtendedExecutionForegroundRevokedReason {
281 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
282 f.debug_tuple("ExtendedExecutionForegroundRevokedReason").field(&self.0).finish()
283 }
284}
285impl ::windows::core::RuntimeType for ExtendedExecutionForegroundRevokedReason {
286 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"enum(Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundRevokedReason;i4)");
287}
288#[cfg(feature = "implement")]
289::core::include!("impl.rs");