File indexing completed on 2025-01-05 05:09:31

0001 /*
0002     SPDX-FileCopyrightText: 2015 Jan Grulich <jgrulich@redhat.com>
0003     SPDX-FileCopyrightText: 2023 Mike Noe <noeerover@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef PROCESS_RUNNER_H
0009 #define PROCESS_RUNNER_H
0010 
0011 #include <QObject>
0012 #include <kcupslib_export.h>
0013 #include <qqmlregistration.h>
0014 
0015 class KCUPSLIB_EXPORT ProcessRunner : public QObject
0016 {
0017     Q_OBJECT
0018     QML_ELEMENT
0019     QML_SINGLETON
0020 
0021 public:
0022     explicit ProcessRunner(QObject *parent = nullptr);
0023 
0024 public Q_SLOTS:
0025     static void configurePrinter(const QString &printerName);
0026     static void openPrintQueue(const QString &printerName);
0027 
0028     static void addPrinter();
0029     static void addPrinterFromDevice(const QString &device);
0030     static void addClass();
0031     static void changePrinterPPD(const QString &printerName);
0032 
0033 private:
0034     static void exec(const QString &cmd, const QStringList &args, const QString &desktopFile = QString());
0035 };
0036 
0037 #endif // PROCESS_RUNNER_H