//
// Copyright (c) Microsoft Corporation. All rights reserved.
// 
//
// File generated by WinMDIDL version 8.00.0021
//

import "inspectable.idl";
import "AsyncInfo.idl";
import "EventToken.idl";
import "windowscontracts.idl";
import "Windows.Foundation.idl";
import "Windows.Storage.idl";
import "Windows.Storage.Streams.idl";
import "Windows.System.idl";

// Forward Declare
namespace Windows
{
    namespace Foundation
    {
        runtimeclass Deferral;

        apicontract UniversalApiContract;
    }
}
namespace Windows
{
    namespace Storage
    {
        interface IStorageItem;
    }
}
namespace Windows
{
    namespace Storage
    {
        namespace Streams
        {
            interface IBuffer;
        }
    }
}
namespace Windows
{
    namespace System
    {
        runtimeclass User;
    }
}
namespace Windows
{
    namespace Security
    {
        namespace DataProtection
        {
            typedef enum UserDataAvailability UserDataAvailability;

            typedef enum UserDataBufferUnprotectStatus UserDataBufferUnprotectStatus;

            typedef enum UserDataStorageItemProtectionStatus UserDataStorageItemProtectionStatus;

            interface IUserDataAvailabilityStateChangedEventArgs;

            interface IUserDataBufferUnprotectResult;

            interface IUserDataProtectionManager;

            interface IUserDataProtectionManagerStatics;

            interface IUserDataStorageItemProtectionInfo;

            runtimeclass UserDataAvailabilityStateChangedEventArgs;

            runtimeclass UserDataBufferUnprotectResult;

            runtimeclass UserDataProtectionManager;

            runtimeclass UserDataStorageItemProtectionInfo;
        }
    }
}

// Generic instantiations
namespace Windows
{
    namespace Security
    {
        namespace DataProtection
        {
            declare
            {
                interface Windows.Foundation.IAsyncOperation<Windows.Security.DataProtection.UserDataBufferUnprotectResult*>;

                interface Windows.Foundation.IAsyncOperation<Windows.Security.DataProtection.UserDataStorageItemProtectionInfo*>;

                interface Windows.Foundation.IAsyncOperation<Windows.Security.DataProtection.UserDataStorageItemProtectionStatus>;

                interface Windows.Foundation.TypedEventHandler<Windows.Security.DataProtection.UserDataProtectionManager*, Windows.Security.DataProtection.UserDataAvailabilityStateChangedEventArgs*>;
            }
        }
    }
}

// Type definition
namespace Windows
{
    namespace Security
    {
        namespace DataProtection
        {
            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            enum UserDataAvailability
            {
                Always           = 0,
                AfterFirstUnlock = 1,
                WhileUnlocked    = 2
            };

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            enum UserDataBufferUnprotectStatus
            {
                Succeeded   = 0,
                Unavailable = 1
            };

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            enum UserDataStorageItemProtectionStatus
            {
                Succeeded       = 0,
                NotProtectable  = 1,
                DataUnavailable = 2
            };

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [exclusiveto(Windows.Security.DataProtection.UserDataAvailabilityStateChangedEventArgs)]
            [uuid(A76582C9-06A2-4273-A803-834C9F87FBEB)]
            interface IUserDataAvailabilityStateChangedEventArgs : IInspectable
            {
                HRESULT GetDeferral([out] [retval] Windows.Foundation.Deferral** result);
            }

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [exclusiveto(Windows.Security.DataProtection.UserDataBufferUnprotectResult)]
            [uuid(8EFD0E90-FA9A-46A4-A377-01CEBF1E74D8)]
            interface IUserDataBufferUnprotectResult : IInspectable
            {
                [propget] HRESULT Status([out] [retval] Windows.Security.DataProtection.UserDataBufferUnprotectStatus* value);
                [propget] HRESULT UnprotectedBuffer([out] [retval] Windows.Storage.Streams.IBuffer** value);
            }

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [exclusiveto(Windows.Security.DataProtection.UserDataProtectionManager)]
            [uuid(1F13237D-B42E-4A88-9480-0F240924C876)]
            interface IUserDataProtectionManager : IInspectable
            {
                HRESULT ProtectStorageItemAsync([in] Windows.Storage.IStorageItem* storageItem, [in] Windows.Security.DataProtection.UserDataAvailability availability, [out] [retval] Windows.Foundation.IAsyncOperation<Windows.Security.DataProtection.UserDataStorageItemProtectionStatus>** result);
                HRESULT GetStorageItemProtectionInfoAsync([in] Windows.Storage.IStorageItem* storageItem, [out] [retval] Windows.Foundation.IAsyncOperation<Windows.Security.DataProtection.UserDataStorageItemProtectionInfo*>** result);
                HRESULT ProtectBufferAsync([in] Windows.Storage.Streams.IBuffer* unprotectedBuffer, [in] Windows.Security.DataProtection.UserDataAvailability availability, [out] [retval] Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IBuffer*>** result);
                HRESULT UnprotectBufferAsync([in] Windows.Storage.Streams.IBuffer* protectedBuffer, [out] [retval] Windows.Foundation.IAsyncOperation<Windows.Security.DataProtection.UserDataBufferUnprotectResult*>** result);
                HRESULT IsContinuedDataAvailabilityExpected([in] Windows.Security.DataProtection.UserDataAvailability availability, [out] [retval] boolean* value);
                [eventadd] HRESULT DataAvailabilityStateChanged([in] Windows.Foundation.TypedEventHandler<Windows.Security.DataProtection.UserDataProtectionManager*, Windows.Security.DataProtection.UserDataAvailabilityStateChangedEventArgs*>* handler, [out] [retval] EventRegistrationToken* token);
                [eventremove] HRESULT DataAvailabilityStateChanged([in] EventRegistrationToken token);
            }

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [exclusiveto(Windows.Security.DataProtection.UserDataProtectionManager)]
            [uuid(977780E8-6DCE-4FAE-AF85-782AC2CF4572)]
            interface IUserDataProtectionManagerStatics : IInspectable
            {
                HRESULT TryGetDefault([out] [retval] Windows.Security.DataProtection.UserDataProtectionManager** result);
                HRESULT TryGetForUser([in] Windows.System.User* user, [out] [retval] Windows.Security.DataProtection.UserDataProtectionManager** result);
            }

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [exclusiveto(Windows.Security.DataProtection.UserDataStorageItemProtectionInfo)]
            [uuid(5B6680F6-E87F-40A1-B19D-A6187A0C662F)]
            interface IUserDataStorageItemProtectionInfo : IInspectable
            {
                [propget] HRESULT Availability([out] [retval] Windows.Security.DataProtection.UserDataAvailability* value);
            }

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [marshaling_behavior(agile)]
            [threading(both)]
            runtimeclass UserDataAvailabilityStateChangedEventArgs
            {
                [default] interface Windows.Security.DataProtection.IUserDataAvailabilityStateChangedEventArgs;
            }

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [marshaling_behavior(agile)]
            [threading(both)]
            runtimeclass UserDataBufferUnprotectResult
            {
                [default] interface Windows.Security.DataProtection.IUserDataBufferUnprotectResult;
            }

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [marshaling_behavior(agile)]
            [static(Windows.Security.DataProtection.IUserDataProtectionManagerStatics, Windows.Foundation.UniversalApiContract, 8.0)]
            [threading(both)]
            runtimeclass UserDataProtectionManager
            {
                [default] interface Windows.Security.DataProtection.IUserDataProtectionManager;
            }

            [contract(Windows.Foundation.UniversalApiContract, 8.0)]
            [marshaling_behavior(agile)]
            [threading(both)]
            runtimeclass UserDataStorageItemProtectionInfo
            {
                [default] interface Windows.Security.DataProtection.IUserDataStorageItemProtectionInfo;
            }
        }
    }
}
