# 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.applicationmodel.activation
import winsdk.windows.devices.printers
import winsdk.windows.foundation
import winsdk.windows.foundation.collections
import winsdk.windows.graphics.printing.printticket
import winsdk.windows.storage
import winsdk.windows.storage.streams
import winsdk.windows.system

class PdlConversionHostBasedProcessingOperations(enum.IntFlag):
    NONE = 0
    PAGE_ROTATION = 0x1
    PAGE_ORDERING = 0x2
    COPIES = 0x4
    BLANK_PAGE_INSERTION = 0x8
    ALL = 0xffffffff

class PrintWorkflowAttributesMergePolicy(enum.IntEnum):
    MERGE_PREFER_PRINT_TICKET_ON_CONFLICT = 0
    MERGE_PREFER_PSA_ON_CONFLICT = 1
    DO_NOT_MERGE_WITH_PRINT_TICKET = 2

class PrintWorkflowJobAbortReason(enum.IntEnum):
    JOB_FAILED = 0
    USER_CANCELED = 1

class PrintWorkflowPdlConversionType(enum.IntEnum):
    XPS_TO_PDF = 0
    XPS_TO_PWGR = 1
    XPS_TO_PCLM = 2

class PrintWorkflowPrinterJobStatus(enum.IntEnum):
    ERROR = 0
    ABORTED = 1
    IN_PROGRESS = 2
    COMPLETED = 3

class PrintWorkflowSessionStatus(enum.IntEnum):
    STARTED = 0
    COMPLETED = 1
    ABORTED = 2
    CLOSED = 3
    PDL_DATA_AVAILABLE_FOR_MODIFICATION = 4

class PrintWorkflowSubmittedStatus(enum.IntEnum):
    SUCCEEDED = 0
    CANCELED = 1
    FAILED = 2

class PrintWorkflowUICompletionStatus(enum.IntEnum):
    COMPLETED = 0
    LAUNCH_FAILED = 1
    JOB_FAILED = 2
    USER_CANCELED = 3

Self = typing.TypeVar('Self')

class PrintWorkflowBackgroundSession(_winrt.Object):
    status: PrintWorkflowSessionStatus
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowBackgroundSession: ...
    def start(self) -> None: ...
    def add_setup_requested(self, setup_event_handler: winsdk.windows.foundation.TypedEventHandler[PrintWorkflowBackgroundSession, PrintWorkflowBackgroundSetupRequestedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_setup_requested(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    def add_submitted(self, submitted_event_handler: winsdk.windows.foundation.TypedEventHandler[PrintWorkflowBackgroundSession, PrintWorkflowSubmittedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_submitted(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class PrintWorkflowBackgroundSetupRequestedEventArgs(_winrt.Object):
    configuration: typing.Optional[PrintWorkflowConfiguration]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowBackgroundSetupRequestedEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...
    def get_user_print_ticket_async(self) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.graphics.printing.printticket.WorkflowPrintTicket]: ...
    def set_requires_u_i(self) -> None: ...

class PrintWorkflowConfiguration(_winrt.Object):
    job_title: str
    session_id: str
    source_app_display_name: str
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowConfiguration: ...
    def abort_print_flow(self, reason: PrintWorkflowJobAbortReason) -> None: ...

class PrintWorkflowForegroundSession(_winrt.Object):
    status: PrintWorkflowSessionStatus
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowForegroundSession: ...
    def start(self) -> None: ...
    def add_setup_requested(self, setup_event_handler: winsdk.windows.foundation.TypedEventHandler[PrintWorkflowForegroundSession, PrintWorkflowForegroundSetupRequestedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_setup_requested(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    def add_xps_data_available(self, xps_data_available_event_handler: winsdk.windows.foundation.TypedEventHandler[PrintWorkflowForegroundSession, PrintWorkflowXpsDataAvailableEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_xps_data_available(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class PrintWorkflowForegroundSetupRequestedEventArgs(_winrt.Object):
    configuration: typing.Optional[PrintWorkflowConfiguration]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowForegroundSetupRequestedEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...
    def get_user_print_ticket_async(self) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.graphics.printing.printticket.WorkflowPrintTicket]: ...

class PrintWorkflowJobActivatedEventArgs(_winrt.Object):
    kind: winsdk.windows.applicationmodel.activation.ActivationKind
    previous_execution_state: winsdk.windows.applicationmodel.activation.ApplicationExecutionState
    splash_screen: typing.Optional[winsdk.windows.applicationmodel.activation.SplashScreen]
    user: typing.Optional[winsdk.windows.system.User]
    session: typing.Optional[PrintWorkflowJobUISession]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowJobActivatedEventArgs: ...

class PrintWorkflowJobBackgroundSession(_winrt.Object):
    status: PrintWorkflowSessionStatus
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowJobBackgroundSession: ...
    def start(self) -> None: ...
    def add_job_starting(self, handler: winsdk.windows.foundation.TypedEventHandler[PrintWorkflowJobBackgroundSession, PrintWorkflowJobStartingEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_job_starting(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    def add_pdl_modification_requested(self, handler: winsdk.windows.foundation.TypedEventHandler[PrintWorkflowJobBackgroundSession, PrintWorkflowPdlModificationRequestedEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_pdl_modification_requested(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class PrintWorkflowJobNotificationEventArgs(_winrt.Object):
    configuration: typing.Optional[PrintWorkflowConfiguration]
    printer_job: typing.Optional[PrintWorkflowPrinterJob]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowJobNotificationEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...

class PrintWorkflowJobStartingEventArgs(_winrt.Object):
    configuration: typing.Optional[PrintWorkflowConfiguration]
    printer: typing.Optional[winsdk.windows.devices.printers.IppPrintDevice]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowJobStartingEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...
    def set_skip_system_rendering(self) -> None: ...

class PrintWorkflowJobTriggerDetails(_winrt.Object):
    print_workflow_job_session: typing.Optional[PrintWorkflowJobBackgroundSession]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowJobTriggerDetails: ...

class PrintWorkflowJobUISession(_winrt.Object):
    status: PrintWorkflowSessionStatus
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowJobUISession: ...
    def start(self) -> None: ...
    def add_job_notification(self, handler: winsdk.windows.foundation.TypedEventHandler[PrintWorkflowJobUISession, PrintWorkflowJobNotificationEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_job_notification(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...
    def add_pdl_data_available(self, handler: winsdk.windows.foundation.TypedEventHandler[PrintWorkflowJobUISession, PrintWorkflowPdlDataAvailableEventArgs]) -> winsdk.windows.foundation.EventRegistrationToken: ...
    def remove_pdl_data_available(self, token: winsdk.windows.foundation.EventRegistrationToken) -> None: ...

class PrintWorkflowObjectModelSourceFileContent(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowObjectModelSourceFileContent: ...
    def __new__(cls: typing.Type[PrintWorkflowObjectModelSourceFileContent], xps_stream: typing.Optional[winsdk.windows.storage.streams.IInputStream]) -> PrintWorkflowObjectModelSourceFileContent:...

class PrintWorkflowObjectModelTargetPackage(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowObjectModelTargetPackage: ...

class PrintWorkflowPdlConverter(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowPdlConverter: ...
    @typing.overload
    def convert_pdl_async(self, print_ticket: typing.Optional[winsdk.windows.graphics.printing.printticket.WorkflowPrintTicket], input_stream: typing.Optional[winsdk.windows.storage.streams.IInputStream], output_stream: typing.Optional[winsdk.windows.storage.streams.IOutputStream]) -> typing.Optional[winsdk.windows.foundation.IAsyncAction]: ...
    @typing.overload
    def convert_pdl_async(self, print_ticket: typing.Optional[winsdk.windows.graphics.printing.printticket.WorkflowPrintTicket], input_stream: typing.Optional[winsdk.windows.storage.streams.IInputStream], output_stream: typing.Optional[winsdk.windows.storage.streams.IOutputStream], host_based_processing_operations: PdlConversionHostBasedProcessingOperations) -> typing.Optional[winsdk.windows.foundation.IAsyncAction]: ...

class PrintWorkflowPdlDataAvailableEventArgs(_winrt.Object):
    configuration: typing.Optional[PrintWorkflowConfiguration]
    printer_job: typing.Optional[PrintWorkflowPrinterJob]
    source_content: typing.Optional[PrintWorkflowPdlSourceContent]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowPdlDataAvailableEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...

class PrintWorkflowPdlModificationRequestedEventArgs(_winrt.Object):
    configuration: typing.Optional[PrintWorkflowConfiguration]
    printer_job: typing.Optional[PrintWorkflowPrinterJob]
    source_content: typing.Optional[PrintWorkflowPdlSourceContent]
    u_i_launcher: typing.Optional[PrintWorkflowUILauncher]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowPdlModificationRequestedEventArgs: ...
    def create_job_on_printer(self, target_content_type: str) -> typing.Optional[PrintWorkflowPdlTargetStream]: ...
    @typing.overload
    def create_job_on_printer_with_attributes(self, job_attributes: typing.Iterable[winsdk.windows.foundation.collections.IKeyValuePair[str, winsdk.windows.devices.printers.IppAttributeValue]], target_content_type: str) -> typing.Optional[PrintWorkflowPdlTargetStream]: ...
    @typing.overload
    def create_job_on_printer_with_attributes(self, job_attributes: typing.Iterable[winsdk.windows.foundation.collections.IKeyValuePair[str, winsdk.windows.devices.printers.IppAttributeValue]], target_content_type: str, operation_attributes: typing.Iterable[winsdk.windows.foundation.collections.IKeyValuePair[str, winsdk.windows.devices.printers.IppAttributeValue]], job_attributes_merge_policy: PrintWorkflowAttributesMergePolicy, operation_attributes_merge_policy: PrintWorkflowAttributesMergePolicy) -> typing.Optional[PrintWorkflowPdlTargetStream]: ...
    @typing.overload
    def create_job_on_printer_with_attributes_buffer(self, job_attributes_buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer], target_content_type: str) -> typing.Optional[PrintWorkflowPdlTargetStream]: ...
    @typing.overload
    def create_job_on_printer_with_attributes_buffer(self, job_attributes_buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer], target_content_type: str, operation_attributes_buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer], job_attributes_merge_policy: PrintWorkflowAttributesMergePolicy, operation_attributes_merge_policy: PrintWorkflowAttributesMergePolicy) -> typing.Optional[PrintWorkflowPdlTargetStream]: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...
    def get_pdl_converter(self, conversion_type: PrintWorkflowPdlConversionType) -> typing.Optional[PrintWorkflowPdlConverter]: ...

class PrintWorkflowPdlSourceContent(_winrt.Object):
    content_type: str
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowPdlSourceContent: ...
    def get_content_file_async(self) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.storage.StorageFile]: ...
    def get_input_stream(self) -> typing.Optional[winsdk.windows.storage.streams.IInputStream]: ...

class PrintWorkflowPdlTargetStream(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowPdlTargetStream: ...
    def complete_stream_submission(self, status: PrintWorkflowSubmittedStatus) -> None: ...
    def get_output_stream(self) -> typing.Optional[winsdk.windows.storage.streams.IOutputStream]: ...

class PrintWorkflowPrinterJob(_winrt.Object):
    job_id: _winrt.Int32
    printer: typing.Optional[winsdk.windows.devices.printers.IppPrintDevice]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowPrinterJob: ...
    def get_job_attributes(self, attribute_names: typing.Iterable[str]) -> typing.Optional[winsdk.windows.foundation.collections.IMap[str, winsdk.windows.devices.printers.IppAttributeValue]]: ...
    def get_job_attributes_as_buffer(self, attribute_names: typing.Iterable[str]) -> typing.Optional[winsdk.windows.storage.streams.IBuffer]: ...
    def get_job_print_ticket(self) -> typing.Optional[winsdk.windows.graphics.printing.printticket.WorkflowPrintTicket]: ...
    def get_job_status(self) -> PrintWorkflowPrinterJobStatus: ...
    def set_job_attributes(self, job_attributes: typing.Iterable[winsdk.windows.foundation.collections.IKeyValuePair[str, winsdk.windows.devices.printers.IppAttributeValue]]) -> typing.Optional[winsdk.windows.devices.printers.IppSetAttributesResult]: ...
    def set_job_attributes_from_buffer(self, job_attributes_buffer: typing.Optional[winsdk.windows.storage.streams.IBuffer]) -> typing.Optional[winsdk.windows.devices.printers.IppSetAttributesResult]: ...

class PrintWorkflowSourceContent(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowSourceContent: ...
    def get_job_print_ticket_async(self) -> winsdk.windows.foundation.IAsyncOperation[winsdk.windows.graphics.printing.printticket.WorkflowPrintTicket]: ...
    def get_source_spool_data_as_stream_content(self) -> typing.Optional[PrintWorkflowSpoolStreamContent]: ...
    def get_source_spool_data_as_xps_object_model(self) -> typing.Optional[PrintWorkflowObjectModelSourceFileContent]: ...

class PrintWorkflowSpoolStreamContent(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowSpoolStreamContent: ...
    def get_input_stream(self) -> typing.Optional[winsdk.windows.storage.streams.IInputStream]: ...

class PrintWorkflowStreamTarget(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowStreamTarget: ...
    def get_output_stream(self) -> typing.Optional[winsdk.windows.storage.streams.IOutputStream]: ...

class PrintWorkflowSubmittedEventArgs(_winrt.Object):
    operation: typing.Optional[PrintWorkflowSubmittedOperation]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowSubmittedEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...
    def get_target(self, job_print_ticket: typing.Optional[winsdk.windows.graphics.printing.printticket.WorkflowPrintTicket]) -> typing.Optional[PrintWorkflowTarget]: ...

class PrintWorkflowSubmittedOperation(_winrt.Object):
    configuration: typing.Optional[PrintWorkflowConfiguration]
    xps_content: typing.Optional[PrintWorkflowSourceContent]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowSubmittedOperation: ...
    def complete(self, status: PrintWorkflowSubmittedStatus) -> None: ...

class PrintWorkflowTarget(_winrt.Object):
    target_as_stream: typing.Optional[PrintWorkflowStreamTarget]
    target_as_xps_object_model_package: typing.Optional[PrintWorkflowObjectModelTargetPackage]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowTarget: ...

class PrintWorkflowTriggerDetails(_winrt.Object):
    print_workflow_session: typing.Optional[PrintWorkflowBackgroundSession]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowTriggerDetails: ...

class PrintWorkflowUIActivatedEventArgs(_winrt.Object):
    kind: winsdk.windows.applicationmodel.activation.ActivationKind
    previous_execution_state: winsdk.windows.applicationmodel.activation.ApplicationExecutionState
    splash_screen: typing.Optional[winsdk.windows.applicationmodel.activation.SplashScreen]
    user: typing.Optional[winsdk.windows.system.User]
    print_workflow_session: typing.Optional[PrintWorkflowForegroundSession]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowUIActivatedEventArgs: ...

class PrintWorkflowUILauncher(_winrt.Object):
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowUILauncher: ...
    def is_u_i_launch_enabled(self) -> _winrt.Boolean: ...
    def launch_and_complete_u_i_async(self) -> winsdk.windows.foundation.IAsyncOperation[PrintWorkflowUICompletionStatus]: ...

class PrintWorkflowXpsDataAvailableEventArgs(_winrt.Object):
    operation: typing.Optional[PrintWorkflowSubmittedOperation]
    @staticmethod
    def _from(obj: _winrt.Object) -> PrintWorkflowXpsDataAvailableEventArgs: ...
    def get_deferral(self) -> typing.Optional[winsdk.windows.foundation.Deferral]: ...

