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