|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 #ifndef __CIMAPFETCHRESPONSE_H__ |
|
18 #define __CIMAPFETCHRESPONSE_H__ |
|
19 |
|
20 #include <e32base.h> |
|
21 |
|
22 #include "tmessageflaginfo.h" |
|
23 |
|
24 // Forward Declarations |
|
25 class CImapBodyStructure; |
|
26 class CImapRfc822HeaderFields; |
|
27 |
|
28 |
|
29 /** |
|
30 Represents the results of a FETCH request. |
|
31 The iHeaderInfo and iBodyStructure are only constructed on demand. |
|
32 This is because they are large and are often not present in the FETCH response, |
|
33 which is indicated by them remaining NULL after parsing. |
|
34 @internalTechnology |
|
35 @prototype |
|
36 */ |
|
37 class CImapFetchResponse : public CBase |
|
38 { |
|
39 public: |
|
40 IMPORT_C static CImapFetchResponse* NewL(); |
|
41 ~CImapFetchResponse(); |
|
42 |
|
43 IMPORT_C CImapRfc822HeaderFields* HeaderFields(); |
|
44 IMPORT_C CImapBodyStructure* BodyStructure(); |
|
45 IMPORT_C TUint MessageUid() const; |
|
46 IMPORT_C TMessageFlagInfo& MessageFlagInfo(); |
|
47 |
|
48 // non-exported public methods |
|
49 void SetBodyStructure(CImapBodyStructure* aBodyStructure, HBufC8* aBodyStructureData); |
|
50 void SetHeaderFields(CImapRfc822HeaderFields* aHeaderFields); |
|
51 void SetMessageFlagInfo(const TMessageFlagInfo& aMessageFlagInfo); |
|
52 |
|
53 private: |
|
54 /** |
|
55 Stores any message flags information recieved for this response. |
|
56 */ |
|
57 TMessageFlagInfo iMessageFlagInfo; |
|
58 /** |
|
59 Stores RFC822 header information. May be NULL. |
|
60 */ |
|
61 CImapRfc822HeaderFields* iHeaderFields; |
|
62 /** |
|
63 Stores a (potentially multipart) bodystructure. May be NULL. |
|
64 */ |
|
65 CImapBodyStructure* iBodyStructure; |
|
66 /** |
|
67 The data buffer that iBodyStructure points into. |
|
68 */ |
|
69 HBufC8* iBodyStructureData; |
|
70 }; |
|
71 |
|
72 /** |
|
73 Implemented by CImapFolder and anything else that wants perform fetch multiple messages from a single request. |
|
74 @internalTechnology |
|
75 @prototype |
|
76 */ |
|
77 class MImapFetchStructureObserver |
|
78 { |
|
79 public: |
|
80 /** |
|
81 Called each time a fetch response has been received and parsed. |
|
82 @param aImapFetchResponse stores all the fetch response information and passes ownership to the implementor. |
|
83 */ |
|
84 virtual void OnFetchLD(CImapFetchResponse* aImapFetchResponse) =0; |
|
85 |
|
86 /** |
|
87 Called to commit any headers that have been created in response to receiving fetch responses. |
|
88 */ |
|
89 virtual void OnFetchCommit() =0; |
|
90 }; |
|
91 |
|
92 #endif // __CIMAPFETCHRESPONSE_H__ |