diff options
Diffstat (limited to 'src/printsupport/kernel/qplatformprintersupport.cpp')
-rw-r--r-- | src/printsupport/kernel/qplatformprintersupport.cpp | 85 |
1 files changed, 18 insertions, 67 deletions
diff --git a/src/printsupport/kernel/qplatformprintersupport.cpp b/src/printsupport/kernel/qplatformprintersupport.cpp index 4d80e55ab6..1494155302 100644 --- a/src/printsupport/kernel/qplatformprintersupport.cpp +++ b/src/printsupport/kernel/qplatformprintersupport.cpp @@ -40,10 +40,13 @@ ****************************************************************************/ #include "qplatformprintersupport.h" +#include "qplatformprintdevice.h" +#include <QtGui/qpagesize.h> #include <QtPrintSupport/qprinterinfo.h> #include <private/qprinterinfo_p.h> +#include <private/qprintdevice_p.h> #ifndef QT_NO_PRINTER @@ -77,90 +80,38 @@ QPaintEngine *QPlatformPrinterSupport::createPaintEngine(QPrintEngine *, QPrinte return 0; } -QList<QPrinter::PaperSize> QPlatformPrinterSupport::supportedPaperSizes(const QPrinterInfo &) const +QPrintDevice QPlatformPrinterSupport::createPrintDevice(QPlatformPrintDevice *device) { - return QList<QPrinter::PaperSize>(); + return QPrintDevice(device); } -QList<QPair<QString, QSizeF> > QPlatformPrinterSupport::supportedSizesWithNames(const QPrinterInfo &) const +QPrintDevice QPlatformPrinterSupport::createPrintDevice(const QString &id) { - return QList<QPair<QString, QSizeF> >(); + Q_UNUSED(id) + return QPrintDevice(); } -QList<QPrinterInfo> QPlatformPrinterSupport::availablePrinters() +QPrintDevice QPlatformPrinterSupport::createDefaultPrintDevice() { - return m_printers; + return createPrintDevice(defaultPrintDeviceId()); } -QPrinterInfo QPlatformPrinterSupport::defaultPrinter() +QStringList QPlatformPrinterSupport::availablePrintDeviceIds() const { - const QList<QPrinterInfo> printers = availablePrinters(); - foreach (const QPrinterInfo &printerInfo, printers) { - if (printerInfo.isDefault()) - return printerInfo; - } - return QPrinterInfo(); + return QStringList(); } -QPrinterInfo QPlatformPrinterSupport::printerInfo(const QString &printerName) +QString QPlatformPrinterSupport::defaultPrintDeviceId() const { - const QList<QPrinterInfo> printers = availablePrinters(); - foreach (const QPrinterInfo &printerInfo, printers) { - if (printerInfo.printerName() == printerName) - return printerInfo; - } - return QPrinterInfo(); -} - -QString QPlatformPrinterSupport::printerOption(const QPrinterInfo &printer, const QString &key) const -{ - Q_UNUSED(printer) - Q_UNUSED(key) return QString(); } -PrinterOptions QPlatformPrinterSupport::printerOptions(const QPrinterInfo &printer) const -{ - Q_UNUSED(printer) - return PrinterOptions(); -} - -int QPlatformPrinterSupport::printerIndex(const QPrinterInfo &printer) -{ - return printer.d_func()->index; -} - -QPrinterInfo QPlatformPrinterSupport::createPrinterInfo(const QString &name, const QString &description, - const QString &location, const QString &makeAndModel, - bool isDefault, int index) -{ - QPrinterInfo printer(name); - printer.d_func()->description = description; - printer.d_func()->location = location; - printer.d_func()->makeAndModel = makeAndModel; - printer.d_func()->isDefault = isDefault; - printer.d_func()->index = index; - return printer; -} - -/* - Converts QSizeF in millimeters to a predefined PaperSize (returns Custom if - the size isn't a standard size) -*/ -extern QPrinter::PaperSize qSizeFTopaperSize(const QSizeF &); -QPrinter::PaperSize QPlatformPrinterSupport::convertQSizeFToPaperSize(const QSizeF &sizef) -{ - return qSizeFTopaperSize(sizef); -} - -/* - Converts a predefined PaperSize to a QSizeF in millimeters (returns - QSizeF(0.0, 0.0) if PaperSize is Custom) -*/ -extern QSizeF qt_paperSizeToQSizeF(QPrinter::PaperSize size); -QSizeF QPlatformPrinterSupport::convertPaperSizeToQSizeF(QPrinter::PaperSize paperSize) +QPageSize QPlatformPrinterSupport::createPageSize(const QString &id, QSize size, const QString &localizedName) { - return qt_paperSizeToQSizeF(paperSize); + Q_UNUSED(id) + Q_UNUSED(size) + Q_UNUSED(localizedName) + return QPageSize(); } QT_END_NAMESPACE |