00001 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 00002 // All rights reserved. 00003 // This component and the accompanying materials are made available 00004 // under the terms of "Eclipse Public License v1.0" 00005 // which accompanies this distribution, and is available 00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00007 // 00008 // Initial Contributors: 00009 // Nokia Corporation - initial contribution. 00010 // 00011 // Contributors: 00012 // 00013 // Description: 00014 // 00015 00016 #ifndef XMLEXAMPLE_H 00017 #define XMLEXAMPLE_H 00018 00019 #include <xml/contenthandler.h> 00020 #include <xml/parser.h> 00021 00022 class RFile; 00023 00031 class CXmlExample: public CBase, public Xml::MContentHandler 00032 { 00033 public: 00034 static CXmlExample* NewL(); 00035 ~CXmlExample(); 00036 00037 // From MContentHandler 00038 void OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode); 00039 void OnEndDocumentL(TInt aErrorCode); 00040 void OnStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, TInt aErrorCode); 00041 void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode); 00042 void OnContentL(const TDesC8& aBytes, TInt aErrorCode); 00043 void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode); 00044 void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); 00045 void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); 00046 void OnSkippedEntityL(const RString& aName, TInt aErrorCode) ; 00047 void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode); 00048 void OnError(TInt aErrorCode); 00049 TAny* GetExtendedInterface(const TInt32 aUid); 00050 00051 void ParseExampleDocumentsL(); 00052 HBufC* Copy8To16LC(const TDesC8& aDes); 00053 00054 public: 00055 TBool iLeaveOnStartElement; 00056 TInt iNumElements; 00057 TInt iNumSkippedEntities; 00058 TInt iNumPrefixMappings; 00059 TInt iNumPrefixUnmappings; 00060 TInt iError; 00061 00062 private: 00063 CXmlExample(); 00064 void ConstructL(); 00066 CConsoleBase* iConsole; 00067 00068 }; 00069 00070 #endif // XMLEXAMPLE_H
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.