|
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 // |
|
15 |
|
16 #if !defined (__CBCP_H__) |
|
17 #define __CBCP_H__ |
|
18 |
|
19 |
|
20 #include <bsp.h> |
|
21 |
|
22 |
|
23 class CBusinessCardParser : public CBaseScriptParser2 |
|
24 /** |
|
25 @internalComponent |
|
26 @released |
|
27 */ |
|
28 { |
|
29 public: |
|
30 IMPORT_C static CBusinessCardParser* NewL(CRegisteredParserDll& aRegisteredParserDll, CMsvEntry& aEntry, RFs& aFs); |
|
31 ~CBusinessCardParser(); |
|
32 |
|
33 void ParseL(TRequestStatus& aStatus, const TDesC& aSms); |
|
34 void ProcessL(TRequestStatus& aStatus); |
|
35 |
|
36 private: |
|
37 void DoCancel(); |
|
38 void RunL(); |
|
39 |
|
40 private: |
|
41 enum TParseSession |
|
42 { |
|
43 EUnfoldMessage, // Perform MIME unfolding of message. |
|
44 EParseMessage, // Parsing - Lexical analysis and fill the array. |
|
45 ECompleteMessage // Completing - writing array and new message body. |
|
46 }; |
|
47 |
|
48 CBusinessCardParser(CRegisteredParserDll& aRegisteredParserDll, CMsvEntry& aEntry, RFs& aFs); |
|
49 void ConstructL(); |
|
50 |
|
51 void ChangeStateL(TParseSession aState); // Advance state machine to next state |
|
52 void ParseMessageL(); |
|
53 void StripCarriageReturnsL(); |
|
54 void CompleteMessageL(); |
|
55 |
|
56 void AddRequiredFieldL(const TDesC& aFieldName); |
|
57 void AddParsedFieldL(const TDesC& aFieldName, const TDesC& aFieldValue, TBool aMandatory); |
|
58 |
|
59 void CreateDataL(); |
|
60 void AppendItemL(const TDesC& aItem); |
|
61 void AppendTelItemL(const TDesC& aTel, const TDesC& aDefaultLabel, const TDesC& aCellLabel); |
|
62 TBool IsValidTelephoneCharacter() const; |
|
63 |
|
64 |
|
65 void RequestComplete(TRequestStatus& aStatus, TInt aError); |
|
66 |
|
67 TInt iState; // Current session state |
|
68 TInt iExtraLines; // Number of extra lines of text after standard address. |
|
69 TInt iNumberOfTel; // Number of telephone numbers. |
|
70 TInt iNumberOfFax; // Number of fax numbers. |
|
71 TInt iNumberOfCbcFields; // Number of fields. |
|
72 |
|
73 TRequestStatus* iReport; |
|
74 TInt iCompleted; // Stores completion code from previous session state |
|
75 HBufC* iNotesBuffer; // Pointer to notes buffer. |
|
76 }; |
|
77 |
|
78 |
|
79 #endif // __CBCP_H__ |