|
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 #ifndef __CIMAPMIMEHEADERFIELDS_H__ |
|
17 #define __CIMAPMIMEHEADERFIELDS_H__ |
|
18 |
|
19 #include "cimapheaderfields.h" |
|
20 |
|
21 /** |
|
22 Stores the MIME header information that is returned by a BODY[X.MIME] request. |
|
23 The data is stored as a simple array of heap descriptors, one for each field type. |
|
24 @internalTechnology |
|
25 @prototype |
|
26 */ |
|
27 NONSHARABLE_CLASS(CImapMimeHeaderFields) : public CImapHeaderFields |
|
28 { |
|
29 public: |
|
30 /** |
|
31 Provides an index into the field value array |
|
32 */ |
|
33 enum THeaderFields |
|
34 { |
|
35 EImapContentBase, |
|
36 EImapContentLocation, |
|
37 |
|
38 EImapCountFields |
|
39 }; |
|
40 |
|
41 static CImapMimeHeaderFields* NewL(); |
|
42 ~CImapMimeHeaderFields(); |
|
43 |
|
44 IMPORT_C const TDesC8& FieldValue(THeaderFields aFieldId); |
|
45 IMPORT_C TBool FieldExists(THeaderFields aFieldId); |
|
46 |
|
47 TBool SetFieldL(const TDesC8& aFieldName, HBufC8* aValue); |
|
48 void RestartGetNextField(); |
|
49 TBool GetNextField(TPtrC8& aFieldName, TPtrC8& aValue); |
|
50 |
|
51 private: |
|
52 CImapMimeHeaderFields(); |
|
53 void ConstructL(); |
|
54 TInt Match(const TDesC8& aFieldName, TBool& aNeedToStripSpaces); |
|
55 const TDesC8& FieldNameFromId(THeaderFields aFieldId); |
|
56 |
|
57 private: |
|
58 RPointerArray<HBufC8> iImapUnmatchedNameArray; |
|
59 RPointerArray<HBufC8> iImapUnmatchedValueArray; |
|
60 TInt iGetNextFieldPos; |
|
61 }; |
|
62 |
|
63 #endif // __CIMAPMIMEHEADERFIELDS_H__ |