|
1 /** |
|
2 * Copyright (c) 2006-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: |
|
15 * Declaration of CSBEParserProxy |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 @file |
|
24 */ |
|
25 #ifndef SBEPARSERPROXY_H |
|
26 #define SBEPARSERPROXY_H |
|
27 |
|
28 // System |
|
29 #include <f32file.h> |
|
30 #include <xml/contenthandler.h> // MContentHandler mix in class |
|
31 #include <xml/parser.h> |
|
32 |
|
33 // Classes referenced |
|
34 class CCnvCharacterSetConverter; |
|
35 |
|
36 using namespace Xml; |
|
37 |
|
38 namespace conn |
|
39 { |
|
40 /** Class used as a proxy to redirect CParser calls to the relevant data owner |
|
41 |
|
42 @internalTechnology |
|
43 */ |
|
44 class CSBEParserProxy : public CBase, public MContentHandler |
|
45 { |
|
46 public: |
|
47 static CSBEParserProxy* NewL( RFs& aFsSession ); |
|
48 ~CSBEParserProxy(); |
|
49 // API |
|
50 void ParseL( const TDesC& aFileName, MContentHandler& aObserver ); |
|
51 TInt ConvertToUnicodeL( TDes16& aUnicode, const TDesC8& aForeign ); |
|
52 |
|
53 private: // Constructors |
|
54 CSBEParserProxy( RFs& aFsSession ); |
|
55 void ConstructL(); |
|
56 |
|
57 // From MContentHandler |
|
58 void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode); |
|
59 void OnEndDocumentL(TInt aErrorCode); |
|
60 void OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode); |
|
61 void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode); |
|
62 void OnContentL(const TDesC8& aBytes, TInt aErrorCode); |
|
63 void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode); |
|
64 void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); |
|
65 void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); |
|
66 void OnSkippedEntityL(const RString& aName, TInt aErrorCode); |
|
67 void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode); |
|
68 void OnError(TInt aErrorCode); |
|
69 TAny* GetExtendedInterface(const TInt32 aUid); |
|
70 |
|
71 private: // Internal |
|
72 RFs& iFsSession; /*<! File server session */ |
|
73 CParser* iParser; /*<! Parser for xml */ |
|
74 MContentHandler* iTransientObserver; /*<! XML observer that we will call back */ |
|
75 TInt iTransientParsingError; /*<! Transient parsing error code, supplied to XML parsing callbacks */ |
|
76 CCnvCharacterSetConverter* iConverter; /*<! Convert from UTF-8 to unicode */ |
|
77 TInt iConverterState; /* State for converter object */ |
|
78 }; |
|
79 } |
|
80 |
|
81 #endif // SBEPARSERPROXY_H |