sl@0: // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // ULogger Input Framework header file sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: @prototype sl@0: */ sl@0: sl@0: #ifndef CINPUTFRAMEWORK_H_ sl@0: #define CINPUTFRAMEWORK_H_ sl@0: sl@0: #include sl@0: #include "uloggerinputplugin.h" sl@0: #include "inputdata.h" sl@0: #include "uloggershared.h" sl@0: #include "uloggercommands.h" sl@0: sl@0: sl@0: namespace Ulogger sl@0: { sl@0: sl@0: /** sl@0: */ sl@0: class MInputFrameworkObserver sl@0: { sl@0: public: sl@0: virtual ControlData* ProcessCommandL(TCommand aOpCode, RArray &aArguments) = 0; sl@0: virtual void DoPostProcessing(TCommand aCmd) = 0; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: */ sl@0: class CInputFramework : public CActive, public MCommandImpl sl@0: { sl@0: friend class CUloggerServerTest4Step; //only for test purposes sl@0: public: sl@0: IMPORT_C static CInputFramework* NewL(MInputPlugin *aInputPlugin, const RPointerArray& aInputSettings, MInputFrameworkObserver *aObserver); sl@0: IMPORT_C static CInputFramework* NewLC(MInputPlugin *aInputPlugin, const RPointerArray& aInputSettings, MInputFrameworkObserver *aObserver); sl@0: IMPORT_C virtual ~CInputFramework(); sl@0: IMPORT_C TInt StartReading(); sl@0: IMPORT_C void StopReading(); sl@0: sl@0: public: //from MCommandImpl sl@0: IMPORT_C TInt DoCommandL(TCommand aCommand, const RArray& aValues); sl@0: sl@0: protected: //from CActive sl@0: void DoCancel(); sl@0: void RunL(); sl@0: sl@0: private: sl@0: CInputFramework(MInputPlugin *aInputPlugin, MInputFrameworkObserver *aObserver); sl@0: void ConstructL(const RPointerArray& aInputSettings); sl@0: static void CleanupHBufCPtrArray(TAny* aPtr); sl@0: static void CleanupHBufC8PtrArray(TAny* aPtr); sl@0: static void CleanupControlData(TAny* aPtr); sl@0: sl@0: private://data sl@0: CInputData* iInputData; sl@0: RPointerArray iInputSettings; sl@0: MInputPlugin *iInputPlugin; sl@0: RBuf8 iControlData; sl@0: HBufC8* iData; sl@0: TPtr8 iDataPtr; sl@0: TBool iContinueReading; sl@0: MInputFrameworkObserver* iObserver; sl@0: CCommand* iCommand; sl@0: }; sl@0: sl@0: } sl@0: sl@0: #endif /*CINPUTFRAMEWORK_H_*/