Libksieve

selectdatewidget.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6#pragma once
7
8#include "ksieveui_private_export.h"
9#include <QWidget>
10
11class QComboBox;
12class QLineEdit;
13class QStackedWidget;
14class KDateComboBox;
15class KTimeComboBox;
16namespace KSieveUi
17{
18class SieveDateSpinBox;
19class KSIEVEUI_TESTS_EXPORT SelectDateWidget : public QWidget
20{
21 Q_OBJECT
22public:
23 enum DateType : uint8_t {
24 Year = 0,
25 Month,
26 Day,
27 Date,
28 Julian,
29 Hour,
30 Minute,
31 Second,
32 Time,
33 Iso8601,
34 Std11,
35 Zone,
36 Weekday
37 };
38 explicit SelectDateWidget(QWidget *parent = nullptr);
39 ~SelectDateWidget() override;
40
41 [[nodiscard]] QString code() const;
42 void setCode(const QString &type, const QString &value);
43
44Q_SIGNALS:
45 void valueChanged();
46
47private:
48 void slotDateTypeActivated(int);
49 SelectDateWidget::DateType dateTypeFromString(const QString &str);
50 void initialize();
51 QString dateType(DateType type) const;
52 QString dateValue(DateType type) const;
53 QComboBox *mDateType = nullptr;
54 QLineEdit *mDateLineEdit = nullptr;
55 SieveDateSpinBox *mDateValue = nullptr;
56 KDateComboBox *mDateEdit = nullptr;
57 KTimeComboBox *mTimeEdit = nullptr;
58 QStackedWidget *mStackWidget = nullptr;
59};
60}
61Q_DECLARE_METATYPE(KSieveUi::SelectDateWidget::DateType)
KCRASH_EXPORT void initialize()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.