xref: /haiku/headers/private/print/PrintTransport.h (revision c237c4ce593ee823d9867fd997e51e4c447f5623)
1 /*
2 
3 PrintTransport
4 
5 Copyright (c) 2004 Haiku.
6 
7 Authors:
8 	Michael Pfeiffer
9 	Philippe Houdoin
10 
11 Permission is hereby granted, free of charge, to any person obtaining a copy of
12 this software and associated documentation files (the "Software"), to deal in
13 the Software without restriction, including without limitation the rights to
14 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15 of the Software, and to permit persons to whom the Software is furnished to do
16 so, subject to the following conditions:
17 
18 The above copyright notice and this permission notice shall be included in all
19 copies or substantial portions of the Software.
20 
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 THE 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.
41 class PrintTransport
42 {
43 public:
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 
55 private:
56 	BDataIO*   fDataIO;
57 	image_id   fAddOnID;
58 	void       (*fExitProc)(void);
59 };
60 
61 #endif // PRINT_TRANSPORT_H
62