File indexing completed on 2024-04-14 14:16:54

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "message.h"
0010 
0011 using namespace Attica;
0012 
0013 class Q_DECL_HIDDEN Message::Private : public QSharedData
0014 {
0015 public:
0016     QString m_id;
0017     QString m_from;
0018     QString m_to;
0019     QDateTime m_sent;
0020     Status m_status;
0021     QString m_subject;
0022     QString m_body;
0023 
0024     Private()
0025         : m_status(Unread)
0026     {
0027     }
0028 };
0029 
0030 Message::Message()
0031     : d(new Private)
0032 {
0033 }
0034 
0035 Message::Message(const Message &other)
0036     : d(other.d)
0037 {
0038 }
0039 
0040 Message &Message::operator=(const Attica::Message &other)
0041 {
0042     d = other.d;
0043     return *this;
0044 }
0045 
0046 Message::~Message()
0047 {
0048 }
0049 
0050 void Message::setId(const QString &u)
0051 {
0052     d->m_id = u;
0053 }
0054 
0055 QString Message::id() const
0056 {
0057     return d->m_id;
0058 }
0059 
0060 void Message::setFrom(const QString &n)
0061 {
0062     d->m_from = n;
0063 }
0064 
0065 QString Message::from() const
0066 {
0067     return d->m_from;
0068 }
0069 
0070 void Message::setTo(const QString &n)
0071 {
0072     d->m_to = n;
0073 }
0074 
0075 QString Message::to() const
0076 {
0077     return d->m_to;
0078 }
0079 
0080 void Message::setSent(const QDateTime &date)
0081 {
0082     d->m_sent = date;
0083 }
0084 
0085 QDateTime Message::sent() const
0086 {
0087     return d->m_sent;
0088 }
0089 
0090 void Message::setStatus(Message::Status s)
0091 {
0092     d->m_status = s;
0093 }
0094 
0095 Message::Status Message::status() const
0096 {
0097     return d->m_status;
0098 }
0099 
0100 void Message::setSubject(const QString &subject)
0101 {
0102     d->m_subject = subject;
0103 }
0104 
0105 QString Message::subject() const
0106 {
0107     return d->m_subject;
0108 }
0109 
0110 void Message::setBody(const QString &body)
0111 {
0112     d->m_body = body;
0113 }
0114 
0115 QString Message::body() const
0116 {
0117     return d->m_body;
0118 }
0119 
0120 bool Message::isValid() const
0121 {
0122     return !(d->m_id.isEmpty());
0123 }