File indexing completed on 2024-12-29 04:54:41

0001 /*
0002    SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "ksieveui_private_export.h"
0010 #include "selectdatewidget.h"
0011 #include <QSpinBox>
0012 namespace KSieveUi
0013 {
0014 class KSIEVEUI_TESTS_EXPORT SieveDateSpinBox : public QSpinBox
0015 {
0016     Q_OBJECT
0017 public:
0018     explicit SieveDateSpinBox(QWidget *parent = nullptr);
0019     ~SieveDateSpinBox() override;
0020     void setType(KSieveUi::SelectDateWidget::DateType type);
0021 
0022     void setRange(int minValue, int maxValue);
0023 
0024     void setCode(const QString &value);
0025     [[nodiscard]] QString code() const;
0026 
0027 private:
0028     QString convertValue() const;
0029     SelectDateWidget::DateType mType = SelectDateWidget::Year;
0030 };
0031 }