os/persistentdata/traceservices/tracefw/ulogger/src/pluginframework/inputframework.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // ULogger Input Framework header file
    15 // 
    16 //
    17 
    18 /**
    19  @file
    20  @internalTechnology
    21  @prototype
    22 */
    23 
    24 #ifndef CINPUTFRAMEWORK_H_
    25 #define CINPUTFRAMEWORK_H_
    26 
    27 #include <e32base.h>
    28 #include "uloggerinputplugin.h"
    29 #include "inputdata.h"
    30 #include "uloggershared.h"
    31 #include "uloggercommands.h"
    32 
    33 
    34 namespace Ulogger
    35 {
    36 
    37 /**
    38 */
    39 class MInputFrameworkObserver
    40 	{
    41 	public: 
    42 		virtual ControlData* ProcessCommandL(TCommand aOpCode, RArray<TPtrC8> &aArguments) = 0; 
    43 		virtual void DoPostProcessing(TCommand aCmd) = 0;
    44 	};
    45 
    46 
    47 /**
    48 */
    49 class CInputFramework : public CActive, public MCommandImpl
    50 	{
    51 	friend class CUloggerServerTest4Step; //only for test purposes
    52 	public:
    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();
    58 		
    59 	public: //from MCommandImpl
    60 		IMPORT_C TInt DoCommandL(TCommand aCommand, const RArray<TPtrC>& aValues);
    61 	
    62 	protected: //from CActive
    63 		void DoCancel();
    64 		void RunL();
    65 
    66 	private:
    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);
    72 
    73 	private://data
    74 		CInputData* 			iInputData;
    75 		RPointerArray<TPluginConfiguration> iInputSettings;
    76 		MInputPlugin 			*iInputPlugin;
    77 		RBuf8					iControlData;
    78 		HBufC8*					iData;
    79 		TPtr8					iDataPtr;
    80 		TBool					iContinueReading;
    81 		MInputFrameworkObserver* iObserver;
    82 		CCommand*				iCommand;
    83 	};
    84 
    85 }
    86 
    87 #endif /*CINPUTFRAMEWORK_H_*/