os/persistentdata/traceservices/tracefw/ulogger/src/pluginframework/inputframework.h
First public contribution.
1 // Copyright (c) 2007-2010 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // ULogger Input Framework header file
24 #ifndef CINPUTFRAMEWORK_H_
25 #define CINPUTFRAMEWORK_H_
28 #include "uloggerinputplugin.h"
29 #include "inputdata.h"
30 #include "uloggershared.h"
31 #include "uloggercommands.h"
39 class MInputFrameworkObserver
42 virtual ControlData* ProcessCommandL(TCommand aOpCode, RArray<TPtrC8> &aArguments) = 0;
43 virtual void DoPostProcessing(TCommand aCmd) = 0;
49 class CInputFramework : public CActive, public MCommandImpl
51 friend class CUloggerServerTest4Step; //only for test purposes
53 IMPORT_C static CInputFramework* NewL(MInputPlugin *aInputPlugin, const RPointerArray<TPluginConfiguration>& aInputSettings, MInputFrameworkObserver *aObserver);
54 IMPORT_C static CInputFramework* NewLC(MInputPlugin *aInputPlugin, const RPointerArray<TPluginConfiguration>& aInputSettings, MInputFrameworkObserver *aObserver);
55 IMPORT_C virtual ~CInputFramework();
56 IMPORT_C TInt StartReading();
57 IMPORT_C void StopReading();
59 public: //from MCommandImpl
60 IMPORT_C TInt DoCommandL(TCommand aCommand, const RArray<TPtrC>& aValues);
62 protected: //from CActive
67 CInputFramework(MInputPlugin *aInputPlugin, MInputFrameworkObserver *aObserver);
68 void ConstructL(const RPointerArray<TPluginConfiguration>& aInputSettings);
69 static void CleanupHBufCPtrArray(TAny* aPtr);
70 static void CleanupHBufC8PtrArray(TAny* aPtr);
71 static void CleanupControlData(TAny* aPtr);
74 CInputData* iInputData;
75 RPointerArray<TPluginConfiguration> iInputSettings;
76 MInputPlugin *iInputPlugin;
80 TBool iContinueReading;
81 MInputFrameworkObserver* iObserver;
87 #endif /*CINPUTFRAMEWORK_H_*/