| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IGeofence(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IGeofence { |
| type Vtable = IGeofence_Vtbl; |
| } |
| impl ::core::clone::Clone for IGeofence { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IGeofence { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x9c090823_edb8_47e0_8245_5bf61d321f2d); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IGeofence_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| #[cfg(feature = "Foundation")] |
| pub StartTime: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::DateTime) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| StartTime: usize, |
| #[cfg(feature = "Foundation")] |
| pub Duration: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::TimeSpan) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| Duration: usize, |
| #[cfg(feature = "Foundation")] |
| pub DwellTime: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::TimeSpan) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| DwellTime: usize, |
| pub Id: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>) -> ::windows_core::HRESULT, |
| pub MonitoredStates: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut MonitoredGeofenceStates) -> ::windows_core::HRESULT, |
| pub Geoshape: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| pub SingleUse: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut bool) -> ::windows_core::HRESULT, |
| } |
| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IGeofenceFactory(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IGeofenceFactory { |
| type Vtable = IGeofenceFactory_Vtbl; |
| } |
| impl ::core::clone::Clone for IGeofenceFactory { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IGeofenceFactory { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x841f624b_325f_4b90_bca7_2b8022a93796); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IGeofenceFactory_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| pub Create: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, id: ::std::mem::MaybeUninit<::windows_core::HSTRING>, geoshape: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| pub CreateWithMonitorStates: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, id: ::std::mem::MaybeUninit<::windows_core::HSTRING>, geoshape: *mut ::core::ffi::c_void, monitoredstates: MonitoredGeofenceStates, singleuse: bool, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(feature = "Foundation")] |
| pub CreateWithMonitorStatesAndDwellTime: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, id: ::std::mem::MaybeUninit<::windows_core::HSTRING>, geoshape: *mut ::core::ffi::c_void, monitoredstates: MonitoredGeofenceStates, singleuse: bool, dwelltime: super::super::super::Foundation::TimeSpan, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| CreateWithMonitorStatesAndDwellTime: usize, |
| #[cfg(feature = "Foundation")] |
| pub CreateWithMonitorStatesDwellTimeStartTimeAndDuration: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, id: ::std::mem::MaybeUninit<::windows_core::HSTRING>, geoshape: *mut ::core::ffi::c_void, monitoredstates: MonitoredGeofenceStates, singleuse: bool, dwelltime: super::super::super::Foundation::TimeSpan, starttime: super::super::super::Foundation::DateTime, duration: super::super::super::Foundation::TimeSpan, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| CreateWithMonitorStatesDwellTimeStartTimeAndDuration: usize, |
| } |
| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IGeofenceMonitor(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IGeofenceMonitor { |
| type Vtable = IGeofenceMonitor_Vtbl; |
| } |
| impl ::core::clone::Clone for IGeofenceMonitor { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IGeofenceMonitor { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x4c0f5f78_1c1f_4621_bbbd_833b92247226); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IGeofenceMonitor_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| pub Status: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut GeofenceMonitorStatus) -> ::windows_core::HRESULT, |
| #[cfg(feature = "Foundation_Collections")] |
| pub Geofences: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation_Collections"))] |
| Geofences: usize, |
| pub LastKnownGeoposition: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(feature = "Foundation")] |
| pub GeofenceStateChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, eventhandler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| GeofenceStateChanged: usize, |
| #[cfg(feature = "Foundation")] |
| pub RemoveGeofenceStateChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| RemoveGeofenceStateChanged: usize, |
| #[cfg(feature = "Foundation_Collections")] |
| pub ReadReports: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation_Collections"))] |
| ReadReports: usize, |
| #[cfg(feature = "Foundation")] |
| pub StatusChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, eventhandler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| StatusChanged: usize, |
| #[cfg(feature = "Foundation")] |
| pub RemoveStatusChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::HRESULT, |
| #[cfg(not(feature = "Foundation"))] |
| RemoveStatusChanged: usize, |
| } |
| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IGeofenceMonitorStatics(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IGeofenceMonitorStatics { |
| type Vtable = IGeofenceMonitorStatics_Vtbl; |
| } |
| impl ::core::clone::Clone for IGeofenceMonitorStatics { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IGeofenceMonitorStatics { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x2dd32fcf_7e75_4899_ace3_2bd0a65cce06); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IGeofenceMonitorStatics_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| pub Current: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| } |
| #[doc(hidden)] |
| #[repr(transparent)] |
| pub struct IGeofenceStateChangeReport(::windows_core::IUnknown); |
| unsafe impl ::windows_core::Interface for IGeofenceStateChangeReport { |
| type Vtable = IGeofenceStateChangeReport_Vtbl; |
| } |
| impl ::core::clone::Clone for IGeofenceStateChangeReport { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::ComInterface for IGeofenceStateChangeReport { |
| const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x9a243c18_2464_4c89_be05_b3ffff5babc5); |
| } |
| #[repr(C)] |
| #[doc(hidden)] |
| pub struct IGeofenceStateChangeReport_Vtbl { |
| pub base__: ::windows_core::IInspectable_Vtbl, |
| pub NewState: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut GeofenceState) -> ::windows_core::HRESULT, |
| pub Geofence: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| pub Geoposition: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, |
| pub RemovalReason: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut GeofenceRemovalReason) -> ::windows_core::HRESULT, |
| } |
| #[doc = "*Required features: `\"Devices_Geolocation_Geofencing\"`*"] |
| #[repr(transparent)] |
| pub struct Geofence(::windows_core::IUnknown); |
| impl Geofence { |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn StartTime(&self) -> ::windows_core::Result<super::super::super::Foundation::DateTime> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).StartTime)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn Duration(&self) -> ::windows_core::Result<super::super::super::Foundation::TimeSpan> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Duration)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn DwellTime(&self) -> ::windows_core::Result<super::super::super::Foundation::TimeSpan> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).DwellTime)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn Id(&self) -> ::windows_core::Result<::windows_core::HSTRING> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Id)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn MonitoredStates(&self) -> ::windows_core::Result<MonitoredGeofenceStates> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).MonitoredStates)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn Geoshape(&self) -> ::windows_core::Result<super::IGeoshape> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Geoshape)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn SingleUse(&self) -> ::windows_core::Result<bool> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).SingleUse)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn Create<P0>(id: &::windows_core::HSTRING, geoshape: P0) -> ::windows_core::Result<Geofence> |
| where |
| P0: ::windows_core::TryIntoParam<super::IGeoshape>, |
| { |
| Self::IGeofenceFactory(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Create)(::windows_core::Interface::as_raw(this), ::core::mem::transmute_copy(id), geoshape.try_into_param()?.abi(), &mut result__).from_abi(result__) |
| }) |
| } |
| pub fn CreateWithMonitorStates<P0>(id: &::windows_core::HSTRING, geoshape: P0, monitoredstates: MonitoredGeofenceStates, singleuse: bool) -> ::windows_core::Result<Geofence> |
| where |
| P0: ::windows_core::TryIntoParam<super::IGeoshape>, |
| { |
| Self::IGeofenceFactory(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).CreateWithMonitorStates)(::windows_core::Interface::as_raw(this), ::core::mem::transmute_copy(id), geoshape.try_into_param()?.abi(), monitoredstates, singleuse, &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn CreateWithMonitorStatesAndDwellTime<P0>(id: &::windows_core::HSTRING, geoshape: P0, monitoredstates: MonitoredGeofenceStates, singleuse: bool, dwelltime: super::super::super::Foundation::TimeSpan) -> ::windows_core::Result<Geofence> |
| where |
| P0: ::windows_core::TryIntoParam<super::IGeoshape>, |
| { |
| Self::IGeofenceFactory(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).CreateWithMonitorStatesAndDwellTime)(::windows_core::Interface::as_raw(this), ::core::mem::transmute_copy(id), geoshape.try_into_param()?.abi(), monitoredstates, singleuse, dwelltime, &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn CreateWithMonitorStatesDwellTimeStartTimeAndDuration<P0>(id: &::windows_core::HSTRING, geoshape: P0, monitoredstates: MonitoredGeofenceStates, singleuse: bool, dwelltime: super::super::super::Foundation::TimeSpan, starttime: super::super::super::Foundation::DateTime, duration: super::super::super::Foundation::TimeSpan) -> ::windows_core::Result<Geofence> |
| where |
| P0: ::windows_core::TryIntoParam<super::IGeoshape>, |
| { |
| Self::IGeofenceFactory(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).CreateWithMonitorStatesDwellTimeStartTimeAndDuration)(::windows_core::Interface::as_raw(this), ::core::mem::transmute_copy(id), geoshape.try_into_param()?.abi(), monitoredstates, singleuse, dwelltime, starttime, duration, &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc(hidden)] |
| pub fn IGeofenceFactory<R, F: FnOnce(&IGeofenceFactory) -> ::windows_core::Result<R>>(callback: F) -> ::windows_core::Result<R> { |
| static SHARED: ::windows_core::imp::FactoryCache<Geofence, IGeofenceFactory> = ::windows_core::imp::FactoryCache::new(); |
| SHARED.call(callback) |
| } |
| } |
| impl ::core::cmp::PartialEq for Geofence { |
| fn eq(&self, other: &Self) -> bool { |
| self.0 == other.0 |
| } |
| } |
| impl ::core::cmp::Eq for Geofence {} |
| impl ::core::fmt::Debug for Geofence { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("Geofence").field(&self.0).finish() |
| } |
| } |
| impl ::windows_core::RuntimeType for Geofence { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Geolocation.Geofencing.Geofence;{9c090823-edb8-47e0-8245-5bf61d321f2d})"); |
| } |
| impl ::core::clone::Clone for Geofence { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::Interface for Geofence { |
| type Vtable = IGeofence_Vtbl; |
| } |
| unsafe impl ::windows_core::ComInterface for Geofence { |
| const IID: ::windows_core::GUID = <IGeofence as ::windows_core::ComInterface>::IID; |
| } |
| impl ::windows_core::RuntimeName for Geofence { |
| const NAME: &'static str = "Windows.Devices.Geolocation.Geofencing.Geofence"; |
| } |
| ::windows_core::imp::interface_hierarchy!(Geofence, ::windows_core::IUnknown, ::windows_core::IInspectable); |
| unsafe impl ::core::marker::Send for Geofence {} |
| unsafe impl ::core::marker::Sync for Geofence {} |
| #[doc = "*Required features: `\"Devices_Geolocation_Geofencing\"`*"] |
| #[repr(transparent)] |
| pub struct GeofenceMonitor(::windows_core::IUnknown); |
| impl GeofenceMonitor { |
| pub fn Status(&self) -> ::windows_core::Result<GeofenceMonitorStatus> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Status)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation_Collections\"`*"] |
| #[cfg(feature = "Foundation_Collections")] |
| pub fn Geofences(&self) -> ::windows_core::Result<super::super::super::Foundation::Collections::IVector<Geofence>> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Geofences)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn LastKnownGeoposition(&self) -> ::windows_core::Result<super::Geoposition> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).LastKnownGeoposition)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn GeofenceStateChanged<P0>(&self, eventhandler: P0) -> ::windows_core::Result<super::super::super::Foundation::EventRegistrationToken> |
| where |
| P0: ::windows_core::IntoParam<super::super::super::Foundation::TypedEventHandler<GeofenceMonitor, ::windows_core::IInspectable>>, |
| { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).GeofenceStateChanged)(::windows_core::Interface::as_raw(this), eventhandler.into_param().abi(), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn RemoveGeofenceStateChanged(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::Result<()> { |
| let this = self; |
| unsafe { (::windows_core::Interface::vtable(this).RemoveGeofenceStateChanged)(::windows_core::Interface::as_raw(this), token).ok() } |
| } |
| #[doc = "*Required features: `\"Foundation_Collections\"`*"] |
| #[cfg(feature = "Foundation_Collections")] |
| pub fn ReadReports(&self) -> ::windows_core::Result<super::super::super::Foundation::Collections::IVectorView<GeofenceStateChangeReport>> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).ReadReports)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn StatusChanged<P0>(&self, eventhandler: P0) -> ::windows_core::Result<super::super::super::Foundation::EventRegistrationToken> |
| where |
| P0: ::windows_core::IntoParam<super::super::super::Foundation::TypedEventHandler<GeofenceMonitor, ::windows_core::IInspectable>>, |
| { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).StatusChanged)(::windows_core::Interface::as_raw(this), eventhandler.into_param().abi(), &mut result__).from_abi(result__) |
| } |
| } |
| #[doc = "*Required features: `\"Foundation\"`*"] |
| #[cfg(feature = "Foundation")] |
| pub fn RemoveStatusChanged(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows_core::Result<()> { |
| let this = self; |
| unsafe { (::windows_core::Interface::vtable(this).RemoveStatusChanged)(::windows_core::Interface::as_raw(this), token).ok() } |
| } |
| pub fn Current() -> ::windows_core::Result<GeofenceMonitor> { |
| Self::IGeofenceMonitorStatics(|this| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Current)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| }) |
| } |
| #[doc(hidden)] |
| pub fn IGeofenceMonitorStatics<R, F: FnOnce(&IGeofenceMonitorStatics) -> ::windows_core::Result<R>>(callback: F) -> ::windows_core::Result<R> { |
| static SHARED: ::windows_core::imp::FactoryCache<GeofenceMonitor, IGeofenceMonitorStatics> = ::windows_core::imp::FactoryCache::new(); |
| SHARED.call(callback) |
| } |
| } |
| impl ::core::cmp::PartialEq for GeofenceMonitor { |
| fn eq(&self, other: &Self) -> bool { |
| self.0 == other.0 |
| } |
| } |
| impl ::core::cmp::Eq for GeofenceMonitor {} |
| impl ::core::fmt::Debug for GeofenceMonitor { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("GeofenceMonitor").field(&self.0).finish() |
| } |
| } |
| impl ::windows_core::RuntimeType for GeofenceMonitor { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Geolocation.Geofencing.GeofenceMonitor;{4c0f5f78-1c1f-4621-bbbd-833b92247226})"); |
| } |
| impl ::core::clone::Clone for GeofenceMonitor { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::Interface for GeofenceMonitor { |
| type Vtable = IGeofenceMonitor_Vtbl; |
| } |
| unsafe impl ::windows_core::ComInterface for GeofenceMonitor { |
| const IID: ::windows_core::GUID = <IGeofenceMonitor as ::windows_core::ComInterface>::IID; |
| } |
| impl ::windows_core::RuntimeName for GeofenceMonitor { |
| const NAME: &'static str = "Windows.Devices.Geolocation.Geofencing.GeofenceMonitor"; |
| } |
| ::windows_core::imp::interface_hierarchy!(GeofenceMonitor, ::windows_core::IUnknown, ::windows_core::IInspectable); |
| unsafe impl ::core::marker::Send for GeofenceMonitor {} |
| unsafe impl ::core::marker::Sync for GeofenceMonitor {} |
| #[doc = "*Required features: `\"Devices_Geolocation_Geofencing\"`*"] |
| #[repr(transparent)] |
| pub struct GeofenceStateChangeReport(::windows_core::IUnknown); |
| impl GeofenceStateChangeReport { |
| pub fn NewState(&self) -> ::windows_core::Result<GeofenceState> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).NewState)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn Geofence(&self) -> ::windows_core::Result<Geofence> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Geofence)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn Geoposition(&self) -> ::windows_core::Result<super::Geoposition> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).Geoposition)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| pub fn RemovalReason(&self) -> ::windows_core::Result<GeofenceRemovalReason> { |
| let this = self; |
| unsafe { |
| let mut result__ = ::std::mem::zeroed(); |
| (::windows_core::Interface::vtable(this).RemovalReason)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__) |
| } |
| } |
| } |
| impl ::core::cmp::PartialEq for GeofenceStateChangeReport { |
| fn eq(&self, other: &Self) -> bool { |
| self.0 == other.0 |
| } |
| } |
| impl ::core::cmp::Eq for GeofenceStateChangeReport {} |
| impl ::core::fmt::Debug for GeofenceStateChangeReport { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("GeofenceStateChangeReport").field(&self.0).finish() |
| } |
| } |
| impl ::windows_core::RuntimeType for GeofenceStateChangeReport { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Geolocation.Geofencing.GeofenceStateChangeReport;{9a243c18-2464-4c89-be05-b3ffff5babc5})"); |
| } |
| impl ::core::clone::Clone for GeofenceStateChangeReport { |
| fn clone(&self) -> Self { |
| Self(self.0.clone()) |
| } |
| } |
| unsafe impl ::windows_core::Interface for GeofenceStateChangeReport { |
| type Vtable = IGeofenceStateChangeReport_Vtbl; |
| } |
| unsafe impl ::windows_core::ComInterface for GeofenceStateChangeReport { |
| const IID: ::windows_core::GUID = <IGeofenceStateChangeReport as ::windows_core::ComInterface>::IID; |
| } |
| impl ::windows_core::RuntimeName for GeofenceStateChangeReport { |
| const NAME: &'static str = "Windows.Devices.Geolocation.Geofencing.GeofenceStateChangeReport"; |
| } |
| ::windows_core::imp::interface_hierarchy!(GeofenceStateChangeReport, ::windows_core::IUnknown, ::windows_core::IInspectable); |
| unsafe impl ::core::marker::Send for GeofenceStateChangeReport {} |
| unsafe impl ::core::marker::Sync for GeofenceStateChangeReport {} |
| #[doc = "*Required features: `\"Devices_Geolocation_Geofencing\"`*"] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)] |
| pub struct GeofenceMonitorStatus(pub i32); |
| impl GeofenceMonitorStatus { |
| pub const Ready: Self = Self(0i32); |
| pub const Initializing: Self = Self(1i32); |
| pub const NoData: Self = Self(2i32); |
| pub const Disabled: Self = Self(3i32); |
| pub const NotInitialized: Self = Self(4i32); |
| pub const NotAvailable: Self = Self(5i32); |
| } |
| impl ::core::marker::Copy for GeofenceMonitorStatus {} |
| impl ::core::clone::Clone for GeofenceMonitorStatus { |
| fn clone(&self) -> Self { |
| *self |
| } |
| } |
| impl ::core::default::Default for GeofenceMonitorStatus { |
| fn default() -> Self { |
| Self(0) |
| } |
| } |
| impl ::windows_core::TypeKind for GeofenceMonitorStatus { |
| type TypeKind = ::windows_core::CopyType; |
| } |
| impl ::core::fmt::Debug for GeofenceMonitorStatus { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("GeofenceMonitorStatus").field(&self.0).finish() |
| } |
| } |
| impl ::windows_core::RuntimeType for GeofenceMonitorStatus { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"enum(Windows.Devices.Geolocation.Geofencing.GeofenceMonitorStatus;i4)"); |
| } |
| #[doc = "*Required features: `\"Devices_Geolocation_Geofencing\"`*"] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)] |
| pub struct GeofenceRemovalReason(pub i32); |
| impl GeofenceRemovalReason { |
| pub const Used: Self = Self(0i32); |
| pub const Expired: Self = Self(1i32); |
| } |
| impl ::core::marker::Copy for GeofenceRemovalReason {} |
| impl ::core::clone::Clone for GeofenceRemovalReason { |
| fn clone(&self) -> Self { |
| *self |
| } |
| } |
| impl ::core::default::Default for GeofenceRemovalReason { |
| fn default() -> Self { |
| Self(0) |
| } |
| } |
| impl ::windows_core::TypeKind for GeofenceRemovalReason { |
| type TypeKind = ::windows_core::CopyType; |
| } |
| impl ::core::fmt::Debug for GeofenceRemovalReason { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("GeofenceRemovalReason").field(&self.0).finish() |
| } |
| } |
| impl ::windows_core::RuntimeType for GeofenceRemovalReason { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"enum(Windows.Devices.Geolocation.Geofencing.GeofenceRemovalReason;i4)"); |
| } |
| #[doc = "*Required features: `\"Devices_Geolocation_Geofencing\"`*"] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)] |
| pub struct GeofenceState(pub u32); |
| impl GeofenceState { |
| pub const None: Self = Self(0u32); |
| pub const Entered: Self = Self(1u32); |
| pub const Exited: Self = Self(2u32); |
| pub const Removed: Self = Self(4u32); |
| } |
| impl ::core::marker::Copy for GeofenceState {} |
| impl ::core::clone::Clone for GeofenceState { |
| fn clone(&self) -> Self { |
| *self |
| } |
| } |
| impl ::core::default::Default for GeofenceState { |
| fn default() -> Self { |
| Self(0) |
| } |
| } |
| impl ::windows_core::TypeKind for GeofenceState { |
| type TypeKind = ::windows_core::CopyType; |
| } |
| impl ::core::fmt::Debug for GeofenceState { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("GeofenceState").field(&self.0).finish() |
| } |
| } |
| impl GeofenceState { |
| pub const fn contains(&self, other: Self) -> bool { |
| self.0 & other.0 == other.0 |
| } |
| } |
| impl ::core::ops::BitOr for GeofenceState { |
| type Output = Self; |
| fn bitor(self, other: Self) -> Self { |
| Self(self.0 | other.0) |
| } |
| } |
| impl ::core::ops::BitAnd for GeofenceState { |
| type Output = Self; |
| fn bitand(self, other: Self) -> Self { |
| Self(self.0 & other.0) |
| } |
| } |
| impl ::core::ops::BitOrAssign for GeofenceState { |
| fn bitor_assign(&mut self, other: Self) { |
| self.0.bitor_assign(other.0) |
| } |
| } |
| impl ::core::ops::BitAndAssign for GeofenceState { |
| fn bitand_assign(&mut self, other: Self) { |
| self.0.bitand_assign(other.0) |
| } |
| } |
| impl ::core::ops::Not for GeofenceState { |
| type Output = Self; |
| fn not(self) -> Self { |
| Self(self.0.not()) |
| } |
| } |
| impl ::windows_core::RuntimeType for GeofenceState { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"enum(Windows.Devices.Geolocation.Geofencing.GeofenceState;u4)"); |
| } |
| #[doc = "*Required features: `\"Devices_Geolocation_Geofencing\"`*"] |
| #[repr(transparent)] |
| #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)] |
| pub struct MonitoredGeofenceStates(pub u32); |
| impl MonitoredGeofenceStates { |
| pub const None: Self = Self(0u32); |
| pub const Entered: Self = Self(1u32); |
| pub const Exited: Self = Self(2u32); |
| pub const Removed: Self = Self(4u32); |
| } |
| impl ::core::marker::Copy for MonitoredGeofenceStates {} |
| impl ::core::clone::Clone for MonitoredGeofenceStates { |
| fn clone(&self) -> Self { |
| *self |
| } |
| } |
| impl ::core::default::Default for MonitoredGeofenceStates { |
| fn default() -> Self { |
| Self(0) |
| } |
| } |
| impl ::windows_core::TypeKind for MonitoredGeofenceStates { |
| type TypeKind = ::windows_core::CopyType; |
| } |
| impl ::core::fmt::Debug for MonitoredGeofenceStates { |
| fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| f.debug_tuple("MonitoredGeofenceStates").field(&self.0).finish() |
| } |
| } |
| impl MonitoredGeofenceStates { |
| pub const fn contains(&self, other: Self) -> bool { |
| self.0 & other.0 == other.0 |
| } |
| } |
| impl ::core::ops::BitOr for MonitoredGeofenceStates { |
| type Output = Self; |
| fn bitor(self, other: Self) -> Self { |
| Self(self.0 | other.0) |
| } |
| } |
| impl ::core::ops::BitAnd for MonitoredGeofenceStates { |
| type Output = Self; |
| fn bitand(self, other: Self) -> Self { |
| Self(self.0 & other.0) |
| } |
| } |
| impl ::core::ops::BitOrAssign for MonitoredGeofenceStates { |
| fn bitor_assign(&mut self, other: Self) { |
| self.0.bitor_assign(other.0) |
| } |
| } |
| impl ::core::ops::BitAndAssign for MonitoredGeofenceStates { |
| fn bitand_assign(&mut self, other: Self) { |
| self.0.bitand_assign(other.0) |
| } |
| } |
| impl ::core::ops::Not for MonitoredGeofenceStates { |
| type Output = Self; |
| fn not(self) -> Self { |
| Self(self.0.not()) |
| } |
| } |
| impl ::windows_core::RuntimeType for MonitoredGeofenceStates { |
| const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"enum(Windows.Devices.Geolocation.Geofencing.MonitoredGeofenceStates;u4)"); |
| } |