// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Devices_Geolocation_Geofencing_H #define WINRT_Windows_Devices_Geolocation_Geofencing_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/Windows.Devices.Geolocation.h" #include "winrt/impl/Windows.Devices.Geolocation.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Devices.Geolocation.Geofencing.2.h" namespace winrt::impl { template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofence::StartTime() const { winrt::Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofence)->get_StartTime(put_abi(value))); return value; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofence::Duration() const { winrt::Windows::Foundation::TimeSpan value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofence)->get_Duration(put_abi(value))); return value; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofence::DwellTime() const { winrt::Windows::Foundation::TimeSpan value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofence)->get_DwellTime(put_abi(value))); return value; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofence::Id() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofence)->get_Id(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofence::MonitoredStates() const { winrt::Windows::Devices::Geolocation::Geofencing::MonitoredGeofenceStates value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofence)->get_MonitoredStates(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofence::Geoshape() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofence)->get_Geoshape(&value)); return winrt::Windows::Devices::Geolocation::IGeoshape{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofence::SingleUse() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofence)->get_SingleUse(&value)); return value; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceFactory::Create(param::hstring const& id, winrt::Windows::Devices::Geolocation::IGeoshape const& geoshape) const { void* geofence{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceFactory)->Create(*(void**)(&id), *(void**)(&geoshape), &geofence)); return winrt::Windows::Devices::Geolocation::Geofencing::Geofence{ geofence, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceFactory::CreateWithMonitorStates(param::hstring const& id, winrt::Windows::Devices::Geolocation::IGeoshape const& geoshape, winrt::Windows::Devices::Geolocation::Geofencing::MonitoredGeofenceStates const& monitoredStates, bool singleUse) const { void* geofence{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceFactory)->CreateWithMonitorStates(*(void**)(&id), *(void**)(&geoshape), static_cast(monitoredStates), singleUse, &geofence)); return winrt::Windows::Devices::Geolocation::Geofencing::Geofence{ geofence, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceFactory::CreateWithMonitorStatesAndDwellTime(param::hstring const& id, winrt::Windows::Devices::Geolocation::IGeoshape const& geoshape, winrt::Windows::Devices::Geolocation::Geofencing::MonitoredGeofenceStates const& monitoredStates, bool singleUse, winrt::Windows::Foundation::TimeSpan const& dwellTime) const { void* geofence{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceFactory)->CreateWithMonitorStatesAndDwellTime(*(void**)(&id), *(void**)(&geoshape), static_cast(monitoredStates), singleUse, impl::bind_in(dwellTime), &geofence)); return winrt::Windows::Devices::Geolocation::Geofencing::Geofence{ geofence, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceFactory::CreateWithMonitorStatesDwellTimeStartTimeAndDuration(param::hstring const& id, winrt::Windows::Devices::Geolocation::IGeoshape const& geoshape, winrt::Windows::Devices::Geolocation::Geofencing::MonitoredGeofenceStates const& monitoredStates, bool singleUse, winrt::Windows::Foundation::TimeSpan const& dwellTime, winrt::Windows::Foundation::DateTime const& startTime, winrt::Windows::Foundation::TimeSpan const& duration) const { void* geofence{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceFactory)->CreateWithMonitorStatesDwellTimeStartTimeAndDuration(*(void**)(&id), *(void**)(&geoshape), static_cast(monitoredStates), singleUse, impl::bind_in(dwellTime), impl::bind_in(startTime), impl::bind_in(duration), &geofence)); return winrt::Windows::Devices::Geolocation::Geofencing::Geofence{ geofence, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::Status() const { winrt::Windows::Devices::Geolocation::Geofencing::GeofenceMonitorStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitor)->get_Status(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::Geofences() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitor)->get_Geofences(&value)); return winrt::Windows::Foundation::Collections::IVector{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::LastKnownGeoposition() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitor)->get_LastKnownGeoposition(&value)); return winrt::Windows::Devices::Geolocation::Geoposition{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::GeofenceStateChanged(winrt::Windows::Foundation::TypedEventHandler const& eventHandler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitor)->add_GeofenceStateChanged(*(void**)(&eventHandler), put_abi(token))); return token; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::GeofenceStateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& eventHandler) const { return impl::make_event_revoker(this, GeofenceStateChanged(eventHandler)); } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::GeofenceStateChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitor)->remove_GeofenceStateChanged(impl::bind_in(token)); } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::ReadReports() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitor)->ReadReports(&value)); return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::StatusChanged(winrt::Windows::Foundation::TypedEventHandler const& eventHandler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitor)->add_StatusChanged(*(void**)(&eventHandler), put_abi(token))); return token; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::StatusChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& eventHandler) const { return impl::make_event_revoker(this, StatusChanged(eventHandler)); } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitor::StatusChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitor)->remove_StatusChanged(impl::bind_in(token)); } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceMonitorStatics::Current() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceMonitorStatics)->get_Current(&value)); return winrt::Windows::Devices::Geolocation::Geofencing::GeofenceMonitor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceStateChangeReport::NewState() const { winrt::Windows::Devices::Geolocation::Geofencing::GeofenceState value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceStateChangeReport)->get_NewState(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceStateChangeReport::Geofence() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceStateChangeReport)->get_Geofence(&value)); return winrt::Windows::Devices::Geolocation::Geofencing::Geofence{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceStateChangeReport::Geoposition() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceStateChangeReport)->get_Geoposition(&value)); return winrt::Windows::Devices::Geolocation::Geoposition{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Geolocation_Geofencing_IGeofenceStateChangeReport::RemovalReason() const { winrt::Windows::Devices::Geolocation::Geofencing::GeofenceRemovalReason value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Geolocation::Geofencing::IGeofenceStateChangeReport)->get_RemovalReason(reinterpret_cast(&value))); return value; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_StartTime(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().StartTime()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Duration(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Duration()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DwellTime(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DwellTime()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Id(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Id()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MonitoredStates(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MonitoredStates()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Geoshape(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Geoshape()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SingleUse(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SingleUse()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall Create(void* id, void* geoshape, void** geofence) noexcept final try { clear_abi(geofence); typename D::abi_guard guard(this->shim()); *geofence = detach_from(this->shim().Create(*reinterpret_cast(&id), *reinterpret_cast(&geoshape))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateWithMonitorStates(void* id, void* geoshape, uint32_t monitoredStates, bool singleUse, void** geofence) noexcept final try { clear_abi(geofence); typename D::abi_guard guard(this->shim()); *geofence = detach_from(this->shim().CreateWithMonitorStates(*reinterpret_cast(&id), *reinterpret_cast(&geoshape), *reinterpret_cast(&monitoredStates), singleUse)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateWithMonitorStatesAndDwellTime(void* id, void* geoshape, uint32_t monitoredStates, bool singleUse, int64_t dwellTime, void** geofence) noexcept final try { clear_abi(geofence); typename D::abi_guard guard(this->shim()); *geofence = detach_from(this->shim().CreateWithMonitorStatesAndDwellTime(*reinterpret_cast(&id), *reinterpret_cast(&geoshape), *reinterpret_cast(&monitoredStates), singleUse, *reinterpret_cast(&dwellTime))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateWithMonitorStatesDwellTimeStartTimeAndDuration(void* id, void* geoshape, uint32_t monitoredStates, bool singleUse, int64_t dwellTime, int64_t startTime, int64_t duration, void** geofence) noexcept final try { clear_abi(geofence); typename D::abi_guard guard(this->shim()); *geofence = detach_from(this->shim().CreateWithMonitorStatesDwellTimeStartTimeAndDuration(*reinterpret_cast(&id), *reinterpret_cast(&geoshape), *reinterpret_cast(&monitoredStates), singleUse, *reinterpret_cast(&dwellTime), *reinterpret_cast(&startTime), *reinterpret_cast(&duration))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Status(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Status()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Geofences(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Geofences()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LastKnownGeoposition(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LastKnownGeoposition()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_GeofenceStateChanged(void* eventHandler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().GeofenceStateChanged(*reinterpret_cast const*>(&eventHandler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_GeofenceStateChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().GeofenceStateChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall ReadReports(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().ReadReports()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_StatusChanged(void* eventHandler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().StatusChanged(*reinterpret_cast const*>(&eventHandler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_StatusChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().StatusChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Current(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Current()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_NewState(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().NewState()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Geofence(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Geofence()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Geoposition(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Geoposition()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RemovalReason(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RemovalReason()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Devices::Geolocation::Geofencing { constexpr auto operator|(GeofenceState const left, GeofenceState const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(GeofenceState& left, GeofenceState const right) noexcept { left = left | right; return left; } constexpr auto operator&(GeofenceState const left, GeofenceState const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(GeofenceState& left, GeofenceState const right) noexcept { left = left & right; return left; } constexpr auto operator~(GeofenceState const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(GeofenceState const left, GeofenceState const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(GeofenceState& left, GeofenceState const right) noexcept { left = left ^ right; return left; } constexpr auto operator|(MonitoredGeofenceStates const left, MonitoredGeofenceStates const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(MonitoredGeofenceStates& left, MonitoredGeofenceStates const right) noexcept { left = left | right; return left; } constexpr auto operator&(MonitoredGeofenceStates const left, MonitoredGeofenceStates const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(MonitoredGeofenceStates& left, MonitoredGeofenceStates const right) noexcept { left = left & right; return left; } constexpr auto operator~(MonitoredGeofenceStates const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(MonitoredGeofenceStates const left, MonitoredGeofenceStates const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(MonitoredGeofenceStates& left, MonitoredGeofenceStates const right) noexcept { left = left ^ right; return left; } inline Geofence::Geofence(param::hstring const& id, winrt::Windows::Devices::Geolocation::IGeoshape const& geoshape) : Geofence(impl::call_factory([&](IGeofenceFactory const& f) { return f.Create(id, geoshape); })) { } inline Geofence::Geofence(param::hstring const& id, winrt::Windows::Devices::Geolocation::IGeoshape const& geoshape, winrt::Windows::Devices::Geolocation::Geofencing::MonitoredGeofenceStates const& monitoredStates, bool singleUse) : Geofence(impl::call_factory([&](IGeofenceFactory const& f) { return f.CreateWithMonitorStates(id, geoshape, monitoredStates, singleUse); })) { } inline Geofence::Geofence(param::hstring const& id, winrt::Windows::Devices::Geolocation::IGeoshape const& geoshape, winrt::Windows::Devices::Geolocation::Geofencing::MonitoredGeofenceStates const& monitoredStates, bool singleUse, winrt::Windows::Foundation::TimeSpan const& dwellTime) : Geofence(impl::call_factory([&](IGeofenceFactory const& f) { return f.CreateWithMonitorStatesAndDwellTime(id, geoshape, monitoredStates, singleUse, dwellTime); })) { } inline Geofence::Geofence(param::hstring const& id, winrt::Windows::Devices::Geolocation::IGeoshape const& geoshape, winrt::Windows::Devices::Geolocation::Geofencing::MonitoredGeofenceStates const& monitoredStates, bool singleUse, winrt::Windows::Foundation::TimeSpan const& dwellTime, winrt::Windows::Foundation::DateTime const& startTime, winrt::Windows::Foundation::TimeSpan const& duration) : Geofence(impl::call_factory([&](IGeofenceFactory const& f) { return f.CreateWithMonitorStatesDwellTimeStartTimeAndDuration(id, geoshape, monitoredStates, singleUse, dwellTime, startTime, duration); })) { } inline auto GeofenceMonitor::Current() { return impl::call_factory_cast([](IGeofenceMonitorStatics const& f) { return f.Current(); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif