--------------------------------------------------------------------------------
-- <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;
limited with Windows.Storage;
limited with Windows.Storage.Streams;
limited with Windows.System;
--------------------------------------------------------------------------------
package Windows.Security.DataProtection is

   pragma preelaborate;
   
   ------------------------------------------------------------------------
   -- Enums
   ------------------------------------------------------------------------
   
   type UserDataAvailability is (
      Always,
      AfterFirstUnlock,
      WhileUnlocked
   );
   for UserDataAvailability use (
      Always => 0,
      AfterFirstUnlock => 1,
      WhileUnlocked => 2
   );
   for UserDataAvailability'Size use 32;
   
   type UserDataAvailability_Ptr is access UserDataAvailability;
   
   type UserDataBufferUnprotectStatus is (
      Succeeded,
      Unavailable
   );
   for UserDataBufferUnprotectStatus use (
      Succeeded => 0,
      Unavailable => 1
   );
   for UserDataBufferUnprotectStatus'Size use 32;
   
   type UserDataBufferUnprotectStatus_Ptr is access UserDataBufferUnprotectStatus;
   
   type UserDataStorageItemProtectionStatus is (
      Succeeded,
      NotProtectable,
      DataUnavailable
   );
   for UserDataStorageItemProtectionStatus use (
      Succeeded => 0,
      NotProtectable => 1,
      DataUnavailable => 2
   );
   for UserDataStorageItemProtectionStatus'Size use 32;
   
   type UserDataStorageItemProtectionStatus_Ptr is access UserDataStorageItemProtectionStatus;
   
   ------------------------------------------------------------------------
   -- Forward Declaration - Delegates/Events
   ------------------------------------------------------------------------
   
   type AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult_Interface;
   type AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult is access all AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult_Interface'Class;
   type AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult_Ptr is access all AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult;
   type AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo_Interface;
   type AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo is access all AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo_Interface'Class;
   type AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo_Ptr is access all AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo;
   type AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus_Interface;
   type AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus is access all AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus_Interface'Class;
   type AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus_Ptr is access all AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus;
   type TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged_Interface;
   type TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged is access all TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged_Interface'Class;
   type TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged_Ptr is access all TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged;
   
   ------------------------------------------------------------------------
   -- Forward Declaration - Interfaces
   ------------------------------------------------------------------------
   
   type IAsyncOperation_IUserDataBufferUnprotectResult_Interface;
   type IAsyncOperation_IUserDataBufferUnprotectResult is access all IAsyncOperation_IUserDataBufferUnprotectResult_Interface'Class;
   type IAsyncOperation_IUserDataBufferUnprotectResult_Ptr is access all IAsyncOperation_IUserDataBufferUnprotectResult;
   type IAsyncOperation_IUserDataStorageItemProtectionInfo_Interface;
   type IAsyncOperation_IUserDataStorageItemProtectionInfo is access all IAsyncOperation_IUserDataStorageItemProtectionInfo_Interface'Class;
   type IAsyncOperation_IUserDataStorageItemProtectionInfo_Ptr is access all IAsyncOperation_IUserDataStorageItemProtectionInfo;
   type IAsyncOperation_UserDataStorageItemProtectionStatus_Interface;
   type IAsyncOperation_UserDataStorageItemProtectionStatus is access all IAsyncOperation_UserDataStorageItemProtectionStatus_Interface'Class;
   type IAsyncOperation_UserDataStorageItemProtectionStatus_Ptr is access all IAsyncOperation_UserDataStorageItemProtectionStatus;
   type IUserDataAvailabilityStateChangedEventArgs_Interface;
   type IUserDataAvailabilityStateChangedEventArgs is access all IUserDataAvailabilityStateChangedEventArgs_Interface'Class;
   type IUserDataAvailabilityStateChangedEventArgs_Ptr is access all IUserDataAvailabilityStateChangedEventArgs;
   type IUserDataBufferUnprotectResult_Interface;
   type IUserDataBufferUnprotectResult is access all IUserDataBufferUnprotectResult_Interface'Class;
   type IUserDataBufferUnprotectResult_Ptr is access all IUserDataBufferUnprotectResult;
   type IUserDataProtectionManager_Interface;
   type IUserDataProtectionManager is access all IUserDataProtectionManager_Interface'Class;
   type IUserDataProtectionManager_Ptr is access all IUserDataProtectionManager;
   type IUserDataProtectionManagerStatics_Interface;
   type IUserDataProtectionManagerStatics is access all IUserDataProtectionManagerStatics_Interface'Class;
   type IUserDataProtectionManagerStatics_Ptr is access all IUserDataProtectionManagerStatics;
   type IUserDataStorageItemProtectionInfo_Interface;
   type IUserDataStorageItemProtectionInfo is access all IUserDataStorageItemProtectionInfo_Interface'Class;
   type IUserDataStorageItemProtectionInfo_Ptr is access all IUserDataStorageItemProtectionInfo;
   
   ------------------------------------------------------------------------
   -- Interfaces
   ------------------------------------------------------------------------
   
   ------------------------------------------------------------------------
   
   IID_IAsyncOperation_IUserDataBufferUnprotectResult : aliased constant Windows.IID := (4168508717, 65505, 23671, (166, 145, 43, 219, 64, 76, 250, 111 ));
   
   type IAsyncOperation_IUserDataBufferUnprotectResult_Interface is interface and Windows.IInspectable_Interface;
   
   function put_Completed
   (
      This       : access IAsyncOperation_IUserDataBufferUnprotectResult_Interface
      ; handler : Windows.Security.DataProtection.AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult
   )
   return Windows.HRESULT is abstract;
   
   function get_Completed
   (
      This       : access IAsyncOperation_IUserDataBufferUnprotectResult_Interface
      ; RetVal : access Windows.Security.DataProtection.AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult
   )
   return Windows.HRESULT is abstract;
   
   function GetResults
   (
      This       : access IAsyncOperation_IUserDataBufferUnprotectResult_Interface
      ; RetVal : access Windows.Security.DataProtection.IUserDataBufferUnprotectResult
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IAsyncOperation_IUserDataStorageItemProtectionInfo : aliased constant Windows.IID := (687838034, 23730, 24455, (159, 8, 222, 202, 207, 79, 89, 179 ));
   
   type IAsyncOperation_IUserDataStorageItemProtectionInfo_Interface is interface and Windows.IInspectable_Interface;
   
   function put_Completed
   (
      This       : access IAsyncOperation_IUserDataStorageItemProtectionInfo_Interface
      ; handler : Windows.Security.DataProtection.AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo
   )
   return Windows.HRESULT is abstract;
   
   function get_Completed
   (
      This       : access IAsyncOperation_IUserDataStorageItemProtectionInfo_Interface
      ; RetVal : access Windows.Security.DataProtection.AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo
   )
   return Windows.HRESULT is abstract;
   
   function GetResults
   (
      This       : access IAsyncOperation_IUserDataStorageItemProtectionInfo_Interface
      ; RetVal : access Windows.Security.DataProtection.IUserDataStorageItemProtectionInfo
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IAsyncOperation_UserDataStorageItemProtectionStatus : aliased constant Windows.IID := (3854970301, 57385, 21217, (175, 213, 115, 247, 164, 34, 61, 230 ));
   
   type IAsyncOperation_UserDataStorageItemProtectionStatus_Interface is interface and Windows.IInspectable_Interface;
   
   function put_Completed
   (
      This       : access IAsyncOperation_UserDataStorageItemProtectionStatus_Interface
      ; handler : Windows.Security.DataProtection.AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus
   )
   return Windows.HRESULT is abstract;
   
   function get_Completed
   (
      This       : access IAsyncOperation_UserDataStorageItemProtectionStatus_Interface
      ; RetVal : access Windows.Security.DataProtection.AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus
   )
   return Windows.HRESULT is abstract;
   
   function GetResults
   (
      This       : access IAsyncOperation_UserDataStorageItemProtectionStatus_Interface
      ; RetVal : access Windows.Security.DataProtection.UserDataStorageItemProtectionStatus
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IUserDataAvailabilityStateChangedEventArgs : aliased constant Windows.IID := (2808447689, 1698, 17011, (168, 3, 131, 76, 159, 135, 251, 235 ));
   
   type IUserDataAvailabilityStateChangedEventArgs_Interface is interface and Windows.IInspectable_Interface;
   
   function GetDeferral
   (
      This       : access IUserDataAvailabilityStateChangedEventArgs_Interface
      ; RetVal : access Windows.Foundation.IDeferral
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IUserDataBufferUnprotectResult : aliased constant Windows.IID := (2398949008, 64154, 18084, (163, 119, 1, 206, 191, 30, 116, 216 ));
   
   type IUserDataBufferUnprotectResult_Interface is interface and Windows.IInspectable_Interface;
   
   function get_Status
   (
      This       : access IUserDataBufferUnprotectResult_Interface
      ; RetVal : access Windows.Security.DataProtection.UserDataBufferUnprotectStatus
   )
   return Windows.HRESULT is abstract;
   
   function get_UnprotectedBuffer
   (
      This       : access IUserDataBufferUnprotectResult_Interface
      ; RetVal : access Windows.Storage.Streams.IBuffer
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IUserDataProtectionManager : aliased constant Windows.IID := (521347965, 46126, 19080, (148, 128, 15, 36, 9, 36, 200, 118 ));
   
   type IUserDataProtectionManager_Interface is interface and Windows.IInspectable_Interface;
   
   function ProtectStorageItemAsync
   (
      This       : access IUserDataProtectionManager_Interface
      ; storageItem : Windows.Storage.IStorageItem
      ; availability : Windows.Security.DataProtection.UserDataAvailability
      ; RetVal : access Windows.Security.DataProtection.IAsyncOperation_UserDataStorageItemProtectionStatus -- Generic Parameter Type
   )
   return Windows.HRESULT is abstract;
   
   function GetStorageItemProtectionInfoAsync
   (
      This       : access IUserDataProtectionManager_Interface
      ; storageItem : Windows.Storage.IStorageItem
      ; RetVal : access Windows.Security.DataProtection.IAsyncOperation_IUserDataStorageItemProtectionInfo -- Generic Parameter Type
   )
   return Windows.HRESULT is abstract;
   
   function ProtectBufferAsync
   (
      This       : access IUserDataProtectionManager_Interface
      ; unprotectedBuffer : Windows.Storage.Streams.IBuffer
      ; availability : Windows.Security.DataProtection.UserDataAvailability
      ; RetVal : access Windows.Storage.Streams.IAsyncOperation_IBuffer -- Generic Parameter Type
   )
   return Windows.HRESULT is abstract;
   
   function UnprotectBufferAsync
   (
      This       : access IUserDataProtectionManager_Interface
      ; protectedBuffer : Windows.Storage.Streams.IBuffer
      ; RetVal : access Windows.Security.DataProtection.IAsyncOperation_IUserDataBufferUnprotectResult -- Generic Parameter Type
   )
   return Windows.HRESULT is abstract;
   
   function IsContinuedDataAvailabilityExpected
   (
      This       : access IUserDataProtectionManager_Interface
      ; availability : Windows.Security.DataProtection.UserDataAvailability
      ; RetVal : access Windows.Boolean
   )
   return Windows.HRESULT is abstract;
   
   function add_DataAvailabilityStateChanged
   (
      This       : access IUserDataProtectionManager_Interface
      ; handler : TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged
      ; RetVal : access Windows.Foundation.EventRegistrationToken
   )
   return Windows.HRESULT is abstract;
   
   function remove_DataAvailabilityStateChanged
   (
      This       : access IUserDataProtectionManager_Interface
      ; token : Windows.Foundation.EventRegistrationToken
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IUserDataProtectionManagerStatics : aliased constant Windows.IID := (2541191400, 28110, 20398, (175, 133, 120, 42, 194, 207, 69, 114 ));
   
   type IUserDataProtectionManagerStatics_Interface is interface and Windows.IInspectable_Interface;
   
   function TryGetDefault
   (
      This       : access IUserDataProtectionManagerStatics_Interface
      ; RetVal : access Windows.Security.DataProtection.IUserDataProtectionManager
   )
   return Windows.HRESULT is abstract;
   
   function TryGetForUser
   (
      This       : access IUserDataProtectionManagerStatics_Interface
      ; user : Windows.System.IUser
      ; RetVal : access Windows.Security.DataProtection.IUserDataProtectionManager
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   
   IID_IUserDataStorageItemProtectionInfo : aliased constant Windows.IID := (1533444342, 59519, 16545, (177, 157, 166, 24, 122, 12, 102, 47 ));
   
   type IUserDataStorageItemProtectionInfo_Interface is interface and Windows.IInspectable_Interface;
   
   function get_Availability
   (
      This       : access IUserDataStorageItemProtectionInfo_Interface
      ; RetVal : access Windows.Security.DataProtection.UserDataAvailability
   )
   return Windows.HRESULT is abstract;
   
   ------------------------------------------------------------------------
   -- Delegates/Events
   ------------------------------------------------------------------------
   
   ------------------------------------------------------------------------
   
   IID_AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult : aliased constant Windows.IID := (3081625265, 13942, 20889, (161, 254, 189, 79, 96, 35, 17, 159 ));
   
   type AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult_Interface(Callback : access procedure (asyncInfo : Windows.Security.DataProtection.IAsyncOperation_IUserDataBufferUnprotectResult ; asyncStatus : Windows.Foundation.AsyncStatus)) is new Windows.IMulticastDelegate_Interface(IID_AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult'access) with null record;
   function Invoke
   (
      This       : access AsyncOperationCompletedHandler_IUserDataBufferUnprotectResult_Interface
      ; asyncInfo : Windows.Security.DataProtection.IAsyncOperation_IUserDataBufferUnprotectResult
      ; asyncStatus : Windows.Foundation.AsyncStatus
   )
   return Windows.HRESULT;
   
   ------------------------------------------------------------------------
   
   IID_AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo : aliased constant Windows.IID := (2860606682, 55424, 23029, (128, 147, 102, 77, 5, 45, 116, 181 ));
   
   type AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo_Interface(Callback : access procedure (asyncInfo : Windows.Security.DataProtection.IAsyncOperation_IUserDataStorageItemProtectionInfo ; asyncStatus : Windows.Foundation.AsyncStatus)) is new Windows.IMulticastDelegate_Interface(IID_AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo'access) with null record;
   function Invoke
   (
      This       : access AsyncOperationCompletedHandler_IUserDataStorageItemProtectionInfo_Interface
      ; asyncInfo : Windows.Security.DataProtection.IAsyncOperation_IUserDataStorageItemProtectionInfo
      ; asyncStatus : Windows.Foundation.AsyncStatus
   )
   return Windows.HRESULT;
   
   ------------------------------------------------------------------------
   
   IID_AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus : aliased constant Windows.IID := (943730012, 50564, 21215, (154, 234, 121, 104, 103, 166, 104, 53 ));
   
   type AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus_Interface(Callback : access procedure (asyncInfo : Windows.Security.DataProtection.IAsyncOperation_UserDataStorageItemProtectionStatus ; asyncStatus : Windows.Foundation.AsyncStatus)) is new Windows.IMulticastDelegate_Interface(IID_AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus'access) with null record;
   function Invoke
   (
      This       : access AsyncOperationCompletedHandler_UserDataStorageItemProtectionStatus_Interface
      ; asyncInfo : Windows.Security.DataProtection.IAsyncOperation_UserDataStorageItemProtectionStatus
      ; asyncStatus : Windows.Foundation.AsyncStatus
   )
   return Windows.HRESULT;
   
   ------------------------------------------------------------------------
   
   IID_TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged : aliased constant Windows.IID := (2190889280, 41767, 22158, (135, 143, 102, 60, 44, 167, 197, 98 ));
   
   type TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged_Interface(Callback : access procedure (sender : Windows.Security.DataProtection.IUserDataProtectionManager ; args : Windows.Security.DataProtection.IUserDataAvailabilityStateChangedEventArgs)) is new Windows.IMulticastDelegate_Interface(IID_TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged'access) with null record;
   function Invoke
   (
      This       : access TypedEventHandler_IUserDataProtectionManager_add_DataAvailabilityStateChanged_Interface
      ; sender : Windows.Security.DataProtection.IUserDataProtectionManager
      ; args : Windows.Security.DataProtection.IUserDataAvailabilityStateChangedEventArgs
   )
   return Windows.HRESULT;
   
   ------------------------------------------------------------------------
   -- Classes
   ------------------------------------------------------------------------
   
   subtype UserDataAvailabilityStateChangedEventArgs is Windows.Security.DataProtection.IUserDataAvailabilityStateChangedEventArgs;
   subtype UserDataBufferUnprotectResult is Windows.Security.DataProtection.IUserDataBufferUnprotectResult;
   subtype UserDataProtectionManager is Windows.Security.DataProtection.IUserDataProtectionManager;
   subtype UserDataStorageItemProtectionInfo is Windows.Security.DataProtection.IUserDataStorageItemProtectionInfo;
   
   ------------------------------------------------------------------------
   -- Static Procedures/functions
   ------------------------------------------------------------------------
   
   function TryGetDefault
   return Windows.Security.DataProtection.IUserDataProtectionManager;
   
   function TryGetForUser
   (
      user : Windows.System.IUser
   )
   return Windows.Security.DataProtection.IUserDataProtectionManager;
   
end;
