Messagelib

sendlaterinfo.h
1 /*
2  SPDX-FileCopyrightText: 2013-2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <Akonadi/Item>
10 #include <QDateTime>
11 
12 #include "messagecomposer_export.h"
13 
14 namespace MessageComposer
15 {
16 /** Send later information. */
17 class MESSAGECOMPOSER_EXPORT SendLaterInfo
18 {
19 public:
20  explicit SendLaterInfo() = default;
21 
22  enum RecurrenceUnit { Days = 0, Weeks, Months, Years };
23 
24  Q_REQUIRED_RESULT bool isValid() const;
25 
26  void setItemId(Akonadi::Item::Id id);
27  Q_REQUIRED_RESULT Akonadi::Item::Id itemId() const;
28 
29  void setRecurrenceUnit(RecurrenceUnit unit);
30  Q_REQUIRED_RESULT RecurrenceUnit recurrenceUnit() const;
31 
32  void setRecurrenceEachValue(int value);
33  Q_REQUIRED_RESULT int recurrenceEachValue() const;
34 
35  Q_REQUIRED_RESULT bool isRecurrence() const;
36  void setRecurrence(bool b);
37 
38  void setDateTime(const QDateTime &time);
39  Q_REQUIRED_RESULT QDateTime dateTime() const;
40 
41  void setLastDateTimeSend(const QDateTime &date);
42  Q_REQUIRED_RESULT QDateTime lastDateTimeSend() const;
43 
44  void setSubject(const QString &subject);
45  Q_REQUIRED_RESULT QString subject() const;
46 
47  void setTo(const QString &to);
48  Q_REQUIRED_RESULT QString to() const;
49 
50  bool operator==(const SendLaterInfo &other) const;
51  inline bool operator!=(const SendLaterInfo &other) const
52  {
53  return !(*this == other);
54  }
55 
56 private:
57  QString mTo;
58  QString mSubject;
59  QDateTime mDateTime;
60  QDateTime mLastDateTimeSend;
61  Akonadi::Item::Id mId = -1;
62  int mRecurrenceEachValue = 1;
63  RecurrenceUnit mRecurrenceUnit = Days;
64  bool mRecurrence = false;
65 };
66 }
67 
68 MESSAGECOMPOSER_EXPORT QDebug operator<<(QDebug debug, const MessageComposer::SendLaterInfo &info);
69 
Send later information.
Definition: sendlaterinfo.h:17
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jan 22 2022 23:06:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.