Messagelib

sendlaterinfo.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
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
14namespace MessageComposer
15{
16/** Send later information. */
17class MESSAGECOMPOSER_EXPORT SendLaterInfo
18{
19public:
20 explicit SendLaterInfo() = default;
21
22 enum RecurrenceUnit {
23 Days = 0,
24 Weeks,
25 Months,
26 Years,
27 };
28
29 [[nodiscard]] bool isValid() const;
30
31 void setItemId(Akonadi::Item::Id id);
32 [[nodiscard]] Akonadi::Item::Id itemId() const;
33
34 void setRecurrenceUnit(RecurrenceUnit unit);
35 [[nodiscard]] RecurrenceUnit recurrenceUnit() const;
36
37 void setRecurrenceEachValue(int value);
38 [[nodiscard]] int recurrenceEachValue() const;
39
40 [[nodiscard]] bool isRecurrence() const;
41 void setRecurrence(bool b);
42
43 void setDateTime(const QDateTime &time);
44 [[nodiscard]] QDateTime dateTime() const;
45
46 void setLastDateTimeSend(const QDateTime &date);
47 [[nodiscard]] QDateTime lastDateTimeSend() const;
48
49 void setSubject(const QString &subject);
50 [[nodiscard]] QString subject() const;
51
52 void setTo(const QString &to);
53 [[nodiscard]] QString to() const;
54
55 bool operator==(const SendLaterInfo &other) const;
56 inline bool operator!=(const SendLaterInfo &other) const
57 {
58 return !(*this == other);
59 }
60
61private:
62 QString mTo;
63 QString mSubject;
64 QDateTime mDateTime;
65 QDateTime mLastDateTimeSend;
66 Akonadi::Item::Id mId = -1;
67 int mRecurrenceEachValue = 1;
68 RecurrenceUnit mRecurrenceUnit = Days;
69 bool mRecurrence = false;
70};
71}
72
73MESSAGECOMPOSER_EXPORT QDebug operator<<(QDebug debug, const MessageComposer::SendLaterInfo &info);
Send later information.
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-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:05:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.