' ########################################################################################
' Microsoft Windows
' File: xpsprint.inc
' 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_xpsprint_PBI)
#DEFINE PBX_xpsprint_PBI
%EQUATE `XPSPRINT_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
#INCLUDE ONCE "Legacy/COM/OCIdl.inc"
'#if (NTDDI_VERSION >= NTDDI_WIN7)
'#ifndef __XpsPrint_LIBRARY_DEFINED__
'#define __XpsPrint_LIBRARY_DEFINED__
' enum XPS_JOB_COMPLETION
%EQUATE `XPS_JOB_IN_PROGRESS = 0
%EQUATE `XPS_JOB_COMPLETED = %XPS_JOB_IN_PROGRESS + 1
%EQUATE `XPS_JOB_CANCELLED = %XPS_JOB_COMPLETED + 1
%EQUATE `XPS_JOB_FAILED = %XPS_JOB_CANCELLED + 1
TYPE XPS_JOB_STATUS DWORD
 jobId AS DWORD ' UINT32
 currentDocument AS LONG ' INT32
 currentPage AS LONG ' INT32
 currentPageTotal AS LONG ' INT32
 completion AS LONG ' XPS_JOB_COMPLETION
 jobStatus AS LONG
END TYPE
'EXTERN_C const IID LIBID_XpsPrint;
' ########################################################################################
' Interface name = IXpsPrintJobStream
' IID = 7a77dc5f-45d6-4dff-9307-d8cb846347ca
' Inherited interface = ISequentialStream
' ########################################################################################
#IF NOT %DEF(%IXpsPrintJobStream_INTERFACE_DEFINED)
 %IXpsPrintJobStream_INTERFACE_DEFINED = 1
$IID_IXpsPrintJobStream = GUID$("{7a77dc5f-45d6-4dff-9307-d8cb846347ca}")
INTERFACE IXpsPrintJobStream $IID_IXpsPrintJobStream
 INHERIT IUnknown
 ' =====================================================================================
 ' ISequentialStream methods
 ' =====================================================================================
 METHOD Read ( ' VTable offset = 12
 BYVAL pv AS DWORD
 , BYVAL cb AS DWORD
 , BYREF pcbRead AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Write ( ' VTable offset = 16
 BYVAL pv AS DWORD
 , BYVAL cb AS DWORD
 , BYREF pcbWritten AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IXpsPrintJobStream methods
 ' =====================================================================================
 METHOD Close ( ' VTable offset = 20
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IXpsPrintJobStream_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IXpsPrintJob
' IID = 5ab89b06-8194-425f-ab3b-d7a96e350161
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IXpsPrintJob_INTERFACE_DEFINED)
 %IXpsPrintJob_INTERFACE_DEFINED = 1
$IID_IXpsPrintJob = GUID$("{5ab89b06-8194-425f-ab3b-d7a96e350161}")
INTERFACE IXpsPrintJob $IID_IXpsPrintJob
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Cancel ( ' VTable offset = 12
 ) AS LONG
 ' =====================================================================================
 METHOD GetJobStatus ( ' VTable offset = 16
 BYREF jobStatus AS XPS_JOB_STATUS
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IXpsPrintJob_INTERFACE_DEFINED__ */
'#ifndef __XpsPrint_MODULE_DEFINED__
'#define __XpsPrint_MODULE_DEFINED__
DECLARE FUNCTION StartXpsPrintJob LIB "xpsprint.dll" ALIAS "StartXpsPrintJob" ( BYREF printerName AS WSTRINGZ , BYREF jobName AS WSTRINGZ , BYREF outputFileName AS WSTRINGZ , BYVAL progressEvent AS QUAD , BYVAL completionEvent AS QUAD , BYREF printablePagesOn AS BYTE , BYVAL printablePagesOnCount AS QUAD , BYREF xpsPrintJob AS IXpsPrintJob , BYREF documentStream AS IXpsPrintJobStream , BYREF printTicketStream AS IXpsPrintJobStream ) AS LONG
'#endif /* __XpsPrint_MODULE_DEFINED__ */
'#endif /* __XpsPrint_LIBRARY_DEFINED__ */
'#endif //(NTDDI_VERSION >= NTDDI_WIN7)
#ENDIF
