2 * lpr for cygwin/windows
4 * Copyright (C) 2000-2003 Rick Rankin
5 * http://www.cygwin.com/ml/cygwin/2000-07/msg00320.html
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation in version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #if !defined(Printer_hh)
33 #include "src/lpr/PrinterException.hh"
38 Printer(const std::string &name, bool debugFlag) throw(PrinterException);
42 void endDoc() throw(PrinterException);
43 void endPage() throw(PrinterException);
44 void flush() throw(PrinterException);
45 bool getRawFlag() const;
46 void print(istream & in, const std::string & docName) throw(PrinterException);
47 void put(unsigned char ch) throw(PrinterException);
48 void setRawFlag(bool flag);
49 void startDoc(const std::string & docName) throw(PrinterException);
50 void startPage() throw(PrinterException);
51 void write(unsigned char *buf, unsigned int size) throw(PrinterException);
55 typedef std::vector<PRINTER_INFO_5> PrinterList;
57 // Don't want copy construction or assignment.
58 Printer(const Printer & rhs);
59 Printer & operator = (const Printer & rhs);
61 // Enumerate the existing printers.
62 PrinterList enumPrinters(DWORD flags, LPTSTR name) throw(PrinterException);
64 // Map a port name (lpt1, etc) to a device name.
65 void mapPortName() throw(PrinterException);
67 // Open the printer if it's not already open.
68 void open() throw(PrinterException);
70 std::string m_devName;
74 unsigned char * m_buffer;
75 unsigned int m_bufferSize;
76 unsigned int m_bufferIndex;
80 #endif /* Printer_hh */