summaryrefslogtreecommitdiff
path: root/noncore/net/mail/mailtypes.cpp
blob: 6a66113ef487743b85f2a4ad6d95c020a687160f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#include "mailtypes.h"


RecMail::RecMail()
    :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7)
{
    init();
}

RecMail::RecMail(const RecMail&old)
    :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7)
{
    init();
    copy_old(old);
    qDebug("Copy constructor RecMail");
}

void RecMail::copy_old(const RecMail&old)
{
    subject = old.subject;
    date = old.date;
    mbox = old.mbox;
    msg_id = old.msg_id;
    msg_size = old.msg_size;
    msg_number = old.msg_number;
    from = old.from;
    msg_flags = old.msg_flags;
    to = old.to;
    cc = old.cc;
    bcc = old.bcc;
}

void RecMail::init()
{
    to.clear();
    cc.clear();
    bcc.clear();
}

void RecMail::setTo(const QStringList&list)
{
    to = list;
}

const QStringList&RecMail::To()const
{
    return to;
}

void RecMail::setCC(const QStringList&list)
{
    cc = list;
}

const QStringList&RecMail::CC()const
{
    return cc;
}

void RecMail::setBcc(const QStringList&list)
{
    bcc = list;
}

const QStringList& RecMail::Bcc()const
{
    return bcc;
}

RecPart::RecPart()
    : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_lines(0)
{
}

RecPart::RecPart(const QString&identifier,const QString&type,const QString&subtype,const QString&encoding,unsigned int lines)
    : m_type(type),m_subtype(subtype),m_identifier(identifier),m_encoding(encoding),m_lines(lines)
{
}

RecPart::~RecPart()
{
}

void RecPart::setLines(unsigned int lines)
{
    m_lines = lines;
}
    
const unsigned int RecPart::Lines()const
{
    return m_lines;
}

const QString& RecPart::Type()const
{
    return m_type;
}

void RecPart::setType(const QString&type)
{
    m_type = type;
}

const QString& RecPart::Subtype()const
{
    return m_subtype;
}

void RecPart::setSubtype(const QString&subtype)
{
    m_subtype = subtype;
}

const QString& RecPart::Identifier()const
{
    return m_identifier;
}

void RecPart::setIdentifier(const QString&identifier)
{
    m_identifier = identifier;
}

const QString& RecPart::Encoding()const
{
    return m_encoding;
}

void RecPart::setEncoding(const QString&encoding)
{
    m_encoding = encoding;
}

RecBody::RecBody()
    : m_BodyText(),m_PartsList()
{
    m_PartsList.setAutoDelete(true);
}

RecBody::~RecBody()
{
}

void RecBody::setBodytext(const QString&bodyText)
{
    m_BodyText = bodyText;
}

const QString& RecBody::Bodytext()const
{
    return m_BodyText;
}

void RecBody::setParts(const QList<RecPart>&parts)
{
    m_PartsList = parts;
    m_PartsList.setAutoDelete(true);
}

const QList<RecPart>& RecBody::Parts()const
{
    return m_PartsList;
}

void RecBody::addPart(const RecPart& part)
{
    RecPart*p = new RecPart(part);
    m_PartsList.append(p);
}

void RecBody::setType(const QString&type)
{
    m_type = type;
}

const QString& RecBody::Type()const
{
    return m_type;
}

void RecBody::setSubtype(const QString&type)
{
    m_subtype = type;
}

const QString& RecBody::Subtype()const
{
    return m_subtype;
}