sl@0
|
1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// f32\sfile\sf_plugin.h
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#if !defined(__SF_PLUGIN_H__)
|
sl@0
|
19 |
|
sl@0
|
20 |
#define __SF_PLUGIN_H__
|
sl@0
|
21 |
|
sl@0
|
22 |
#include "message.h"
|
sl@0
|
23 |
#include <f32fsys.h>
|
sl@0
|
24 |
#include <F32plugin.h>
|
sl@0
|
25 |
|
sl@0
|
26 |
class CFsSyncMessageScheduler;
|
sl@0
|
27 |
class CFsInternalRequest;
|
sl@0
|
28 |
|
sl@0
|
29 |
class TFsPluginThread
|
sl@0
|
30 |
{
|
sl@0
|
31 |
public:
|
sl@0
|
32 |
TFsPluginThread();
|
sl@0
|
33 |
public:
|
sl@0
|
34 |
TInt iDriveNumber;
|
sl@0
|
35 |
TBool iIsAvailable;
|
sl@0
|
36 |
RMutex iPluginLock;
|
sl@0
|
37 |
CPluginThread* iThread;
|
sl@0
|
38 |
TUint iId;
|
sl@0
|
39 |
};
|
sl@0
|
40 |
|
sl@0
|
41 |
/**
|
sl@0
|
42 |
* Plugin Manager
|
sl@0
|
43 |
*
|
sl@0
|
44 |
* - Initialised in main thread
|
sl@0
|
45 |
*
|
sl@0
|
46 |
* - Contains array of request chains which represent the
|
sl@0
|
47 |
* plugins registered for each request type.
|
sl@0
|
48 |
*
|
sl@0
|
49 |
* - Plugins register their interest with each request type,
|
sl@0
|
50 |
* specifying the associated thread and pre/post processing options.
|
sl@0
|
51 |
*/
|
sl@0
|
52 |
class FsPluginManager
|
sl@0
|
53 |
{
|
sl@0
|
54 |
public:
|
sl@0
|
55 |
static void InitialiseL();
|
sl@0
|
56 |
|
sl@0
|
57 |
static TInt MountPlugin(CFsPluginFactory& aPluginFactory, TInt aDrive, TInt aPos);
|
sl@0
|
58 |
static void DismountPlugin(CFsPluginFactory& aPluginFactory, TInt aPos);
|
sl@0
|
59 |
|
sl@0
|
60 |
static TInt InstallPluginFactory(CFsPluginFactory* aFactory,RLibrary aLib);
|
sl@0
|
61 |
static CFsPluginFactory* GetPluginFactory(const TDesC& aName);
|
sl@0
|
62 |
|
sl@0
|
63 |
static TInt NextPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock, TBool aCheckCurrentOperation=ETrue);
|
sl@0
|
64 |
static TInt PrevPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock);
|
sl@0
|
65 |
static TInt InsertInPluginStack(CFsPlugin*& aPlugin,TInt aPos);
|
sl@0
|
66 |
static TInt IsInChain(TInt aUPos, TInt aPos,TInt aDrive, CFsPluginFactory* aPluginFactory);
|
sl@0
|
67 |
static CFsPlugin* FindByUniquePosition(TInt aPos);
|
sl@0
|
68 |
|
sl@0
|
69 |
static TInt InitPlugin(CFsPlugin& aPlugin);
|
sl@0
|
70 |
static void TransferRequests(CPluginThread* aPluginThread);
|
sl@0
|
71 |
static void CancelPlugin(CFsPlugin* aPlugin,CSessionFs* aSession);
|
sl@0
|
72 |
static TInt ChainCount();
|
sl@0
|
73 |
static TInt Plugin(CFsPlugin*& aPlugin, TInt aPos);
|
sl@0
|
74 |
|
sl@0
|
75 |
static void LockChain();
|
sl@0
|
76 |
static void UnlockChain();
|
sl@0
|
77 |
|
sl@0
|
78 |
static CFsPluginConn* CreatePluginConnL(TInt aUniquePosition, TUint aClientId);
|
sl@0
|
79 |
static CFsPluginConn* GetPluginConnFromHandle(CSessionFs* aSession, TInt aHandle);
|
sl@0
|
80 |
|
sl@0
|
81 |
static TBool IsPluginConnThread(TThreadId tid, CFsPlugin* aPlugin);
|
sl@0
|
82 |
|
sl@0
|
83 |
static void DispatchSync(CFsRequest* aRequest);
|
sl@0
|
84 |
static void CompleteSessionRequests(CSessionFs* aSession, TInt aValue, CFsInternalRequest* aRequest);
|
sl@0
|
85 |
|
sl@0
|
86 |
private:
|
sl@0
|
87 |
static TInt UpdateMountedDrive(CFsPlugin* aPlugin, CFsPluginFactory* aFactory,TInt aDrive);
|
sl@0
|
88 |
static void GetNextCancelPluginOpRequest(CPluginThread* aPluginThread, CFsRequest*& aCancelPluginRequest);
|
sl@0
|
89 |
private:
|
sl@0
|
90 |
static CFsObjectCon* iPluginFactories;
|
sl@0
|
91 |
static CFsObjectCon* iPluginConns;
|
sl@0
|
92 |
|
sl@0
|
93 |
static RPointerArray<CFsPlugin> iPluginChain;
|
sl@0
|
94 |
static RFastLock iChainLock;
|
sl@0
|
95 |
|
sl@0
|
96 |
static CFsSyncMessageScheduler* iScheduler;
|
sl@0
|
97 |
|
sl@0
|
98 |
friend class RequestAllocator;
|
sl@0
|
99 |
};
|
sl@0
|
100 |
|
sl@0
|
101 |
#endif // __SF_PLUGIN_H
|
sl@0
|
102 |
|