Attica

message.cpp
1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8
9#include "message.h"
10
11using namespace Attica;
12
13class Q_DECL_HIDDEN Message::Private : public QSharedData
14{
15public:
16 QString m_id;
17 QString m_from;
18 QString m_to;
19 QDateTime m_sent;
20 Status m_status;
21 QString m_subject;
22 QString m_body;
23
24 Private()
25 : m_status(Unread)
26 {
27 }
28};
29
30Message::Message()
31 : d(new Private)
32{
33}
34
35Message::Message(const Message &other)
36 : d(other.d)
37{
38}
39
40Message &Message::operator=(const Attica::Message &other)
41{
42 d = other.d;
43 return *this;
44}
45
46Message::~Message()
47{
48}
49
50void Message::setId(const QString &u)
51{
52 d->m_id = u;
53}
54
55QString Message::id() const
56{
57 return d->m_id;
58}
59
60void Message::setFrom(const QString &n)
61{
62 d->m_from = n;
63}
64
65QString Message::from() const
66{
67 return d->m_from;
68}
69
70void Message::setTo(const QString &n)
71{
72 d->m_to = n;
73}
74
75QString Message::to() const
76{
77 return d->m_to;
78}
79
80void Message::setSent(const QDateTime &date)
81{
82 d->m_sent = date;
83}
84
85QDateTime Message::sent() const
86{
87 return d->m_sent;
88}
89
90void Message::setStatus(Message::Status s)
91{
92 d->m_status = s;
93}
94
95Message::Status Message::status() const
96{
97 return d->m_status;
98}
99
100void Message::setSubject(const QString &subject)
101{
102 d->m_subject = subject;
103}
104
105QString Message::subject() const
106{
107 return d->m_subject;
108}
109
110void Message::setBody(const QString &body)
111{
112 d->m_body = body;
113}
114
115QString Message::body() const
116{
117 return d->m_body;
118}
119
120bool Message::isValid() const
121{
122 return !(d->m_id.isEmpty());
123}
Represents a message.
Definition message.h:27
The Attica namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 12:00:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.