os/persistentdata/traceservices/tracefw/ulogger/src/pluginframework/inputframework.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// ULogger Input Framework header file
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @internalTechnology
sl@0
    21
 @prototype
sl@0
    22
*/
sl@0
    23
sl@0
    24
#ifndef CINPUTFRAMEWORK_H_
sl@0
    25
#define CINPUTFRAMEWORK_H_
sl@0
    26
sl@0
    27
#include <e32base.h>
sl@0
    28
#include "uloggerinputplugin.h"
sl@0
    29
#include "inputdata.h"
sl@0
    30
#include "uloggershared.h"
sl@0
    31
#include "uloggercommands.h"
sl@0
    32
sl@0
    33
sl@0
    34
namespace Ulogger
sl@0
    35
{
sl@0
    36
sl@0
    37
/**
sl@0
    38
*/
sl@0
    39
class MInputFrameworkObserver
sl@0
    40
	{
sl@0
    41
	public: 
sl@0
    42
		virtual ControlData* ProcessCommandL(TCommand aOpCode, RArray<TPtrC8> &aArguments) = 0; 
sl@0
    43
		virtual void DoPostProcessing(TCommand aCmd) = 0;
sl@0
    44
	};
sl@0
    45
sl@0
    46
sl@0
    47
/**
sl@0
    48
*/
sl@0
    49
class CInputFramework : public CActive, public MCommandImpl
sl@0
    50
	{
sl@0
    51
	friend class CUloggerServerTest4Step; //only for test purposes
sl@0
    52
	public:
sl@0
    53
		IMPORT_C static CInputFramework* NewL(MInputPlugin *aInputPlugin, const RPointerArray<TPluginConfiguration>& aInputSettings, MInputFrameworkObserver *aObserver);
sl@0
    54
		IMPORT_C static CInputFramework* NewLC(MInputPlugin *aInputPlugin, const RPointerArray<TPluginConfiguration>& aInputSettings, MInputFrameworkObserver *aObserver);
sl@0
    55
		IMPORT_C virtual ~CInputFramework();
sl@0
    56
		IMPORT_C TInt StartReading();
sl@0
    57
		IMPORT_C void StopReading();
sl@0
    58
		
sl@0
    59
	public: //from MCommandImpl
sl@0
    60
		IMPORT_C TInt DoCommandL(TCommand aCommand, const RArray<TPtrC>& aValues);
sl@0
    61
	
sl@0
    62
	protected: //from CActive
sl@0
    63
		void DoCancel();
sl@0
    64
		void RunL();
sl@0
    65
sl@0
    66
	private:
sl@0
    67
		CInputFramework(MInputPlugin *aInputPlugin, MInputFrameworkObserver *aObserver);
sl@0
    68
		void ConstructL(const RPointerArray<TPluginConfiguration>& aInputSettings);
sl@0
    69
		static void CleanupHBufCPtrArray(TAny* aPtr);
sl@0
    70
		static void CleanupHBufC8PtrArray(TAny* aPtr);
sl@0
    71
		static void CleanupControlData(TAny* aPtr);
sl@0
    72
sl@0
    73
	private://data
sl@0
    74
		CInputData* 			iInputData;
sl@0
    75
		RPointerArray<TPluginConfiguration> iInputSettings;
sl@0
    76
		MInputPlugin 			*iInputPlugin;
sl@0
    77
		RBuf8					iControlData;
sl@0
    78
		HBufC8*					iData;
sl@0
    79
		TPtr8					iDataPtr;
sl@0
    80
		TBool					iContinueReading;
sl@0
    81
		MInputFrameworkObserver* iObserver;
sl@0
    82
		CCommand*				iCommand;
sl@0
    83
	};
sl@0
    84
sl@0
    85
}
sl@0
    86
sl@0
    87
#endif /*CINPUTFRAMEWORK_H_*/