Messagelib

sendlaterinfo.cpp
1 /*
2  SPDX-FileCopyrightText: 2013-2023 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "sendlaterinfo.h"
8 
9 using namespace MessageComposer;
10 
11 bool SendLaterInfo::isValid() const
12 {
13  return (mId != -1) && mDateTime.isValid();
14 }
15 
16 bool SendLaterInfo::isRecurrence() const
17 {
18  return mRecurrence;
19 }
20 
21 void SendLaterInfo::setRecurrence(bool b)
22 {
23  mRecurrence = b;
24 }
25 
26 void SendLaterInfo::setRecurrenceUnit(SendLaterInfo::RecurrenceUnit unit)
27 {
28  mRecurrenceUnit = unit;
29 }
30 
31 SendLaterInfo::RecurrenceUnit SendLaterInfo::recurrenceUnit() const
32 {
33  return mRecurrenceUnit;
34 }
35 
36 void SendLaterInfo::setRecurrenceEachValue(int value)
37 {
38  mRecurrenceEachValue = value;
39 }
40 
41 int SendLaterInfo::recurrenceEachValue() const
42 {
43  return mRecurrenceEachValue;
44 }
45 
46 void SendLaterInfo::setItemId(Akonadi::Item::Id id)
47 {
48  mId = id;
49 }
50 
51 Akonadi::Item::Id SendLaterInfo::itemId() const
52 {
53  return mId;
54 }
55 
56 void SendLaterInfo::setDateTime(const QDateTime &time)
57 {
58  mDateTime = time;
59 }
60 
61 QDateTime SendLaterInfo::dateTime() const
62 {
63  return mDateTime;
64 }
65 
66 void SendLaterInfo::setLastDateTimeSend(const QDateTime &dateTime)
67 {
68  mLastDateTimeSend = dateTime;
69 }
70 
71 QDateTime SendLaterInfo::lastDateTimeSend() const
72 {
73  return mLastDateTimeSend;
74 }
75 
76 void SendLaterInfo::setSubject(const QString &subject)
77 {
78  mSubject = subject;
79 }
80 
81 QString SendLaterInfo::subject() const
82 {
83  return mSubject;
84 }
85 
86 void SendLaterInfo::setTo(const QString &to)
87 {
88  mTo = to;
89 }
90 
91 QString SendLaterInfo::to() const
92 {
93  return mTo;
94 }
95 
96 bool SendLaterInfo::operator==(const SendLaterInfo &other) const
97 {
98  return (itemId() == other.itemId()) && (recurrenceUnit() == other.recurrenceUnit()) && (recurrenceEachValue() == other.recurrenceEachValue())
99  && (isRecurrence() == other.isRecurrence()) && (dateTime() == other.dateTime()) && (lastDateTimeSend() == other.lastDateTimeSend())
100  && (subject() == other.subject()) && (to() == other.to());
101 }
102 
103 QDebug operator<<(QDebug d, const SendLaterInfo &info)
104 {
105  d << "mTo: " << info.to();
106  d << "mSubject: " << info.subject();
107  d << "mDateTime: " << info.dateTime().toString();
108  d << "mLastDateTimeSend: " << info.lastDateTimeSend().toString();
109  d << "mId: " << info.itemId();
110  d << "mRecurrenceEachValue: " << info.recurrenceEachValue();
111  d << "mRecurrenceUnit: " << info.recurrenceUnit();
112  d << "mRecurrence: " << info.isRecurrence();
113  return d;
114 }
Send later information.
Definition: sendlaterinfo.h:17
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
QDataStream & operator<<(QDataStream &out, const KDateTime &dateTime)
bool isValid() const const
QString toString(Qt::DateFormat format) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Mar 22 2023 04:07:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.