' ########################################################################################
' Microsoft Windows
' File: prntvpt.inc
' Contents: Print ticket APIs for Win32 applications
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_prntvpt_PBI)
#DEFINE PBX_prntvpt_PBI
%EQUATE `PRNTVPT_INC = 1
#INCLUDE ONCE "Legacy/COM/ObjIdl.inc"
'DECLARE_HANDLE(HPTPROVIDER);
%EQUATE `PRINTTICKET_ISTREAM_APIS = 1
%EQUATE `S_PT_NO_CONFLICT = &H00040001
%EQUATE `S_PT_CONFLICT_RESOLVED = &H00040002
'/*
' PrintTicket stream provided by the caller did not
' follow PrintTicket framework specification or the XML
' could not be parsed. If returned by
' PTMergeAndValidatePrintTicket, it indicates that the
' base ticket contained the error.
'*/
%EQUATE `E_PRINTTICKET_FORMAT = &H80040003
'/*
' PrintCapabilities document generated by the driver
' did not follow the specification. This indicates an
' error in the driver.
'*/
%EQUATE `E_PRINTCAPABILITIES_FORMAT = &H80040004
'/*
' The delta print ticket parameter passed to
' PTMergeAndValidatePrintTicket did not
' follow PrintTicket framework specification or
' the XML could not be parsed.
'*/
%EQUATE `E_DELTA_PRINTTICKET_FORMAT = &H80040005
' enum EDefaultDevmodeType
%EQUATE `kUserDefaultDevmode = 0
%EQUATE `kPrinterDefaultDevmode = 1
' enum EPrintTicketScope
%EQUATE `kPTPageScope = 0
%EQUATE `kPTDocumentScope = 1
%EQUATE `kPTJobScope = 2
DECLARE FUNCTION PTQuerySchemaVersionSupport LIB "prntvpt.dll" ALIAS "PTQuerySchemaVersionSupport" ( BYREF pszPrinterName AS WSTRINGZ , BYREF pMaxVersion AS QUAD ) AS LONG
DECLARE FUNCTION PTOpenProvider LIB "prntvpt.dll" ALIAS "PTOpenProvider" ( BYREF pszPrinterName AS WSTRINGZ
 , BYVAL dwVersion AS DWORD
 , BYREF phProvider AS DWORD
 ) AS LONG
DECLARE FUNCTION PTOpenProviderEx LIB "prntvpt.dll" ALIAS "PTOpenProviderEx" ( BYREF pszPrinterName AS WSTRINGZ
 , BYVAL dwMaxVersion AS DWORD
 , BYVAL dwPrefVersion AS DWORD
 , BYREF phProvider AS DWORD
 , BYREF pUsedVersion AS DWORD
 ) AS LONG
DECLARE FUNCTION PTCloseProvider LIB "prntvpt.dll" ALIAS "PTCloseProvider" ( BYVAL hProvider AS DWORD
 ) AS LONG
DECLARE FUNCTION PTReleaseMemory LIB "prntvpt.dll" ALIAS "PTReleaseMemory" ( BYVAL pBuffer AS DWORD
 ) AS LONG
DECLARE FUNCTION PTGetPrintCapabilities LIB "prntvpt.dll" ALIAS "PTGetPrintCapabilities" ( BYVAL hProvider AS DWORD
 , BYVAL pPrintTicket AS IStream
 , BYVAL pCapabilities AS IStream
 , BYREF pbstrErrorMessage AS WSTRING
 ) AS LONG
DECLARE FUNCTION PTMergeAndValidatePrintTicket LIB "prntvpt.dll" ALIAS "PTMergeAndValidatePrintTicket" ( BYVAL hProvider AS DWORD
 , BYVAL pBaseTicket AS IStream
 , BYVAL pDeltaTicket AS IStream
 , BYREF pbstrErrorMessage AS WSTRING
 ) AS LONG
DECLARE FUNCTION PTConvertPrintTicketToDevMode LIB "prntvpt.dll" ALIAS "PTConvertPrintTicketToDevMode" ( BYVAL hProvider AS DWORD
 , BYVAL pPrintTicket AS IStream
 , BYVAL baseDevmodeType AS DWORD
 , BYVAL scope AS DWORD
 , BYREF pcbDevmode AS DWORD
 , BYREF ppDevmode AS DEVMODEA
 , BYREF pbstrErrorMessage AS WSTRING
 ) AS LONG
DECLARE FUNCTION PTConvertDevModeToPrintTicket LIB "prntvpt.dll" ALIAS "PTConvertDevModeToPrintTicket" ( BYVAL hProvider AS DWORD
 , BYVAL cbDevmode AS DWORD
 , BYREF pDevmode AS DEVMODEA
 , BYVAL scope AS DWORD
 , BYVAL pPrintTicket AS IStream
 ) AS LONG
#ENDIF
