2004-02-14 02:45:40 +03:00
|
|
|
#ifndef _PRINTER_DRIVER_H
|
|
|
|
#define _PRINTER_DRIVER_H
|
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
|
2004-02-14 02:45:40 +03:00
|
|
|
#include <SupportDefs.h>
|
2007-10-16 00:13:55 +04:00
|
|
|
|
|
|
|
|
2004-02-14 02:45:40 +03:00
|
|
|
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:
|
2010-12-08 23:07:22 +03:00
|
|
|
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;
|
2004-02-14 02:45:40 +03:00
|
|
|
|
2010-12-08 23:07:22 +03:00
|
|
|
void InitPrinterDataAndCap();
|
2005-02-06 21:22:40 +03:00
|
|
|
|
2010-12-08 23:07:22 +03:00
|
|
|
virtual void About();
|
|
|
|
virtual char* AddPrinter(char* printerName);
|
|
|
|
BMessage* ConfigPage(BMessage* settings);
|
|
|
|
BMessage* ConfigJob(BMessage* settings);
|
|
|
|
BMessage* TakeJob(BFile* printJob, BMessage* settings);
|
2004-02-14 02:45:40 +03:00
|
|
|
|
2005-02-06 21:22:40 +03:00
|
|
|
protected:
|
2010-12-08 23:07:22 +03:00
|
|
|
PrinterData* GetPrinterData() { return fPrinterData; }
|
|
|
|
PrinterCap* GetPrinterCap() { return fPrinterCap; }
|
2005-02-06 21:22:40 +03:00
|
|
|
|
2004-02-14 02:45:40 +03:00
|
|
|
private:
|
2010-12-08 23:07:22 +03:00
|
|
|
bool _ReadSettings(const char* attrName,
|
|
|
|
BMessage* settings);
|
|
|
|
void _WriteSettings(const char* attrName,
|
|
|
|
BMessage* settings);
|
|
|
|
void _MergeWithPreviousSettings(const char* attrName,
|
|
|
|
BMessage* settings);
|
2004-02-14 02:45:40 +03:00
|
|
|
|
|
|
|
BNode* fSpoolFolder;
|
2005-02-06 21:22:40 +03:00
|
|
|
PrinterData* fPrinterData;
|
2004-02-14 02:45:40 +03:00
|
|
|
PrinterCap* fPrinterCap;
|
|
|
|
GraphicsDriver* fGraphicsDriver;
|
|
|
|
};
|
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
PrinterDriver* instantiate_printer_driver(BNode* printerFolder = NULL);
|
2004-02-14 02:45:40 +03:00
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
#endif // _PRINTER_DRIVER_H
|