|
1 // Copyright (c) 1999-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 // ENP.H |
|
15 // |
|
16 /** |
|
17 * @file |
|
18 * @internalComponent |
|
19 * @released |
|
20 */ |
|
21 |
|
22 #if !defined (__ENP_H__) |
|
23 #define __ENP_H__ |
|
24 |
|
25 |
|
26 #if !defined(__BSP_H__) |
|
27 #include <bsp.h> |
|
28 #endif |
|
29 |
|
30 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
31 #include "tmsvbioinfo.h" |
|
32 #endif |
|
33 |
|
34 // Forward declarations |
|
35 class CImBaseEmailSettings; |
|
36 class CCnvCharacterSetConverter; |
|
37 class CEmailNotificationParser : public CBaseScriptParser2 |
|
38 /** |
|
39 @internalComponent |
|
40 @released |
|
41 */ |
|
42 { |
|
43 public: |
|
44 IMPORT_C static CEmailNotificationParser* NewL(CRegisteredParserDll& aRegisteredParserDll, CMsvEntry& aEntry, RFs& aFs); |
|
45 ~CEmailNotificationParser(); |
|
46 |
|
47 void ParseL(TRequestStatus& aStatus, const TDesC& aSms); |
|
48 void ProcessL(TRequestStatus& aStatus); |
|
49 |
|
50 private: |
|
51 void DoCancel(); |
|
52 void RunL(); |
|
53 |
|
54 private: |
|
55 enum TParseSession |
|
56 { |
|
57 EUnfoldMessage, // |
|
58 EParseMessage, // Parsing - Lexical analysis and fill the array.. |
|
59 ECompleteMessage // Completing - writing array and new message body.. |
|
60 }; |
|
61 |
|
62 CEmailNotificationParser(CRegisteredParserDll& aRegisteredParserDll, CMsvEntry& aEntry, RFs& aFs); |
|
63 void ConstructL(); |
|
64 |
|
65 void ChangeStateL(TParseSession aState); // Advance state machine to next state |
|
66 void UnfoldMessageL(); |
|
67 void ParseMessageL(); |
|
68 void CompleteMessageL(); |
|
69 |
|
70 void AddRequiredFieldL(const TDesC& aFieldName); |
|
71 void AddParsedFieldL(const TDesC& aFieldName, const TDesC& aFieldValue, TBool aMandatory); |
|
72 |
|
73 // fns to try and match notification msg to a server |
|
74 void GetEmailServicesL(); |
|
75 TBool CalcHashValueL(CCnvCharacterSetConverter& aCharConv, const TDesC8& aUserName, const TDesC& aServerName, const TDesC8& aPortNum); |
|
76 |
|
77 // utility completion fn |
|
78 void RequestComplete(TRequestStatus& aStatus, TInt aError); |
|
79 |
|
80 //fix for DEF017686: EMail notification parser leaves when field data is empty |
|
81 void LeaveIfEmptyFieldsL(const TDesC& aFieldName, const TLex& aTokenLex); |
|
82 |
|
83 TInt iState; // Current session state |
|
84 HBufC* iSmsBuf; // Local copy of buffer passed to ParseL() |
|
85 |
|
86 TRequestStatus* iReport; |
|
87 TInt iCompleted; // Stores completion code from previous session state |
|
88 TInt iMessageCount; // Count of new messages on mail host |
|
89 TBool iExtendedNotification; // Flag indicating simple or extended notification |
|
90 TInt iServerId; // Extracted from email not msg used to identfy server |
|
91 HBufC8* iServerName; // name of server if we can get it from the server id etc. |
|
92 TMsvId iServiceMsvId; // id of associated service entry |
|
93 TBool iFoundServer; |
|
94 }; |
|
95 |
|
96 |
|
97 #endif // __ENP_H__ |