68
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
* Api's email message implementation.
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "nmapiheaders.h"
|
|
19 |
|
|
20 |
namespace EmailClientApi
|
|
21 |
{
|
|
22 |
|
|
23 |
/*!
|
|
24 |
Class constructor.
|
|
25 |
*/
|
|
26 |
NmApiMessagePrivate::NmApiMessagePrivate()
|
|
27 |
{
|
|
28 |
NM_FUNCTION;
|
|
29 |
}
|
|
30 |
|
|
31 |
/*!
|
74
|
32 |
Class copy constructor.
|
|
33 |
*/
|
|
34 |
NmApiMessagePrivate::NmApiMessagePrivate(const NmApiMessagePrivate &other)
|
|
35 |
: QSharedData(other),
|
|
36 |
mPlainTextContent(other.mPlainTextContent),
|
|
37 |
mHtmlContent(other.mHtmlContent),
|
|
38 |
mComplete(other.mComplete),
|
|
39 |
mAttachments(other.mAttachments),
|
|
40 |
mEnvelope(other.mEnvelope)
|
|
41 |
{
|
|
42 |
NM_FUNCTION;
|
|
43 |
}
|
|
44 |
|
|
45 |
/*!
|
68
|
46 |
Class destructor.
|
|
47 |
*/
|
|
48 |
NmApiMessagePrivate::~NmApiMessagePrivate()
|
|
49 |
{
|
|
50 |
NM_FUNCTION;
|
|
51 |
}
|
|
52 |
|
|
53 |
/*!
|
|
54 |
\fn plainTextContent
|
|
55 |
\return Message plain text content.
|
|
56 |
|
|
57 |
Returns message plain text content.
|
|
58 |
*/
|
|
59 |
NmApiTextContent NmApiMessagePrivate::plainTextContent()
|
|
60 |
{
|
|
61 |
NM_FUNCTION;
|
|
62 |
return mPlainTextContent;
|
|
63 |
}
|
|
64 |
|
|
65 |
/*!
|
|
66 |
\fn htmlContent
|
|
67 |
\return Message html text content.
|
|
68 |
|
|
69 |
Returns message html text content.
|
|
70 |
*/
|
|
71 |
NmApiTextContent NmApiMessagePrivate::htmlContent()
|
|
72 |
{
|
|
73 |
NM_FUNCTION;
|
|
74 |
return mHtmlContent;
|
|
75 |
}
|
|
76 |
|
|
77 |
/*!
|
|
78 |
\fn isComplete
|
|
79 |
\return Message complete state.
|
|
80 |
|
|
81 |
Returns message complete state.
|
|
82 |
*/
|
|
83 |
bool NmApiMessagePrivate::isComplete()
|
|
84 |
{
|
|
85 |
NM_FUNCTION;
|
|
86 |
return mComplete;
|
|
87 |
}
|
|
88 |
|
|
89 |
/*!
|
|
90 |
\fn getAttachments
|
|
91 |
\return Message attachment list.
|
|
92 |
|
|
93 |
Returns message attachment list.
|
|
94 |
*/
|
|
95 |
QList<NmApiAttachment> NmApiMessagePrivate::attachments()
|
|
96 |
{
|
|
97 |
NM_FUNCTION;
|
|
98 |
return mAttachments;
|
|
99 |
}
|
|
100 |
|
|
101 |
|
|
102 |
/*!
|
|
103 |
\fn addAttachment
|
|
104 |
\param attachment Attachment.
|
|
105 |
|
|
106 |
Add attachment to message.
|
|
107 |
*/
|
|
108 |
void NmApiMessagePrivate::addAttachment(NmApiAttachment &attachment)
|
|
109 |
{
|
|
110 |
NM_FUNCTION;
|
|
111 |
mAttachments.append(attachment);
|
|
112 |
}
|
|
113 |
|
|
114 |
/*!
|
|
115 |
\fn envelope
|
|
116 |
\return Message envelope.
|
|
117 |
|
|
118 |
Returns message envelope.
|
|
119 |
*/
|
|
120 |
NmApiMessageEnvelope& NmApiMessagePrivate::envelope()
|
|
121 |
{
|
|
122 |
NM_FUNCTION;
|
|
123 |
return mEnvelope;
|
|
124 |
}
|
|
125 |
|
|
126 |
/*!
|
|
127 |
\fn setPlainTextContent
|
|
128 |
\param textContent Content.
|
|
129 |
|
|
130 |
Setter for plain text content.
|
|
131 |
*/
|
|
132 |
void NmApiMessagePrivate::setPlainTextContent(NmApiTextContent &textContent)
|
|
133 |
{
|
|
134 |
NM_FUNCTION;
|
|
135 |
mPlainTextContent = textContent;
|
|
136 |
}
|
|
137 |
|
|
138 |
/*!
|
|
139 |
\fn setHtmlContent
|
|
140 |
\param textContent Content.
|
|
141 |
|
|
142 |
Setter for html text content.
|
|
143 |
*/
|
|
144 |
void NmApiMessagePrivate::setHtmlContent(NmApiTextContent &textContent)
|
|
145 |
{
|
|
146 |
NM_FUNCTION;
|
|
147 |
mHtmlContent = textContent;
|
|
148 |
}
|
|
149 |
|
|
150 |
/*!
|
|
151 |
\fn setComplete
|
|
152 |
\param complete Complete state.
|
|
153 |
|
|
154 |
Setter for message complete state.
|
|
155 |
*/
|
|
156 |
void NmApiMessagePrivate::setComplete(bool complete)
|
|
157 |
{
|
|
158 |
NM_FUNCTION;
|
|
159 |
mComplete = complete;
|
|
160 |
}
|
|
161 |
|
|
162 |
/*!
|
|
163 |
\fn setAttachments
|
|
164 |
\param attachments Attachments.
|
|
165 |
|
|
166 |
Setter for set attachments to message.
|
|
167 |
*/
|
|
168 |
void NmApiMessagePrivate::setAttachments(QList<NmApiAttachment> &attachments)
|
|
169 |
{
|
|
170 |
NM_FUNCTION;
|
|
171 |
mAttachments = attachments;
|
|
172 |
|
|
173 |
}
|
|
174 |
|
|
175 |
/*!
|
|
176 |
\fn setEnvelope
|
|
177 |
\param envelope Envelope.
|
|
178 |
|
|
179 |
Setter for message envelope.
|
|
180 |
*/
|
|
181 |
void NmApiMessagePrivate::setEnvelope(NmApiMessageEnvelope &envelope)
|
|
182 |
{
|
|
183 |
NM_FUNCTION;
|
|
184 |
mEnvelope = envelope;
|
|
185 |
}
|
|
186 |
|
|
187 |
}
|