|
1 // Copyright (c) 1998-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 // Internet Mail Parser |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __IMP_H__ |
|
19 #define __IMP_H__ |
|
20 |
|
21 #include <imapset.h> // TFolderSyncType, TFolderSubscribeType |
|
22 #include <pop3set.h> |
|
23 #include <smtpset.h> |
|
24 #include <cemailaccounts.h> |
|
25 |
|
26 #include "IMPMACRO.H" |
|
27 |
|
28 |
|
29 class CMailParser : public CBase |
|
30 /** |
|
31 @internalComponent |
|
32 @released |
|
33 */ |
|
34 { |
|
35 public: |
|
36 enum TMailProtocolType //i.e POP3, IMAP, SMTP, etc... |
|
37 { |
|
38 ESmtp=1, |
|
39 EPop3, |
|
40 EImap4 |
|
41 }; |
|
42 |
|
43 public: |
|
44 static CMailParser* NewLC(); |
|
45 static CMailParser* NewL(); |
|
46 ~CMailParser(); |
|
47 |
|
48 void ParseL(CParsedFieldCollection& aIacpFields); |
|
49 void ProcessL(CMSVENTRY& aEntry); |
|
50 void CheckMandatoryFieldsL(CParsedFieldCollection& aIacpFields); |
|
51 void AssociateIAPWithMailL(CMSVENTRY& aEntry, TUint32 aId); |
|
52 |
|
53 private: |
|
54 CMailParser(); |
|
55 void ConstructL(); |
|
56 |
|
57 void GetServiceIdsL(TPopAccount& aPop3AccountId, TImapAccount& aImap4AccountId); |
|
58 void GetFolderSyncTypeL(const TDesC& aDes,TFolderSyncType& aFolderSyncType) const; |
|
59 void GetFolderSubscribeTypeL(const TDesC& aDes,TFolderSubscribeType& aFolderSubscribeType) const; |
|
60 |
|
61 void SetMailProtocolL(CParsedFieldCollection& aIacpFields); |
|
62 |
|
63 private: |
|
64 TInt iProtocolName; |
|
65 TBuf<KMaxSettingStringLength> iIspName; |
|
66 |
|
67 CImSmtpSettings* iSmtpSettings; |
|
68 CImPop3Settings* iPop3Settings; |
|
69 CImImap4Settings* iImap4Settings; |
|
70 |
|
71 CEmailAccounts* iEmailAccounts; |
|
72 CImIAPPreferences* iEmailPreferences; |
|
73 CImIAPPreferences* iSmtpPreferences; |
|
74 |
|
75 TPopAccount iPop3AccountId; |
|
76 TImapAccount iImap4AccountId; |
|
77 }; |
|
78 |
|
79 |
|
80 #endif // __IMP_H__ |