|
1 // Copyright (c) 1997-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 #ifndef __TCHARSETVCARD_H__ |
|
17 #define __TCHARSETVCARD_H__ |
|
18 |
|
19 // System includes |
|
20 #include <vcal.h> |
|
21 #include <vcard.h> |
|
22 #include <e32cons.h> |
|
23 #include <s32stor.h> |
|
24 #include <s32file.h> |
|
25 #include <f32file.h> |
|
26 #include <charconv.h> |
|
27 |
|
28 |
|
29 // |
|
30 // ------> CVersitCardTest (header) |
|
31 // |
|
32 class CVersitCardTest : public CBase |
|
33 { |
|
34 // |
|
35 public: // CONSTRUCT |
|
36 // |
|
37 static CVersitCardTest* NewLC(); |
|
38 ~CVersitCardTest(); |
|
39 |
|
40 // |
|
41 private: // INTERNAL CONSTRUCT |
|
42 // |
|
43 void ConstructL(); |
|
44 |
|
45 // |
|
46 public: // ACCESS |
|
47 // |
|
48 void StartTestsL(); |
|
49 |
|
50 // |
|
51 private: // INTERNAL |
|
52 // |
|
53 |
|
54 // Read and write to the file using all encodings and character sets |
|
55 void InternalizeAndExternalizeCardL(const TDesC& aFile, CParserVCard& aParser) const; |
|
56 |
|
57 // Read and write to the file using the specified default encodings and character |
|
58 // sets |
|
59 void InternalizeCardL(const TDesC& aFile, CParserVCard& aParser, Versit::TVersitCharSet aCharSet, Versit::TVersitEncoding aEncoding) const; |
|
60 void ExternalizeCardL(const TDesC& aFile, CParserVCard& aParser, Versit::TVersitCharSet aCharSet, Versit::TVersitEncoding aEncoding) const; |
|
61 |
|
62 // Return a descriptor representation of the specified character set |
|
63 static const TDesC& CharsetAsDescriptor(Versit::TVersitCharSet aCharSet); |
|
64 |
|
65 // Return a descriptor representation of the specified encoding |
|
66 static const TDesC& EncodingAsDescriptor(Versit::TVersitEncoding aEncoding); |
|
67 |
|
68 // Guess the charset of the document |
|
69 TUint AutoDetectCharacterSetL(RFs& aFsSession, const TDesC& aFile) const; |
|
70 |
|
71 // Map charconv id to versit id |
|
72 static Versit::TVersitCharSet MapCharConvCharSetToVersitCharSet(TUint aCharConvCharSet); |
|
73 |
|
74 // |
|
75 private: // MEMBER DATA |
|
76 // |
|
77 CDirScan* iDirectoryScanner; |
|
78 CArrayFix<CCnvCharacterSetConverter::SCharacterSet>* iArrayOfCharacterSetsAvailable; |
|
79 }; |
|
80 |
|
81 |
|
82 #endif |