| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | 
|---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qprinter.h:1 --> | 
|---|
| 3 | <html> | 
|---|
| 4 | <head> | 
|---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | 
|---|
| 6 | <title>qprinter.h Include File</title> | 
|---|
| 7 | <style type="text/css"><!-- | 
|---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; } | 
|---|
| 9 | a:link { color: #004faf; text-decoration: none } | 
|---|
| 10 | a:visited { color: #672967; text-decoration: none } | 
|---|
| 11 | body { background: #ffffff; color: black; } | 
|---|
| 12 | --></style> | 
|---|
| 13 | </head> | 
|---|
| 14 | <body> | 
|---|
| 15 |  | 
|---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> | 
|---|
| 17 | <tr bgcolor="#E5E5E5"> | 
|---|
| 18 | <td valign=center> | 
|---|
| 19 | <a href="index.html"> | 
|---|
| 20 | <font color="#004faf">Home</font></a> | 
|---|
| 21 | | <a href="classes.html"> | 
|---|
| 22 | <font color="#004faf">All Classes</font></a> | 
|---|
| 23 | | <a href="mainclasses.html"> | 
|---|
| 24 | <font color="#004faf">Main Classes</font></a> | 
|---|
| 25 | | <a href="annotated.html"> | 
|---|
| 26 | <font color="#004faf">Annotated</font></a> | 
|---|
| 27 | | <a href="groups.html"> | 
|---|
| 28 | <font color="#004faf">Grouped Classes</font></a> | 
|---|
| 29 | | <a href="functions.html"> | 
|---|
| 30 | <font color="#004faf">Functions</font></a> | 
|---|
| 31 | </td> | 
|---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qprinter.h</h1> | 
|---|
| 33 |  | 
|---|
| 34 | <p>This is the verbatim text of the qprinter.h include file. It is provided only for illustration; the copyright remains with Trolltech. | 
|---|
| 35 | <hr> | 
|---|
| 36 | <pre> | 
|---|
| 37 | /********************************************************************** | 
|---|
| 38 | ** $Id: qprinter-h.html 2051 2007-02-21 10:04:20Z chehrlic $ | 
|---|
| 39 | ** | 
|---|
| 40 | ** Definition of QPrinter class | 
|---|
| 41 | ** | 
|---|
| 42 | ** Created : 940927 | 
|---|
| 43 | ** | 
|---|
| 44 | ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved. | 
|---|
| 45 | ** | 
|---|
| 46 | ** This file is part of the kernel module of the Qt GUI Toolkit. | 
|---|
| 47 | ** | 
|---|
| 48 | ** This file may be distributed under the terms of the Q Public License | 
|---|
| 49 | ** as defined by Trolltech ASA of Norway and appearing in the file | 
|---|
| 50 | ** LICENSE.QPL included in the packaging of this file. | 
|---|
| 51 | ** | 
|---|
| 52 | ** This file may be distributed and/or modified under the terms of the | 
|---|
| 53 | ** GNU General Public License version 2 as published by the Free Software | 
|---|
| 54 | ** Foundation and appearing in the file LICENSE.GPL included in the | 
|---|
| 55 | ** packaging of this file. | 
|---|
| 56 | ** | 
|---|
| 57 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | 
|---|
| 58 | ** licenses may use this file in accordance with the Qt Commercial License | 
|---|
| 59 | ** Agreement provided with the Software. | 
|---|
| 60 | ** | 
|---|
| 61 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 
|---|
| 62 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 
|---|
| 63 | ** | 
|---|
| 64 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | 
|---|
| 65 | **   information about Qt Commercial License Agreements. | 
|---|
| 66 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 
|---|
| 67 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 
|---|
| 68 | ** | 
|---|
| 69 | ** Contact info@trolltech.com if any conditions of this licensing are | 
|---|
| 70 | ** not clear to you. | 
|---|
| 71 | ** | 
|---|
| 72 | **********************************************************************/ | 
|---|
| 73 |  | 
|---|
| 74 | #ifndef QPRINTER_H | 
|---|
| 75 | #define QPRINTER_H | 
|---|
| 76 |  | 
|---|
| 77 | #ifndef QT_H | 
|---|
| 78 | #include "qpaintdevice.h" | 
|---|
| 79 | #include "qstring.h" | 
|---|
| 80 | #include "qstringlist.h" | 
|---|
| 81 | #endif // QT_H | 
|---|
| 82 |  | 
|---|
| 83 | #ifndef QT_NO_PRINTER | 
|---|
| 84 |  | 
|---|
| 85 | #if defined(B0) | 
|---|
| 86 | #undef B0 // Terminal hang-up.  We assume that you do not want that. | 
|---|
| 87 | #endif | 
|---|
| 88 |  | 
|---|
| 89 | class QPrinterPrivate; | 
|---|
| 90 |  | 
|---|
| 91 | class Q_EXPORT QPrinter : public QPaintDevice | 
|---|
| 92 | { | 
|---|
| 93 | public: | 
|---|
| 94 | enum PrinterMode { ScreenResolution, PrinterResolution, HighResolution, Compatible }; | 
|---|
| 95 |  | 
|---|
| 96 | QPrinter( PrinterMode mode = ScreenResolution ); | 
|---|
| 97 | ~QPrinter(); | 
|---|
| 98 |  | 
|---|
| 99 | enum Orientation { Portrait, Landscape }; | 
|---|
| 100 |  | 
|---|
| 101 | enum PageSize    { A4, B5, Letter, Legal, Executive, | 
|---|
| 102 | A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1, | 
|---|
| 103 | B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E, | 
|---|
| 104 | DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom }; | 
|---|
| 105 |  | 
|---|
| 106 | enum PageOrder   { FirstPageFirst, LastPageFirst }; | 
|---|
| 107 |  | 
|---|
| 108 | enum ColorMode   { GrayScale, Color }; | 
|---|
| 109 |  | 
|---|
| 110 | enum PaperSource { OnlyOne, Lower, Middle, Manual, Envelope, | 
|---|
| 111 | EnvelopeManual, Auto, Tractor, SmallFormat, | 
|---|
| 112 | LargeFormat, LargeCapacity, Cassette, FormSource }; | 
|---|
| 113 |  | 
|---|
| 114 | enum PrintRange   { AllPages, | 
|---|
| 115 | Selection, | 
|---|
| 116 | PageRange }; | 
|---|
| 117 |  | 
|---|
| 118 | enum PrinterOption { PrintToFile, | 
|---|
| 119 | PrintSelection, | 
|---|
| 120 | PrintPageRange }; | 
|---|
| 121 |  | 
|---|
| 122 | QString printerName() const; | 
|---|
| 123 | virtual void setPrinterName( const QString &); | 
|---|
| 124 | bool outputToFile() const; | 
|---|
| 125 | virtual void setOutputToFile( bool ); | 
|---|
| 126 | QString outputFileName()const; | 
|---|
| 127 | virtual void setOutputFileName( const QString &); | 
|---|
| 128 |  | 
|---|
| 129 | QString printProgram() const; | 
|---|
| 130 | virtual void setPrintProgram( const QString &); | 
|---|
| 131 |  | 
|---|
| 132 | QString printerSelectionOption() const; | 
|---|
| 133 | virtual void setPrinterSelectionOption( const QString & ); | 
|---|
| 134 |  | 
|---|
| 135 | QString docName() const; | 
|---|
| 136 | virtual void setDocName( const QString &); | 
|---|
| 137 | QString creator() const; | 
|---|
| 138 | virtual void setCreator( const QString &); | 
|---|
| 139 |  | 
|---|
| 140 | Orientation orientation()   const; | 
|---|
| 141 | virtual void setOrientation( Orientation ); | 
|---|
| 142 | PageSize pageSize()      const; | 
|---|
| 143 | virtual void setPageSize( PageSize ); | 
|---|
| 144 | #ifdef Q_WS_WIN | 
|---|
| 145 | void setWinPageSize( short winPageSize ); | 
|---|
| 146 | short winPageSize() const; | 
|---|
| 147 | #endif | 
|---|
| 148 | #ifdef Q_WS_MAC | 
|---|
| 149 | bool printSetup(); | 
|---|
| 150 | bool pageSetup(); | 
|---|
| 151 | #endif | 
|---|
| 152 | virtual void setPageOrder( PageOrder ); | 
|---|
| 153 | PageOrder   pageOrder() const; | 
|---|
| 154 |  | 
|---|
| 155 | void setResolution( int ); | 
|---|
| 156 | int resolution() const; | 
|---|
| 157 |  | 
|---|
| 158 | virtual void setColorMode( ColorMode ); | 
|---|
| 159 | ColorMode   colorMode() const; | 
|---|
| 160 |  | 
|---|
| 161 | virtual void        setFullPage( bool ); | 
|---|
| 162 | bool                fullPage() const; | 
|---|
| 163 | QSize       margins()       const; | 
|---|
| 164 | void setMargins( uint top, uint left, uint bottom, uint right ); | 
|---|
| 165 | void margins( uint *top, uint *left, uint *bottom, uint *right ) const; | 
|---|
| 166 |  | 
|---|
| 167 | int         fromPage()      const; | 
|---|
| 168 | int         toPage()        const; | 
|---|
| 169 | virtual void setFromTo( int fromPage, int toPage ); | 
|---|
| 170 | int         minPage()       const; | 
|---|
| 171 | int         maxPage()       const; | 
|---|
| 172 | virtual void setMinMax( int minPage, int maxPage ); | 
|---|
| 173 | int         numCopies()     const; | 
|---|
| 174 | virtual void setNumCopies( int ); | 
|---|
| 175 |  | 
|---|
| 176 | bool        collateCopiesEnabled() const; | 
|---|
| 177 | void        setCollateCopiesEnabled(bool ); | 
|---|
| 178 |  | 
|---|
| 179 | bool        collateCopies() const; | 
|---|
| 180 | void        setCollateCopies( bool ); | 
|---|
| 181 |  | 
|---|
| 182 | PrintRange  printRange() const; | 
|---|
| 183 | void        setPrintRange( PrintRange range ); | 
|---|
| 184 |  | 
|---|
| 185 | bool        newPage(); | 
|---|
| 186 | bool        abort(); | 
|---|
| 187 | bool        aborted()       const; | 
|---|
| 188 |  | 
|---|
| 189 | bool        setup( QWidget *parent = 0 ); | 
|---|
| 190 |  | 
|---|
| 191 | PaperSource paperSource()   const; | 
|---|
| 192 | virtual void setPaperSource( PaperSource ); | 
|---|
| 193 |  | 
|---|
| 194 | void setOptionEnabled( PrinterOption, bool enable ); | 
|---|
| 195 | bool isOptionEnabled( PrinterOption ); | 
|---|
| 196 |  | 
|---|
| 197 | protected: | 
|---|
| 198 | bool        cmd( int, QPainter *, QPDevCmdParam * ); | 
|---|
| 199 | int         metric( int ) const; | 
|---|
| 200 |  | 
|---|
| 201 | #if defined(Q_WS_WIN) | 
|---|
| 202 | virtual void        setActive(); | 
|---|
| 203 | virtual void        setIdle(); | 
|---|
| 204 | #endif | 
|---|
| 205 |  | 
|---|
| 206 | private: | 
|---|
| 207 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) | 
|---|
| 208 | QPaintDevice *pdrv; | 
|---|
| 209 | int         pid; | 
|---|
| 210 | #endif | 
|---|
| 211 | #if defined(Q_WS_MAC) | 
|---|
| 212 | friend class QPrinterPrivate; | 
|---|
| 213 | PMPageFormat pformat; | 
|---|
| 214 | PMPrintSettings psettings; | 
|---|
| 215 | PMPrintSession psession; | 
|---|
| 216 | bool prepare(PMPrintSettings *); | 
|---|
| 217 | bool prepare(PMPageFormat *); | 
|---|
| 218 | void interpret(PMPrintSettings *); | 
|---|
| 219 | void interpret(PMPageFormat *); | 
|---|
| 220 | #endif | 
|---|
| 221 | #if defined(Q_WS_WIN) | 
|---|
| 222 | void        readPdlg( void* ); | 
|---|
| 223 | void        readPdlgA( void* ); | 
|---|
| 224 | void        writeDevmode( Qt::HANDLE ); | 
|---|
| 225 | void        writeDevmodeA( Qt::HANDLE ); | 
|---|
| 226 | void        reinit(); | 
|---|
| 227 |  | 
|---|
| 228 | bool        viewOffsetDone; | 
|---|
| 229 | QPainter*   painter; | 
|---|
| 230 | Qt::HANDLE hdevmode; | 
|---|
| 231 | Qt::HANDLE hdevnames; | 
|---|
| 232 | #endif | 
|---|
| 233 |  | 
|---|
| 234 | int         state; | 
|---|
| 235 | QString     printer_name; | 
|---|
| 236 | QString     option_string; | 
|---|
| 237 | QString     output_filename; | 
|---|
| 238 | bool        output_file; | 
|---|
| 239 | QString     print_prog; | 
|---|
| 240 | QString     doc_name; | 
|---|
| 241 | QString     creator_name; | 
|---|
| 242 |  | 
|---|
| 243 | PageSize    page_size; | 
|---|
| 244 | PaperSource paper_source; | 
|---|
| 245 | PageOrder   page_order; | 
|---|
| 246 | ColorMode   color_mode; | 
|---|
| 247 | Orientation orient; | 
|---|
| 248 | uint        to_edge : 1; | 
|---|
| 249 | uint        appcolcopies : 1; | 
|---|
| 250 | uint        usercolcopies : 1; | 
|---|
| 251 | uint        res_set : 1; | 
|---|
| 252 | short       from_pg, to_pg; | 
|---|
| 253 | short       min_pg,  max_pg; | 
|---|
| 254 | short       ncopies; | 
|---|
| 255 | int         res; | 
|---|
| 256 | QPrinterPrivate *d; | 
|---|
| 257 |  | 
|---|
| 258 | private:        // Disabled copy constructor and operator= | 
|---|
| 259 | #if defined(Q_DISABLE_COPY) | 
|---|
| 260 | QPrinter( const QPrinter & ); | 
|---|
| 261 | QPrinter &operator=( const QPrinter & ); | 
|---|
| 262 | #endif | 
|---|
| 263 | }; | 
|---|
| 264 |  | 
|---|
| 265 |  | 
|---|
| 266 | inline QString QPrinter::printerName() const | 
|---|
| 267 | { return printer_name; } | 
|---|
| 268 |  | 
|---|
| 269 | inline bool QPrinter::outputToFile() const | 
|---|
| 270 | { return output_file; } | 
|---|
| 271 |  | 
|---|
| 272 | inline QString QPrinter::outputFileName() const | 
|---|
| 273 | { return output_filename; } | 
|---|
| 274 |  | 
|---|
| 275 | inline QString QPrinter::printProgram() const | 
|---|
| 276 | { return print_prog; } | 
|---|
| 277 |  | 
|---|
| 278 | inline QString QPrinter::docName() const | 
|---|
| 279 | { return doc_name; } | 
|---|
| 280 |  | 
|---|
| 281 | inline QString QPrinter::creator() const | 
|---|
| 282 | { return creator_name; } | 
|---|
| 283 |  | 
|---|
| 284 | inline QPrinter::PageSize QPrinter::pageSize() const | 
|---|
| 285 | { return page_size; } | 
|---|
| 286 |  | 
|---|
| 287 | inline QPrinter::Orientation QPrinter::orientation() const | 
|---|
| 288 | { return orient; } | 
|---|
| 289 |  | 
|---|
| 290 | inline int QPrinter::fromPage() const | 
|---|
| 291 | { return from_pg; } | 
|---|
| 292 |  | 
|---|
| 293 | inline int QPrinter::toPage() const | 
|---|
| 294 | { return to_pg; } | 
|---|
| 295 |  | 
|---|
| 296 | inline int QPrinter::minPage() const | 
|---|
| 297 | { return min_pg; } | 
|---|
| 298 |  | 
|---|
| 299 | inline int QPrinter::maxPage() const | 
|---|
| 300 | { return max_pg; } | 
|---|
| 301 |  | 
|---|
| 302 | inline int QPrinter::numCopies() const | 
|---|
| 303 | { return ncopies; } | 
|---|
| 304 |  | 
|---|
| 305 | inline bool QPrinter::collateCopiesEnabled() const | 
|---|
| 306 | { return appcolcopies; } | 
|---|
| 307 |  | 
|---|
| 308 | inline void QPrinter::setCollateCopiesEnabled(bool v) | 
|---|
| 309 | { appcolcopies = v; } | 
|---|
| 310 |  | 
|---|
| 311 | inline bool QPrinter::collateCopies() const | 
|---|
| 312 | { return usercolcopies; } | 
|---|
| 313 |  | 
|---|
| 314 |  | 
|---|
| 315 | #endif // QT_NO_PRINTER | 
|---|
| 316 |  | 
|---|
| 317 | #endif // QPRINTER_H | 
|---|
| 318 | </pre> | 
|---|
| 319 | <!-- eof --> | 
|---|
| 320 | <p><address><hr><div align=center> | 
|---|
| 321 | <table width=100% cellspacing=0 border=0><tr> | 
|---|
| 322 | <td>Copyright © 2007 | 
|---|
| 323 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> | 
|---|
| 324 | <td align=right><div align=right>Qt 3.3.8</div> | 
|---|
| 325 | </table></div></address></body> | 
|---|
| 326 | </html> | 
|---|