|
1 /* |
|
2 * Copyright (c) 2008-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 the License "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 * An XML parser for the CSoftwareTypeRegInfo class used for installation of a Layered Eexecution Environment. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalComponent |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef SWTYPEREGINFOPARSER_H |
|
27 #define SWTYPEREGINFOPARSER_H |
|
28 |
|
29 #include "swtypereginfo.h" |
|
30 #include <xml/contenthandler.h> |
|
31 |
|
32 namespace Swi |
|
33 { |
|
34 |
|
35 class CSoftwareTypeRegInfoParser : public CBase, public Xml::MContentHandler |
|
36 { |
|
37 public: |
|
38 static CSoftwareTypeRegInfoParser* NewL(); |
|
39 virtual ~CSoftwareTypeRegInfoParser(); |
|
40 |
|
41 void ParseL(const TDesC8& aDocument, RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray); |
|
42 |
|
43 private: |
|
44 // From MContentHandler |
|
45 virtual void OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode); |
|
46 virtual void OnEndDocumentL(TInt aErrorCode); |
|
47 virtual void OnStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, TInt aErrorCode); |
|
48 virtual void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode); |
|
49 virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode); |
|
50 virtual void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode); |
|
51 virtual void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); |
|
52 virtual void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); |
|
53 virtual void OnSkippedEntityL(const RString& aName, TInt aErrorCode); |
|
54 virtual void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode); |
|
55 virtual void OnError(TInt aErrorCode); |
|
56 virtual TAny* GetExtendedInterface(const TInt32 aUid); |
|
57 |
|
58 private: |
|
59 CSoftwareTypeRegInfoParser(); |
|
60 |
|
61 RPointerArray<CSoftwareTypeRegInfo>* iSwTypeRegInfoArray; |
|
62 HBufC8* iContentChunks; |
|
63 TLanguage iLocalizedNameLanguage; |
|
64 |
|
65 enum TXmlNode |
|
66 { |
|
67 ENodeNone, |
|
68 ENodeSoftwareTypeRegistrationData, |
|
69 ENodeSoftwareType, |
|
70 ENodeLocalizedName, |
|
71 ENodeMimeType, |
|
72 ENodeSifPluginUid, |
|
73 ENodeInstallerSecureId, |
|
74 ENodeExecutionLayerSecureId |
|
75 }; |
|
76 RArray<TXmlNode> iNodes; |
|
77 |
|
78 TXmlNode ElementNameToNode(const TDesC8& aName) const; |
|
79 void PushNodeL(TXmlNode aNew, TXmlNode aExpectedParent); |
|
80 void AddContentChunkL(const TDesC8& aChunk); |
|
81 }; |
|
82 |
|
83 } |
|
84 |
|
85 #endif // SWTYPEREGINFOPARSER_H |