os/persistentdata/traceservices/tracefw/ulogger/src/pluginframework/inputframework.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/traceservices/tracefw/ulogger/src/pluginframework/inputframework.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,87 @@
1.4 +// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// ULogger Input Framework header file
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @internalTechnology
1.24 + @prototype
1.25 +*/
1.26 +
1.27 +#ifndef CINPUTFRAMEWORK_H_
1.28 +#define CINPUTFRAMEWORK_H_
1.29 +
1.30 +#include <e32base.h>
1.31 +#include "uloggerinputplugin.h"
1.32 +#include "inputdata.h"
1.33 +#include "uloggershared.h"
1.34 +#include "uloggercommands.h"
1.35 +
1.36 +
1.37 +namespace Ulogger
1.38 +{
1.39 +
1.40 +/**
1.41 +*/
1.42 +class MInputFrameworkObserver
1.43 + {
1.44 + public:
1.45 + virtual ControlData* ProcessCommandL(TCommand aOpCode, RArray<TPtrC8> &aArguments) = 0;
1.46 + virtual void DoPostProcessing(TCommand aCmd) = 0;
1.47 + };
1.48 +
1.49 +
1.50 +/**
1.51 +*/
1.52 +class CInputFramework : public CActive, public MCommandImpl
1.53 + {
1.54 + friend class CUloggerServerTest4Step; //only for test purposes
1.55 + public:
1.56 + IMPORT_C static CInputFramework* NewL(MInputPlugin *aInputPlugin, const RPointerArray<TPluginConfiguration>& aInputSettings, MInputFrameworkObserver *aObserver);
1.57 + IMPORT_C static CInputFramework* NewLC(MInputPlugin *aInputPlugin, const RPointerArray<TPluginConfiguration>& aInputSettings, MInputFrameworkObserver *aObserver);
1.58 + IMPORT_C virtual ~CInputFramework();
1.59 + IMPORT_C TInt StartReading();
1.60 + IMPORT_C void StopReading();
1.61 +
1.62 + public: //from MCommandImpl
1.63 + IMPORT_C TInt DoCommandL(TCommand aCommand, const RArray<TPtrC>& aValues);
1.64 +
1.65 + protected: //from CActive
1.66 + void DoCancel();
1.67 + void RunL();
1.68 +
1.69 + private:
1.70 + CInputFramework(MInputPlugin *aInputPlugin, MInputFrameworkObserver *aObserver);
1.71 + void ConstructL(const RPointerArray<TPluginConfiguration>& aInputSettings);
1.72 + static void CleanupHBufCPtrArray(TAny* aPtr);
1.73 + static void CleanupHBufC8PtrArray(TAny* aPtr);
1.74 + static void CleanupControlData(TAny* aPtr);
1.75 +
1.76 + private://data
1.77 + CInputData* iInputData;
1.78 + RPointerArray<TPluginConfiguration> iInputSettings;
1.79 + MInputPlugin *iInputPlugin;
1.80 + RBuf8 iControlData;
1.81 + HBufC8* iData;
1.82 + TPtr8 iDataPtr;
1.83 + TBool iContinueReading;
1.84 + MInputFrameworkObserver* iObserver;
1.85 + CCommand* iCommand;
1.86 + };
1.87 +
1.88 +}
1.89 +
1.90 +#endif /*CINPUTFRAMEWORK_H_*/