Update contrib.
1 // Copyright (c) 1995-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // f32\sfile\sf_plugin.h
18 #if !defined(__SF_PLUGIN_H__)
20 #define __SF_PLUGIN_H__
24 #include <F32plugin.h>
26 class CFsSyncMessageScheduler;
27 class CFsInternalRequest;
37 CPluginThread* iThread;
44 * - Initialised in main thread
46 * - Contains array of request chains which represent the
47 * plugins registered for each request type.
49 * - Plugins register their interest with each request type,
50 * specifying the associated thread and pre/post processing options.
55 static void InitialiseL();
57 static TInt MountPlugin(CFsPluginFactory& aPluginFactory, TInt aDrive, TInt aPos);
58 static void DismountPlugin(CFsPluginFactory& aPluginFactory, TInt aPos);
60 static TInt InstallPluginFactory(CFsPluginFactory* aFactory,RLibrary aLib);
61 static CFsPluginFactory* GetPluginFactory(const TDesC& aName);
63 static TInt NextPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock, TBool aCheckCurrentOperation=ETrue);
64 static TInt PrevPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock);
65 static TInt InsertInPluginStack(CFsPlugin*& aPlugin,TInt aPos);
66 static TInt IsInChain(TInt aUPos, TInt aPos,TInt aDrive, CFsPluginFactory* aPluginFactory);
67 static CFsPlugin* FindByUniquePosition(TInt aPos);
69 static TInt InitPlugin(CFsPlugin& aPlugin);
70 static void TransferRequests(CPluginThread* aPluginThread);
71 static void CancelPlugin(CFsPlugin* aPlugin,CSessionFs* aSession);
72 static TInt ChainCount();
73 static TInt Plugin(CFsPlugin*& aPlugin, TInt aPos);
75 static void LockChain();
76 static void UnlockChain();
78 static CFsPluginConn* CreatePluginConnL(TInt aUniquePosition, TUint aClientId);
79 static CFsPluginConn* GetPluginConnFromHandle(CSessionFs* aSession, TInt aHandle);
81 static TBool IsPluginConnThread(TThreadId tid, CFsPlugin* aPlugin);
83 static void DispatchSync(CFsRequest* aRequest);
84 static void CompleteSessionRequests(CSessionFs* aSession, TInt aValue, CFsInternalRequest* aRequest);
87 static TInt UpdateMountedDrive(CFsPlugin* aPlugin, CFsPluginFactory* aFactory,TInt aDrive);
88 static void GetNextCancelPluginOpRequest(CPluginThread* aPluginThread, CFsRequest*& aCancelPluginRequest);
90 static CFsObjectCon* iPluginFactories;
91 static CFsObjectCon* iPluginConns;
93 static RPointerArray<CFsPlugin> iPluginChain;
94 static RFastLock iChainLock;
96 static CFsSyncMessageScheduler* iScheduler;
98 friend class RequestAllocator;
101 #endif // __SF_PLUGIN_H