--------------------------------------------------------------------------------
-- <auto-generated>                                                           --
--     This code was generated by a tool.                                     --
--                                                                            --
--     Changes to this file may cause incorrect behavior and will be lost if  --
--     the code is regenerated.                                               --
-- </auto-generated>                                                          --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--                                                                            --
--    Copyright(c) 2018 Alexander Gamper, All Rights Reserved.                --
--                                                                            --
--    Ada-WinRT                                                               --
--                                                                            --
-- This program is free software: you can redistribute it and / or modify     --
-- it under the terms of the GNU Lesser General Public License as published by--
-- the Free Software Foundation, either version 3 of the License, or          --
-- (at your option) any later version.                                        --
--                                                                            --
-- This program is distributed in the hope that it will be useful,            --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of             --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the               --
-- GNU Lesser General Public License for more details.                        --
--                                                                            --
-- You should have received a copy of the GNU Lesser General Public License   --
-- along with this program.If not, see http://www.gnu.org/licenses            --
--                                                                            --
--------------------------------------------------------------------------------
with Windows.Foundation;
with Windows.Foundation.Collections;
package Windows.System.Update is

   pragma preelaborate;
   
   ------------------------------------------------------------------------
   -- Enums
   ------------------------------------------------------------------------
   
   type SystemUpdateAttentionRequiredReason is (
      None,
      NetworkRequired,
      InsufficientDiskSpace,
      InsufficientBattery,
      UpdateBlocked
   );
   for SystemUpdateAttentionRequiredReason use (
      None => 0,
      NetworkRequired => 1,
      InsufficientDiskSpace => 2,
      InsufficientBattery => 3,
      UpdateBlocked => 4
   );
   for SystemUpdateAttentionRequiredReason'Size use 32;
   
   type SystemUpdateAttentionRequiredReason_Ptr is access SystemUpdateAttentionRequiredReason;
   
   type SystemUpdateItemState is (
      NotStarted,
      Initializing,
      Preparing,
      Calculating,
      Downloading,
      Installing,
      Completed,
      RebootRequired,
      Error
   );
   for SystemUpdateItemState use (
      NotStarted => 0,
      Initializing => 1,
      Preparing => 2,
      Calculating => 3,
      Downloading => 4,
      Installing => 5,
      Completed => 6,
      RebootRequired => 7,
      Error => 8
   );
   for SystemUpdateItemState'Size use 32;
   
   type SystemUpdateItemState_Ptr is access SystemUpdateItemState;
   
   type SystemUpdateManagerState is (
      Idle,
      Detecting,
      ReadyToDownload,
      Downloading,
      ReadyToInstall,
      Installing,
      RebootRequired,
      ReadyToFinalize,
      Finalizing,
      Completed,
      AttentionRequired,
      Error
   );
   for SystemUpdateManagerState use (
      Idle => 0,
      Detecting => 1,
      ReadyToDownload => 2,
      Downloading => 3,
      ReadyToInstall => 4,
      Installing => 5,
      RebootRequired => 6,
      ReadyToFinalize => 7,
      Finalizing => 8,
      Completed => 9,
      AttentionRequired => 10,
      Error => 11
   );
   for SystemUpdateManagerState'Size use 32;
   
   type SystemUpdateManagerState_Ptr is access SystemUpdateManagerState;
   
   type SystemUpdateStartInstallAction is (
      UpToReboot,
      AllowReboot
   );
   for SystemUpdateStartInstallAction use (
      UpToReboot => 0,
      AllowReboot => 1
   );
   for SystemUpdateStartInstallAction'Size use 32;
   
   type SystemUpdateStartInstallAction_Ptr is access SystemUpdateStartInstallAction;
   
   ------------------------------------------------------------------------
   -- Forward Declaration - Interfaces
   ------------------------------------------------------------------------
   
   type IIterable_ISystemUpdateItem_Interface;
   type IIterable_ISystemUpdateItem is access all IIterable_ISystemUpdateItem_Interface'Class;
   type IIterable_ISystemUpdateItem_Ptr is access all IIterable_ISystemUpdateItem;
   type IIterator_ISystemUpdateItem_Interface;
   type IIterator_ISystemUpdateItem is access all IIterator_ISystemUpdateItem_Interface'Class;
   type IIterator_ISystemUpdateItem_Ptr is access all IIterator_ISystemUpdateItem;
   type ISystemUpdateItem_Interface;
   type ISystemUpdateItem is access all ISystemUpdateItem_Interface'Class;
   type ISystemUpdateItem_Ptr is access all ISystemUpdateItem;
   type ISystemUpdateLastErrorInfo_Interface;
   type ISystemUpdateLastErrorInfo is access all ISystemUpdateLastErrorInfo_Interface'Class;
   type ISystemUpdateLastErrorInfo_Ptr is access all ISystemUpdateLastErrorInfo;
   type ISystemUpdateManagerStatics_Interface;
   type ISystemUpdateManagerStatics is access all ISystemUpdateManagerStatics_Interface'Class;
   type ISystemUpdateManagerStatics_Ptr is access all ISystemUpdateManagerStatics;
   type IVectorView_ISystemUpdateItem_Interface;
   type IVectorView_ISystemUpdateItem is access all IVectorView_ISystemUpdateItem_Interface'Class;
   type IVectorView_ISystemUpdateItem_Ptr is access all IVectorView_ISystemUpdateItem;
   
   ------------------------------------------------------------------------
   -- Interfaces
   ------------------------------------------------------------------------
   
   ------------------------------------------------------------------------
   
   IID_IIterable_ISystemUpdateItem : aliased constant Windows.IID := (831139960, 37260, 21793, (180, 96, 11, 66, 16, 54, 10, 161 ));
   
   type IIterable_ISystemUpdateItem_Interface is interface and Windows.IInspectable_Interface;
   
   function First
   (
      This       : access IIterable_ISystemUpdateItem_Interface
      ; RetVal : access Windows.System.Update.IIterator_ISystemUpdateItem
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IIterator_ISystemUpdateItem : aliased constant Windows.IID := (4105064822, 49256, 21551, (129, 180, 137, 0, 247, 43, 215, 66 ));
   
   type IIterator_ISystemUpdateItem_Interface is interface and Windows.IInspectable_Interface;
   
   function get_Current
   (
      This       : access IIterator_ISystemUpdateItem_Interface
      ; RetVal : access Windows.System.Update.ISystemUpdateItem
   )
   return Windows.HRESULT is abstract;
   
   function get_HasCurrent
   (
      This       : access IIterator_ISystemUpdateItem_Interface
      ; RetVal : access Windows.Boolean
   )
   return Windows.HRESULT is abstract;
   
   function MoveNext
   (
      This       : access IIterator_ISystemUpdateItem_Interface
      ; RetVal : access Windows.Boolean
   )
   return Windows.HRESULT is abstract;
   
   function GetMany
   (
      This       : access IIterator_ISystemUpdateItem_Interface
      ; items : Windows.System.Update.ISystemUpdateItem_Ptr
      ; RetVal : access Windows.UInt32
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_ISystemUpdateItem : aliased constant Windows.IID := (2006401259, 22052, 20894, (168, 226, 9, 233, 23, 59, 63, 183 ));
   
   type ISystemUpdateItem_Interface is interface and Windows.IInspectable_Interface;
   
   function get_State
   (
      This       : access ISystemUpdateItem_Interface
      ; RetVal : access Windows.System.Update.SystemUpdateItemState
   )
   return Windows.HRESULT is abstract;
   
   function get_Title
   (
      This       : access ISystemUpdateItem_Interface
      ; RetVal : access Windows.String
   )
   return Windows.HRESULT is abstract;
   
   function get_Description
   (
      This       : access ISystemUpdateItem_Interface
      ; RetVal : access Windows.String
   )
   return Windows.HRESULT is abstract;
   
   function get_Id
   (
      This       : access ISystemUpdateItem_Interface
      ; RetVal : access Windows.String
   )
   return Windows.HRESULT is abstract;
   
   function get_Revision
   (
      This       : access ISystemUpdateItem_Interface
      ; RetVal : access Windows.UInt32
   )
   return Windows.HRESULT is abstract;
   
   function get_DownloadProgress
   (
      This       : access ISystemUpdateItem_Interface
      ; RetVal : access Windows.Double
   )
   return Windows.HRESULT is abstract;
   
   function get_InstallProgress
   (
      This       : access ISystemUpdateItem_Interface
      ; RetVal : access Windows.Double
   )
   return Windows.HRESULT is abstract;
   
   function get_ExtendedError
   (
      This       : access ISystemUpdateItem_Interface
      ; RetVal : access Windows.HResult
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_ISystemUpdateLastErrorInfo : aliased constant Windows.IID := (2129168375, 35396, 23406, (189, 7, 122, 236, 228, 17, 110, 169 ));
   
   type ISystemUpdateLastErrorInfo_Interface is interface and Windows.IInspectable_Interface;
   
   function get_State
   (
      This       : access ISystemUpdateLastErrorInfo_Interface
      ; RetVal : access Windows.System.Update.SystemUpdateManagerState
   )
   return Windows.HRESULT is abstract;
   
   function get_ExtendedError
   (
      This       : access ISystemUpdateLastErrorInfo_Interface
      ; RetVal : access Windows.HResult
   )
   return Windows.HRESULT is abstract;
   
   function get_IsInteractive
   (
      This       : access ISystemUpdateLastErrorInfo_Interface
      ; RetVal : access Windows.Boolean
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_ISystemUpdateManagerStatics : aliased constant Windows.IID := (3000237295, 10609, 20926, (180, 26, 139, 215, 3, 187, 112, 26 ));
   
   type ISystemUpdateManagerStatics_Interface is interface and Windows.IInspectable_Interface;
   
   function IsSupported
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Boolean
   )
   return Windows.HRESULT is abstract;
   
   function get_State
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.System.Update.SystemUpdateManagerState
   )
   return Windows.HRESULT is abstract;
   
   function add_StateChanged
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; handler : Windows.Foundation.EventHandler_Object
      ; RetVal : access Windows.Foundation.EventRegistrationToken
   )
   return Windows.HRESULT is abstract;
   
   function remove_StateChanged
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; token : Windows.Foundation.EventRegistrationToken
   )
   return Windows.HRESULT is abstract;
   
   function get_DownloadProgress
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Double
   )
   return Windows.HRESULT is abstract;
   
   function get_InstallProgress
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Double
   )
   return Windows.HRESULT is abstract;
   
   function get_UserActiveHoursStart
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Foundation.TimeSpan
   )
   return Windows.HRESULT is abstract;
   
   function get_UserActiveHoursEnd
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Foundation.TimeSpan
   )
   return Windows.HRESULT is abstract;
   
   function get_UserActiveHoursMax
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Int32
   )
   return Windows.HRESULT is abstract;
   
   function TrySetUserActiveHours
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; start : Windows.Foundation.TimeSpan
      ; end_x : Windows.Foundation.TimeSpan
      ; RetVal : access Windows.Boolean
   )
   return Windows.HRESULT is abstract;
   
   function get_LastUpdateCheckTime
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Foundation.DateTime
   )
   return Windows.HRESULT is abstract;
   
   function get_LastUpdateInstallTime
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Foundation.DateTime
   )
   return Windows.HRESULT is abstract;
   
   function get_LastErrorInfo
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.System.Update.ISystemUpdateLastErrorInfo
   )
   return Windows.HRESULT is abstract;
   
   function GetAutomaticRebootBlockIds
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.Foundation.Collections.IVectorView_String -- Generic Parameter Type
   )
   return Windows.HRESULT is abstract;
   
   function BlockAutomaticRebootAsync
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; lockId : Windows.String
      ; RetVal : access Windows.Foundation.IAsyncOperation_Boolean -- Generic Parameter Type
   )
   return Windows.HRESULT is abstract;
   
   function UnblockAutomaticRebootAsync
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; lockId : Windows.String
      ; RetVal : access Windows.Foundation.IAsyncOperation_Boolean -- Generic Parameter Type
   )
   return Windows.HRESULT is abstract;
   
   function get_ExtendedError
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.HResult
   )
   return Windows.HRESULT is abstract;
   
   function GetUpdateItems
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.System.Update.IVectorView_ISystemUpdateItem -- Generic Parameter Type
   )
   return Windows.HRESULT is abstract;
   
   function get_AttentionRequiredReason
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.System.Update.SystemUpdateAttentionRequiredReason
   )
   return Windows.HRESULT is abstract;
   
   function SetFlightRing
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; flightRing : Windows.String
      ; RetVal : access Windows.Boolean
   )
   return Windows.HRESULT is abstract;
   
   function GetFlightRing
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; RetVal : access Windows.String
   )
   return Windows.HRESULT is abstract;
   
   function StartInstall
   (
      This       : access ISystemUpdateManagerStatics_Interface
      ; action : Windows.System.Update.SystemUpdateStartInstallAction
   )
   return Windows.HRESULT is abstract;
   
   function RebootToCompleteInstall
   (
      This       : access ISystemUpdateManagerStatics_Interface
   )
   return Windows.HRESULT is abstract;
   
   function StartCancelUpdates
   (
      This       : access ISystemUpdateManagerStatics_Interface
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IVectorView_ISystemUpdateItem : aliased constant Windows.IID := (2088220236, 35810, 20704, (140, 165, 216, 38, 93, 128, 144, 43 ));
   
   type IVectorView_ISystemUpdateItem_Interface is interface and Windows.IInspectable_Interface;
   
   function GetAt
   (
      This       : access IVectorView_ISystemUpdateItem_Interface
      ; index : Windows.UInt32
      ; RetVal : access Windows.System.Update.ISystemUpdateItem
   )
   return Windows.HRESULT is abstract;
   
   function get_Size
   (
      This       : access IVectorView_ISystemUpdateItem_Interface
      ; RetVal : access Windows.UInt32
   )
   return Windows.HRESULT is abstract;
   
   function IndexOf
   (
      This       : access IVectorView_ISystemUpdateItem_Interface
      ; value : Windows.System.Update.ISystemUpdateItem
      ; index : access Windows.UInt32
      ; RetVal : access Windows.Boolean
   )
   return Windows.HRESULT is abstract;
   
   function GetMany
   (
      This       : access IVectorView_ISystemUpdateItem_Interface
      ; startIndex : Windows.UInt32
      ; items : Windows.System.Update.ISystemUpdateItem_Ptr
      ; RetVal : access Windows.UInt32
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   -- Classes
   ------------------------------------------------------------------------
   
   subtype SystemUpdateItem is Windows.System.Update.ISystemUpdateItem;
   subtype SystemUpdateLastErrorInfo is Windows.System.Update.ISystemUpdateLastErrorInfo;
   
   ------------------------------------------------------------------------
   -- Static Procedures/functions
   ------------------------------------------------------------------------
   
   function add_StateChanged
   (
      handler : Windows.Foundation.EventHandler_Object
   )
   return Windows.Foundation.EventRegistrationToken;
   
   function BlockAutomaticRebootAsync
   (
      lockId : Windows.String
   )
   return Windows.Foundation.IAsyncOperation_Boolean;
   
   function get_AttentionRequiredReason
   return Windows.System.Update.SystemUpdateAttentionRequiredReason;
   
   function get_DownloadProgress
   return Windows.Double;
   
   function get_ExtendedError
   return Windows.HResult;
   
   function get_InstallProgress
   return Windows.Double;
   
   function get_LastErrorInfo
   return Windows.System.Update.ISystemUpdateLastErrorInfo;
   
   function get_LastUpdateCheckTime
   return Windows.Foundation.DateTime;
   
   function get_LastUpdateInstallTime
   return Windows.Foundation.DateTime;
   
   function get_State
   return Windows.System.Update.SystemUpdateManagerState;
   
   function get_UserActiveHoursEnd
   return Windows.Foundation.TimeSpan;
   
   function get_UserActiveHoursMax
   return Windows.Int32;
   
   function get_UserActiveHoursStart
   return Windows.Foundation.TimeSpan;
   
   function GetAutomaticRebootBlockIds
   return Windows.Foundation.Collections.IVectorView_String;
   
   function GetFlightRing
   return Windows.String;
   
   function GetUpdateItems
   return Windows.System.Update.IVectorView_ISystemUpdateItem;
   
   function IsSupported
   return Windows.Boolean;
   
   procedure RebootToCompleteInstall
   ;
   
   procedure remove_StateChanged
   (
      token : Windows.Foundation.EventRegistrationToken
   )
   ;
   
   function SetFlightRing
   (
      flightRing : Windows.String
   )
   return Windows.Boolean;
   
   procedure StartCancelUpdates
   ;
   
   procedure StartInstall
   (
      action : Windows.System.Update.SystemUpdateStartInstallAction
   )
   ;
   
   function TrySetUserActiveHours
   (
      start : Windows.Foundation.TimeSpan
      ; end_x : Windows.Foundation.TimeSpan
   )
   return Windows.Boolean;
   
   function UnblockAutomaticRebootAsync
   (
      lockId : Windows.String
   )
   return Windows.Foundation.IAsyncOperation_Boolean;
   
end;
