// C++/WinRT v2.0.190620.2

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifndef WINRT_Windows_System_Update_0_H
#define WINRT_Windows_System_Update_0_H
namespace winrt::Windows::Foundation
{
    template <typename T> struct EventHandler;
    struct EventRegistrationToken;
    struct HResult;
}
namespace winrt::Windows::System::Update
{
    enum class SystemUpdateAttentionRequiredReason : int32_t
    {
        None = 0,
        NetworkRequired = 1,
        InsufficientDiskSpace = 2,
        InsufficientBattery = 3,
        UpdateBlocked = 4,
    };
    enum class SystemUpdateItemState : int32_t
    {
        NotStarted = 0,
        Initializing = 1,
        Preparing = 2,
        Calculating = 3,
        Downloading = 4,
        Installing = 5,
        Completed = 6,
        RebootRequired = 7,
        Error = 8,
    };
    enum class SystemUpdateManagerState : int32_t
    {
        Idle = 0,
        Detecting = 1,
        ReadyToDownload = 2,
        Downloading = 3,
        ReadyToInstall = 4,
        Installing = 5,
        RebootRequired = 6,
        ReadyToFinalize = 7,
        Finalizing = 8,
        Completed = 9,
        AttentionRequired = 10,
        Error = 11,
    };
    enum class SystemUpdateStartInstallAction : int32_t
    {
        UpToReboot = 0,
        AllowReboot = 1,
    };
    struct ISystemUpdateItem;
    struct ISystemUpdateLastErrorInfo;
    struct ISystemUpdateManagerStatics;
    struct SystemUpdateItem;
    struct SystemUpdateLastErrorInfo;
    struct SystemUpdateManager;
}
namespace winrt::impl
{
    template <> struct category<Windows::System::Update::ISystemUpdateItem>
    {
        using type = interface_category;
    };
    template <> struct category<Windows::System::Update::ISystemUpdateLastErrorInfo>
    {
        using type = interface_category;
    };
    template <> struct category<Windows::System::Update::ISystemUpdateManagerStatics>
    {
        using type = interface_category;
    };
    template <> struct category<Windows::System::Update::SystemUpdateItem>
    {
        using type = class_category;
    };
    template <> struct category<Windows::System::Update::SystemUpdateLastErrorInfo>
    {
        using type = class_category;
    };
    template <> struct category<Windows::System::Update::SystemUpdateManager>
    {
        using type = class_category;
    };
    template <> struct category<Windows::System::Update::SystemUpdateAttentionRequiredReason>
    {
        using type = enum_category;
    };
    template <> struct category<Windows::System::Update::SystemUpdateItemState>
    {
        using type = enum_category;
    };
    template <> struct category<Windows::System::Update::SystemUpdateManagerState>
    {
        using type = enum_category;
    };
    template <> struct category<Windows::System::Update::SystemUpdateStartInstallAction>
    {
        using type = enum_category;
    };
    template <> struct name<Windows::System::Update::ISystemUpdateItem>
    {
        static constexpr auto & value{ L"Windows.System.Update.ISystemUpdateItem" };
    };
    template <> struct name<Windows::System::Update::ISystemUpdateLastErrorInfo>
    {
        static constexpr auto & value{ L"Windows.System.Update.ISystemUpdateLastErrorInfo" };
    };
    template <> struct name<Windows::System::Update::ISystemUpdateManagerStatics>
    {
        static constexpr auto & value{ L"Windows.System.Update.ISystemUpdateManagerStatics" };
    };
    template <> struct name<Windows::System::Update::SystemUpdateItem>
    {
        static constexpr auto & value{ L"Windows.System.Update.SystemUpdateItem" };
    };
    template <> struct name<Windows::System::Update::SystemUpdateLastErrorInfo>
    {
        static constexpr auto & value{ L"Windows.System.Update.SystemUpdateLastErrorInfo" };
    };
    template <> struct name<Windows::System::Update::SystemUpdateManager>
    {
        static constexpr auto & value{ L"Windows.System.Update.SystemUpdateManager" };
    };
    template <> struct name<Windows::System::Update::SystemUpdateAttentionRequiredReason>
    {
        static constexpr auto & value{ L"Windows.System.Update.SystemUpdateAttentionRequiredReason" };
    };
    template <> struct name<Windows::System::Update::SystemUpdateItemState>
    {
        static constexpr auto & value{ L"Windows.System.Update.SystemUpdateItemState" };
    };
    template <> struct name<Windows::System::Update::SystemUpdateManagerState>
    {
        static constexpr auto & value{ L"Windows.System.Update.SystemUpdateManagerState" };
    };
    template <> struct name<Windows::System::Update::SystemUpdateStartInstallAction>
    {
        static constexpr auto & value{ L"Windows.System.Update.SystemUpdateStartInstallAction" };
    };
    template <> struct guid_storage<Windows::System::Update::ISystemUpdateItem>
    {
        static constexpr guid value{ 0x779740EB,0x5624,0x519E,{ 0xA8,0xE2,0x09,0xE9,0x17,0x3B,0x3F,0xB7 } };
    };
    template <> struct guid_storage<Windows::System::Update::ISystemUpdateLastErrorInfo>
    {
        static constexpr guid value{ 0x7EE887F7,0x8A44,0x5B6E,{ 0xBD,0x07,0x7A,0xEC,0xE4,0x11,0x6E,0xA9 } };
    };
    template <> struct guid_storage<Windows::System::Update::ISystemUpdateManagerStatics>
    {
        static constexpr guid value{ 0xB2D3FCEF,0x2971,0x51BE,{ 0xB4,0x1A,0x8B,0xD7,0x03,0xBB,0x70,0x1A } };
    };
    template <> struct default_interface<Windows::System::Update::SystemUpdateItem>
    {
        using type = Windows::System::Update::ISystemUpdateItem;
    };
    template <> struct default_interface<Windows::System::Update::SystemUpdateLastErrorInfo>
    {
        using type = Windows::System::Update::ISystemUpdateLastErrorInfo;
    };
    template <> struct abi<Windows::System::Update::ISystemUpdateItem>
    {
        struct __declspec(novtable) type : inspectable_abi
        {
            virtual int32_t __stdcall get_State(int32_t*) noexcept = 0;
            virtual int32_t __stdcall get_Title(void**) noexcept = 0;
            virtual int32_t __stdcall get_Description(void**) noexcept = 0;
            virtual int32_t __stdcall get_Id(void**) noexcept = 0;
            virtual int32_t __stdcall get_Revision(uint32_t*) noexcept = 0;
            virtual int32_t __stdcall get_DownloadProgress(double*) noexcept = 0;
            virtual int32_t __stdcall get_InstallProgress(double*) noexcept = 0;
            virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
        };
    };
    template <> struct abi<Windows::System::Update::ISystemUpdateLastErrorInfo>
    {
        struct __declspec(novtable) type : inspectable_abi
        {
            virtual int32_t __stdcall get_State(int32_t*) noexcept = 0;
            virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
            virtual int32_t __stdcall get_IsInteractive(bool*) noexcept = 0;
        };
    };
    template <> struct abi<Windows::System::Update::ISystemUpdateManagerStatics>
    {
        struct __declspec(novtable) type : inspectable_abi
        {
            virtual int32_t __stdcall IsSupported(bool*) noexcept = 0;
            virtual int32_t __stdcall get_State(int32_t*) noexcept = 0;
            virtual int32_t __stdcall add_StateChanged(void*, winrt::event_token*) noexcept = 0;
            virtual int32_t __stdcall remove_StateChanged(winrt::event_token) noexcept = 0;
            virtual int32_t __stdcall get_DownloadProgress(double*) noexcept = 0;
            virtual int32_t __stdcall get_InstallProgress(double*) noexcept = 0;
            virtual int32_t __stdcall get_UserActiveHoursStart(int64_t*) noexcept = 0;
            virtual int32_t __stdcall get_UserActiveHoursEnd(int64_t*) noexcept = 0;
            virtual int32_t __stdcall get_UserActiveHoursMax(int32_t*) noexcept = 0;
            virtual int32_t __stdcall TrySetUserActiveHours(int64_t, int64_t, bool*) noexcept = 0;
            virtual int32_t __stdcall get_LastUpdateCheckTime(int64_t*) noexcept = 0;
            virtual int32_t __stdcall get_LastUpdateInstallTime(int64_t*) noexcept = 0;
            virtual int32_t __stdcall get_LastErrorInfo(void**) noexcept = 0;
            virtual int32_t __stdcall GetAutomaticRebootBlockIds(void**) noexcept = 0;
            virtual int32_t __stdcall BlockAutomaticRebootAsync(void*, void**) noexcept = 0;
            virtual int32_t __stdcall UnblockAutomaticRebootAsync(void*, void**) noexcept = 0;
            virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
            virtual int32_t __stdcall GetUpdateItems(void**) noexcept = 0;
            virtual int32_t __stdcall get_AttentionRequiredReason(int32_t*) noexcept = 0;
            virtual int32_t __stdcall SetFlightRing(void*, bool*) noexcept = 0;
            virtual int32_t __stdcall GetFlightRing(void**) noexcept = 0;
            virtual int32_t __stdcall StartInstall(int32_t) noexcept = 0;
            virtual int32_t __stdcall RebootToCompleteInstall() noexcept = 0;
            virtual int32_t __stdcall StartCancelUpdates() noexcept = 0;
        };
    };
    template <typename D>
    struct consume_Windows_System_Update_ISystemUpdateItem
    {
        [[nodiscard]] auto State() const;
        [[nodiscard]] auto Title() const;
        [[nodiscard]] auto Description() const;
        [[nodiscard]] auto Id() const;
        [[nodiscard]] auto Revision() const;
        [[nodiscard]] auto DownloadProgress() const;
        [[nodiscard]] auto InstallProgress() const;
        [[nodiscard]] auto ExtendedError() const;
    };
    template <> struct consume<Windows::System::Update::ISystemUpdateItem>
    {
        template <typename D> using type = consume_Windows_System_Update_ISystemUpdateItem<D>;
    };
    template <typename D>
    struct consume_Windows_System_Update_ISystemUpdateLastErrorInfo
    {
        [[nodiscard]] auto State() const;
        [[nodiscard]] auto ExtendedError() const;
        [[nodiscard]] auto IsInteractive() const;
    };
    template <> struct consume<Windows::System::Update::ISystemUpdateLastErrorInfo>
    {
        template <typename D> using type = consume_Windows_System_Update_ISystemUpdateLastErrorInfo<D>;
    };
    template <typename D>
    struct consume_Windows_System_Update_ISystemUpdateManagerStatics
    {
        auto IsSupported() const;
        [[nodiscard]] auto State() const;
        auto StateChanged(Windows::Foundation::EventHandler<Windows::Foundation::IInspectable> const& handler) const;
        using StateChanged_revoker = impl::event_revoker<Windows::System::Update::ISystemUpdateManagerStatics, &impl::abi_t<Windows::System::Update::ISystemUpdateManagerStatics>::remove_StateChanged>;
        StateChanged_revoker StateChanged(auto_revoke_t, Windows::Foundation::EventHandler<Windows::Foundation::IInspectable> const& handler) const;
        auto StateChanged(winrt::event_token const& token) const noexcept;
        [[nodiscard]] auto DownloadProgress() const;
        [[nodiscard]] auto InstallProgress() const;
        [[nodiscard]] auto UserActiveHoursStart() const;
        [[nodiscard]] auto UserActiveHoursEnd() const;
        [[nodiscard]] auto UserActiveHoursMax() const;
        auto TrySetUserActiveHours(Windows::Foundation::TimeSpan const& start, Windows::Foundation::TimeSpan const& end) const;
        [[nodiscard]] auto LastUpdateCheckTime() const;
        [[nodiscard]] auto LastUpdateInstallTime() const;
        [[nodiscard]] auto LastErrorInfo() const;
        auto GetAutomaticRebootBlockIds() const;
        auto BlockAutomaticRebootAsync(param::hstring const& lockId) const;
        auto UnblockAutomaticRebootAsync(param::hstring const& lockId) const;
        [[nodiscard]] auto ExtendedError() const;
        auto GetUpdateItems() const;
        [[nodiscard]] auto AttentionRequiredReason() const;
        auto SetFlightRing(param::hstring const& flightRing) const;
        auto GetFlightRing() const;
        auto StartInstall(Windows::System::Update::SystemUpdateStartInstallAction const& action) const;
        auto RebootToCompleteInstall() const;
        auto StartCancelUpdates() const;
    };
    template <> struct consume<Windows::System::Update::ISystemUpdateManagerStatics>
    {
        template <typename D> using type = consume_Windows_System_Update_ISystemUpdateManagerStatics<D>;
    };
}
#endif
