os/kernelhwsrv/kerneltest/f32test/plugins/version_2/inc/observer_plugin.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 the License "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 //
    15 
    16 #if !defined(__OBSERVER_PLUGIN_H__)
    17 #define __OBSERVER_PLUGIN_H__
    18 
    19 #include <f32plugin.h>
    20 
    21 #define _LOG(a) {if(iLogging) RDebug::Print(a);}
    22 #define _LOG2(a,b) {if(iLogging) RDebug::Print(a,b);}
    23 #define _LOG3(a,b,c) {if(iLogging) RDebug::Print(a,b,c);}
    24 #define _LOG4(a,b,c,d) {if(iLogging) RDebug::Print(a,b,c,d);}
    25 #define _LOG5(a,b,c,d,e) {if(iLogging) RDebug::Print(a,b,c,d,e);}
    26 
    27 const TInt KObserverPos = 0x20000000;
    28 
    29 _LIT(KObserverPluginFileName,"observer_plugin");
    30 _LIT(KObserverPluginName,"ObserverPlugin");
    31 
    32 class CObserverPlugin : public CFsPlugin
    33 {
    34 
    35 public:
    36 	static CObserverPlugin* NewL();
    37 	~CObserverPlugin();
    38 
    39 	virtual void InitialiseL();
    40 	virtual TInt DoRequestL(TFsPluginRequest& aRequest);
    41 
    42 	TInt FsPluginDoControlL(CFsPluginConnRequest& aRequest);
    43 
    44 	// void DoControlL(CFsPluginConnRequest& aRequest);
    45 
    46 protected:
    47 	 CFsPluginConn* NewPluginConnL();
    48 
    49 private:
    50 	CObserverPlugin();
    51 	void ConstructL();
    52 
    53 	void EnableInterceptsL();
    54 	void DisableInterceptsL();
    55 
    56 private:
    57 	RFs iFs;
    58 	TBool iInterceptsEnabled;
    59 	TBool iLogging;
    60 };
    61 
    62 class CObserverPluginConn : public CFsPluginConn
    63 	{
    64 	virtual TInt DoControl(CFsPluginConnRequest& aRequest);
    65 	virtual void DoRequest(CFsPluginConnRequest& aRequest);
    66 	virtual void DoCancel(TInt aReqMask);
    67 	};
    68 
    69 #endif