|
1 // Copyright (c) 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 // timrfc822datefield.h |
|
15 // |
|
16 |
|
17 /** |
|
18 * @file |
|
19 * @internal |
|
20 * @released |
|
21 */ |
|
22 |
|
23 #ifndef __TIMRFC822DATEFIELD_H__ |
|
24 #define __TIMRFC822DATEFIELD_H__ |
|
25 |
|
26 #include <miutstd.hrh> // KUidMsvEmailTextEntryValue |
|
27 |
|
28 /** |
|
29 * Identifies which version of CImHeader has been stored in stream |
|
30 * @internalComponent |
|
31 * @released |
|
32 */ |
|
33 const TUint16 KImHeaderVersion = 2; |
|
34 |
|
35 /** |
|
36 * @internalTechnology |
|
37 * @released |
|
38 */ |
|
39 const TUid KUidMsvEmailTextEntry = {KUidMsvEmailTextEntryValue}; |
|
40 const TUid KUidMsvEmailHtmlEntry = {KUidMsvEmailHtmlEntryValue}; |
|
41 |
|
42 /** |
|
43 * @internalComponent |
|
44 * @released |
|
45 */ |
|
46 const TUid KUidMsvEmailExternalBodyEntry = {KUidMsvEmailExternalBodyEntryValue}; |
|
47 const TUid KUidMsvEmailRtfEntry = {KUidMsvEmailRtfEntryValue}; |
|
48 |
|
49 /** |
|
50 * @internalComponent |
|
51 * @released |
|
52 */ |
|
53 _LIT8(KMiutDateFormat, " %S, %2d %S %04d %02d:%02d:%02d "); |
|
54 _LIT8(KMiutMonthNames, "JanFebMarAprMayJunJulAugSepOctNovDec"); |
|
55 _LIT8(KMiutDayNames, "MonTueWedThuFriSatSun"); |
|
56 _LIT8(KMiutTimeZoneNeg, "-%02d%02d"); |
|
57 _LIT8(KMiutTimeZonePos, "+%02d%02d"); |
|
58 _LIT8(KMiutBase64String, "Base64"); |
|
59 _LIT8(KMiutQPString, "quoted-printable"); |
|
60 _LIT8(KMiut7BitString, "7bit"); |
|
61 _LIT8(KMiut8BitString, "8bit"); |
|
62 _LIT8(KMiutBinaryString, "binary"); |
|
63 _LIT8(KMiutUUString, "uuencode"); |
|
64 _LIT8(KMiutWildcardBase64, "*base64*"); |
|
65 _LIT8(KMiutWildcardQP, "*quoted-printable*"); |
|
66 _LIT8(KMiutWildcard7Bit, "*7bit*"); |
|
67 _LIT8(KMiutWildcard8Bit, "*8bit*"); |
|
68 _LIT8(KMiutWildcardBinary, "*binary*"); |
|
69 _LIT8(KMiutWildcardUU, "*uu*"); |
|
70 _LIT(KMiutFormatString, "%S"); |
|
71 |
|
72 /** |
|
73 * @internalTechnology |
|
74 * @released |
|
75 */ |
|
76 _LIT(KImEngineResourceFile, "\\resource\\messaging\\imcm.rsc"); |
|
77 |
|
78 /** |
|
79 * @internalComponent |
|
80 * @released |
|
81 */ |
|
82 const TInt KMiutDateStringLength = 32; |
|
83 const TInt KCenturyThreshold = 100; |
|
84 const TInt KCenturyOffset = 70; |
|
85 const TInt KThisCentury = 1900; // as defined in 1998 |
|
86 const TInt KNextCentury = 2000; |
|
87 |
|
88 /** |
|
89 * @internalComponent |
|
90 * @released |
|
91 */ |
|
92 const TInt KMaxImMimeFieldLength = 1000; |
|
93 const TInt KImMailMaxBufferSize = 1000; // 1000 is defined by the SMTP spec as max space |
|
94 const TInt KSmtpMaxBufferExcludingCRLF = 979; // Line length limit is 1000 chars per line including CRLF (RFC2822, Section 2.1.1) |
|
95 // 1000 chars including "Field name: "+"Field body"+CRLF (here "Resent-Message-ID: " is largest field) |
|
96 /** |
|
97 * Maximum size for descriptors stored in HBufC members of CImHeader = 1000 chars |
|
98 * @internalTechnology |
|
99 * @released |
|
100 */ |
|
101 const TInt KMaxImHeaderStringLength = 1000; |
|
102 |
|
103 /** |
|
104 * @internalComponent |
|
105 * @released |
|
106 */ |
|
107 void CopyArrayL(const CDesCArray& aSource, CDesCArray& aDestination); |
|
108 |
|
109 class TImRfc822DateField |
|
110 /** |
|
111 @internalTechnology |
|
112 @released |
|
113 */ |
|
114 { |
|
115 public: |
|
116 IMPORT_C TInt ParseDateField(const TDesC8& aRfc822DateField, TTime& rTime); |
|
117 IMPORT_C void SetDate(const TTime& aTimeDate, TDes8& rOutputLine); // NB assumes that "Date: " string has already been inserted into rOutputLine |
|
118 |
|
119 private: |
|
120 TBool GetMonth( const TDesC8& name, TMonth& month ); |
|
121 TBool GetTimezone( const TDesC8& name, TInt& minsOffset ); |
|
122 }; |
|
123 |
|
124 #endif //__TIMRFC822DATEFIELD_H__ |