#pragma once

#include <QString>
#include <QDateTime>
#include <QVector>

class MailItem
{
public:
    MailItem() = default;
    MailItem(qint64 id, int folderId, const QString& subject, const QString& sender,
             const QString& recipient, const QDateTime& date,
             bool read = false, bool flagged = false,
             const QVector<QString>& attachments = QVector<QString>(),
             const QString& fileId = QString(),
             qint64 size = 0,
             const QString& messageId = QString());

    qint64 id() const { return m_id; }
    void setId(qint64 id) { m_id = id; }

    int folderId() const { return m_folderId; }
    void setFolderId(int folderId) { m_folderId = folderId; }

    QString subject() const { return m_subject; }
    void setSubject(const QString& subject) { m_subject = subject; }

    QString sender() const { return m_sender; }
    void setSender(const QString& sender) { m_sender = sender; }

    QString recipient() const { return m_recipient; }
    void setRecipient(const QString& recipient) { m_recipient = recipient; }

    QDateTime date() const { return m_date; }
    void setDate(const QDateTime& date) { m_date = date; }

    bool isRead() const { return m_read; }
    void setRead(bool read) { m_read = read; }

    bool isFlagged() const { return m_flagged; }
    void setFlagged(bool flagged) { m_flagged = flagged; }

    QVector<QString> attachments() const { return m_attachments; }
    void setAttachments(const QVector<QString>& attachments) { m_attachments = attachments; }

    QString fileId() const { return m_fileId; }
    void setFileId(const QString& fileId) { m_fileId = fileId; }

    qint64 size() const { return m_size; }
    void setSize(qint64 size) { m_size = size; }

    QString messageId() const { return m_messageId; }
    void setMessageId(const QString& messageId) { m_messageId = messageId; }
  
  QString bodyHtml() const { return m_bodyHtml; }
    void setBodyHtml(const QString& body) { m_bodyHtml = body; }
    
    QString to() const { return m_to; }
    void setTo(const QString& to) { m_to = to; }
    
    QString cc() const { return m_cc; }
    void setCc(const QString& cc) { m_cc = cc; }
    
    QString bcc() const { return m_bcc; }
    void setBcc(const QString& bcc) { m_bcc = bcc; }

private:
    qint64 m_id{0};
    int m_folderId{0};
    QString m_subject;
    QString m_sender;
    QString m_recipient;
    QDateTime m_date;
    bool m_read{false};
    bool m_flagged{false};
    QVector<QString> m_attachments;
    QString m_fileId;
    qint64 m_size{0};
    QString m_messageId;
    QString m_bodyHtml;
    QString m_to;
    QString m_cc;
    QString m_bcc;
};