Use the service thread for comm notifications.
[wine] / include / winspool.h
1 /* 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
11 #include "windef.h"
12 #include "winbase.h"
13 #include "wingdi.h"
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 /* DEFINES */
20
21 #define PRINTER_ATTRIBUTE_QUEUED         0x00000001
22 #define PRINTER_ATTRIBUTE_DIRECT         0x00000002
23 #define PRINTER_ATTRIBUTE_DEFAULT        0x00000004
24 #define PRINTER_ATTRIBUTE_SHARED         0x00000008
25 #define PRINTER_ATTRIBUTE_NETWORK        0x00000010
26 #define PRINTER_ATTRIBUTE_HIDDEN         0x00000020
27 #define PRINTER_ATTRIBUTE_LOCAL          0x00000040
28
29 #define PRINTER_ATTRIBUTE_ENABLE_DEVQ       0x00000080
30 #define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS   0x00000100
31 #define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST 0x00000200
32
33 #define PRINTER_ATTRIBUTE_WORK_OFFLINE   0x00000400
34 #define PRINTER_ATTRIBUTE_ENABLE_BIDI    0x00000800
35
36 #define PRINTER_ENUM_DEFAULT     0x00000001
37 #define PRINTER_ENUM_LOCAL       0x00000002
38 #define PRINTER_ENUM_CONNECTIONS 0x00000004
39 #define PRINTER_ENUM_FAVORITE    0x00000004
40 #define PRINTER_ENUM_NAME        0x00000008
41 #define PRINTER_ENUM_REMOTE      0x00000010
42 #define PRINTER_ENUM_SHARED      0x00000020
43 #define PRINTER_ENUM_NETWORK     0x00000040
44
45 #define PRINTER_ENUM_EXPAND      0x00004000
46 #define PRINTER_ENUM_CONTAINER   0x00008000
47
48 #define PRINTER_ENUM_ICONMASK    0x00ff0000
49 #define PRINTER_ENUM_ICON1       0x00010000
50 #define PRINTER_ENUM_ICON2       0x00020000
51 #define PRINTER_ENUM_ICON3       0x00040000
52 #define PRINTER_ENUM_ICON4       0x00080000
53 #define PRINTER_ENUM_ICON5       0x00100000
54 #define PRINTER_ENUM_ICON6       0x00200000
55 #define PRINTER_ENUM_ICON7       0x00400000
56 #define PRINTER_ENUM_ICON8       0x00800000
57
58
59 /* various printer statuses */
60 #define PRINTER_STATUS_PAUSED            0x00000001
61 #define PRINTER_STATUS_ERROR             0x00000002
62 #define PRINTER_STATUS_PENDING_DELETION  0x00000004
63 #define PRINTER_STATUS_PAPER_JAM         0x00000008
64 #define PRINTER_STATUS_PAPER_OUT         0x00000010
65 #define PRINTER_STATUS_MANUAL_FEED       0x00000020
66 #define PRINTER_STATUS_PAPER_PROBLEM     0x00000040
67 #define PRINTER_STATUS_OFFLINE           0x00000080
68 #define PRINTER_STATUS_IO_ACTIVE         0x00000100
69 #define PRINTER_STATUS_BUSY              0x00000200
70 #define PRINTER_STATUS_PRINTING          0x00000400
71 #define PRINTER_STATUS_OUTPUT_BIN_FULL   0x00000800
72 #define PRINTER_STATUS_NOT_AVAILABLE     0x00001000
73 #define PRINTER_STATUS_WAITING           0x00002000
74 #define PRINTER_STATUS_PROCESSING        0x00004000
75 #define PRINTER_STATUS_INITIALIZING      0x00008000
76 #define PRINTER_STATUS_WARMING_UP        0x00010000
77 #define PRINTER_STATUS_TONER_LOW         0x00020000
78 #define PRINTER_STATUS_NO_TONER          0x00040000
79 #define PRINTER_STATUS_PAGE_PUNT         0x00080000
80 #define PRINTER_STATUS_USER_INTERVENTION 0x00100000
81 #define PRINTER_STATUS_OUT_OF_MEMORY     0x00200000
82 #define PRINTER_STATUS_DOOR_OPEN         0x00400000
83 #define PRINTER_STATUS_SERVER_UNKNOWN    0x00800000
84 #define PRINTER_STATUS_POWER_SAVE        0x01000000
85
86 /* TYPES */
87 typedef struct _PRINTER_DEFAULTSA {
88   LPSTR        pDatatype;
89   LPDEVMODEA pDevMode;
90   ACCESS_MASK  DesiredAccess;
91 } PRINTER_DEFAULTSA, *LPPRINTER_DEFAULTSA;
92
93 typedef struct _PRINTER_DEFAULTSW {
94   LPWSTR       pDatatype;
95   LPDEVMODEW pDevMode;
96   ACCESS_MASK  DesiredAccess;
97 } PRINTER_DEFAULTSW, *LPPRINTER_DEFAULTSW;
98
99 DECL_WINELIB_TYPE_AW(PRINTER_DEFAULTS)
100 DECL_WINELIB_TYPE_AW(LPPRINTER_DEFAULTS)
101
102 typedef struct _DRIVER_INFO_1A {
103   LPSTR     pName;
104 } DRIVER_INFO_1A, *PDRIVER_INFO_1A, *LPDRIVER_INFO_1A;
105
106 typedef struct _DRIVER_INFO_1W {
107   LPWSTR    pName;
108 } DRIVER_INFO_1W, *PDRIVER_INFO_1W, *LPDRIVER_INFO_1W;
109
110 DECL_WINELIB_TYPE_AW(DRIVER_INFO_1)
111 DECL_WINELIB_TYPE_AW(PDRIVER_INFO_1)
112 DECL_WINELIB_TYPE_AW(LPDRIVER_INFO_1)
113
114 typedef struct _DRIVER_INFO_2A {
115   DWORD   cVersion;
116   LPSTR     pName;
117   LPSTR     pEnvironment;
118   LPSTR     pDriverPath;
119   LPSTR     pDataFile; 
120   LPSTR     pConfigFile;
121 } DRIVER_INFO_2A, *PDRIVER_INFO_2A, *LPDRIVER_INFO_2A;
122
123 typedef struct _DRIVER_INFO_2W {
124   DWORD   cVersion;
125   LPWSTR    pName;     
126   LPWSTR    pEnvironment;
127   LPWSTR    pDriverPath;
128   LPWSTR    pDataFile; 
129   LPWSTR    pConfigFile;
130 } DRIVER_INFO_2W, *PDRIVER_INFO_2W, *LPDRIVER_INFO_2W;
131
132 DECL_WINELIB_TYPE_AW(DRIVER_INFO_2)
133 DECL_WINELIB_TYPE_AW(PDRIVER_INFO_2)
134 DECL_WINELIB_TYPE_AW(LPDRIVER_INFO_2)
135
136 typedef struct _DRIVER_INFO_3A {
137   DWORD cVersion;
138   LPSTR pName;
139   LPSTR pEnvironment;
140   LPSTR pDriverPath;
141   LPSTR pDataFile;
142   LPSTR pConfigFile;
143   LPSTR pHelpFile;
144   LPSTR pDependentFiles;
145   LPSTR pMonitorName;
146   LPSTR pDefaultDataType;
147 } DRIVER_INFO_3A, *PDRIVER_INFO_3A, *LPDRIVER_INFO_3A;
148
149 typedef struct _DRIVER_INFO_3W {
150   DWORD cVersion;
151   LPWSTR pName;
152   LPWSTR pEnvironment;
153   LPWSTR pDriverPath;
154   LPWSTR pDataFile;
155   LPWSTR pConfigFile;
156   LPWSTR pHelpFile;
157   LPWSTR pDependentFiles;
158   LPWSTR pMonitorName;
159   LPWSTR pDefaultDataType;
160 } DRIVER_INFO_3W, *PDRIVER_INFO_3W, *LPDRIVER_INFO_3W;
161
162 DECL_WINELIB_TYPE_AW(DRIVER_INFO_3)
163 DECL_WINELIB_TYPE_AW(PDRIVER_INFO_3)
164 DECL_WINELIB_TYPE_AW(LPDRIVER_INFO_3)
165
166 typedef struct _PRINTER_INFO_1A {
167   DWORD   Flags;
168   LPSTR   pDescription;
169   LPSTR   pName;
170   LPSTR   pComment;
171 } PRINTER_INFO_1A, *PPRINTER_INFO_1A, *LPPRINTER_INFO_1A;
172
173 typedef struct _PRINTER_INFO_1W {
174   DWORD   Flags;
175   LPWSTR  pDescription;
176   LPWSTR  pName;
177   LPWSTR  pComment;
178 } PRINTER_INFO_1W, *PPRINTER_INFO_1W, *LPPRINTER_INFO_1W;
179
180 DECL_WINELIB_TYPE_AW(PRINTER_INFO_1)
181 DECL_WINELIB_TYPE_AW(PPRINTER_INFO_1)
182 DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_1)
183
184 /* FIXME: winspool.h declares some structure members with the name Status.
185  * unfortunatly <X11/ICE/ICElib.h> #defines Status to the type 'int' 
186  * therfore the following hack */
187 #ifndef Status
188
189 typedef struct _PRINTER_INFO_2A {
190   LPSTR     pServerName;
191   LPSTR     pPrinterName;
192   LPSTR     pShareName;
193   LPSTR     pPortName;
194   LPSTR     pDriverName;
195   LPSTR     pComment;
196   LPSTR     pLocation;
197   LPDEVMODEA pDevMode;
198   LPSTR     pSepFile;
199   LPSTR     pPrintProcessor;
200   LPSTR     pDatatype;
201   LPSTR     pParameters;
202   PSECURITY_DESCRIPTOR pSecurityDescriptor;
203   DWORD   Attributes;
204   DWORD   Priority;
205   DWORD   DefaultPriority;
206   DWORD   StartTime;
207   DWORD   UntilTime;
208   DWORD   Status;
209   DWORD   cJobs;
210   DWORD   AveragePPM;
211 } PRINTER_INFO_2A, *PPRINTER_INFO_2A, *LPPRINTER_INFO_2A;
212
213 typedef struct _PRINTER_INFO_2W {
214   LPWSTR    pServerName;
215   LPWSTR    pPrinterName;
216   LPWSTR    pShareName;
217   LPWSTR    pPortName;
218   LPWSTR    pDriverName;
219   LPWSTR    pComment;
220   LPWSTR    pLocation;
221   LPDEVMODEW pDevMode;
222   LPWSTR    pSepFile;
223   LPWSTR    pPrintProcessor;
224   LPWSTR    pDatatype;
225   LPWSTR    pParameters;
226   PSECURITY_DESCRIPTOR pSecurityDescriptor;
227   DWORD   Attributes;
228   DWORD   Priority;
229   DWORD   DefaultPriority;
230   DWORD   StartTime;
231   DWORD   UntilTime;
232   DWORD   Status;
233   DWORD   cJobs;
234   DWORD   AveragePPM;
235 } PRINTER_INFO_2W, *PPRINTER_INFO_2W, *LPPRINTER_INFO_2W;
236
237 DECL_WINELIB_TYPE_AW(PRINTER_INFO_2)
238 DECL_WINELIB_TYPE_AW(PPRINTER_INFO_2)
239 DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_2)
240
241 typedef struct _PRINTER_INFO_4A {
242   LPSTR     pPrinterName;
243   LPSTR     pServerName;
244   DWORD     Attributes;
245 } PRINTER_INFO_4A, *PPRINTER_INFO_4A, *LPPRINTER_INFO_4A;
246
247 typedef struct _PRINTER_INFO_4W {
248   LPWSTR     pPrinterName;
249   LPWSTR     pServerName;
250   DWORD     Attributes;
251 } PRINTER_INFO_4W, *PPRINTER_INFO_4W, *LPPRINTER_INFO_4W;
252
253 DECL_WINELIB_TYPE_AW(PRINTER_INFO_4)
254 DECL_WINELIB_TYPE_AW(PPRINTER_INFO_4)
255 DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_4)
256
257 typedef struct _PRINTER_INFO_5A {
258   LPSTR     pPrinterName;
259   LPSTR     pPortName;
260   DWORD     Attributes;
261   DWORD     DeviceNotSelectedTimeOut;
262   DWORD     TransmissionRetryTimeout;
263 } PRINTER_INFO_5A, *PPRINTER_INFO_5A, *LPPRINTER_INFO_5A;
264
265 typedef struct _PRINTER_INFO_5W {
266   LPWSTR    pPrinterName;
267   LPWSTR    pPortName;
268   DWORD     Attributes;
269   DWORD     DeviceNotSelectedTimeOut;
270   DWORD     TransmissionRetryTimeout;
271 } PRINTER_INFO_5W, *PPRINTER_INFO_5W, *LPPRINTER_INFO_5W;
272
273 DECL_WINELIB_TYPE_AW(PRINTER_INFO_5)
274 DECL_WINELIB_TYPE_AW(PPRINTER_INFO_5)
275 DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_5)
276
277 typedef struct _JOB_INFO_1A {
278   DWORD JobID;
279   LPSTR pPrinterName;
280   LPSTR pMachineName;
281   LPSTR pUserName;
282   LPSTR pDocument;
283   LPSTR pDatatype;
284   LPSTR pStatus;
285   DWORD Status;
286   DWORD Priority;
287   DWORD Position;
288   DWORD TotalPages;
289   DWORD PagesPrinted;
290   SYSTEMTIME Submitted;
291 } JOB_INFO_1A, *PJOB_INFO_1A, *LPJOB_INFO_1A;
292
293 typedef struct _JOB_INFO_1W {
294   DWORD JobID;
295   LPWSTR pPrinterName;
296   LPWSTR pMachineName;
297   LPWSTR pUserName;
298   LPWSTR pDocument;
299   LPWSTR pDatatype;
300   LPWSTR pStatus;
301   DWORD Status;
302   DWORD Priority;
303   DWORD Position;
304   DWORD TotalPages;
305   DWORD PagesPrinted;
306   SYSTEMTIME Submitted;
307 } JOB_INFO_1W, *PJOB_INFO_1W, *LPJOB_INFO_1W;
308
309 DECL_WINELIB_TYPE_AW(JOB_INFO_1)
310 DECL_WINELIB_TYPE_AW(PJOB_INFO_1)
311 DECL_WINELIB_TYPE_AW(LPJOB_INFO_1)
312
313 typedef struct _JOB_INFO_2A {
314   DWORD JobID;
315   LPSTR pPrinterName;
316   LPSTR pMachineName;
317   LPSTR pUserName;
318   LPSTR pDocument;
319   LPSTR pNotifyName;
320   LPSTR pDatatype;
321   LPSTR pPrintProcessor;
322   LPSTR pParameters;
323   LPSTR pDriverName;
324   LPDEVMODEA pDevMode;
325   LPSTR pStatus;
326   PSECURITY_DESCRIPTOR pSecurityDescriptor;
327   DWORD Status;
328   DWORD Priority;
329   DWORD Position;
330   DWORD StartTime;
331   DWORD UntilTime;
332   DWORD TotalPages;
333   DWORD Size;
334   SYSTEMTIME Submitted;
335   DWORD Time;
336   DWORD PagesPrinted;
337 } JOB_INFO_2A, *PJOB_INFO_2A, *LPJOB_INFO_2A;
338   
339 typedef struct _JOB_INFO_2W {
340   DWORD JobID;
341   LPWSTR pPrinterName;
342   LPWSTR pMachineName;
343   LPWSTR pUserName;
344   LPWSTR pDocument;
345   LPWSTR pNotifyName;
346   LPWSTR pDatatype;
347   LPWSTR pPrintProcessor;
348   LPWSTR pParameters;
349   LPWSTR pDriverName;
350   LPDEVMODEW pDevMode;
351   LPWSTR pStatus;
352   PSECURITY_DESCRIPTOR pSecurityDescriptor;
353   DWORD Status;
354   DWORD Priority;
355   DWORD Position;
356   DWORD StartTime;
357   DWORD UntilTime;
358   DWORD TotalPages;
359   DWORD Size;
360   SYSTEMTIME Submitted;
361   DWORD Time;
362   DWORD PagesPrinted;
363 } JOB_INFO_2W, *PJOB_INFO_2W, *LPJOB_INFO_2W;
364   
365 DECL_WINELIB_TYPE_AW(JOB_INFO_2)
366 DECL_WINELIB_TYPE_AW(PJOB_INFO_2)
367 DECL_WINELIB_TYPE_AW(LPJOB_INFO_2)
368
369
370 #endif /* Status */
371
372   
373
374 /* DECLARATIONS */
375 INT WINAPI DeviceCapabilitiesA(LPCSTR pDevice,LPCSTR pPort,WORD fwCapability,
376                                LPSTR pOutput, LPDEVMODEA pDevMode);
377 INT WINAPI DeviceCapabilitiesW(LPCWSTR pDevice, LPCWSTR pPort,
378                                WORD fwCapability, LPWSTR pOutput,
379                                const DEVMODEW *pDevMode);
380
381 #define DeviceCapabilities WINELIB_NAME_AW(DeviceCapabilities)
382
383 LONG WINAPI DocumentPropertiesA(HWND hWnd,HANDLE hPrinter,
384                                 LPSTR pDeviceName, LPDEVMODEA pDevModeOutput,
385                                   LPDEVMODEA pDevModeInput,DWORD fMode );
386 LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
387                                   LPWSTR pDeviceName,
388                                   LPDEVMODEW pDevModeOutput,
389                                   LPDEVMODEW pDevModeInput, DWORD fMode);
390
391 #define DocumentProperties WINELIB_NAME_AW(DocumentProperties)
392
393 BOOL WINAPI OpenPrinterA(LPSTR lpPrinterName,HANDLE *phPrinter,
394                              LPPRINTER_DEFAULTSA pDefault);
395 BOOL WINAPI OpenPrinterW(LPWSTR lpPrinterName,HANDLE *phPrinter,
396                              LPPRINTER_DEFAULTSW pDefault);
397
398 #define OpenPrinter WINELIB_NAME_AW(OpenPrinter)
399
400 BOOL WINAPI ClosePrinter (HANDLE phPrinter);
401
402 BOOL WINAPI EnumJobsA(HANDLE hPrinter, DWORD FirstJob, DWORD NoJobs,
403                       DWORD Level, LPBYTE pJob, DWORD cbBuf, LPDWORD pcbNeeded,
404                       LPDWORD pcReturned);
405 BOOL WINAPI EnumJobsW(HANDLE hPrinter, DWORD FirstJob, DWORD NoJobs,
406                       DWORD Level, LPBYTE pJob, DWORD cbBuf, LPDWORD pcbNeeded,
407                       LPDWORD pcReturned);
408 #define EnumJobs WINELIB_NAME_AW(EnumJobs)
409
410 BOOL  WINAPI EnumPrintersA(DWORD dwType, LPSTR lpszName,
411                                DWORD dwLevel, LPBYTE lpbPrinters,
412                                DWORD cbBuf, LPDWORD lpdwNeeded,
413                                LPDWORD lpdwReturned);
414 BOOL  WINAPI EnumPrintersW(DWORD dwType, LPWSTR lpszName,
415                                DWORD dwLevel, LPBYTE lpbPrinters,
416                                DWORD cbBuf, LPDWORD lpdwNeeded,
417                                LPDWORD lpdwReturned);
418 #define EnumPrinters WINELIB_NAME_AW(EnumPrinters)
419
420 BOOL WINAPI PrinterProperties(HWND hWnd, HANDLE hPrinter);
421
422 BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR,LPSTR,DWORD,LPBYTE,DWORD,LPDWORD);
423 BOOL WINAPI GetPrinterDriverDirectoryW(LPWSTR,LPWSTR,DWORD,LPBYTE,DWORD,LPDWORD);
424 #define GetPrinterDriverDirectory WINELIB_NAME_AW(GetPrinterDriverDirectory)
425
426 BOOL WINAPI GetPrinterDriverA(HANDLE hPrinter, LPSTR pEnvironment,
427                               DWORD Level, LPBYTE pDriverInfo,
428                               DWORD cbBuf, LPDWORD pcbNeeded);
429 BOOL WINAPI GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment,
430                               DWORD Level, LPBYTE pDriverInfo,
431                               DWORD cbBuf, LPDWORD pcbNeeded);
432 #define GetPrinterDriver WINELIB_NAME_AW(GetPrinterDriver)
433
434 #ifdef __cplusplus
435 } /* extern "C" */
436 #endif
437
438 #endif  /* __WINE_WINSPOOL_H */
439