haiku/headers/libs/print/libprint/PrinterDriver.h
Ithamar R. Adema f7b0c08cae This modifies the Postscript printer to be able to insert a pipe in between the Postscript generation
and the transport addon. The actual command use as pipe is retrieved from the PPD that can be selected
at printer creation time.

Currently PPD selection is not shown (as the PPD directory is not available) and therefore the pipe
will not be inserted.

This still needs a bit of TLC, so hope to commit the last changes to fully support this later this week.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36173 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-11 22:01:13 +00:00

59 lines
1.6 KiB
C++

#ifndef _PRINTER_DRIVER_H
#define _PRINTER_DRIVER_H
#include <SupportDefs.h>
class BFile;
class BMessage;
class BNode;
class PrinterCap;
class PrinterData;
class GraphicsDriver;
#define kAttrPageSettings "libprint/page_settings"
#define kAttrJobSettings "libprint/job_settings"
class PrinterDriver {
public:
PrinterDriver(BNode* spoolFolder);
virtual ~PrinterDriver();
virtual const char* GetSignature() const = 0;
virtual const char* GetDriverName() const = 0;
virtual const char* GetVersion() const = 0;
virtual const char* GetCopyright() const = 0;
virtual PrinterCap* InstantiatePrinterCap(PrinterData* printerData) = 0;
virtual PrinterData* InstantiatePrinterData(BNode* node);
virtual GraphicsDriver* InstantiateGraphicsDriver(BMessage* settings, PrinterData* printerData, PrinterCap* printerCap) = 0;
void InitPrinterDataAndCap();
virtual void About();
virtual char* AddPrinter(char* printerName);
BMessage* ConfigPage(BMessage* settings);
BMessage* ConfigJob(BMessage* settings);
BMessage* TakeJob(BFile* printJob, BMessage* settings);
protected:
PrinterData* GetPrinterData() { return fPrinterData; }
PrinterCap* GetPrinterCap() { return fPrinterCap; }
private:
bool ReadSettings(const char* attrName, BMessage* settings);
void WriteSettings(const char* attrName, BMessage* settings);
void MergeWithPreviousSettings(const char* attrName, BMessage* settings);
BNode* fSpoolFolder;
PrinterData* fPrinterData;
PrinterCap* fPrinterCap;
GraphicsDriver* fGraphicsDriver;
};
PrinterDriver* instantiate_printer_driver(BNode* printerFolder = NULL);
#endif // _PRINTER_DRIVER_H