// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Media_ContentRestrictions_H #define WINRT_Windows_Media_ContentRestrictions_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.Media.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.Media.ContentRestrictions.2.h" namespace winrt::impl { template auto consume_Windows_Media_ContentRestrictions_IContentRestrictionsBrowsePolicy::GeographicRegion() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IContentRestrictionsBrowsePolicy)->get_GeographicRegion(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IContentRestrictionsBrowsePolicy::MaxBrowsableAgeRating() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IContentRestrictionsBrowsePolicy)->get_MaxBrowsableAgeRating(&value)); return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IContentRestrictionsBrowsePolicy::PreferredAgeRating() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IContentRestrictionsBrowsePolicy)->get_PreferredAgeRating(&value)); return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Id() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->get_Id(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Id(param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->put_Id(*(void**)(&value))); } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Title() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->get_Title(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Title(param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->put_Title(*(void**)(&value))); } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Image() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->get_Image(&value)); return winrt::Windows::Storage::Streams::IRandomAccessStreamReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Image(winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->put_Image(*(void**)(&value))); } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Category() const { winrt::Windows::Media::ContentRestrictions::RatedContentCategory value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->get_Category(reinterpret_cast(&value))); return value; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Category(winrt::Windows::Media::ContentRestrictions::RatedContentCategory const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->put_Category(static_cast(value))); } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Ratings() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->get_Ratings(&value)); return winrt::Windows::Foundation::Collections::IVector{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescription::Ratings(param::vector const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescription)->put_Ratings(*(void**)(&value))); } template auto consume_Windows_Media_ContentRestrictions_IRatedContentDescriptionFactory::Create(param::hstring const& id, param::hstring const& title, winrt::Windows::Media::ContentRestrictions::RatedContentCategory const& category) const { void* RatedContentDescription{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentDescriptionFactory)->Create(*(void**)(&id), *(void**)(&title), static_cast(category), &RatedContentDescription)); return winrt::Windows::Media::ContentRestrictions::RatedContentDescription{ RatedContentDescription, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentRestrictions::GetBrowsePolicyAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentRestrictions)->GetBrowsePolicyAsync(&operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentRestrictions::GetRestrictionLevelAsync(winrt::Windows::Media::ContentRestrictions::RatedContentDescription const& RatedContentDescription) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentRestrictions)->GetRestrictionLevelAsync(*(void**)(&RatedContentDescription), &operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentRestrictions::RequestContentAccessAsync(winrt::Windows::Media::ContentRestrictions::RatedContentDescription const& RatedContentDescription) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentRestrictions)->RequestContentAccessAsync(*(void**)(&RatedContentDescription), &operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentRestrictions::RestrictionsChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentRestrictions)->add_RestrictionsChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Media_ContentRestrictions_IRatedContentRestrictions::RestrictionsChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, RestrictionsChanged(handler)); } template auto consume_Windows_Media_ContentRestrictions_IRatedContentRestrictions::RestrictionsChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentRestrictions)->remove_RestrictionsChanged(impl::bind_in(token)); } template auto consume_Windows_Media_ContentRestrictions_IRatedContentRestrictionsFactory::CreateWithMaxAgeRating(uint32_t maxAgeRating) const { void* ratedContentRestrictions{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::ContentRestrictions::IRatedContentRestrictionsFactory)->CreateWithMaxAgeRating(maxAgeRating, &ratedContentRestrictions)); return winrt::Windows::Media::ContentRestrictions::RatedContentRestrictions{ ratedContentRestrictions, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_GeographicRegion(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GeographicRegion()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBrowsableAgeRating(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().MaxBrowsableAgeRating()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PreferredAgeRating(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().PreferredAgeRating()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { 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 put_Id(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Id(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Title(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Title()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Title(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Title(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Image(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Image()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Image(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Image(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Category(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Category()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Category(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Category(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Ratings(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Ratings()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Ratings(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Ratings(*reinterpret_cast const*>(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall Create(void* id, void* title, int32_t category, void** RatedContentDescription) noexcept final try { clear_abi(RatedContentDescription); typename D::abi_guard guard(this->shim()); *RatedContentDescription = detach_from(this->shim().Create(*reinterpret_cast(&id), *reinterpret_cast(&title), *reinterpret_cast(&category))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetBrowsePolicyAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetBrowsePolicyAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetRestrictionLevelAsync(void* RatedContentDescription, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetRestrictionLevelAsync(*reinterpret_cast(&RatedContentDescription))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RequestContentAccessAsync(void* RatedContentDescription, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().RequestContentAccessAsync(*reinterpret_cast(&RatedContentDescription))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_RestrictionsChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().RestrictionsChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_RestrictionsChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().RestrictionsChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateWithMaxAgeRating(uint32_t maxAgeRating, void** ratedContentRestrictions) noexcept final try { clear_abi(ratedContentRestrictions); typename D::abi_guard guard(this->shim()); *ratedContentRestrictions = detach_from(this->shim().CreateWithMaxAgeRating(maxAgeRating)); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Media::ContentRestrictions { inline RatedContentDescription::RatedContentDescription(param::hstring const& id, param::hstring const& title, winrt::Windows::Media::ContentRestrictions::RatedContentCategory const& category) : RatedContentDescription(impl::call_factory([&](IRatedContentDescriptionFactory const& f) { return f.Create(id, title, category); })) { } inline RatedContentRestrictions::RatedContentRestrictions() : RatedContentRestrictions(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline RatedContentRestrictions::RatedContentRestrictions(uint32_t maxAgeRating) : RatedContentRestrictions(impl::call_factory([&](IRatedContentRestrictionsFactory const& f) { return f.CreateWithMaxAgeRating(maxAgeRating); })) { } } 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