syncmlfw/common/wbxml/inc/devinf/WBXMLDevInfParser.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Device Information document parser class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __WBXMLDEVINFPARSER_H__
       
    20 #define __WBXMLDEVINFPARSER_H__
       
    21 
       
    22 // ------------------------------------------------------------------------------------------------
       
    23 // Includes
       
    24 // ------------------------------------------------------------------------------------------------
       
    25 #include "WBXMLHandler.h"
       
    26 #include "xmlelement.h"
       
    27 #include "NSmlStack.h"
       
    28 #include "smldevinfdtd.h"
       
    29 #include "smldevinftags.h"
       
    30 
       
    31 // ------------------------------------------------------------------------------------------------
       
    32 // MWBXMLDevInfCallbacks
       
    33 // ------------------------------------------------------------------------------------------------
       
    34 class MWBXMLDevInfCallbacks
       
    35 	{
       
    36 public:
       
    37 	virtual Ret_t smlDeviceInfoL( SmlDevInfDevInfPtr_t aContent ) = 0;
       
    38 	};
       
    39 
       
    40 // ------------------------------------------------------------------------------------------------
       
    41 // CWBXMLDevInfDocHandler
       
    42 // ------------------------------------------------------------------------------------------------
       
    43 class CWBXMLDevInfDocHandler : public CBase, public MWBXMLDocumentHandler, public MWBXMLExtensionHandler
       
    44 	{
       
    45 public:
       
    46 	IMPORT_C static CWBXMLDevInfDocHandler* NewL( MWBXMLDevInfCallbacks* aCallbacks );
       
    47 	IMPORT_C ~CWBXMLDevInfDocHandler();
       
    48 
       
    49 private:
       
    50 	void ConstructL();
       
    51 	CWBXMLDevInfDocHandler( MWBXMLDevInfCallbacks* aCallbacks );
       
    52 	void AddElementL( CXMLElement* aElement );
       
    53 
       
    54 	// from MWBXMLDocumentHandler
       
    55 	void StartDocumentL( TUint8 aVersion, TInt32 aPublicId, TUint32 aCharset );
       
    56 	void StartDocumentL( TUint8 aVersion, const TDesC8& aPublicIdStr, TUint32 aCharset );
       
    57 	void EndDocumentL();
       
    58 	void StartElementL( TWBXMLTag aTag, const CWBXMLAttributes& aAttributes );
       
    59 	void EndElementL( TWBXMLTag aTag );
       
    60 	void CodePageSwitchL( TUint8 aPage );
       
    61 	void CharactersL( const TDesC8& aBuffer );
       
    62 	void DocumentChangedL();
       
    63 
       
    64 	// from MWBXMLExtensionHandler
       
    65 	void Ext_IL( TWBXMLTag aTag, const TDesC8& aData );	
       
    66 	void Ext_TL( TWBXMLTag aTag, TUint32 aData );
       
    67 	void ExtL( TWBXMLTag aTag );
       
    68 	void OpaqueL( const TDesC8& aData );
       
    69 
       
    70 private:
       
    71 	CNSmlStack<CXMLElement>* iCmdStack;
       
    72 	CNSmlStack<CXMLElement>* iCleanupStack;
       
    73 	MWBXMLDevInfCallbacks* iCallbacks;
       
    74 	}; 
       
    75 
       
    76 #endif // __WBXMLDEVINFPARSER_H__