Libksieve

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

KDE's Doxygen guidelines are available online.