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

0001 /*
0002     SPDX-FileCopyrightText: 2010-2012 Daniel Nicoletti <dantti12@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef PAGE_DESTINATIONS_H
0008 #define PAGE_DESTINATIONS_H
0009 
0010 #include "GenericPage.h"
0011 
0012 #include <KCupsPrinter.h>
0013 
0014 #include <QUrl>
0015 #include <QLabel>
0016 
0017 namespace Ui {
0018     class PageDestinations;
0019 }
0020 
0021 class DevicesModel;
0022 class ChooseLpd;
0023 class ChoosePrinters;
0024 class ChooseSamba;
0025 class ChooseSerial;
0026 class ChooseSocket;
0027 class ChooseUri;
0028 class PageDestinations : public GenericPage
0029 {
0030     Q_OBJECT
0031 public:
0032     explicit PageDestinations(const QVariantHash &args = QVariantHash(), QWidget *parent = nullptr);
0033     ~PageDestinations() override;
0034 
0035     bool canProceed() const override;
0036     void setValues(const QVariantHash &args) override;
0037     QVariantHash values() const override;
0038     bool isValid() const override;
0039 
0040 private slots:
0041     void deviceChanged();
0042     void deviceUriChanged();
0043     void insertDevice(const QString &device_class,
0044                       const QString &device_id,
0045                       const QString &device_info,
0046                       const QString &device_make_and_model,
0047                       const QString &device_uri,
0048                       const QString &device_location,
0049                       const KCupsPrinters &grouped_printers);
0050 
0051 private:
0052     QString uriText(const QString &uri) const;
0053     QVariantHash selectedItemValues() const;
0054     void setCurrentPage(QWidget *widget, const QVariantHash &args);
0055 
0056     Ui::PageDestinations *ui;
0057     DevicesModel *m_model;
0058 
0059     QString m_currentUri;
0060     ChooseLpd      *m_chooseLpd;
0061     ChoosePrinters *m_choosePrinters;
0062     ChooseSamba    *m_chooseSamba;
0063     ChooseSerial   *m_chooseSerial;
0064     ChooseSocket   *m_chooseSocket;
0065     ChooseUri      *m_chooseUri;
0066     QLabel         *m_chooseLabel;
0067 };
0068 
0069 #endif