vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / print / drivers / gutenprint / GPDriver.h
blob602ea83e31f6d75f1c39397a68b92fea6511ced7
1 /*
2 * GP.h
3 * Copyright 1999-2000 Y.Takagi. All Rights Reserved.
4 */
5 #ifndef __GP_H
6 #define __GP_H
9 #include "GPBinding.h"
10 #include "GPCapabilities.h"
11 #include "GraphicsDriver.h"
12 #include "OutputStream.h"
14 class Halftone;
17 class GPDriver : public GraphicsDriver, public OutputStream
19 public:
20 GPDriver(BMessage* msg, PrinterData* printer_data,
21 const PrinterCap* printer_cap);
23 void Write(const void *buffer, size_t size)
24 throw(TransportException);
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);
47 private:
48 GPBinding fBinding;
49 GPJobConfiguration fConfiguration;
52 #endif // __GP_H