servicediscoveryandcontrol/pnp/test/upnp/upnpdescription/inc/deviceinfoparser.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-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 __DEVICEINFOPARSER_H__
       
    17 #define __DEVICEINFOPARSER_H__
       
    18 
       
    19 #include <xml/parser.h>
       
    20 #include "parsehandlerbase.h"
       
    21 #include "cpnpdeviceparam.h"
       
    22 
       
    23 /* CDeviceInfoParser parses the device description file.
       
    24    Whatever fields are present in the xml device description tree after <device> tag are parsed here
       
    25    It calls suitable classes to parse child elements like icon,service etc.
       
    26    
       
    27    Also see CUPnPDeviceIconParser and CUPnPServiceInfoParser
       
    28    Please consult UPnPDeviceArchitecture 1.0
       
    29  */
       
    30 class CDeviceInfoParser : public CParseHandlerBase
       
    31 		{
       
    32 	public:
       
    33 		static CDeviceInfoParser* NewL(CUPnPDevice *aDeviceInfo, const RStringPool& aStringPool);
       
    34 		virtual ~CDeviceInfoParser();
       
    35 
       
    36 		virtual void ParseStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes);
       
    37 		virtual void ParseEndElementL(const RTagInfo& aElement);
       
    38 		virtual void ParseContentL(const TDesC8& aBytes);
       
    39 		virtual void ParsePrefixL(const RString& aPrefix, const RString& aUri);
       
    40 	private:
       
    41 		CDeviceInfoParser(CUPnPDevice *aDeviceInfo, const RStringPool& aStringPool);
       
    42 		enum
       
    43 			{
       
    44 			EDevice  = 			0x001,
       
    45 			EDeviceType =		0x002,
       
    46 			EDeviceList = 		0x004,
       
    47 			EEmbeddedDevice = 	0x005, //Embedded device (EDeviceList | EDevice)
       
    48 			};
       
    49 	private:
       
    50 		CUPnPDevice *iDeviceInfo;
       
    51 		const RStringPool& iStringPool;
       
    52 		CParser* iXmlParser;
       
    53 		TUint iFlags;
       
    54 		};
       
    55 		
       
    56 #endif//__DEVICEINFOPARSER_H__