|
1 /* |
|
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CCntParserCollector header |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CNTPARSERCOLLECTOR_H__ |
|
21 #define __CNTPARSERCOLLECTOR_H__ |
|
22 |
|
23 #include <f32file.h> |
|
24 #include <s32file.h> |
|
25 |
|
26 class CCntParserServer; |
|
27 class CContactDatabase; |
|
28 class CContactIdArray; |
|
29 class CCntFilter; |
|
30 class CVersitTlsData; |
|
31 |
|
32 class CCntParserCollector : public CActive |
|
33 { |
|
34 public: |
|
35 |
|
36 CCntParserCollector(); |
|
37 static CCntParserCollector* NewL(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase); |
|
38 static CCntParserCollector* NewLC(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase); |
|
39 virtual ~CCntParserCollector(); |
|
40 void ConstructL(CCntParserServer* aServer,CContactDatabase* aCurrentDatabase); |
|
41 TInt CreateIrMCL2FileL(const TDesC& aFileName,TInt aMaxNumberOfContacts,TBool aForced); |
|
42 void PrepareParserL(); |
|
43 void ParseCntDatabaseL(); |
|
44 void DoCancel(); |
|
45 |
|
46 TInt CurrentItem(); |
|
47 TInt Count(); |
|
48 TInt ContactsSaved(); |
|
49 |
|
50 protected: |
|
51 void RunL(); |
|
52 TInt RunError(TInt aError); |
|
53 void ExternalizeCurrentContactL(CContactDatabase* aContactsDb,TInt aCurrentItem,TBool ExternalizeEmpty); |
|
54 void CloseResources(); |
|
55 void SaveTotalCountL(); |
|
56 TInt ReadTotalCountL() const; |
|
57 TBool ContactCountChanged(); |
|
58 |
|
59 private: |
|
60 CContactDatabase* iContactsDb; //Caller has the ownership |
|
61 TInt iCurrentItem; |
|
62 TInt iCount; //Contacts in CDB |
|
63 TInt iMaxNumberOfContacts; //Max contacts to be parsed (MAXIMUM RECORDS in info.log) |
|
64 RFileWriteStream iWriter; |
|
65 CContactIdArray* iIds; //List of ID numbers of contacts |
|
66 CCntParserServer* iServer; //Caller has the ownership |
|
67 CCntFilter* iFilter; |
|
68 CVersitTlsData* iVersitTLS; //For speed optimization |
|
69 TBool iCancel; |
|
70 TInt iContactsSaved; |
|
71 TInt iTotalCount; |
|
72 |
|
73 RFs iFsSession; |
|
74 }; |
|
75 |
|
76 #endif |