# WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.7

import enum
import datetime
import sys
import types
import typing

import winsdk._winrt as _winrt
import winsdk.windows.foundation
import winsdk.windows.foundation.collections
import winsdk.windows.media.playback

class GraphicsTrustStatus(enum.IntEnum):
    TRUST_NOT_REQUIRED = 0
    TRUST_ESTABLISHED = 1
    ENVIRONMENT_NOT_SUPPORTED = 2
    DRIVER_NOT_SUPPORTED = 3
    DRIVER_SIGNING_FAILURE = 4
    UNKNOWN_FAILURE = 5

class HdcpProtection(enum.IntEnum):
    OFF = 0
    ON = 1
    ON_WITH_TYPE_ENFORCEMENT = 2

class HdcpSetProtectionResult(enum.IntEnum):
    SUCCESS = 0
    TIMED_OUT = 1
    NOT_SUPPORTED = 2
    UNKNOWN_FAILURE = 3

class ProtectionCapabilityResult(enum.IntEnum):
    NOT_SUPPORTED = 0
    MAYBE = 1
    PROBABLY = 2

class RenewalStatus(enum.IntEnum):
    NOT_STARTED = 0
    UPDATES_IN_PROGRESS = 1
    USER_CANCELLED = 2
    APP_COMPONENTS_MAY_NEED_UPDATING = 3
    NO_COMPONENTS_FOUND = 4

class RevocationAndRenewalReasons(enum.IntFlag):
    USER_MODE_COMPONENT_LOAD = 0x1
    KERNEL_MODE_COMPONENT_LOAD = 0x2
    APP_COMPONENT = 0x4
    GLOBAL_REVOCATION_LIST_LOAD_FAILED = 0x10
    INVALID_GLOBAL_REVOCATION_LIST_SIGNATURE = 0x20
    GLOBAL_REVOCATION_LIST_ABSENT = 0x1000
    COMPONENT_REVOKED = 0x2000
    INVALID_COMPONENT_CERTIFICATE_EXTENDED_KEY_USE = 0x4000
    COMPONENT_CERTIFICATE_REVOKED = 0x8000
    INVALID_COMPONENT_CERTIFICATE_ROOT = 0x10000
    COMPONENT_HIGH_SECURITY_CERTIFICATE_REVOKED = 0x20000
    COMPONENT_LOW_SECURITY_CERTIFICATE_REVOKED = 0x40000
    BOOT_DRIVER_VERIFICATION_FAILED = 0x100000
    COMPONENT_SIGNED_WITH_TEST_CERTIFICATE = 0x1000000
    ENCRYPTION_FAILURE = 0x10000000

Self = typing.TypeVar('Self')

class ComponentLoadFailedEventArgs(_winrt.Object):
    completion: typing.Optional[MediaProtectionServiceCompletion]
    information: typing.Optional[RevocationAndRenewalInformation]
    @staticmethod
    def _from(obj: _winrt.Object) -> ComponentLoadFailedEventArgs: ...

class ComponentRenewal(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> ComponentRenewal: ...
    @staticmethod
    def renew_system_components_async(information: typing.Optional[RevocationAndRenewalInformation]) -> winsdk.windows.foundation.IAsyncOperationWithProgress[RenewalStatus, _winrt.UInt32]: ...

class HdcpSession(_winrt.Object):
    def __enter__(self: Self) -> Self: ...
    def __exit__(self, *args) -> None: ...
    @staticmethod
    def _from(obj: _winrt.Object) -> HdcpSession: ...
    def __new__(cls: typing.Type[HdcpSession]) -> HdcpSession:...
    def close(self) -> None: ...
    def get_effective_protection(self) -> typing.Optional[typing.Optional[HdcpProtection]]: ...
    def is_effective_protection_at_least(self, protection: HdcpProtection) -> _winrt.Boolean: ...
    def set_desired_min_protection_async(self, protection: HdcpProtection) -> winsdk.windows.foundation.IAsyncOperation[HdcpSetProtectionResult]: ...
    def add_protection_changed(self, handler: winsdk.windows.foundation.TypedEventHandler[HdcpSession, _winrt.Object]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_protection_changed(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class MediaProtectionManager(_winrt.Object):
    properties: typing.Optional[winsdk.windows.foundation.collections.IPropertySet]
    @staticmethod
    def _from(obj: _winrt.Object) -> MediaProtectionManager: ...
    def __new__(cls: typing.Type[MediaProtectionManager]) -> MediaProtectionManager:...
    def add_component_load_failed(self, handler: typing.Optional[ComponentLoadFailedEventHandler]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_component_load_failed(self, cookie: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    def add_reboot_needed(self, handler: typing.Optional[RebootNeededEventHandler]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_reboot_needed(self, cookie: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    def add_service_requested(self, handler: typing.Optional[ServiceRequestedEventHandler]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_service_requested(self, cookie: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class MediaProtectionPMPServer(_winrt.Object):
    properties: typing.Optional[winsdk.windows.foundation.collections.IPropertySet]
    @staticmethod
    def _from(obj: _winrt.Object) -> MediaProtectionPMPServer: ...
    def __new__(cls: typing.Type[MediaProtectionPMPServer], p_properties: typing.Optional[winsdk.windows.foundation.collections.IPropertySet]) -> MediaProtectionPMPServer:...

class MediaProtectionServiceCompletion(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> MediaProtectionServiceCompletion: ...
    def complete(self, success: _winrt.Boolean) -> None: ...

class ProtectionCapabilities(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> ProtectionCapabilities: ...
    def __new__(cls: typing.Type[ProtectionCapabilities]) -> ProtectionCapabilities:...
    def is_type_supported(self, type: str, key_system: str) -> ProtectionCapabilityResult: ...

class RevocationAndRenewalInformation(_winrt.Object):
    items: typing.Optional[winsdk.windows.foundation.collections.IVector[RevocationAndRenewalItem]]
    @staticmethod
    def _from(obj: _winrt.Object) -> RevocationAndRenewalInformation: ...

class RevocationAndRenewalItem(_winrt.Object):
    header_hash: str
    name: str
    public_key_hash: str
    reasons: RevocationAndRenewalReasons
    renewal_id: str
    @staticmethod
    def _from(obj: _winrt.Object) -> RevocationAndRenewalItem: ...

class ServiceRequestedEventArgs(_winrt.Object):
    completion: typing.Optional[MediaProtectionServiceCompletion]
    request: typing.Optional[IMediaProtectionServiceRequest]
    media_playback_item: typing.Optional[winsdk.windows.media.playback.MediaPlaybackItem]
    @staticmethod
    def _from(obj: _winrt.Object) -> ServiceRequestedEventArgs: ...

class IMediaProtectionServiceRequest(_winrt.Object):
    protection_system: _winrt.Guid
    type: _winrt.Guid
    @staticmethod
    def _from(obj: _winrt.Object) -> IMediaProtectionServiceRequest: ...

ComponentLoadFailedEventHandler = typing.Callable[[typing.Optional[MediaProtectionManager], typing.Optional[ComponentLoadFailedEventArgs]], None]

RebootNeededEventHandler = typing.Callable[[typing.Optional[MediaProtectionManager]], None]

ServiceRequestedEventHandler = typing.Callable[[typing.Optional[MediaProtectionManager], typing.Optional[ServiceRequestedEventArgs]], None]

