File indexing completed on 2024-04-28 05:02:07

0001 /*
0002  *  Print dialog
0003  *
0004  *  SPDX-FileCopyrightText: 2023 Alexander Reinholdt <alexander.reinholdt@kdemail.net>
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #ifndef SMB4KPRINTDIALOG_H
0009 #define SMB4KPRINTDIALOG_H
0010 
0011 // application specific includes
0012 #include "core/smb4kglobal.h"
0013 
0014 // Qt includes
0015 #include <QDialog>
0016 #include <QLabel>
0017 #include <QPushButton>
0018 #include <QSpinBox>
0019 
0020 // KDE includes
0021 #include <KUrlRequester>
0022 
0023 class Q_DECL_EXPORT Smb4KPrintDialog : public QDialog
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     /**
0029      * Constructor
0030      */
0031     explicit Smb4KPrintDialog(QWidget *parent = nullptr);
0032 
0033     /**
0034      * Destructor
0035      */
0036     virtual ~Smb4KPrintDialog();
0037 
0038     /**
0039      * Set the printer share to which should be printed
0040      *
0041      * @param printer       The printer share
0042      *
0043      * @returns TRUE if the printer share could successfully be set
0044      */
0045     bool setPrinterShare(SharePtr printer);
0046 
0047 protected Q_SLOTS:
0048     void slotPrintFile();
0049     void slotUrlChanged(const QString &path);
0050     void slotCopiesChanged(int copies);
0051 
0052 private:
0053     void enablePrintButton();
0054     SharePtr m_printer;
0055     QPushButton *m_cancelButton;
0056     QPushButton *m_printButton;
0057     QLabel *m_descriptionText;
0058     KUrlRequester *m_fileInput;
0059     QSpinBox *m_copiesInput;
0060 };
0061 
0062 #endif