traceservices/tracefw/ulogger/src/pluginframework/inputframework.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 16:57:14 +0300
branchRCL_3
changeset 23 26645d81f48d
parent 0 08ec8eefde2f
permissions -rw-r--r--
Revision: 201035 Kit: 201035

// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "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:
// ULogger Input Framework header file
// 
//

/**
 @file
 @internalTechnology
 @prototype
*/

#ifndef CINPUTFRAMEWORK_H_
#define CINPUTFRAMEWORK_H_

#include <e32base.h>
#include "uloggerinputplugin.h"
#include "inputdata.h"
#include "uloggershared.h"
#include "uloggercommands.h"


namespace Ulogger
{

/**
*/
class MInputFrameworkObserver
	{
	public: 
		virtual ControlData* ProcessCommandL(TCommand aOpCode, RArray<TPtrC8> &aArguments) = 0; 
		virtual void DoPostProcessing(TCommand aCmd) = 0;
	};


/**
*/
class CInputFramework : public CActive, public MCommandImpl
	{
	friend class CUloggerServerTest4Step; //only for test purposes
	public:
		IMPORT_C static CInputFramework* NewL(MInputPlugin *aInputPlugin, const RPointerArray<TPluginConfiguration>& aInputSettings, MInputFrameworkObserver *aObserver);
		IMPORT_C static CInputFramework* NewLC(MInputPlugin *aInputPlugin, const RPointerArray<TPluginConfiguration>& aInputSettings, MInputFrameworkObserver *aObserver);
		IMPORT_C virtual ~CInputFramework();
		IMPORT_C TInt StartReading();
		IMPORT_C void StopReading();
		
	public: //from MCommandImpl
		IMPORT_C TInt DoCommandL(TCommand aCommand, const RArray<TPtrC>& aValues);
	
	protected: //from CActive
		void DoCancel();
		void RunL();

	private:
		CInputFramework(MInputPlugin *aInputPlugin, MInputFrameworkObserver *aObserver);
		void ConstructL(const RPointerArray<TPluginConfiguration>& aInputSettings);

	private://data
		CInputData* 			iInputData;
		RPointerArray<TPluginConfiguration> iInputSettings;
		MInputPlugin 			*iInputPlugin;
		RBuf8					iControlData;
		HBufC8*					iData;
		TPtr8					iDataPtr;
		TBool					iContinueReading;
		MInputFrameworkObserver* iObserver;
		CCommand*				iCommand;
	};

}

#endif /*CINPUTFRAMEWORK_H_*/