Added print job substitutions for %{printername}, %{sharename} and %{portname}
[nivanova/samba-autobuild/.git] / source3 / include / nt_printing.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell              1992-2000,
6    Copyright (C) Jean Francois Micouleau      1998-2000.
7    
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 #ifndef NT_PRINTING_H_
24 #define NT_PRINTING_H_
25
26 #define ORIENTATION      0x00000001L
27 #define PAPERSIZE        0x00000002L
28 #define PAPERLENGTH      0x00000004L
29 #define PAPERWIDTH       0x00000008L
30 #define SCALE            0x00000010L
31 #define COPIES           0x00000100L
32 #define DEFAULTSOURCE    0x00000200L
33 #define PRINTQUALITY     0x00000400L
34 #define COLOR            0x00000800L
35 #define DUPLEX           0x00001000L
36 #define YRESOLUTION      0x00002000L
37 #define TTOPTION         0x00004000L
38 #define COLLATE          0x00008000L
39 #define FORMNAME         0x00010000L
40 #define LOGPIXELS        0x00020000L
41 #define BITSPERPEL       0x00040000L
42 #define PELSWIDTH        0x00080000L
43 #define PELSHEIGHT       0x00100000L
44 #define DISPLAYFLAGS     0x00200000L
45 #define DISPLAYFREQUENCY 0x00400000L
46 #define PANNINGWIDTH     0x00800000L
47 #define PANNINGHEIGHT    0x01000000L
48
49 #define ORIENT_PORTRAIT   1
50 #define ORIENT_LANDSCAPE  2
51
52 #define PAPER_FIRST                PAPER_LETTER
53 #define PAPER_LETTER               1  /* Letter 8 1/2 x 11 in               */
54 #define PAPER_LETTERSMALL          2  /* Letter Small 8 1/2 x 11 in         */
55 #define PAPER_TABLOID              3  /* Tabloid 11 x 17 in                 */
56 #define PAPER_LEDGER               4  /* Ledger 17 x 11 in                  */
57 #define PAPER_LEGAL                5  /* Legal 8 1/2 x 14 in                */
58 #define PAPER_STATEMENT            6  /* Statement 5 1/2 x 8 1/2 in         */
59 #define PAPER_EXECUTIVE            7  /* Executive 7 1/4 x 10 1/2 in        */
60 #define PAPER_A3                   8  /* A3 297 x 420 mm                    */
61 #define PAPER_A4                   9  /* A4 210 x 297 mm                    */
62 #define PAPER_A4SMALL             10  /* A4 Small 210 x 297 mm              */
63 #define PAPER_A5                  11  /* A5 148 x 210 mm                    */
64 #define PAPER_B4                  12  /* B4 (JIS) 250 x 354                 */
65 #define PAPER_B5                  13  /* B5 (JIS) 182 x 257 mm              */
66 #define PAPER_FOLIO               14  /* Folio 8 1/2 x 13 in                */
67 #define PAPER_QUARTO              15  /* Quarto 215 x 275 mm                */
68 #define PAPER_10X14               16  /* 10x14 in                           */
69 #define PAPER_11X17               17  /* 11x17 in                           */
70 #define PAPER_NOTE                18  /* Note 8 1/2 x 11 in                 */
71 #define PAPER_ENV_9               19  /* Envelope #9 3 7/8 x 8 7/8          */
72 #define PAPER_ENV_10              20  /* Envelope #10 4 1/8 x 9 1/2         */
73 #define PAPER_ENV_11              21  /* Envelope #11 4 1/2 x 10 3/8        */
74 #define PAPER_ENV_12              22  /* Envelope #12 4 \276 x 11           */
75 #define PAPER_ENV_14              23  /* Envelope #14 5 x 11 1/2            */
76 #define PAPER_CSHEET              24  /* C size sheet                       */
77 #define PAPER_DSHEET              25  /* D size sheet                       */
78 #define PAPER_ESHEET              26  /* E size sheet                       */
79 #define PAPER_ENV_DL              27  /* Envelope DL 110 x 220mm            */
80 #define PAPER_ENV_C5              28  /* Envelope C5 162 x 229 mm           */
81 #define PAPER_ENV_C3              29  /* Envelope C3  324 x 458 mm          */
82 #define PAPER_ENV_C4              30  /* Envelope C4  229 x 324 mm          */
83 #define PAPER_ENV_C6              31  /* Envelope C6  114 x 162 mm          */
84 #define PAPER_ENV_C65             32  /* Envelope C65 114 x 229 mm          */
85 #define PAPER_ENV_B4              33  /* Envelope B4  250 x 353 mm          */
86 #define PAPER_ENV_B5              34  /* Envelope B5  176 x 250 mm          */
87 #define PAPER_ENV_B6              35  /* Envelope B6  176 x 125 mm          */
88 #define PAPER_ENV_ITALY           36  /* Envelope 110 x 230 mm              */
89 #define PAPER_ENV_MONARCH         37  /* Envelope Monarch 3.875 x 7.5 in    */
90 #define PAPER_ENV_PERSONAL        38  /* 6 3/4 Envelope 3 5/8 x 6 1/2 in    */
91 #define PAPER_FANFOLD_US          39  /* US Std Fanfold 14 7/8 x 11 in      */
92 #define PAPER_FANFOLD_STD_GERMAN  40  /* German Std Fanfold 8 1/2 x 12 in   */
93 #define PAPER_FANFOLD_LGL_GERMAN  41  /* German Legal Fanfold 8 1/2 x 13 in */
94
95 #define PAPER_LAST                PAPER_FANFOLD_LGL_GERMAN
96 #define PAPER_USER                256
97
98 #define BIN_FIRST         BIN_UPPER
99 #define BIN_UPPER         1
100 #define BIN_ONLYONE       1
101 #define BIN_LOWER         2
102 #define BIN_MIDDLE        3
103 #define BIN_MANUAL        4
104 #define BIN_ENVELOPE      5
105 #define BIN_ENVMANUAL     6
106 #define BIN_AUTO          7
107 #define BIN_TRACTOR       8
108 #define BIN_SMALLFMT      9
109 #define BIN_LARGEFMT      10
110 #define BIN_LARGECAPACITY 11
111 #define BIN_CASSETTE      14
112 #define BIN_FORMSOURCE    15
113 #define BIN_LAST          BIN_FORMSOURCE
114
115 #define BIN_USER          256     /* device specific bins start here */
116
117 #define RES_DRAFT         (-1)
118 #define RES_LOW           (-2)
119 #define RES_MEDIUM        (-3)
120 #define RES_HIGH          (-4)
121
122 #define COLOR_MONOCHROME  1
123 #define COLOR_COLOR       2
124
125 #define DUP_SIMPLEX    1
126 #define DUP_VERTICAL   2
127 #define DUP_HORIZONTAL 3
128
129 #define TT_BITMAP     1       /* print TT fonts as graphics */
130 #define TT_DOWNLOAD   2       /* download TT fonts as soft fonts */
131 #define TT_SUBDEV     3       /* substitute device fonts for TT fonts */
132
133 #define COLLATE_FALSE  0
134 #define COLLATE_TRUE   1
135
136 typedef struct nt_printer_driver_info_level_3
137 {
138         uint32 cversion;
139
140         fstring name;
141         fstring environment;
142         fstring driverpath;
143         fstring datafile;
144         fstring configfile;
145         fstring helpfile;
146         fstring monitorname;
147         fstring defaultdatatype;
148         fstring *dependentfiles;
149 } NT_PRINTER_DRIVER_INFO_LEVEL_3;
150
151 /* SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 structure */
152 typedef struct {
153         uint32  version;
154         fstring name;
155         fstring environment;
156         fstring driverpath;
157         fstring datafile;
158         fstring configfile;
159         fstring helpfile;
160         fstring monitorname;
161         fstring defaultdatatype;
162         fstring mfgname;
163         fstring oemurl;
164         fstring hardwareid;
165         fstring provider;
166         fstring *dependentfiles;
167         fstring *previousnames;
168 } NT_PRINTER_DRIVER_INFO_LEVEL_6;
169
170
171 typedef struct nt_printer_driver_info_level
172 {
173         NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
174         NT_PRINTER_DRIVER_INFO_LEVEL_6 *info_6;
175 } NT_PRINTER_DRIVER_INFO_LEVEL;
176
177 typedef struct nt_printer_param
178 {
179         fstring value;
180         uint32 type;
181         uint8 *data;
182         int data_len;
183         struct nt_printer_param *next;
184 } NT_PRINTER_PARAM;
185
186 typedef struct ntdevicemode
187 {
188         fstring devicename;
189         fstring formname;
190
191         uint16  specversion;
192         uint16  driverversion;
193         uint16  size;
194         uint16  driverextra;
195         uint16  orientation;
196         uint16  papersize;
197         uint16  paperlength;
198         uint16  paperwidth;
199         uint16  scale;
200         uint16  copies;
201         uint16  defaultsource;
202         uint16  printquality;
203         uint16  color;
204         uint16  duplex;
205         uint16  yresolution;
206         uint16  ttoption;
207         uint16  collate;
208         uint16  logpixels;
209
210         uint32  fields;
211         uint32  bitsperpel;
212         uint32  pelswidth;
213         uint32  pelsheight;
214         uint32  displayflags;
215         uint32  displayfrequency;
216         uint32  icmmethod;
217         uint32  icmintent;
218         uint32  mediatype;
219         uint32  dithertype;
220         uint32  reserved1;
221         uint32  reserved2;
222         uint32  panningwidth;
223         uint32  panningheight;
224         uint8   *private;
225 } NT_DEVICEMODE; 
226
227 typedef struct nt_printer_info_level_2
228 {
229         uint32 attributes;
230         uint32 priority;
231         uint32 default_priority;
232         uint32 starttime;
233         uint32 untiltime;
234         uint32 status;
235         uint32 cjobs;
236         uint32 averageppm;
237         fstring servername;
238         fstring printername;
239         fstring sharename;
240         fstring portname;
241         fstring drivername;
242         pstring comment;
243         fstring location;
244         NT_DEVICEMODE *devmode;
245         fstring sepfile;
246         fstring printprocessor;
247         fstring datatype;
248         fstring parameters;
249         NT_PRINTER_PARAM *specific;
250         SEC_DESC_BUF *secdesc_buf;
251         /* not used but ... and how ??? */
252         uint32 changeid;
253         uint32 c_setprinter;
254         uint32 setuptime;       
255 } NT_PRINTER_INFO_LEVEL_2;
256
257 typedef struct nt_printer_info_level
258 {
259         NT_PRINTER_INFO_LEVEL_2 *info_2;
260 } NT_PRINTER_INFO_LEVEL;
261
262 typedef struct
263 {
264         fstring name;
265         uint32 flag;
266         uint32 width;
267         uint32 length;
268         uint32 left;
269         uint32 top;
270         uint32 right;
271         uint32 bottom;
272 } nt_forms_struct;
273
274 /*
275 typedef struct _form
276 {
277        uint32 flags;
278        uint32 name_ptr;
279        uint32 size_x;
280        uint32 size_y;
281        uint32 left;
282        uint32 top;
283        uint32 right;
284        uint32 bottom;
285        UNISTR2 name;
286 } FORM;
287 */
288
289 #ifndef SAMBA_PRINTER_PORT_NAME
290 #define SAMBA_PRINTER_PORT_NAME "Samba Printer Port"
291 #endif 
292
293 #endif /* NT_PRINTING_H_ */