1926f1247SMichael Pfeiffer// Sun, 18 Jun 2000
2926f1247SMichael Pfeiffer// Y.Takagi
3926f1247SMichael Pfeiffer
4926f1247SMichael Pfeiffer#ifndef __IppContent_H
5926f1247SMichael Pfeiffer#define __IppContent_H
6926f1247SMichael Pfeiffer
76b376d60SOliver Tappe#include <iostream>
8926f1247SMichael Pfeiffer#include <list>
9926f1247SMichael Pfeiffer#include <string>
10926f1247SMichael Pfeiffer
11926f1247SMichael Pfeiffer#if (!__MWERKS__)
12926f1247SMichael Pfeifferusing namespace std;
13926f1247SMichael Pfeiffer#else
14926f1247SMichael Pfeiffer#define std
15926f1247SMichael Pfeiffer#endif
16926f1247SMichael Pfeiffer
17926f1247SMichael Pfeifferenum IPP_OPERATION_ID {
18926f1247SMichael Pfeiffer
19926f1247SMichael Pfeiffer	/* reserved, not used: 0x0000 */
20926f1247SMichael Pfeiffer	/* reserved, not used: 0x0001 */
21926f1247SMichael Pfeiffer
22926f1247SMichael Pfeiffer	IPP_PRINT_JOB				= 0x0002,	// printer operation
23926f1247SMichael Pfeiffer	IPP_PRINT_URI				= 0x0003,	// printer operation
24926f1247SMichael Pfeiffer	IPP_VALIDATE_JOB			= 0x0004,	// printer operation
25926f1247SMichael Pfeiffer	IPP_CREATE_JOB				= 0x0005,	// printer operation
26926f1247SMichael Pfeiffer
27926f1247SMichael Pfeiffer	IPP_SEND_DOCUMENT			= 0x0006,	// job operation
28926f1247SMichael Pfeiffer	IPP_SEND_URI				= 0x0007,	// job operation
29926f1247SMichael Pfeiffer	IPP_CANCEL_JOB				= 0x0008,	// job operation
30926f1247SMichael Pfeiffer	IPP_GET_JOB_ATTRIBUTES		= 0x0009,	// job operation
31926f1247SMichael Pfeiffer
32926f1247SMichael Pfeiffer	IPP_GET_JOBS				= 0x000A,	// printer operation
33926f1247SMichael Pfeiffer	IPP_GET_PRINTER_ATTRIBUTES	= 0x000B	// printer operation
34926f1247SMichael Pfeiffer
35926f1247SMichael Pfeiffer	/* reserved for future operations: 0x000C-0x3FFF */
36926f1247SMichael Pfeiffer	/* reserved for private extensions: 0x4000-0x8FFF */
37926f1247SMichael Pfeiffer};
38926f1247SMichael Pfeiffer
39926f1247SMichael Pfeifferenum IPP_STATUS_CODE {
40926f1247SMichael Pfeiffer
41926f1247SMichael Pfeiffer	IPP_SUCCESSFUL_OK_S									= 0x0000,	// successful
42926f1247SMichael Pfeiffer	IPP_SUCCESSFUL_OK									= 0x0000,	// successful
43926f1247SMichael Pfeiffer	IPP_SUCCESSFUL_OK_IGNORED_OR_SUBSTITUTED_ATTRIBUTES	= 0x0001,	// successful
44926f1247SMichael Pfeiffer	IPP_SUCCESSFUL_OK_CONFLICTING_ATTRIBUTES			= 0x0002,	// successful
45926f1247SMichael Pfeiffer	IPP_SUCCESSFUL_OK_E									= 0x00FF,	// successful
46926f1247SMichael Pfeiffer
47926f1247SMichael Pfeiffer	IPP_INFORMATIONAL_S									= 0x0100,	// informational
48926f1247SMichael Pfeiffer	IPP_INFORMATIONAL_E									= 0x01FF,	// informational
49926f1247SMichael Pfeiffer
50926f1247SMichael Pfeiffer	IPP_REDIRECTION_S									= 0x0200,	// redirection
51926f1247SMichael Pfeiffer	IPP_REDIRECTION_SE									= 0x02FF,	// redirection
52926f1247SMichael Pfeiffer
53926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_S									= 0x0400,	// client-error
54926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_BAD_REQUEST						= 0x0400,	// client-error
55926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_FORBIDDEN							= 0x0401,	// client-error
56926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_NOT_AUTHENTICATED					= 0x0402,	// client-error
57926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_NOT_AUTHORIZED						= 0x0403,	// client-error
58926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_NOT_POSSIBLE						= 0x0404,	// client-error
59926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_TIMEOUT							= 0x0405,	// client-error
60926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_NOT_FOUND							= 0x0406,	// client-error
61926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_GONE								= 0x0407,	// client-error
62926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE			= 0x0408,	// client-error
63926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_REQUEST_VALUE_TOO_LONG				= 0x0409,	// client-error
64926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED		= 0x040A,	// client-error
65926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_ATTRIBUTES_OR_VALUES_NOT_SUPPORTED	= 0x040B,	// client-error
66926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_URI_SCHEME_NOT_SUPPORTED			= 0x040C,	// client-error
67926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_CHARSET_NOT_SUPPORTED				= 0x040D,	// client-error
68926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_CONFLICTING_ATTRIBUTES				= 0x040E,	// client-error
69926f1247SMichael Pfeiffer	IPP_CLIENT_ERROR_E									= 0x04FF,	// client-error
70926f1247SMichael Pfeiffer
71926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_S									= 0x0500,	// server-error
72926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_INTERNAL_ERROR						= 0x0500,	// server-error
73926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_OPERATION_NOT_SUPPORTED			= 0x0501,	// server-error
74926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_SERVICE_UNAVAILABLE				= 0x0502,	// server-error
75926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_VERSION_NOT_SUPPORTED				= 0x0503,	// server-error
76926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_DEVICE_ERROR						= 0x0504,	// server-error
77926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_TEMPORARY_ERROR					= 0x0505,	// server-error
78926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_NOT_ACCEPTING_JOBS					= 0x0506,	// server-error
79926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_BUSY								= 0x0507,	// server-error
80926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_JOB_CANCELED						= 0x0508,	// server-error
81926f1247SMichael Pfeiffer	IPP_SERVER_ERROR_E									= 0x05FF	// server-error
82926f1247SMichael Pfeiffer};
83926f1247SMichael Pfeiffer
84926f1247SMichael Pfeifferenum IPP_TAG {
85926f1247SMichael Pfeiffer	/* reserved: 0x00 */
86926f1247SMichael Pfeiffer	IPP_OPERATION_ATTRIBUTES_TAG	= 0x01,
87926f1247SMichael Pfeiffer	IPP_JOB_ATTRIBUTES_TAG			= 0x02,
88926f1247SMichael Pfeiffer	IPP_END_OF_ATTRIBUTES_TAG		= 0x03,
89926f1247SMichael Pfeiffer	IPP_PRINTER_ATTRIBUTES_TAG		= 0x04,
90926f1247SMichael Pfeiffer	IPP_UNSUPPORTED_ATTRIBUTES_TAG	= 0x05,
91926f1247SMichael Pfeiffer	/* reserved for future delimiters: 0x06-0x0e */
92926f1247SMichael Pfeiffer	/* reserved for future chunking-end-of-attributes-tag: 0x0F */
93926f1247SMichael Pfeiffer
94926f1247SMichael Pfeiffer	IPP_UNSUPPORTED					= 0x10,
95926f1247SMichael Pfeiffer	/* reserved for future 'default': 0x11 */
96926f1247SMichael Pfeiffer	IPP_UNKNOWN						= 0x12,
97926f1247SMichael Pfeiffer	IPP_NO_VALUE					= 0x13,
98926f1247SMichael Pfeiffer	/* reserved for future "out-of-band" values: 0x14-0x1F */
99926f1247SMichael Pfeiffer	/* reserved: 0x20 */
100926f1247SMichael Pfeiffer	IPP_INTEGER						= 0x21,
101926f1247SMichael Pfeiffer	IPP_BOOLEAN						= 0x22,
102926f1247SMichael Pfeiffer	IPP_ENUM						= 0x23,
103926f1247SMichael Pfeiffer	/* reserved for future integer types: 0x24-0x2F */
104926f1247SMichael Pfeiffer	IPP_STRING						= 0x30,
105926f1247SMichael Pfeiffer	IPP_DATETIME					= 0x31,
106926f1247SMichael Pfeiffer	IPP_RESOLUTION					= 0x32,
107926f1247SMichael Pfeiffer	IPP_RANGE_OF_INTEGER			= 0x33,
108926f1247SMichael Pfeiffer	/* reserved for collection (in the future): 0x34 */
109926f1247SMichael Pfeiffer	IPP_TEXT_WITH_LANGUAGE			= 0x35,
110926f1247SMichael Pfeiffer	IPP_NAME_WITH_LANGUAGE			= 0x36,
111926f1247SMichael Pfeiffer	/* reserved for future octetString types: 0x37-0x3F */
112926f1247SMichael Pfeiffer	/* reserved: 0x40 */
113926f1247SMichael Pfeiffer	IPP_TEXT_WITHOUT_LANGUAGE		= 0x41,
114926f1247SMichael Pfeiffer	IPP_NAME_WITHOUT_LANGUAGE		= 0x42,
115926f1247SMichael Pfeiffer	/* reserved: 0x43 */
116926f1247SMichael Pfeiffer	IPP_KEYWORD						= 0x44,
117926f1247SMichael Pfeiffer	IPP_URI							= 0x45,
118926f1247SMichael Pfeiffer	IPP_URISCHEME					= 0x46,
119926f1247SMichael Pfeiffer	IPP_CHARSET						= 0x47,
120926f1247SMichael Pfeiffer	IPP_NATURAL_LANGUAGE			= 0x48,
121926f1247SMichael Pfeiffer	IPP_MIME_MEDIA_TYPE				= 0x49
122926f1247SMichael Pfeiffer	/* reserved for future character string types: 0x4A-0x5F */
123926f1247SMichael Pfeiffer};
124926f1247SMichael Pfeiffer
125926f1247SMichael Pfeifferenum IPP_RESOLUTION_UNITS {
126926f1247SMichael Pfeiffer	IPP_DOTS_PER_INCH		= 3,
127926f1247SMichael Pfeiffer	IPP_DOTS_PER_CENTIMETER	= 4
128926f1247SMichael Pfeiffer};
129926f1247SMichael Pfeiffer
130926f1247SMichael Pfeifferenum IPP_FINISHINGS {
131926f1247SMichael Pfeiffer	IPP_NONE	= 3,
132926f1247SMichael Pfeiffer	IPP_STAPLE	= 4,
133926f1247SMichael Pfeiffer	IPP_PUNCH	= 5,
134926f1247SMichael Pfeiffer	IPP_COVER	= 6,
135926f1247SMichael Pfeiffer	IPP_BIND	= 7
136926f1247SMichael Pfeiffer};
137926f1247SMichael Pfeiffer
138926f1247SMichael Pfeifferenum IPP_ORIENTATION_REQUESTED {
139926f1247SMichael Pfeiffer	IPP_PORTRAIT			= 3,
140926f1247SMichael Pfeiffer	IPP_LANDSCAPE			= 4,
141926f1247SMichael Pfeiffer	IPP_REVERSE_LANDSCAPE	= 5,
142926f1247SMichael Pfeiffer	IPP_REVERSE_PORTRAIT	= 6
143926f1247SMichael Pfeiffer};
144926f1247SMichael Pfeiffer
145926f1247SMichael Pfeifferenum IPP_PRINT_QUALITY {
146926f1247SMichael Pfeiffer	IPP_DRAFT	= 3,
147926f1247SMichael Pfeiffer	IPP_NORMAL	= 4,
148926f1247SMichael Pfeiffer	IPP_HIGH	= 5
149926f1247SMichael Pfeiffer};
150926f1247SMichael Pfeiffer
151926f1247SMichael Pfeifferenum IPP_JOB_STATE {
152926f1247SMichael Pfeiffer	IPP_JOB_STATE_PENDING			= 3,
153926f1247SMichael Pfeiffer	IPP_JOB_STATE_PENDING_HELD		= 4,
154926f1247SMichael Pfeiffer	IPP_JOB_STATE_PROCESSING		= 5,
155926f1247SMichael Pfeiffer	IPP_JOB_STATE_PROCESSING_STOPPED= 6,
156926f1247SMichael Pfeiffer	IPP_JOB_STATE_CANCELED			= 7,
157926f1247SMichael Pfeiffer	IPP_JOB_STATE_ABORTED			= 8,
158926f1247SMichael Pfeiffer	IPP_JOB_STATE_COMPLETED			= 9
159926f1247SMichael Pfeiffer};
160926f1247SMichael Pfeiffer
161926f1247SMichael Pfeifferenum IPP_PRINTER_STATE {
162926f1247SMichael Pfeiffer	IPP_PRINTER_STATEIDLE		= 3,
163926f1247SMichael Pfeiffer	IPP_PRINTER_STATEPROCESSING	= 4,
164926f1247SMichael Pfeiffer	IPP_PRINTER_STATESTOPPED	= 5
165926f1247SMichael Pfeiffer};
166926f1247SMichael Pfeiffer
167926f1247SMichael Pfeiffer
168926f1247SMichael Pfeifferclass IppAttribute {
169926f1247SMichael Pfeifferpublic:
170926f1247SMichael Pfeiffer	IppAttribute(IPP_TAG);
171926f1247SMichael Pfeiffer	virtual ~IppAttribute() {}
172926f1247SMichael Pfeiffer	virtual int length() const;
173926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
174926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
175926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
176926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppAttribute &attr)
177926f1247SMichael Pfeiffer	{
178926f1247SMichael Pfeiffer		return attr.input(is);
179926f1247SMichael Pfeiffer	}
180926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppAttribute &attr)
181926f1247SMichael Pfeiffer	{
182926f1247SMichael Pfeiffer		return attr.output(os);
183926f1247SMichael Pfeiffer	}
184926f1247SMichael Pfeiffer
185926f1247SMichael Pfeiffer	IPP_TAG tag;
186926f1247SMichael Pfeiffer};
187926f1247SMichael Pfeiffer
188926f1247SMichael Pfeifferclass IppNamedAttribute : public IppAttribute {
189926f1247SMichael Pfeifferpublic:
190926f1247SMichael Pfeiffer	IppNamedAttribute(IPP_TAG t);
191926f1247SMichael Pfeiffer	IppNamedAttribute(IPP_TAG t, const char *n);
192926f1247SMichael Pfeiffer	virtual ~IppNamedAttribute() {}
193926f1247SMichael Pfeiffer	virtual int length() const;
194926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
195926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
196926f1247SMichael Pfeiffer	string name;
197926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppNamedAttribute &attr)
198926f1247SMichael Pfeiffer	{
199926f1247SMichael Pfeiffer		return attr.input(is);
200926f1247SMichael Pfeiffer	}
201926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppNamedAttribute &attr)
202926f1247SMichael Pfeiffer	{
203926f1247SMichael Pfeiffer		return attr.output(os);
204926f1247SMichael Pfeiffer	}
205926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
206926f1247SMichael Pfeiffer};
207926f1247SMichael Pfeiffer
208926f1247SMichael Pfeifferclass IppNoValueAttribute : public IppNamedAttribute {
209926f1247SMichael Pfeifferpublic:
210926f1247SMichael Pfeiffer	IppNoValueAttribute(IPP_TAG t);
211926f1247SMichael Pfeiffer	IppNoValueAttribute(IPP_TAG t, const char *n);
212926f1247SMichael Pfeiffer	virtual ~IppNoValueAttribute() {}
213926f1247SMichael Pfeiffer	virtual int length() const;
214926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
215926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
216926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
217926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppNoValueAttribute &attr)
218926f1247SMichael Pfeiffer	{
219926f1247SMichael Pfeiffer		return attr.input(is);
220926f1247SMichael Pfeiffer	}
221926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppNoValueAttribute &attr)
222926f1247SMichael Pfeiffer	{
223926f1247SMichael Pfeiffer		return attr.output(os);
224926f1247SMichael Pfeiffer	}
225926f1247SMichael Pfeiffer};
226926f1247SMichael Pfeiffer
227926f1247SMichael Pfeifferclass IppBooleanAttribute : public IppNamedAttribute {
228926f1247SMichael Pfeifferpublic:
229926f1247SMichael Pfeiffer	IppBooleanAttribute(IPP_TAG t);
230926f1247SMichael Pfeiffer	IppBooleanAttribute(IPP_TAG t, const char *n, bool f);
231926f1247SMichael Pfeiffer	virtual ~IppBooleanAttribute() {}
232926f1247SMichael Pfeiffer	virtual int length() const;
233926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
234926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
235926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
236926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppBooleanAttribute &attr)
237926f1247SMichael Pfeiffer	{
238926f1247SMichael Pfeiffer		return attr.input(is);
239926f1247SMichael Pfeiffer	}
240926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppBooleanAttribute &attr)
241926f1247SMichael Pfeiffer	{
242926f1247SMichael Pfeiffer		return attr.output(os);
243926f1247SMichael Pfeiffer	}
244926f1247SMichael Pfeiffer
245926f1247SMichael Pfeiffer	bool value;
246926f1247SMichael Pfeiffer};
247926f1247SMichael Pfeiffer
248926f1247SMichael Pfeifferclass IppIntegerAttribute : public IppNamedAttribute {
249926f1247SMichael Pfeifferpublic:
250926f1247SMichael Pfeiffer	IppIntegerAttribute(IPP_TAG t);
251926f1247SMichael Pfeiffer	IppIntegerAttribute(IPP_TAG t, const char *n, int v);
252926f1247SMichael Pfeiffer	virtual ~IppIntegerAttribute() {}
253926f1247SMichael Pfeiffer	virtual int length() const;
254926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
255926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
256926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
257926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppIntegerAttribute &attr)
258926f1247SMichael Pfeiffer	{
259926f1247SMichael Pfeiffer		return attr.input(is);
260926f1247SMichael Pfeiffer	}
261926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppIntegerAttribute &attr)
262926f1247SMichael Pfeiffer	{
263926f1247SMichael Pfeiffer		return attr.output(os);
264926f1247SMichael Pfeiffer	}
265926f1247SMichael Pfeiffer
266926f1247SMichael Pfeiffer	long value;
267926f1247SMichael Pfeiffer};
268926f1247SMichael Pfeiffer
269926f1247SMichael Pfeifferclass DATETIME {
270926f1247SMichael Pfeifferpublic:
271926f1247SMichael Pfeiffer	DATETIME();
272926f1247SMichael Pfeiffer	DATETIME(const DATETIME &);
273926f1247SMichael Pfeiffer	DATETIME & operator = (const DATETIME &);
274926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, DATETIME &attr);
275926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const DATETIME &attr);
276926f1247SMichael Pfeiffer
277926f1247SMichael Pfeiffer	unsigned char datetime[11];
278926f1247SMichael Pfeiffer};
279926f1247SMichael Pfeiffer
280926f1247SMichael Pfeifferclass IppDatetimeAttribute : public IppNamedAttribute {
281926f1247SMichael Pfeifferpublic:
282926f1247SMichael Pfeiffer	IppDatetimeAttribute(IPP_TAG t);
283926f1247SMichael Pfeiffer	IppDatetimeAttribute(IPP_TAG t, const char *n, const DATETIME *dt);
284926f1247SMichael Pfeiffer	virtual ~IppDatetimeAttribute() {}
285926f1247SMichael Pfeiffer	virtual int length() const;
286926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
287926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
288926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
289926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppDatetimeAttribute &attr)
290926f1247SMichael Pfeiffer	{
291926f1247SMichael Pfeiffer		return attr.input(is);
292926f1247SMichael Pfeiffer	}
293926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppDatetimeAttribute &attr)
294926f1247SMichael Pfeiffer	{
295926f1247SMichael Pfeiffer		return attr.output(os);
296926f1247SMichael Pfeiffer	}
297926f1247SMichael Pfeiffer
298926f1247SMichael Pfeiffer	DATETIME datetime;
299926f1247SMichael Pfeiffer};
300926f1247SMichael Pfeiffer
301926f1247SMichael Pfeifferclass IppStringAttribute : public IppNamedAttribute {
302926f1247SMichael Pfeifferpublic:
303926f1247SMichael Pfeiffer	IppStringAttribute(IPP_TAG t);
304926f1247SMichael Pfeiffer	IppStringAttribute(IPP_TAG t, const char *s, const char *s1);
305926f1247SMichael Pfeiffer	virtual ~IppStringAttribute() {}
306926f1247SMichael Pfeiffer	virtual int length() const;
307926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
308926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
309926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
310926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppStringAttribute &attr)
311926f1247SMichael Pfeiffer	{
312926f1247SMichael Pfeiffer		return attr.input(is);
313926f1247SMichael Pfeiffer	}
314926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppStringAttribute &attr)
315926f1247SMichael Pfeiffer	{
316926f1247SMichael Pfeiffer		return attr.output(os);
317926f1247SMichael Pfeiffer	}
318926f1247SMichael Pfeiffer
319926f1247SMichael Pfeiffer	string text;
320926f1247SMichael Pfeiffer};
321926f1247SMichael Pfeiffer
322926f1247SMichael Pfeifferclass IppDoubleStringAttribute : public IppNamedAttribute {
323926f1247SMichael Pfeifferpublic:
324926f1247SMichael Pfeiffer	IppDoubleStringAttribute(IPP_TAG t);
325926f1247SMichael Pfeiffer	IppDoubleStringAttribute(IPP_TAG t, const char *n, const char *s1, const char *s2);
326926f1247SMichael Pfeiffer	virtual ~IppDoubleStringAttribute() {}
327926f1247SMichael Pfeiffer	virtual int length() const;
328926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
329926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
330926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppDoubleStringAttribute &attr)
331926f1247SMichael Pfeiffer	{
332926f1247SMichael Pfeiffer		return attr.input(is);
333926f1247SMichael Pfeiffer	}
334926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppDoubleStringAttribute &attr)
335926f1247SMichael Pfeiffer	{
336926f1247SMichael Pfeiffer		return attr.output(os);
337926f1247SMichael Pfeiffer	}
338926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
339926f1247SMichael Pfeiffer
340926f1247SMichael Pfeiffer	string text1;
341926f1247SMichael Pfeiffer	string text2;
342926f1247SMichael Pfeiffer};
343926f1247SMichael Pfeiffer
344926f1247SMichael Pfeifferclass IppResolutionAttribute : public IppNamedAttribute {
345926f1247SMichael Pfeifferpublic:
346926f1247SMichael Pfeiffer	IppResolutionAttribute(IPP_TAG t);
347926f1247SMichael Pfeiffer	IppResolutionAttribute(IPP_TAG t, const char *n, int, int, IPP_RESOLUTION_UNITS);
348926f1247SMichael Pfeiffer	virtual ~IppResolutionAttribute() {}
349926f1247SMichael Pfeiffer	virtual int length() const;
350926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
351926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
352926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
353926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppResolutionAttribute &attr)
354926f1247SMichael Pfeiffer	{
355926f1247SMichael Pfeiffer		return attr.input(is);
356926f1247SMichael Pfeiffer	}
357926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppResolutionAttribute &attr)
358926f1247SMichael Pfeiffer	{
359926f1247SMichael Pfeiffer		return attr.output(os);
360926f1247SMichael Pfeiffer	}
361926f1247SMichael Pfeiffer
362926f1247SMichael Pfeiffer	int xres;
363926f1247SMichael Pfeiffer	int yres;
364926f1247SMichael Pfeiffer	IPP_RESOLUTION_UNITS resolution_units;
365926f1247SMichael Pfeiffer};
366926f1247SMichael Pfeiffer
367926f1247SMichael Pfeifferclass IppRangeOfIntegerAttribute : public IppNamedAttribute {
368926f1247SMichael Pfeifferpublic:
369926f1247SMichael Pfeiffer	IppRangeOfIntegerAttribute(IPP_TAG t);
370926f1247SMichael Pfeiffer	IppRangeOfIntegerAttribute(IPP_TAG t, const char *n, int, int);
371926f1247SMichael Pfeiffer	virtual ~IppRangeOfIntegerAttribute() {}
372926f1247SMichael Pfeiffer	virtual int length() const;
373926f1247SMichael Pfeiffer	virtual istream &input(istream &is);
374926f1247SMichael Pfeiffer	virtual ostream &output(ostream &os) const;
375926f1247SMichael Pfeiffer	virtual ostream &print(ostream &) const;
376926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppRangeOfIntegerAttribute &attr)
377926f1247SMichael Pfeiffer	{
378926f1247SMichael Pfeiffer		return attr.input(is);
379926f1247SMichael Pfeiffer	}
380926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppRangeOfIntegerAttribute &attr)
381926f1247SMichael Pfeiffer	{
382926f1247SMichael Pfeiffer		return attr.output(os);
383926f1247SMichael Pfeiffer	}
384926f1247SMichael Pfeiffer
385926f1247SMichael Pfeiffer	long lower;
386926f1247SMichael Pfeiffer	long upper;
387926f1247SMichael Pfeiffer};
388926f1247SMichael Pfeiffer
389926f1247SMichael Pfeifferclass IppContent {
390926f1247SMichael Pfeifferpublic:
391926f1247SMichael Pfeiffer	IppContent();
392926f1247SMichael Pfeiffer	~IppContent();
393926f1247SMichael Pfeiffer	int length() const;
394926f1247SMichael Pfeiffer	istream &input(istream &);
395926f1247SMichael Pfeiffer	ostream &output(ostream &) const;
396926f1247SMichael Pfeiffer	friend istream& operator >> (istream &is, IppContent &ic)
397926f1247SMichael Pfeiffer	{
398926f1247SMichael Pfeiffer		return ic.input(is);
399926f1247SMichael Pfeiffer	}
400926f1247SMichael Pfeiffer	friend ostream& operator << (ostream &os, const IppContent &ic)
401926f1247SMichael Pfeiffer	{
402926f1247SMichael Pfeiffer		return ic.output(os);
403926f1247SMichael Pfeiffer	}
404926f1247SMichael Pfeiffer	void setVersion(unsigned short);
405926f1247SMichael Pfeiffer	unsigned short getVersion() const;
406926f1247SMichael Pfeiffer	void setOperationId(IPP_OPERATION_ID);
407926f1247SMichael Pfeiffer	IPP_OPERATION_ID getOperationId() const;
408926f1247SMichael Pfeiffer	void setRequestId(unsigned long);
409926f1247SMichael Pfeiffer	unsigned long getRequestId() const;
410926f1247SMichael Pfeiffer	IPP_STATUS_CODE getStatusCode() const;
411926f1247SMichael Pfeiffer	const char *getStatusMessage() const;
412926f1247SMichael Pfeiffer
413926f1247SMichael Pfeiffer	void setDelimiter(IPP_TAG tag);
414926f1247SMichael Pfeiffer	void setInteger(const char *name, int value);
415926f1247SMichael Pfeiffer	void setBoolean(const char *name, bool value);
416926f1247SMichael Pfeiffer	void setString(const char *name, const char *value);
417926f1247SMichael Pfeiffer	void setDateTime(const char *name, const DATETIME *dt);
418926f1247SMichael Pfeiffer	void setResolution(const char *name, int x, int y, IPP_RESOLUTION_UNITS u);
419926f1247SMichael Pfeiffer	void setRangeOfInteger(const char *name, int lower, int upper);
420926f1247SMichael Pfeiffer	void setTextWithLanguage(const char *name, const char *s1, const char *s2);
421926f1247SMichael Pfeiffer	void setNameWithLanguage(const char *name, const char *s1, const char *s2);
422926f1247SMichael Pfeiffer	void setTextWithoutLanguage(const char *name, const char *value);
423926f1247SMichael Pfeiffer	void setNameWithoutLanguage(const char *name, const char *value);
424926f1247SMichael Pfeiffer	void setKeyword(const char *name, const char *value);
425926f1247SMichael Pfeiffer	void setURI(const char *name, const char *value);
426926f1247SMichael Pfeiffer	void setURIScheme(const char *name, const char *value);
427926f1247SMichael Pfeiffer	void setCharset(const char *name, const char *value);
428926f1247SMichael Pfeiffer	void setNaturalLanguage(const char *name, const char *value);
429926f1247SMichael Pfeiffer	void setMimeMediaType(const char *name, const char *value);
430926f1247SMichael Pfeiffer
431926f1247SMichael Pfeiffer	void setRawData(const char *file, int size = -1);
432926f1247SMichael Pfeiffer	void setRawData(istream &is, int size = -1);
433926f1247SMichael Pfeiffer	ostream &print(ostream &) const;
434926f1247SMichael Pfeiffer
435926f1247SMichael Pfeiffer	bool operator !() const;
436926f1247SMichael Pfeiffer	bool good() const;
437926f1247SMichael Pfeiffer	bool fail() const;
438926f1247SMichael Pfeiffer
439926f1247SMichael Pfeifferprivate:
440926f1247SMichael Pfeiffer	list<IppAttribute *> attrs;
441926f1247SMichael Pfeiffer	unsigned short version;
442926f1247SMichael Pfeiffer	unsigned short operation_id;
443926f1247SMichael Pfeiffer	unsigned long  request_id;
444926f1247SMichael Pfeiffer	string file_path;
445926f1247SMichael Pfeiffer	istream *is;
446926f1247SMichael Pfeiffer	int size;
447926f1247SMichael Pfeiffer};
448926f1247SMichael Pfeiffer
449926f1247SMichael Pfeiffer#endif	// __IppContent_H
450