File indexing completed on 2025-01-19 05:06:22
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 <QLabel> 0015 #include <QUrl> 0016 0017 namespace Ui 0018 { 0019 class PageDestinations; 0020 } 0021 0022 class DevicesModel; 0023 class ChooseLpd; 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 QVariantMap &args = QVariantMap(), QWidget *parent = nullptr); 0033 ~PageDestinations() override; 0034 0035 bool canProceed() const override; 0036 void setValues(const QVariantMap &args) override; 0037 QVariantMap 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 QVariantMap selectedItemValues() const; 0053 void setCurrentPage(QWidget *widget, const QVariantMap &args); 0054 0055 Ui::PageDestinations *const ui; 0056 DevicesModel *m_model = nullptr; 0057 0058 QString m_currentUri; 0059 ChooseLpd *m_chooseLpd = nullptr; 0060 ChooseSamba *m_chooseSamba = nullptr; 0061 ChooseSerial *m_chooseSerial = nullptr; 0062 ChooseSocket *m_chooseSocket = nullptr; 0063 ChooseUri *m_chooseUri = nullptr; 0064 QLabel *m_chooseLabel = nullptr; 0065 }; 0066 0067 #endif