blob: b4aa0c457601d0c4c99a80a130abb21eaef72062 [file] [log] [blame]
Alexandre Julliard59545601999-02-10 06:52:57 +00001/* Definitions for printing
2 *
3 * Copyright 1998 Huw Davies, Andreas Mohr
4 *
5 * Portions Copyright (c) 1999 Corel Corporation
6 * (Paul Quinn, Albert Den Haan)
7 */
8#ifndef __WINE_WINSPOOL_H
9#define __WINE_WINSPOOL_H
10
Jim Aston2e1cafa1999-03-14 16:35:05 +000011#include "windef.h"
Marcus Meissner317af321999-02-17 13:51:06 +000012#include "winbase.h"
13#include "wingdi.h"
Alexandre Julliard59545601999-02-10 06:52:57 +000014
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/* DEFINES */
20#define INT_PD_DEFAULT_DEVMODE 1
21#define INT_PD_DEFAULT_MODEL 2
22
23#define PRINTER_ATTRIBUTE_QUEUED 0x00000001
24#define PRINTER_ATTRIBUTE_DIRECT 0x00000002
25#define PRINTER_ATTRIBUTE_DEFAULT 0x00000004
26#define PRINTER_ATTRIBUTE_SHARED 0x00000008
27#define PRINTER_ATTRIBUTE_NETWORK 0x00000010
28#define PRINTER_ATTRIBUTE_HIDDEN 0x00000020
29#define PRINTER_ATTRIBUTE_LOCAL 0x00000040
30
31#define PRINTER_ATTRIBUTE_ENABLE_DEVQ 0x00000080
32#define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS 0x00000100
33#define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST 0x00000200
34
35#define PRINTER_ATTRIBUTE_WORK_OFFLINE 0x00000400
36#define PRINTER_ATTRIBUTE_ENABLE_BIDI 0x00000800
37
38#define PRINTER_ENUM_DEFAULT 0x00000001
39#define PRINTER_ENUM_LOCAL 0x00000002
40#define PRINTER_ENUM_CONNECTIONS 0x00000004
41#define PRINTER_ENUM_FAVORITE 0x00000004
42#define PRINTER_ENUM_NAME 0x00000008
43#define PRINTER_ENUM_REMOTE 0x00000010
44#define PRINTER_ENUM_SHARED 0x00000020
45#define PRINTER_ENUM_NETWORK 0x00000040
46
47#define PRINTER_ENUM_EXPAND 0x00004000
48#define PRINTER_ENUM_CONTAINER 0x00008000
49
50#define PRINTER_ENUM_ICONMASK 0x00ff0000
51#define PRINTER_ENUM_ICON1 0x00010000
52#define PRINTER_ENUM_ICON2 0x00020000
53#define PRINTER_ENUM_ICON3 0x00040000
54#define PRINTER_ENUM_ICON4 0x00080000
55#define PRINTER_ENUM_ICON5 0x00100000
56#define PRINTER_ENUM_ICON6 0x00200000
57#define PRINTER_ENUM_ICON7 0x00400000
58#define PRINTER_ENUM_ICON8 0x00800000
59
60/* TYPES */
Alexandre Julliarda3960291999-02-26 11:11:13 +000061typedef struct _PRINTER_DEFAULTSA {
Alexandre Julliard59545601999-02-10 06:52:57 +000062 LPSTR pDatatype;
Alexandre Julliarda3960291999-02-26 11:11:13 +000063 LPDEVMODEA pDevMode;
Alexandre Julliard59545601999-02-10 06:52:57 +000064 ACCESS_MASK DesiredAccess;
Alexandre Julliarda3960291999-02-26 11:11:13 +000065} PRINTER_DEFAULTSA, *LPPRINTER_DEFAULTSA;
Alexandre Julliard59545601999-02-10 06:52:57 +000066
Alexandre Julliarda3960291999-02-26 11:11:13 +000067typedef struct _PRINTER_DEFAULTSW {
Alexandre Julliard59545601999-02-10 06:52:57 +000068 LPWSTR pDatatype;
Alexandre Julliarda3960291999-02-26 11:11:13 +000069 LPDEVMODEW pDevMode;
Alexandre Julliard59545601999-02-10 06:52:57 +000070 ACCESS_MASK DesiredAccess;
Alexandre Julliarda3960291999-02-26 11:11:13 +000071} PRINTER_DEFAULTSW, *LPPRINTER_DEFAULTSW;
Alexandre Julliard59545601999-02-10 06:52:57 +000072
73DECL_WINELIB_TYPE_AW(PRINTER_DEFAULTS)
74DECL_WINELIB_TYPE_AW(LPPRINTER_DEFAULTS)
75
Alexandre Julliarda3960291999-02-26 11:11:13 +000076typedef struct _DRIVER_INFO_1A {
Alexandre Julliard59545601999-02-10 06:52:57 +000077 LPSTR pName;
Alexandre Julliarda3960291999-02-26 11:11:13 +000078} DRIVER_INFO_1A, *PDRIVER_INFO_1A, *LPDRIVER_INFO_1A;
Alexandre Julliard59545601999-02-10 06:52:57 +000079
Alexandre Julliarda3960291999-02-26 11:11:13 +000080typedef struct _DRIVER_INFO_1W {
Alexandre Julliard59545601999-02-10 06:52:57 +000081 LPWSTR pName;
Alexandre Julliarda3960291999-02-26 11:11:13 +000082} DRIVER_INFO_1W, *PDRIVER_INFO_1W, *LPDRIVER_INFO_1W;
Alexandre Julliard59545601999-02-10 06:52:57 +000083
84DECL_WINELIB_TYPE_AW(DRIVER_INFO_1)
85DECL_WINELIB_TYPE_AW(PDRIVER_INFO_1)
86DECL_WINELIB_TYPE_AW(LPDRIVER_INFO_1)
87
Alexandre Julliarda3960291999-02-26 11:11:13 +000088typedef struct _DRIVER_INFO_2A {
Alexandre Julliard59545601999-02-10 06:52:57 +000089 DWORD cVersion;
90 LPSTR pName;
91 LPSTR pEnvironment;
92 LPSTR pDriverPath;
93 LPSTR pDataFile;
94 LPSTR pConfigFile;
Alexandre Julliarda3960291999-02-26 11:11:13 +000095} DRIVER_INFO_2A, *PDRIVER_INFO_2A, *LPDRIVER_INFO_2A;
Alexandre Julliard59545601999-02-10 06:52:57 +000096
Alexandre Julliarda3960291999-02-26 11:11:13 +000097typedef struct _DRIVER_INFO_2W {
Alexandre Julliard59545601999-02-10 06:52:57 +000098 DWORD cVersion;
99 LPWSTR pName;
100 LPWSTR pEnvironment;
101 LPWSTR pDriverPath;
102 LPWSTR pDataFile;
103 LPWSTR pConfigFile;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000104} DRIVER_INFO_2W, *PDRIVER_INFO_2W, *LPDRIVER_INFO_2W;
Alexandre Julliard59545601999-02-10 06:52:57 +0000105
106DECL_WINELIB_TYPE_AW(DRIVER_INFO_2)
107DECL_WINELIB_TYPE_AW(PDRIVER_INFO_2)
108DECL_WINELIB_TYPE_AW(LPDRIVER_INFO_2)
109
Alexandre Julliarda3960291999-02-26 11:11:13 +0000110typedef struct _PRINTER_INFO_1A {
Alexandre Julliard59545601999-02-10 06:52:57 +0000111 DWORD Flags;
112 LPSTR pDescription;
113 LPSTR pName;
114 LPSTR pComment;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000115} PRINTER_INFO_1A, *PPRINTER_INFO_1A, *LPPRINTER_INFO_1A;
Alexandre Julliard59545601999-02-10 06:52:57 +0000116
Alexandre Julliarda3960291999-02-26 11:11:13 +0000117typedef struct _PRINTER_INFO_1W {
Alexandre Julliard59545601999-02-10 06:52:57 +0000118 DWORD Flags;
119 LPWSTR pDescription;
120 LPWSTR pName;
121 LPWSTR pComment;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000122} PRINTER_INFO_1W, *PPRINTER_INFO_1W, *LPPRINTER_INFO_1W;
Alexandre Julliard59545601999-02-10 06:52:57 +0000123
124DECL_WINELIB_TYPE_AW(PRINTER_INFO_1)
125DECL_WINELIB_TYPE_AW(PPRINTER_INFO_1)
126DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_1)
127
128/* FIXME: winspool.h declares some structure members with the name Status.
129 * unfortunatly <X11/ICE/ICElib.h> #defines Status to the type 'int'
130 * therfore the following hack */
131#ifndef Status
132
Alexandre Julliarda3960291999-02-26 11:11:13 +0000133typedef struct _PRINTER_INFO_2A {
Alexandre Julliard59545601999-02-10 06:52:57 +0000134 LPSTR pServerName;
135 LPSTR pPrinterName;
136 LPSTR pShareName;
137 LPSTR pPortName;
138 LPSTR pDriverName;
139 LPSTR pComment;
140 LPSTR pLocation;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000141 LPDEVMODEA pDevMode;
Alexandre Julliard59545601999-02-10 06:52:57 +0000142 LPSTR pSepFile;
143 LPSTR pPrintProcessor;
144 LPSTR pDatatype;
145 LPSTR pParameters;
146 PSECURITY_DESCRIPTOR pSecurityDescriptor;
147 DWORD Attributes;
148 DWORD Priority;
149 DWORD DefaultPriority;
150 DWORD StartTime;
151 DWORD UntilTime;
152 DWORD Status;
153 DWORD cJobs;
154 DWORD AveragePPM;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000155} PRINTER_INFO_2A, *PPRINTER_INFO_2A, *LPPRINTER_INFO_2A;
Alexandre Julliard59545601999-02-10 06:52:57 +0000156
Alexandre Julliarda3960291999-02-26 11:11:13 +0000157typedef struct _PRINTER_INFO_2W {
Alexandre Julliard59545601999-02-10 06:52:57 +0000158 LPWSTR pServerName;
159 LPWSTR pPrinterName;
160 LPWSTR pShareName;
161 LPWSTR pPortName;
162 LPWSTR pDriverName;
163 LPWSTR pComment;
164 LPWSTR pLocation;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000165 LPDEVMODEW pDevMode;
Alexandre Julliard59545601999-02-10 06:52:57 +0000166 LPWSTR pSepFile;
167 LPWSTR pPrintProcessor;
168 LPWSTR pDatatype;
169 LPWSTR pParameters;
170 PSECURITY_DESCRIPTOR pSecurityDescriptor;
171 DWORD Attributes;
172 DWORD Priority;
173 DWORD DefaultPriority;
174 DWORD StartTime;
175 DWORD UntilTime;
176 DWORD Status;
177 DWORD cJobs;
178 DWORD AveragePPM;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000179} PRINTER_INFO_2W, *PPRINTER_INFO_2W, *LPPRINTER_INFO_2W;
Alexandre Julliard59545601999-02-10 06:52:57 +0000180
181DECL_WINELIB_TYPE_AW(PRINTER_INFO_2)
182DECL_WINELIB_TYPE_AW(PPRINTER_INFO_2)
183DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_2)
184
Klaas van Gendfdedc341999-03-22 12:40:24 +0000185typedef struct _PRINTER_INFO_4A {
186 LPSTR pPrinterName;
187 LPSTR pServerName;
188 DWORD Attributes;
189} PRINTER_INFO_4A, *PPRINTER_INFO_4A, *LPPRINTER_INFO_4A;
190
191typedef struct _PRINTER_INFO_4W {
192 LPWSTR pPrinterName;
193 LPWSTR pServerName;
194 DWORD Attributes;
195} PRINTER_INFO_4W, *PPRINTER_INFO_4W, *LPPRINTER_INFO_4W;
196
197DECL_WINELIB_TYPE_AW(PRINTER_INFO_4)
198DECL_WINELIB_TYPE_AW(PPRINTER_INFO_4)
199DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_4)
200
201typedef struct _PRINTER_INFO_5A {
202 LPSTR pPrinterName;
203 LPSTR pPortName;
204 DWORD Attributes;
205 DWORD DeviceNotSelectedTimeOut;
206 DWORD TransmissionRetryTimeout;
207} PRINTER_INFO_5A, *PPRINTER_INFO_5A, *LPPRINTER_INFO_5A;
208
209typedef struct _PRINTER_INFO_5W {
210 LPWSTR pPrinterName;
211 LPWSTR pPortName;
212 DWORD Attributes;
213 DWORD DeviceNotSelectedTimeOut;
214 DWORD TransmissionRetryTimeout;
215} PRINTER_INFO_5W, *PPRINTER_INFO_5W, *LPPRINTER_INFO_5W;
216
217DECL_WINELIB_TYPE_AW(PRINTER_INFO_5)
218DECL_WINELIB_TYPE_AW(PPRINTER_INFO_5)
219DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_5)
220
Alexandre Julliard59545601999-02-10 06:52:57 +0000221#endif /* Status */
222
223/* DECLARATIONS */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000224DWORD WINAPI DrvGetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile,
Alexandre Julliard59545601999-02-10 06:52:57 +0000225 LPDWORD lpType, LPBYTE lpPrinterData, int cbData, LPDWORD lpNeeded);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000226DWORD WINAPI DrvSetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile,
Alexandre Julliard59545601999-02-10 06:52:57 +0000227 DWORD lpType, LPBYTE lpPrinterData, DWORD dwSize);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000228HANDLE16 WINAPI OpenJob16(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC);
229int WINAPI CloseJob16(HANDLE16 hJob);
230int WINAPI WriteSpool16(HANDLE16 hJob, LPSTR lpData, WORD cch);
231int WINAPI DeleteJob16(HANDLE16 hJob, WORD wNotUsed);
232int WINAPI StartSpoolPage16(HANDLE16 hJob);
233int WINAPI EndSpoolPage16(HANDLE16 hJob);
234DWORD WINAPI GetSpoolJob16(int nOption, LONG param);
235int WINAPI WriteDialog16(HANDLE16 hJob, LPSTR lpMsg, WORD cchMsg);
Alexandre Julliard59545601999-02-10 06:52:57 +0000236
Alexandre Julliarda3960291999-02-26 11:11:13 +0000237INT WINAPI DeviceCapabilitiesA(LPCSTR printer,LPCSTR target,WORD z,
238 LPSTR a,LPDEVMODEA b);
239INT WINAPI DeviceCapabilitiesW(LPCWSTR pDevice, LPCWSTR pPort,
Alexandre Julliard59545601999-02-10 06:52:57 +0000240 WORD fwCapability, LPWSTR pOutput,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000241 const DEVMODEW *pDevMode);
Alexandre Julliard59545601999-02-10 06:52:57 +0000242
243#define DeviceCapabilities WINELIB_NAME_AW(DeviceCapabilities)
244
Alexandre Julliarda3960291999-02-26 11:11:13 +0000245LONG WINAPI DocumentPropertiesA(HWND hWnd,HANDLE hPrinter,
246 LPSTR pDeviceName, LPDEVMODEA pDevModeOutput,
247 LPDEVMODEA pDevModeInput,DWORD fMode );
248LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
Alexandre Julliard59545601999-02-10 06:52:57 +0000249 LPWSTR pDeviceName,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000250 LPDEVMODEW pDevModeOutput,
251 LPDEVMODEW pDevModeInput, DWORD fMode);
Alexandre Julliard59545601999-02-10 06:52:57 +0000252
253#define DocumentProperties WINELIB_NAME_AW(DocumentProperties)
254
Alexandre Julliarda3960291999-02-26 11:11:13 +0000255BOOL WINAPI OpenPrinterA(LPSTR lpPrinterName,HANDLE *phPrinter,
256 LPPRINTER_DEFAULTSA pDefault);
257BOOL WINAPI OpenPrinterW(LPWSTR lpPrinterName,HANDLE *phPrinter,
258 LPPRINTER_DEFAULTSW pDefault);
Alexandre Julliard59545601999-02-10 06:52:57 +0000259
260#define OpenPrinter WINELIB_NAME_AW(OpenPrinter)
261
Alexandre Julliarda3960291999-02-26 11:11:13 +0000262BOOL WINAPI ClosePrinter (HANDLE phPrinter);
Alexandre Julliard59545601999-02-10 06:52:57 +0000263
Klaas van Gendfdedc341999-03-22 12:40:24 +0000264BOOL WINAPI EnumPrintersA(DWORD dwType, LPSTR lpszName,
265 DWORD dwLevel, LPBYTE lpbPrinters,
266 DWORD cbBuf, LPDWORD lpdwNeeded,
267 LPDWORD lpdwReturned);
268BOOL WINAPI EnumPrintersW(DWORD dwType, LPWSTR lpszName,
269 DWORD dwLevel, LPBYTE lpbPrinters,
270 DWORD cbBuf, LPDWORD lpdwNeeded,
271 LPDWORD lpdwReturned);
272#define EnumPrinters WINELIB_NAME_AW(EnumPrinters)
273
274
Alexandre Julliard59545601999-02-10 06:52:57 +0000275
276#ifdef __cplusplus
277} // extern "C"
278#endif
279
280#endif /* __WINE_WINSPOOL_H */
281