Libksieve

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

KDE's Doxygen guidelines are available online.