// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Phone_StartScreen_H #define WINRT_Windows_Phone_StartScreen_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.UI.Notifications.2.h" #include "winrt/impl/Windows.Phone.StartScreen.2.h" namespace winrt::impl { template auto consume_Windows_Phone_StartScreen_IDualSimTile::DisplayName(param::hstring const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_DisplayName(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_DisplayName(*(void**)(&value))); } } template auto consume_Windows_Phone_StartScreen_IDualSimTile::DisplayName() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_DisplayName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DisplayName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTile::IsPinnedToStart() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_IsPinnedToStart(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsPinnedToStart(&value)); } return value; } template auto consume_Windows_Phone_StartScreen_IDualSimTile::CreateAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTile::UpdateAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->UpdateAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->UpdateAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTile::DeleteAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->DeleteAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->DeleteAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTileStatics::GetTileForSim2() const { void* result{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetTileForSim2(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetTileForSim2(&result)); } return winrt::Windows::Phone::StartScreen::DualSimTile{ result, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTileStatics::UpdateDisplayNameForSim1Async(param::hstring const& name) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->UpdateDisplayNameForSim1Async(*(void**)(&name), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->UpdateDisplayNameForSim1Async(*(void**)(&name), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateTileUpdaterForSim1() const { void* updater{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateTileUpdaterForSim1(&updater)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateTileUpdaterForSim1(&updater)); } return winrt::Windows::UI::Notifications::TileUpdater{ updater, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateTileUpdaterForSim2() const { void* updater{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateTileUpdaterForSim2(&updater)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateTileUpdaterForSim2(&updater)); } return winrt::Windows::UI::Notifications::TileUpdater{ updater, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateBadgeUpdaterForSim1() const { void* updater{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateBadgeUpdaterForSim1(&updater)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateBadgeUpdaterForSim1(&updater)); } return winrt::Windows::UI::Notifications::BadgeUpdater{ updater, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateBadgeUpdaterForSim2() const { void* updater{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateBadgeUpdaterForSim2(&updater)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateBadgeUpdaterForSim2(&updater)); } return winrt::Windows::UI::Notifications::BadgeUpdater{ updater, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateToastNotifierForSim1() const { void* notifier{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateToastNotifierForSim1(¬ifier)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateToastNotifierForSim1(¬ifier)); } return winrt::Windows::UI::Notifications::ToastNotifier{ notifier, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateToastNotifierForSim2() const { void* notifier{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateToastNotifierForSim2(¬ifier)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateToastNotifierForSim2(¬ifier)); } return winrt::Windows::UI::Notifications::ToastNotifier{ notifier, take_ownership_from_abi }; } template auto consume_Windows_Phone_StartScreen_IToastNotificationManagerStatics3::CreateToastNotifierForSecondaryTile(param::hstring const& tileId) const { void* notifier{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateToastNotifierForSecondaryTile(*(void**)(&tileId), ¬ifier)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateToastNotifierForSecondaryTile(*(void**)(&tileId), ¬ifier)); } return winrt::Windows::UI::Notifications::ToastNotifier{ notifier, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall put_DisplayName(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().DisplayName(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DisplayName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DisplayName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsPinnedToStart(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsPinnedToStart()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().CreateAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UpdateAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().UpdateAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DeleteAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().DeleteAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetTileForSim2(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetTileForSim2()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UpdateDisplayNameForSim1Async(void* name, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().UpdateDisplayNameForSim1Async(*reinterpret_cast(&name))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateTileUpdaterForSim1(void** updater) noexcept final try { clear_abi(updater); typename D::abi_guard guard(this->shim()); *updater = detach_from(this->shim().CreateTileUpdaterForSim1()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateTileUpdaterForSim2(void** updater) noexcept final try { clear_abi(updater); typename D::abi_guard guard(this->shim()); *updater = detach_from(this->shim().CreateTileUpdaterForSim2()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateBadgeUpdaterForSim1(void** updater) noexcept final try { clear_abi(updater); typename D::abi_guard guard(this->shim()); *updater = detach_from(this->shim().CreateBadgeUpdaterForSim1()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateBadgeUpdaterForSim2(void** updater) noexcept final try { clear_abi(updater); typename D::abi_guard guard(this->shim()); *updater = detach_from(this->shim().CreateBadgeUpdaterForSim2()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateToastNotifierForSim1(void** notifier) noexcept final try { clear_abi(notifier); typename D::abi_guard guard(this->shim()); *notifier = detach_from(this->shim().CreateToastNotifierForSim1()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateToastNotifierForSim2(void** notifier) noexcept final try { clear_abi(notifier); typename D::abi_guard guard(this->shim()); *notifier = detach_from(this->shim().CreateToastNotifierForSim2()); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall CreateToastNotifierForSecondaryTile(void* tileId, void** notifier) noexcept final try { clear_abi(notifier); typename D::abi_guard guard(this->shim()); *notifier = detach_from(this->shim().CreateToastNotifierForSecondaryTile(*reinterpret_cast(&tileId))); return 0; } catch (...) { return to_hresult(); } }; } WINRT_EXPORT namespace winrt::Windows::Phone::StartScreen { inline DualSimTile::DualSimTile() : DualSimTile(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline auto DualSimTile::GetTileForSim2() { return impl::call_factory_cast([](IDualSimTileStatics const& f) { return f.GetTileForSim2(); }); } inline auto DualSimTile::UpdateDisplayNameForSim1Async(param::hstring const& name) { return impl::call_factory([&](IDualSimTileStatics const& f) { return f.UpdateDisplayNameForSim1Async(name); }); } inline auto DualSimTile::CreateTileUpdaterForSim1() { return impl::call_factory_cast([](IDualSimTileStatics const& f) { return f.CreateTileUpdaterForSim1(); }); } inline auto DualSimTile::CreateTileUpdaterForSim2() { return impl::call_factory_cast([](IDualSimTileStatics const& f) { return f.CreateTileUpdaterForSim2(); }); } inline auto DualSimTile::CreateBadgeUpdaterForSim1() { return impl::call_factory_cast([](IDualSimTileStatics const& f) { return f.CreateBadgeUpdaterForSim1(); }); } inline auto DualSimTile::CreateBadgeUpdaterForSim2() { return impl::call_factory_cast([](IDualSimTileStatics const& f) { return f.CreateBadgeUpdaterForSim2(); }); } inline auto DualSimTile::CreateToastNotifierForSim1() { return impl::call_factory_cast([](IDualSimTileStatics const& f) { return f.CreateToastNotifierForSim1(); }); } inline auto DualSimTile::CreateToastNotifierForSim2() { return impl::call_factory_cast([](IDualSimTileStatics const& f) { return f.CreateToastNotifierForSim2(); }); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif