Libksieve

vacationeditwidget.h
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "vacationutils.h"
10 #include <QWidget>
11 class KDateComboBox;
12 class KTimeComboBox;
13 
14 class QComboBox;
15 class QDate;
16 class QTime;
17 
18 class QLabel;
19 class QSpinBox;
20 class QLineEdit;
21 class KDateComboBox;
22 
23 class QDate;
24 
25 namespace KPIMTextEdit
26 {
27 class PlainTextEditorWidget;
28 }
29 
30 class QCheckBox;
31 
32 namespace KMime
33 {
34 namespace Types
35 {
36 struct AddrSpec;
37 using AddrSpecList = QVector<AddrSpec>;
38 }
39 }
40 
41 namespace PimCommon
42 {
43 class SpellCheckLineEdit;
44 }
45 
46 namespace KSieveUi
47 {
48 class VacationMailActionWidget;
49 class SieveImapAccountSettings;
50 class VacationMailLineEdit;
51 class VacationEditWidget : public QWidget
52 {
53  Q_OBJECT
54 public:
55  explicit VacationEditWidget(QWidget *parent = nullptr);
56  ~VacationEditWidget() override;
57 
58  void enableDomainAndSendForSpam(bool enable = true);
59  void enableDates(bool enable = true);
60 
61  Q_REQUIRED_RESULT bool activateVacation() const;
62  void setActivateVacation(bool activate);
63 
64  Q_REQUIRED_RESULT bool domainCheck() const;
65  void setDomainCheck(bool check);
66 
67  Q_REQUIRED_RESULT QString messageText() const;
68  void setMessageText(const QString &text);
69 
70  Q_REQUIRED_RESULT int notificationInterval() const;
71  void setNotificationInterval(int days);
72 
73  Q_REQUIRED_RESULT KMime::Types::AddrSpecList mailAliases(bool &ok) const;
74  void setMailAliases(const KMime::Types::AddrSpecList &aliases);
75  void setMailAliases(const QString &aliases);
76 
77  Q_REQUIRED_RESULT QString domainName() const;
78  void setDomainName(const QString &domain);
79 
80  Q_REQUIRED_RESULT QString subject() const;
81  void setSubject(const QString &subject);
82 
83  Q_REQUIRED_RESULT bool sendForSpam() const;
84  void setSendForSpam(bool enable);
85 
86  Q_REQUIRED_RESULT QDate startDate() const;
87  void setStartDate(QDate startDate);
88 
89  Q_REQUIRED_RESULT QTime startTime() const;
90  void setStartTime(QTime startTime);
91 
92  Q_REQUIRED_RESULT QDate endDate() const;
93  void setEndDate(QDate endDate);
94 
95  Q_REQUIRED_RESULT QTime endTime() const;
96  void setEndTime(QTime endTime);
97 
98  Q_REQUIRED_RESULT VacationUtils::MailAction mailAction() const;
99  Q_REQUIRED_RESULT QString mailActionRecipient(bool &valid) const;
100  void setMailAction(VacationUtils::MailAction action, const QString &recipient);
101  void setSieveImapAccountSettings(const KSieveUi::SieveImapAccountSettings &account);
102 
103  void setDefault();
104 
105  Q_REQUIRED_RESULT bool changed() const;
106  void setChanged(bool changed);
107 
108 private Q_SLOTS:
109  void slotIntervalSpinChanged(int value);
110  void mailActionChanged(int index);
111 
112 private:
113  void setWasChanged();
114 
115 protected:
116  QCheckBox *mActiveCheck = nullptr;
117  QSpinBox *mIntervalSpin = nullptr;
118  VacationMailLineEdit *mMailAliasesEdit = nullptr;
119  KPIMTextEdit::PlainTextEditorWidget *mTextEdit = nullptr;
120  QCheckBox *mSpamCheck = nullptr;
121  QCheckBox *mDomainCheck = nullptr;
122  QLineEdit *mDomainEdit = nullptr;
123  PimCommon::SpellCheckLineEdit *mSubject = nullptr;
124  QComboBox *mMailAction = nullptr;
125  VacationMailActionWidget *mMailActionRecipient = nullptr;
126  KDateComboBox *mStartDate = nullptr;
127  KTimeComboBox *mStartTime = nullptr;
128  QCheckBox *mStartTimeActive = nullptr;
129  QLabel *mStartDateLabel = nullptr;
130  KDateComboBox *mEndDate = nullptr;
131  KTimeComboBox *mEndTime = nullptr;
132  QCheckBox *mEndTimeActive = nullptr;
133  QLabel *mEndDateLabel = nullptr;
134  bool mChanged = false;
135 };
136 }
137 
The SieveImapAccountSettings class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:09:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.