Qt 4.8
Public Functions | Public Variables | List of all members
QPrinterPrivate Class Reference

#include <qprinter_p.h>

Public Functions

void addToManualSetList (QPrintEngine::PrintEnginePropertyKey key)
 
void createDefaultEngines ()
 
QList< const QPicture * > previewPages () const
 
 QPrinterPrivate (QPrinter *printer)
 
void setPreviewMode (bool)
 
 ~QPrinterPrivate ()
 

Public Variables

int fromPage
 
uint had_default_engines: 1
 
uint hasCustomPageMargins: 1
 
uint hasUserSetPageSize: 1
 
QList< QPrintEngine::PrintEnginePropertyKeymanualSetList
 
int maxPage
 
int minPage
 
QAbstractPrintDialog::PrintDialogOptions options
 
QPrinter::OutputFormat outputFormat
 
QPaintEnginepaintEngine
 
QPreviewPaintEnginepreviewEngine
 
QPrintEngineprintEngine
 
QPrinter::PrinterMode printerMode
 
QAbstractPrintDialog::PrintRange printRange
 
QPrinterq_ptr
 
QPaintEnginerealPaintEngine
 
QPrintEnginerealPrintEngine
 
int toPage
 
uint use_default_engine: 1
 
uint validPrinter: 1
 

Detailed Description

Definition at line 74 of file qprinter_p.h.

Constructors and Destructors

◆ QPrinterPrivate()

QPrinterPrivate::QPrinterPrivate ( QPrinter printer)
inline

Definition at line 78 of file qprinter_p.h.

79  : printEngine(0)
80  , paintEngine(0)
81  , q_ptr(printer)
85  , minPage(1)
86  , maxPage(INT_MAX)
87  , fromPage(0)
88  , toPage(0)
89  , use_default_engine(true)
90  , validPrinter(false)
91  , hasCustomPageMargins(false)
92  , hasUserSetPageSize(false)
93  {
94  }
QPrintEngine * printEngine
Definition: qprinter_p.h:110
uint hasCustomPageMargins
Definition: qprinter_p.h:129
uint hasUserSetPageSize
Definition: qprinter_p.h:130
QPrinter * q_ptr
Definition: qprinter_p.h:119
QAbstractPrintDialog::PrintRange printRange
Definition: qprinter_p.h:122
uint use_default_engine
Definition: qprinter_p.h:125
QAbstractPrintDialog::PrintDialogOptions options
Definition: qprinter_p.h:121
QPaintEngine * paintEngine
Definition: qprinter_p.h:111
#define INT_MAX

◆ ~QPrinterPrivate()

QPrinterPrivate::~QPrinterPrivate ( )
inline

Definition at line 96 of file qprinter_p.h.

96  {
97 
98  }

Functions

◆ addToManualSetList()

void QPrinterPrivate::addToManualSetList ( QPrintEngine::PrintEnginePropertyKey  key)

Definition at line 235 of file qprinter.cpp.

Referenced by ~QPrinterPrivate().

236 {
237  for (int c = 0; c < manualSetList.size(); ++c) {
238  if (manualSetList[c] == key) return;
239  }
241 }
QList< QPrintEngine::PrintEnginePropertyKey > manualSetList
Definition: qprinter_p.h:133
unsigned char c[8]
Definition: qnumeric_p.h:62
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
int key
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ createDefaultEngines()

void QPrinterPrivate::createDefaultEngines ( )

Definition at line 161 of file qprinter.cpp.

Referenced by ~QPrinterPrivate().

162 {
163  QPrinter::OutputFormat realOutputFormat = outputFormat;
164 #if !defined (QTOPIA_PRINTENGINE)
165 #if defined (Q_OS_UNIX) && ! defined (Q_WS_MAC)
167  realOutputFormat = QPrinter::PostScriptFormat;
168  }
169 #endif
170 #endif
171 
172  switch (realOutputFormat) {
173  case QPrinter::NativeFormat: {
174 #if defined (Q_WS_WIN)
176  paintEngine = winEngine;
177  printEngine = winEngine;
178 #elif defined (Q_WS_MAC)
179  QMacPrintEngine *macEngine = new QMacPrintEngine(printerMode);
180  paintEngine = macEngine;
181  printEngine = macEngine;
182 #elif defined (QTOPIA_PRINTENGINE)
184  paintEngine = qwsEngine;
185  printEngine = qwsEngine;
186 #elif defined (Q_OS_UNIX)
187  Q_ASSERT(false);
188 #endif
189  }
190  break;
191  case QPrinter::PdfFormat: {
192  QPdfEngine *pdfEngine = new QPdfEngine(printerMode);
193  paintEngine = pdfEngine;
194  printEngine = pdfEngine;
195  }
196  break;
198  QPSPrintEngine *psEngine = new QPSPrintEngine(printerMode);
199  paintEngine = psEngine;
200  printEngine = psEngine;
201  }
202  break;
203  }
204  use_default_engine = true;
205  had_default_engines = true;
206 }
QPrintEngine * printEngine
Definition: qprinter_p.h:110
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
OutputFormat
The OutputFormat enum is used to describe the format QPrinter should use for printing.
Definition: qprinter.h:124
QPrinter::PrinterMode printerMode
Definition: qprinter_p.h:108
uint use_default_engine
Definition: qprinter_p.h:125
QPaintEngine * paintEngine
Definition: qprinter_p.h:111
uint had_default_engines
Definition: qprinter_p.h:126
QPrinter::OutputFormat outputFormat
Definition: qprinter_p.h:109

◆ previewPages()

QList< const QPicture * > QPrinterPrivate::previewPages ( ) const

Definition at line 209 of file qprinter.cpp.

Referenced by ~QPrinterPrivate().

210 {
211  if (previewEngine)
212  return previewEngine->pages();
213  return QList<const QPicture *>();
214 }
QList< const QPicture * > pages()
QPreviewPaintEngine * previewEngine
Definition: qprinter_p.h:116
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ setPreviewMode()

void QPrinterPrivate::setPreviewMode ( bool  enable)

Definition at line 216 of file qprinter.cpp.

Referenced by ~QPrinterPrivate().

217 {
218  Q_Q(QPrinter);
219  if (enable) {
220  if (!previewEngine)
223  use_default_engine = false;
226  q->setEngines(previewEngine, previewEngine);
228  } else {
229  q->setEngines(realPrintEngine, realPaintEngine);
231  }
232 }
QPrintEngine * printEngine
Definition: qprinter_p.h:110
QPrintEngine * realPrintEngine
Definition: qprinter_p.h:113
QPaintEngine * realPaintEngine
Definition: qprinter_p.h:114
void setProxyEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine)
#define Q_Q(Class)
Definition: qglobal.h:2483
The QPrinter class is a paint device that paints on a printer.
Definition: qprinter.h:66
QPreviewPaintEngine * previewEngine
Definition: qprinter_p.h:116
uint use_default_engine
Definition: qprinter_p.h:125
QPaintEngine * paintEngine
Definition: qprinter_p.h:111
uint had_default_engines
Definition: qprinter_p.h:126

Properties

◆ fromPage

int QPrinterPrivate::fromPage

Definition at line 123 of file qprinter_p.h.

◆ had_default_engines

uint QPrinterPrivate::had_default_engines

Definition at line 126 of file qprinter_p.h.

Referenced by createDefaultEngines(), and setPreviewMode().

◆ hasCustomPageMargins

uint QPrinterPrivate::hasCustomPageMargins

Definition at line 129 of file qprinter_p.h.

◆ hasUserSetPageSize

uint QPrinterPrivate::hasUserSetPageSize

Definition at line 130 of file qprinter_p.h.

◆ manualSetList

QList<QPrintEngine::PrintEnginePropertyKey> QPrinterPrivate::manualSetList

Definition at line 133 of file qprinter_p.h.

Referenced by addToManualSetList().

◆ maxPage

int QPrinterPrivate::maxPage

Definition at line 123 of file qprinter_p.h.

◆ minPage

int QPrinterPrivate::minPage

Definition at line 123 of file qprinter_p.h.

◆ options

QAbstractPrintDialog::PrintDialogOptions QPrinterPrivate::options

Definition at line 121 of file qprinter_p.h.

◆ outputFormat

QPrinter::OutputFormat QPrinterPrivate::outputFormat

Definition at line 109 of file qprinter_p.h.

Referenced by createDefaultEngines().

◆ paintEngine

QPaintEngine* QPrinterPrivate::paintEngine

Definition at line 111 of file qprinter_p.h.

Referenced by createDefaultEngines(), QPrinter::QPrinter(), and setPreviewMode().

◆ previewEngine

QPreviewPaintEngine* QPrinterPrivate::previewEngine

Definition at line 116 of file qprinter_p.h.

Referenced by previewPages(), and setPreviewMode().

◆ printEngine

QPrintEngine* QPrinterPrivate::printEngine

Definition at line 110 of file qprinter_p.h.

Referenced by createDefaultEngines(), and setPreviewMode().

◆ printerMode

QPrinter::PrinterMode QPrinterPrivate::printerMode

Definition at line 108 of file qprinter_p.h.

Referenced by createDefaultEngines().

◆ printRange

QAbstractPrintDialog::PrintRange QPrinterPrivate::printRange

Definition at line 122 of file qprinter_p.h.

◆ q_ptr

QPrinter* QPrinterPrivate::q_ptr

Definition at line 119 of file qprinter_p.h.

◆ realPaintEngine

QPaintEngine* QPrinterPrivate::realPaintEngine

Definition at line 114 of file qprinter_p.h.

Referenced by setPreviewMode().

◆ realPrintEngine

QPrintEngine* QPrinterPrivate::realPrintEngine

Definition at line 113 of file qprinter_p.h.

Referenced by setPreviewMode().

◆ toPage

int QPrinterPrivate::toPage

Definition at line 123 of file qprinter_p.h.

◆ use_default_engine

uint QPrinterPrivate::use_default_engine

Definition at line 125 of file qprinter_p.h.

Referenced by createDefaultEngines(), and setPreviewMode().

◆ validPrinter

uint QPrinterPrivate::validPrinter

Definition at line 128 of file qprinter_p.h.


The documentation for this class was generated from the following files: