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 "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.
16 #ifndef MMFDRMPLUGINSERVER_H
17 #define MMFDRMPLUGINSERVER_H
21 #include <mmf/common/mmfipc.h>
22 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
23 #include <mmf/common/mmfipcserver.h>
25 class CStartAndMonitorControllerThread;
26 class RMMFControllerServerProxy;
28 class CMMFDRMPluginServer : public CMmfIpcServer
34 static CMMFDRMPluginServer* NewL();
35 ~CMMFDRMPluginServer();
36 CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
38 void IncrementSessionId();
39 void DecrementSessionId();
41 void IncrementControllerCount();
42 void DecrementControllerCount();
44 TInt StartControllerServer(const RThread& aClientThread, TUint aMaxHeapSize, TBool aUseSharedHeap,
45 RMMFControllerServerProxy& aDevSoundSessionHandle, TThreadId& aControllerTID, TUint aStackSize) const;
47 void PanicControllerThread(TThreadId aTid, const TDesC& aCategory,TInt aReason);
48 void KillControllerThread(TThreadId aTid, TInt aReason);
49 TInt SetThreadPriority(TThreadId aTid, TThreadPriority aPriority);
50 void SetTimeout(TInt aTimeout) { iServerTimeout = aTimeout; };
54 class CDelayServerShutDown : public CActive
58 static CDelayServerShutDown* NewL();
59 ~CDelayServerShutDown();
61 void SetDelay(TTimeIntervalMicroSeconds32 aDelay);
65 CDelayServerShutDown();
72 RTimer iShutDownTimer; // Has
76 CMMFDRMPluginServer();
81 TInt iControllerCount;
83 CDelayServerShutDown* iDelayServerShutDown;
84 mutable RPointerArray<CStartAndMonitorControllerThread> iControllerServList;
87 class CStartAndMonitorControllerThread: public CActive
90 static CStartAndMonitorControllerThread* NewL(CMMFDRMPluginServer* aPluginServer);
91 ~CStartAndMonitorControllerThread();
92 TInt StartControllerServer(const RThread& aClientThread, TUint aMaxHeapSize, TBool aUseSharedHeap,
93 RMMFControllerServerProxy& aControllerSessionHandle, TThreadId& aControllerTID, TUint aStackSize);
94 RThread& Thread() { return iServerThread; };
97 CStartAndMonitorControllerThread(CMMFDRMPluginServer* aPluginServer);
104 CMMFDRMPluginServer* iDrmPluginServer;
105 RThread iServerThread;
108 class RMMFControllerServerProxy : public RMmfSessionBase
111 TInt Open(RServer2& aControllerServerHandle);