Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwindowsprintersupport.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6
7#ifndef QT_NO_PRINTER
8
10
11#include <QtCore/QStringList>
12#include <private/qprintengine_win_p.h>
13#include <private/qprintdevice_p.h>
14
15#define QT_STATICPLUGIN
16#include <qpa/qplatformprintplugin.h>
17
19
20using namespace Qt::StringLiterals;
21
22QWindowsPrinterSupport::QWindowsPrinterSupport()
23 : QPlatformPrinterSupport()
24{
25}
26
27QWindowsPrinterSupport::~QWindowsPrinterSupport()
28{
29}
30
31QPrintEngine *QWindowsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId)
32{
33 return new QWin32PrintEngine(printerMode, deviceId);
34}
35
36QPaintEngine *QWindowsPrinterSupport::createPaintEngine(QPrintEngine *engine, QPrinter::PrinterMode printerMode)
37{
38 Q_UNUSED(printerMode);
39 return static_cast<QWin32PrintEngine *>(engine);
40}
41
42QPrintDevice QWindowsPrinterSupport::createPrintDevice(const QString &id)
43{
44 return QPlatformPrinterSupport::createPrintDevice(new QWindowsPrintDevice(id));
45}
46
47QStringList QWindowsPrinterSupport::availablePrintDeviceIds() const
48{
49 return QWindowsPrintDevice::availablePrintDeviceIds();
50}
51
52QString QWindowsPrinterSupport::defaultPrintDeviceId() const
53{
54 return QWindowsPrintDevice::defaultPrintDeviceId();
55}
56
58{
59 Q_OBJECT
60 Q_PLUGIN_METADATA(IID QPlatformPrinterSupportFactoryInterface_iid FILE "windows.json")
61
62public:
64};
65
66QPlatformPrinterSupport *QWindowsPrinterSupportPlugin::create(const QString &key)
67{
68 if (key.compare(key, "windowsprintsupport"_L1, Qt::CaseInsensitive) == 0)
69 return new QWindowsPrinterSupport;
70 return nullptr;
71}
72
73QT_END_NAMESPACE
74
75#include "qwindowsprintersupport.moc"
76
77#endif // QT_NO_PRINTER