1/*
2
3PrintTransport
4
5Copyright (c) 2004 Haiku.
6
7Authors:
8	Michael Pfeiffer
9	Philippe Houdoin
10
11Permission is hereby granted, free of charge, to any person obtaining a copy of
12this software and associated documentation files (the "Software"), to deal in
13the Software without restriction, including without limitation the rights to
14use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15of the Software, and to permit persons to whom the Software is furnished to do
16so, subject to the following conditions:
17
18The above copyright notice and this permission notice shall be included in all
19copies or substantial portions of the Software.
20
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27THE SOFTWARE.
28
29*/
30
31#ifndef _PRINT_TRANSPORT_H
32#define _PRINT_TRANSPORT_H
33
34#include <image.h>
35#include <DataIO.h>
36#include <Node.h>
37#include <Message.h>
38
39// The class PrintTransport is intended to be used by
40// a printer driver.
41class PrintTransport
42{
43public:
44	PrintTransport();
45	~PrintTransport();
46
47	// opens the transport add-on associated with the printerFolder
48	status_t Open(BNode* printerFolder);
49	// returns the output stream created by the transport add-on
50	BDataIO* GetDataIO();
51	// returns false if the user has canceled the save to file dialog
52	// of the "Print To File" transport add-on.
53	bool IsPrintToFileCanceled() const;
54
55private:
56	BDataIO*   fDataIO;
57	image_id   fAddOnID;
58	void       (*fExitProc)(void);
59};
60
61#endif // PRINT_TRANSPORT_H
62