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