Libksieve

vacationutils.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 "ksievecore_export.h"
9#include <KMime/HeaderParsing>
10#include <QString>
11
12class QDate;
13
14namespace KSieveCore
15{
16namespace VacationUtils
17{
18enum MailAction : uint8_t {
19 Keep,
20 Discard,
21 Sendto,
22 CopyTo,
23};
24
25[[nodiscard]] KSIEVECORE_EXPORT QString defaultMessageText();
26[[nodiscard]] KSIEVECORE_EXPORT QString defaultSubject();
27[[nodiscard]] KSIEVECORE_EXPORT MailAction defaultMailAction();
28[[nodiscard]] KSIEVECORE_EXPORT int defaultNotificationInterval();
29[[nodiscard]] KSIEVECORE_EXPORT KMime::Types::AddrSpecList defaultMailAliases();
30[[nodiscard]] KSIEVECORE_EXPORT bool defaultSendForSpam();
31[[nodiscard]] KSIEVECORE_EXPORT QString defaultDomainName();
32[[nodiscard]] KSIEVECORE_EXPORT QDate defaultStartDate();
33[[nodiscard]] KSIEVECORE_EXPORT QDate defaultEndDate();
34
35struct KSIEVECORE_EXPORT Vacation {
36 Vacation() = default;
37
38 [[nodiscard]] bool isValid() const
39 {
40 return valid;
41 }
42
43 QString mailActionRecipient;
44 QString messageText;
45 QString subject;
47 QString reactOndomainName;
48 QDate startDate;
49 QTime startTime;
50 QDate endDate;
51 QTime endTime;
52 int notificationInterval = 1;
53 MailAction mailAction = Keep;
54 bool valid = false;
55 bool active = false;
56 bool sendForSpam = true;
57};
58
59[[nodiscard]] KSIEVECORE_EXPORT QString composeScript(const Vacation &vacation);
60
61[[nodiscard]] KSIEVECORE_EXPORT KSieveCore::VacationUtils::Vacation parseScript(const QString &script);
62
63[[nodiscard]] KSIEVECORE_EXPORT QString mergeRequireLine(const QString &script, const QString &scriptUpdate);
64
65[[nodiscard]] KSIEVECORE_EXPORT QString updateVacationBlock(const QString &oldScript, const QString &newScript);
66
67[[nodiscard]] KSIEVECORE_EXPORT QString mailAction(MailAction action);
68}
69}
bool isValid(QStringView ifopt)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:09:39 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.