xref: /haiku/src/add-ons/print/drivers/preview/PrinterDriver.h (revision df24dede80b41ec24063f8169f5f53ef95866cc2)
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 "BlockingWindow.h"
17 
18 
19 class BFile;
20 class BlockingWindow;
21 class BNode;
22 class BMessage;
23 
24 
25 class PrinterDriver
26 {
27 public:
28 	// constructors / destructor
29 							PrinterDriver(BNode* printerNode);
30 	virtual					~PrinterDriver();
31 
32 	void StopPrinting();
33 
34 	virtual status_t 		PrintJob(BFile *jobFile, BMessage *jobMsg);
35 	virtual status_t        BeginJob();
36 	virtual status_t		PrintPage(int32 pageNumber, int32 pageCount);
37 	virtual status_t        EndJob();
38 
39 	// configuration window getters
40 	virtual BlockingWindow* NewPageSetupWindow(BMessage *setupMsg, const char *printerName);
41 	virtual BlockingWindow* NewJobSetupWindow(BMessage *setupMsg, const char *printerName);
42 
43 	// configuration default methods
44 	virtual status_t 		PageSetup(BMessage *msg, const char *printerName = NULL);
45 	virtual status_t 		JobSetup(BMessage *msg, const char *printerName = NULL);
46 	virtual BMessage*       GetDefaultSettings();
47 
48 	// accessors
JobFile()49 	inline BFile			*JobFile()		{ return fJobFile; }
PrinterNode()50 	inline BNode			*PrinterNode()	{ return fPrinterNode; }
51 
52 	// publics status code
53 	typedef enum {
54 		PORTRAIT_ORIENTATION,
55 		LANDSCAPE_ORIENTATION
56 	} Orientation;
57 
58 
59 private:
60 	bool					fPrinting;
61 	BFile					*fJobFile;
62 	BNode					*fPrinterNode;
63 
64 	volatile Orientation	fOrientation;
65 };
66 
67 #endif
68 
69