// C++/WinRT v2.0.220110.5 // 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.220110.5"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.220110.5" #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 WINRT_IMPL_AUTO(void) consume_Windows_Phone_StartScreen_IDualSimTile::DisplayName(param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTile)->put_DisplayName(*(void**)(&value))); } template WINRT_IMPL_AUTO(hstring) consume_Windows_Phone_StartScreen_IDualSimTile::DisplayName() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTile)->get_DisplayName(&value)); return hstring{ value, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(bool) consume_Windows_Phone_StartScreen_IDualSimTile::IsPinnedToStart() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTile)->get_IsPinnedToStart(&value)); return value; } template WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation) consume_Windows_Phone_StartScreen_IDualSimTile::CreateAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTile)->CreateAsync(&operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation) consume_Windows_Phone_StartScreen_IDualSimTile::UpdateAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTile)->UpdateAsync(&operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation) consume_Windows_Phone_StartScreen_IDualSimTile::DeleteAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTile)->DeleteAsync(&operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::Phone::StartScreen::DualSimTile) consume_Windows_Phone_StartScreen_IDualSimTileStatics::GetTileForSim2() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTileStatics)->GetTileForSim2(&result)); return winrt::Windows::Phone::StartScreen::DualSimTile{ result, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation) consume_Windows_Phone_StartScreen_IDualSimTileStatics::UpdateDisplayNameForSim1Async(param::hstring const& name) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTileStatics)->UpdateDisplayNameForSim1Async(*(void**)(&name), &operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::UI::Notifications::TileUpdater) consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateTileUpdaterForSim1() const { void* updater{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTileStatics)->CreateTileUpdaterForSim1(&updater)); return winrt::Windows::UI::Notifications::TileUpdater{ updater, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::UI::Notifications::TileUpdater) consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateTileUpdaterForSim2() const { void* updater{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTileStatics)->CreateTileUpdaterForSim2(&updater)); return winrt::Windows::UI::Notifications::TileUpdater{ updater, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::UI::Notifications::BadgeUpdater) consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateBadgeUpdaterForSim1() const { void* updater{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTileStatics)->CreateBadgeUpdaterForSim1(&updater)); return winrt::Windows::UI::Notifications::BadgeUpdater{ updater, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::UI::Notifications::BadgeUpdater) consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateBadgeUpdaterForSim2() const { void* updater{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTileStatics)->CreateBadgeUpdaterForSim2(&updater)); return winrt::Windows::UI::Notifications::BadgeUpdater{ updater, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::UI::Notifications::ToastNotifier) consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateToastNotifierForSim1() const { void* notifier{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTileStatics)->CreateToastNotifierForSim1(¬ifier)); return winrt::Windows::UI::Notifications::ToastNotifier{ notifier, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::UI::Notifications::ToastNotifier) consume_Windows_Phone_StartScreen_IDualSimTileStatics::CreateToastNotifierForSim2() const { void* notifier{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IDualSimTileStatics)->CreateToastNotifierForSim2(¬ifier)); return winrt::Windows::UI::Notifications::ToastNotifier{ notifier, take_ownership_from_abi }; } template WINRT_IMPL_AUTO(winrt::Windows::UI::Notifications::ToastNotifier) consume_Windows_Phone_StartScreen_IToastNotificationManagerStatics3::CreateToastNotifierForSecondaryTile(param::hstring const& tileId) const { void* notifier{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Phone::StartScreen::IToastNotificationManagerStatics3)->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