File indexing completed on 2022-09-27 16:37:09

0001 /*
0002     SPDX-FileCopyrightText: 2010 Daniel Nicoletti <dantti12@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef CHOOSE_URI_H
0008 #define CHOOSE_URI_H
0009 
0010 #include "GenericPage.h"
0011 
0012 #include <KCupsPrinter.h>
0013 
0014 #include <QUrl>
0015 
0016 namespace Ui {
0017     class ChooseUri;
0018 }
0019 class KCupsRequest;
0020 class ChooseUri : public GenericPage
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit ChooseUri(QWidget *parent = nullptr);
0025     ~ChooseUri() override;
0026 
0027     void setValues(const QVariantHash &args) override;
0028     QVariantHash values() const override;
0029     bool isValid() const override;
0030     bool canProceed() const override;
0031 
0032 public slots:
0033     void load();
0034 
0035 signals:
0036     void errorMessage(const QString &message);
0037     void insertDevice(const QString &device_class,
0038                       const QString &device_id,
0039                       const QString &device_info,
0040                       const QString &device_make_and_model,
0041                       const QString &device_uri,
0042                       const QString &device_location,
0043                       const KCupsPrinters &grouped_printers);
0044 
0045 private slots:
0046     void checkSelected();
0047     void on_addressLE_textChanged(const QString &text);
0048     void findPrinters();
0049     void getPrintersFinished(KCupsRequest *request);
0050 
0051 private:
0052     QUrl parsedURL(const QString &text) const;
0053 
0054     Ui::ChooseUri *ui;
0055 };
0056 
0057 #endif