1 /* 2 * Copyright 2001-2008, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Philippe Houdoin 7 * Simon Gauvin 8 * Michael Pfeiffer 9 * Dr. Hartmut Reh 10 */ 11 12 #ifndef PRINTERDRIVER_H 13 #define PRINTERDRIVER_H 14 15 16 #include "InterfaceUtils.h" 17 18 19 class BFile; 20 class BNode; 21 class BMessage; 22 23 24 class PrinterDriver 25 { 26 public: 27 // constructors / destructor 28 PrinterDriver(BNode* printerNode); 29 virtual ~PrinterDriver(); 30 31 void StopPrinting(); 32 33 virtual status_t PrintJob(BFile *jobFile, BMessage *jobMsg); 34 virtual status_t BeginJob(); 35 virtual status_t PrintPage(int32 pageNumber, int32 pageCount); 36 virtual status_t EndJob(); 37 38 // configuration window getters 39 virtual BlockingWindow* NewPageSetupWindow(BMessage *setupMsg, const char *printerName); 40 virtual BlockingWindow* NewJobSetupWindow(BMessage *setupMsg, const char *printerName); 41 42 // configuration default methods 43 virtual status_t PageSetup(BMessage *msg, const char *printerName = NULL); 44 virtual status_t JobSetup(BMessage *msg, const char *printerName = NULL); 45 virtual BMessage* GetDefaultSettings(); 46 47 // accessors 48 inline BFile *JobFile() { return fJobFile; } 49 inline BNode *PrinterNode() { return fPrinterNode; } 50 51 // publics status code 52 typedef enum { 53 PORTRAIT_ORIENTATION, 54 LANDSCAPE_ORIENTATION 55 } Orientation; 56 57 58 private: 59 bool fPrinting; 60 BFile *fJobFile; 61 BNode *fPrinterNode; 62 63 volatile Orientation fOrientation; 64 }; 65 66 #endif 67 68