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 | |
4 | |
5 | #include "qcupsprintersupport_p.h" |
6 | |
7 | #include <qpa/qplatformprintplugin.h> |
8 | #include <QtCore/QStringList> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | using namespace Qt::StringLiterals; |
13 | |
14 | class QCupsPrinterSupportPlugin : public QPlatformPrinterSupportPlugin |
15 | { |
16 | Q_OBJECT |
17 | Q_PLUGIN_METADATA(IID QPlatformPrinterSupportFactoryInterface_iid FILE "cups.json") |
18 | |
19 | public: |
20 | QStringList keys() const; |
21 | QPlatformPrinterSupport *create(const QString &) override; |
22 | }; |
23 | |
24 | QStringList QCupsPrinterSupportPlugin::keys() const |
25 | { |
26 | return QStringList(QStringLiteral("cupsprintersupport")); |
27 | } |
28 | |
29 | QPlatformPrinterSupport *QCupsPrinterSupportPlugin::create(const QString &key) |
30 | { |
31 | if (key.compare(s1: key, s2: "cupsprintersupport"_L1, cs: Qt::CaseInsensitive) == 0) |
32 | return new QCupsPrinterSupport; |
33 | return 0; |
34 | } |
35 | |
36 | QT_END_NAMESPACE |
37 | |
38 | #include "main.moc" |
39 |