Libksieve

vacationutils.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 #include <QString>
9 #include <kmime/kmime_header_parsing.h>
10 
11 class QDate;
12 
13 namespace KSieveUi
14 {
15 namespace VacationUtils
16 {
17 enum MailAction {
18  Keep,
19  Discard,
20  Sendto,
21  CopyTo,
22 };
23 
24 Q_REQUIRED_RESULT QString defaultMessageText();
25 Q_REQUIRED_RESULT QString defaultSubject();
26 Q_REQUIRED_RESULT MailAction defaultMailAction();
27 Q_REQUIRED_RESULT int defaultNotificationInterval();
28 Q_REQUIRED_RESULT KMime::Types::AddrSpecList defaultMailAliases();
29 Q_REQUIRED_RESULT bool defaultSendForSpam();
30 Q_REQUIRED_RESULT QString defaultDomainName();
31 Q_REQUIRED_RESULT QDate defaultStartDate();
32 Q_REQUIRED_RESULT QDate defaultEndDate();
33 
34 struct Vacation {
35  Vacation()
36  {
37  }
38 
39  Q_REQUIRED_RESULT bool isValid() const
40  {
41  return valid;
42  }
43 
44  QString mailActionRecipient;
45  QString messageText;
46  QString subject;
48  QString reactOndomainName;
49  QDate startDate;
50  QTime startTime;
51  QDate endDate;
52  QTime endTime;
53  int notificationInterval = 1;
54  MailAction mailAction = Keep;
55  bool valid = false;
56  bool active = false;
57  bool sendForSpam = true;
58 };
59 
60 Q_REQUIRED_RESULT QString composeScript(const Vacation &vacation);
61 
62 Q_REQUIRED_RESULT KSieveUi::VacationUtils::Vacation parseScript(const QString &script);
63 
64 Q_REQUIRED_RESULT QString mergeRequireLine(const QString &script, const QString &scriptUpdate);
65 
66 Q_REQUIRED_RESULT QString updateVacationBlock(const QString &oldScript, const QString &newScript);
67 
68 Q_REQUIRED_RESULT QString mailAction(MailAction action);
69 }
70 }
71 
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.