File indexing completed on 2021-12-21 14:36:55

0001 /*
0002     SPDX-FileCopyrightText: 2002 Jean-Baptiste Mardelle <bj@altern.org>
0003     SPDX-FileCopyrightText: 2007 Jimmy Gilles <jimmygilles@gmail.com>
0004     SPDX-FileCopyrightText: 2008 Rolf Eike Beer <kde@opensource.sf-tec.de>
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef SELECTEXPIRYDATE_H
0009 #define SELECTEXPIRYDATE_H
0010 
0011 #include <QDateTime>
0012 #include <QDialog>
0013 
0014 class KDatePicker;
0015 class QCheckBox;
0016 class QPushButton;
0017 
0018 /**
0019  * @brief shows a dialog to choose expiry date
0020  *
0021  * This dialog allows the user to choose a expiry date or set a
0022  * checkbox to select that the given item will never expire.
0023  */
0024 class SelectExpiryDate : public QDialog
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     explicit SelectExpiryDate(QWidget *parent = nullptr, QDateTime date = QDateTime());
0030 
0031     QDateTime date() const;
0032 
0033 private Q_SLOTS:
0034     void slotCheckDate(const QDate &date);
0035     void slotEnableDate(const bool ison);
0036 
0037 private:
0038     QCheckBox *m_unlimited;
0039     QPushButton *okButton;
0040     KDatePicker *m_datepicker;
0041 };
0042 
0043 #endif /* SELECTEXPIRYDATE_H */