xref: /haiku/src/add-ons/print/drivers/gutenprint/GPDriver.h (revision 89f1fd6512c10854013d231a85289797e47c7543)
1 /*
2  * GP.h
3  * Copyright 1999-2000 Y.Takagi. All Rights Reserved.
4  */
5 #ifndef __GP_H
6 #define __GP_H
7 
8 
9 #include "GPBinding.h"
10 #include "GPCapabilities.h"
11 #include "GraphicsDriver.h"
12 #include "OutputStream.h"
13 
14 class Halftone;
15 
16 
17 class GPDriver : public GraphicsDriver, public OutputStream
18 {
19 public:
20 				GPDriver(BMessage* msg, PrinterData* printer_data,
21 					const PrinterCap* printer_cap);
22 
23 	void		Write(const void *buffer, size_t size)
24 					/* throw(TransportException) */;
25 
26 protected:
27 	bool		StartDocument();
28 	void		SetParameter(BString& parameter, PrinterCap::CapID category,
29 					int value);
30 	void		SetDriverSpecificSettings();
31 	void		AddDriverSpecificSetting(PrinterCap::CapID category,
32 					const char* key);
33 	void		AddDriverSpecificBooleanSetting(PrinterCap::CapID category,
34 					const char* key);
35 	void		AddDriverSpecificIntSetting(PrinterCap::CapID category,
36 					const char* key);
37 	void		AddDriverSpecificDimensionSetting(PrinterCap::CapID category,
38 					const char* key);
39 	void		AddDriverSpecificDoubleSetting(PrinterCap::CapID category,
40 					const char* key);
41 	bool		StartPage(int page);
42 	bool		NextBand(BBitmap* bitmap, BPoint* offset);
43 	bool		EndPage(int page);
44 	bool		EndDocument(bool success);
45 	void		ShowError(const char* message);
46 
47 private:
48 	GPBinding		fBinding;
49 	GPJobConfiguration	fConfiguration;
50 };
51 
52 #endif // __GP_H
53