traceservices/tracefw/ulogger/src/pluginframework/inputframework.h
changeset 0 08ec8eefde2f
child 51 7d4490026038
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2007-2009 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 
       
    70 	private://data
       
    71 		CInputData* 			iInputData;
       
    72 		RPointerArray<TPluginConfiguration> iInputSettings;
       
    73 		MInputPlugin 			*iInputPlugin;
       
    74 		RBuf8					iControlData;
       
    75 		HBufC8*					iData;
       
    76 		TPtr8					iDataPtr;
       
    77 		TBool					iContinueReading;
       
    78 		MInputFrameworkObserver* iObserver;
       
    79 		CCommand*				iCommand;
       
    80 	};
       
    81 
       
    82 }
       
    83 
       
    84 #endif /*CINPUTFRAMEWORK_H_*/