contentmgmt/referencedrmagent/RefTestAgent/RTAParser/intentparser.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 May 2010 14:32:46 +0300
changeset 66 8873e6835f7b
parent 8 35751d3474b7
permissions -rw-r--r--
Revision: 201021 Kit: 2010121

/*
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/


/**
 @file
 @internalComponent
 @released
*/


#ifndef __INTENTPARSER_H__
#define __INTENTPARSER_H__

#include <caf/caf.h>
#include "parsehandlerbase.h"
#include "stringparser.h"

namespace ReferenceTestAgent
	{
	class CRightsObject;
	class CIntent;
	
	_LIT8(KIntentPeek, "peek");
	_LIT8(KIntentPlay, "play");
	_LIT8(KIntentDisplay, "display");
	_LIT8(KIntentExecute, "execute");
	_LIT8(KIntentPrint, "print");
	_LIT8(KIntentPause, "pause");
	_LIT8(KIntentContinue, "continue");
	_LIT8(KIntentStop, "stop");
	_LIT8(KIntentUnknown, "unknown");
	_LIT8(KIntentInstall, "install");
	
	/** parser for the <Intent> tag
	*/
	class CIntentParser : public CParseHandlerBase, public MStringParser
		{
	public:
		static CIntentParser* NewL(CRightsObject& aRights);
		virtual ~CIntentParser();
		
		virtual void ParseStartElementL(const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes);
		virtual void ParseEndElementL(const Xml::RTagInfo& aElement);
		
		// From MStringParser
		virtual void StringParseCompleteL(const TDesC& aString);

	private:
		CIntentParser(CRightsObject& aRights);

	private:
		TBool iFoundStartTag;
		CRightsObject& iRights;
		CIntent* iIntent;
		TParserWaitingForTag iWaitingForTag;
		TInt iCriteriaAdded;
		};
	}

#endif