|
1 /* |
|
2 * Copyright (c) 2009 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 * |
|
16 */ |
|
17 |
|
18 #ifndef NMAPIMESSAGEENVELOPEINFO_H |
|
19 #define NMAPIMESSAGEENVELOPEINFO_H |
|
20 |
|
21 #include <QString> |
|
22 #include <QDateTime> |
|
23 #include <QExplicitlySharedDataPointer> |
|
24 |
|
25 #include "nmenginedef.h" |
|
26 #include "nmapiemailaddress.h" |
|
27 #include "nmapimessagebody.h" |
|
28 |
|
29 namespace EmailClientApi |
|
30 { |
|
31 class NmMessageEnvelopePrivate : public QSharedData |
|
32 { |
|
33 public: |
|
34 NmMessageEnvelopePrivate(); |
|
35 virtual ~NmMessageEnvelopePrivate(); |
|
36 |
|
37 bool read; |
|
38 bool attachments; |
|
39 bool forwarded; |
|
40 bool replied; |
|
41 |
|
42 QList<EmailClientApi::NmEmailAddress> ccRecipients; |
|
43 QList<EmailClientApi::NmEmailAddress> toRecipients; |
|
44 |
|
45 quint64 id; |
|
46 quint64 parentFolder; |
|
47 |
|
48 QString contentType; |
|
49 QString subject; |
|
50 QString sender; |
|
51 |
|
52 QString plainText; |
|
53 quint64 totalSize; |
|
54 quint64 fetchedSize; |
|
55 |
|
56 QDateTime sentTime; |
|
57 }; |
|
58 |
|
59 // read-only envelope |
|
60 class NMENGINE_EXPORT NmMessageEnvelope |
|
61 { |
|
62 public: |
|
63 /* |
|
64 * constructor for nmmessageenvelope |
|
65 */ |
|
66 NmMessageEnvelope(); |
|
67 /* |
|
68 * destructor for nmmessageenvelope |
|
69 */ |
|
70 virtual ~NmMessageEnvelope(); |
|
71 NmMessageEnvelope &operator=(const NmMessageEnvelope &envelope); |
|
72 |
|
73 /*! |
|
74 * getter for id |
|
75 */ |
|
76 quint64 id() const; |
|
77 |
|
78 /* |
|
79 * getter for id of parent folder |
|
80 */ |
|
81 quint64 parentFolder() const; |
|
82 |
|
83 /* |
|
84 * getter for subject |
|
85 */ |
|
86 QString subject() const; |
|
87 |
|
88 /* |
|
89 * getter for sender |
|
90 */ |
|
91 QString sender() const; |
|
92 |
|
93 /* |
|
94 * getter for to recipients |
|
95 */ |
|
96 void toRecipients( QList<EmailClientApi::NmEmailAddress> &toRecipients ); |
|
97 |
|
98 /* |
|
99 * getter for cc recipients |
|
100 */ |
|
101 void ccRecipients( QList<EmailClientApi::NmEmailAddress> &ccRecipients ); |
|
102 |
|
103 /* |
|
104 * getter for sent time |
|
105 */ |
|
106 QDateTime sentTime() const; |
|
107 |
|
108 /* |
|
109 * getter for is read flag |
|
110 */ |
|
111 bool isRead() const; |
|
112 |
|
113 /* |
|
114 * getter for has attachments flag |
|
115 */ |
|
116 bool hasAttachments() const; |
|
117 |
|
118 /* |
|
119 * getter for is forwarded flag |
|
120 */ |
|
121 bool isForwarded() const; |
|
122 |
|
123 /* |
|
124 * getter for is replied flag |
|
125 */ |
|
126 bool isReplied() const; |
|
127 |
|
128 /* |
|
129 * getter for content type |
|
130 */ |
|
131 QString contentType() const; |
|
132 |
|
133 /* |
|
134 * getter for plaintext body |
|
135 */ |
|
136 void plainTextBody( EmailClientApi::NmMessageBody &body ); |
|
137 |
|
138 /* |
|
139 * getter for plaintext body |
|
140 */ |
|
141 QString plainText() const; |
|
142 |
|
143 /* |
|
144 * getter for messages fetched size |
|
145 */ |
|
146 quint64 totalSize() const; |
|
147 |
|
148 /* |
|
149 * getter for messages fetched size |
|
150 */ |
|
151 quint64 fetchedSize() const; |
|
152 |
|
153 /* |
|
154 * setter for id |
|
155 */ |
|
156 void setId(quint64 id); |
|
157 |
|
158 /* |
|
159 * setter for parent folder |
|
160 */ |
|
161 void setParentFolder(quint64 parentFolder); |
|
162 |
|
163 /* |
|
164 * setter for subject |
|
165 */ |
|
166 void setSubject(const QString& subject); |
|
167 |
|
168 /* |
|
169 * setter for sender |
|
170 */ |
|
171 void setSender(const QString& sender); |
|
172 |
|
173 /* |
|
174 * setter for to recipients |
|
175 */ |
|
176 void setGetToRecipients(const QList<EmailClientApi::NmEmailAddress>& toRecipients); |
|
177 |
|
178 /* |
|
179 * setter for cc recipients |
|
180 */ |
|
181 void setGetCcRecipients(const QList<EmailClientApi::NmEmailAddress> &ccRecipients); |
|
182 |
|
183 /* |
|
184 * setter for sent time |
|
185 */ |
|
186 void setSentTime(QDateTime sentTime); |
|
187 |
|
188 /* |
|
189 * setter for is read flag |
|
190 */ |
|
191 void setIsRead(bool isRead); |
|
192 |
|
193 /* |
|
194 * setter for has attachments flag |
|
195 */ |
|
196 void setHasAttachments(bool hasAttachments); |
|
197 |
|
198 /* |
|
199 * setter for is forwarded flag |
|
200 */ |
|
201 void setIsForwarded(bool isForwarded); |
|
202 |
|
203 /* |
|
204 * setter for is replied flag |
|
205 */ |
|
206 void setIsReplied(bool isReplied); |
|
207 |
|
208 /* |
|
209 * setter for content type |
|
210 */ |
|
211 void setContentType(const QString &contentType); |
|
212 |
|
213 /* |
|
214 * getter for messages plain text |
|
215 */ |
|
216 void setPlainText(const QString &plainText); |
|
217 |
|
218 /* |
|
219 * getter for messages fetched size |
|
220 */ |
|
221 void setTotalSize(quint64 totalSize); |
|
222 |
|
223 /* |
|
224 * getter for messages fetched size |
|
225 */ |
|
226 void setFetchedSize(quint64 fetchedSize); |
|
227 |
|
228 private: |
|
229 QExplicitlySharedDataPointer<NmMessageEnvelopePrivate> d; |
|
230 }; |
|
231 } |
|
232 #endif |
|
233 |