|
1 /* |
|
2 * Copyright (c) 2007-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: common email base object |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CFSMAILMESSAGEBASE_H |
|
20 #define __CFSMAILMESSAGEBASE_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include "cfsmailaddress.h" |
|
25 #include "cemailextensionbase.h" |
|
26 |
|
27 class CFSMailRequestHandler; |
|
28 |
|
29 /** |
|
30 * email handling base class |
|
31 * |
|
32 * @lib FSFWCommonLib |
|
33 |
|
34 */ |
|
35 class CFSMailMessageBase : public CExtendableEmail |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * |
|
42 * @param aMessageId id of the email to be created |
|
43 */ |
|
44 IMPORT_C static CFSMailMessageBase* NewL(const TFSMailMsgId aMessageId); |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * |
|
49 * @param aMessageId id of the email to be created |
|
50 */ |
|
51 IMPORT_C static CFSMailMessageBase* NewLC(const TFSMailMsgId aMessageId); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 IMPORT_C virtual ~CFSMailMessageBase(); |
|
57 |
|
58 /** |
|
59 * message id accessor |
|
60 * |
|
61 * @return message id |
|
62 */ |
|
63 IMPORT_C TFSMailMsgId GetMessageId() const; |
|
64 |
|
65 /** |
|
66 * if email is related to another email, for example due reply / forward, |
|
67 * related email id is returned |
|
68 * |
|
69 * @return related email id |
|
70 */ |
|
71 IMPORT_C TFSMailMsgId IsRelatedTo() const; |
|
72 |
|
73 /** |
|
74 * set email related to another email, for example due reply / forward |
|
75 * |
|
76 * @param aMessageId related email id |
|
77 */ |
|
78 IMPORT_C void SetRelatedTo( const TFSMailMsgId aMessageId ); |
|
79 |
|
80 /** |
|
81 * email parent folder id accessor |
|
82 * |
|
83 * @returns parent folder id |
|
84 */ |
|
85 IMPORT_C TFSMailMsgId GetFolderId() const ; |
|
86 |
|
87 /** |
|
88 * email parent folder id mutator |
|
89 * |
|
90 * @param aFolderId parent folder id |
|
91 */ |
|
92 IMPORT_C void SetFolderId( const TFSMailMsgId aFolderId ); |
|
93 |
|
94 /** |
|
95 * email mailbox id accessor |
|
96 * |
|
97 * @returns mailbox id |
|
98 */ |
|
99 IMPORT_C TFSMailMsgId GetMailBoxId() const ; |
|
100 |
|
101 /** |
|
102 * email mailbox id mutator |
|
103 * |
|
104 * @param aMailBoxId mailbox id |
|
105 */ |
|
106 IMPORT_C void SetMailBoxId( const TFSMailMsgId aMailBoxId ); |
|
107 |
|
108 /** |
|
109 * email sender address accessor |
|
110 * |
|
111 * @return email sender address, ownership not transferred to user |
|
112 */ |
|
113 IMPORT_C CFSMailAddress* GetSender() const; |
|
114 |
|
115 /** |
|
116 * email sender address mutator |
|
117 * |
|
118 * @param aSender email sender address, ownership transferred from user |
|
119 */ |
|
120 IMPORT_C void SetSender(CFSMailAddress* aSender); |
|
121 |
|
122 /** |
|
123 * returns TO-recipients list of email |
|
124 * |
|
125 * @return to-recipients list, ownership not transferred user |
|
126 */ |
|
127 IMPORT_C RPointerArray<CFSMailAddress>& GetToRecipients(); |
|
128 |
|
129 /** |
|
130 * returns CC-recipients list of email |
|
131 * |
|
132 * @return cc-recipients list, ownership not transferred user |
|
133 */ |
|
134 IMPORT_C RPointerArray<CFSMailAddress>& GetCCRecipients( ); |
|
135 |
|
136 /** |
|
137 * returns BCC-recipients list of email |
|
138 * |
|
139 * @return bcc-recipients list, ownership not transferred user |
|
140 */ |
|
141 IMPORT_C RPointerArray<CFSMailAddress>& GetBCCRecipients( ); |
|
142 |
|
143 /** |
|
144 * appends one recipient to email TO-field, ownership transferred from user |
|
145 * |
|
146 * @param aRecipient new recipient email address |
|
147 */ |
|
148 IMPORT_C void AppendToRecipient( CFSMailAddress* aRecipient); |
|
149 |
|
150 /** |
|
151 * appends one recipient to email CC-field, ownership transferred from user |
|
152 * |
|
153 * @param aRecipient new recipient email address |
|
154 */ |
|
155 IMPORT_C void AppendCCRecipient( CFSMailAddress* aRecipient ); |
|
156 |
|
157 /** |
|
158 * appends one recipient to email BCC field, ownership transferred from user |
|
159 * |
|
160 * @param aRecipient new recipient email address |
|
161 */ |
|
162 IMPORT_C void AppendBCCRecipient( CFSMailAddress* aRecipient ); |
|
163 |
|
164 /** |
|
165 * clears email TO-recipients list |
|
166 * |
|
167 */ |
|
168 IMPORT_C void ClearToRecipients( ); |
|
169 |
|
170 /** |
|
171 * clears email CC-recipients list |
|
172 * |
|
173 */ |
|
174 IMPORT_C void ClearCcRecipients( ); |
|
175 |
|
176 /** |
|
177 * clears email BCC-recipients list |
|
178 * |
|
179 */ |
|
180 IMPORT_C void ClearBccRecipients( ); |
|
181 |
|
182 /** |
|
183 * email subject accessor |
|
184 * |
|
185 * @return email subject, ownership not transferred user |
|
186 */ |
|
187 IMPORT_C TDesC& GetSubject() const; |
|
188 |
|
189 /** |
|
190 * email subject mutator |
|
191 * |
|
192 * @param aSubject new email subject |
|
193 */ |
|
194 IMPORT_C void SetSubject(const TDesC& aSubject); |
|
195 |
|
196 /** |
|
197 * email date accessor |
|
198 * |
|
199 * @return email date |
|
200 */ |
|
201 IMPORT_C TTime GetDate() const; |
|
202 |
|
203 /** |
|
204 * email date mutator |
|
205 * |
|
206 * @param aDate new email date |
|
207 */ |
|
208 IMPORT_C void SetDate(const TTime aDate); |
|
209 |
|
210 /** |
|
211 * email flags accessor |
|
212 * |
|
213 * @return email flags |
|
214 */ |
|
215 IMPORT_C TInt GetFlags( ) const; |
|
216 |
|
217 /** |
|
218 * email flag set |
|
219 * |
|
220 * @aFlag email flag to be set |
|
221 */ |
|
222 IMPORT_C void SetFlag(const TInt aFlag); |
|
223 |
|
224 /** |
|
225 * email flag reset |
|
226 * |
|
227 * @aFlag email flag to be reset |
|
228 */ |
|
229 IMPORT_C void ResetFlag(const TInt aFlag); |
|
230 |
|
231 /** |
|
232 * test email flag is set |
|
233 * |
|
234 * @aFlag email flag to be tested |
|
235 * @return email flag status (set/reset) |
|
236 */ |
|
237 IMPORT_C TBool IsFlagSet(const TInt aFlag) const; |
|
238 |
|
239 /** |
|
240 * Email reply-to address accessor ; defines optional email address |
|
241 * that clients should use to send replies. Returns NULL pointer |
|
242 * if address is not set, ownership not transferred to user. |
|
243 * |
|
244 * @return email reply-to address |
|
245 */ |
|
246 IMPORT_C const CFSMailAddress& GetReplyToAddress(); |
|
247 |
|
248 /** |
|
249 * email reply-to address mutator, ownership transferred from user |
|
250 * |
|
251 * @param aReplyToAddress email reply-to address |
|
252 */ |
|
253 IMPORT_C void SetReplyToAddress(CFSMailAddress* aReplyToAddress); |
|
254 |
|
255 /** |
|
256 * plugin request handler accessor |
|
257 * |
|
258 * @return request handler |
|
259 */ |
|
260 IMPORT_C CFSMailRequestHandler& RequestHandler( ); |
|
261 |
|
262 public: // from CExtendableEmail |
|
263 |
|
264 /** |
|
265 * @see CExtendableEmail::ReleaseExtension |
|
266 */ |
|
267 IMPORT_C void ReleaseExtension( CEmailExtension* aExtension ); |
|
268 |
|
269 /** |
|
270 * Returns extension by uid, leaves KErrNotSupported if extension is |
|
271 * not available. |
|
272 * @param aInterfaceUid extension interface uid |
|
273 * @return extension pointer. Ownership depends on extension. |
|
274 */ |
|
275 IMPORT_C CEmailExtension* ExtensionL( const TUid& aInterfaceUid ); |
|
276 |
|
277 protected: |
|
278 |
|
279 /** |
|
280 * C++ default constructor. |
|
281 */ |
|
282 CFSMailMessageBase(); |
|
283 |
|
284 /** |
|
285 * email message id |
|
286 */ |
|
287 TFSMailMsgId iMessageId; |
|
288 |
|
289 private: |
|
290 |
|
291 /** |
|
292 * ConstructL |
|
293 */ |
|
294 void ConstructL( const TFSMailMsgId aMessageId ); |
|
295 protected: |
|
296 // Request handler from tls |
|
297 CFSMailRequestHandler* iRequestHandler; |
|
298 private: // data |
|
299 |
|
300 /** |
|
301 * id of another email or part this object is related to |
|
302 * due some reason, like in reply or forward email use cases |
|
303 */ |
|
304 TFSMailMsgId iRelatedTo; |
|
305 |
|
306 /** |
|
307 * email mailbox id |
|
308 */ |
|
309 TFSMailMsgId iMailBoxId; |
|
310 |
|
311 /** |
|
312 * email parent folder id |
|
313 */ |
|
314 TFSMailMsgId iFolderId; |
|
315 |
|
316 /** |
|
317 * email sender address |
|
318 */ |
|
319 CFSMailAddress* iSender; |
|
320 |
|
321 /** |
|
322 * email reply-to address |
|
323 */ |
|
324 CFSMailAddress* iReplyTo; |
|
325 |
|
326 /** |
|
327 * email recipients, to/cc/bcc |
|
328 */ |
|
329 RPointerArray<CFSMailAddress> iToRecipients; |
|
330 RPointerArray<CFSMailAddress> iCcRecipients; |
|
331 RPointerArray<CFSMailAddress> iBccRecipients; |
|
332 |
|
333 /** |
|
334 * email subject |
|
335 */ |
|
336 HBufC* iSubject; |
|
337 |
|
338 /** |
|
339 * email flags |
|
340 */ |
|
341 TInt iFlags; |
|
342 |
|
343 /** |
|
344 * email date |
|
345 */ |
|
346 TTime iDate; |
|
347 }; |
|
348 |
|
349 |
|
350 #endif // __CFSMAILMESSAGEBASE_H |