os/mm/mmplugins/cameraplugins/source/mmcameraclientplugin/mmcameraserver/src/mmcameraserverpolicymanager.h
Update contrib.
1 // Copyright (c) 2008-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.
14 // mmcamerapolicymanager.h
23 #ifndef MMCAMERASERVERPOLICYMANAGER_H
24 #define MMCAMERASERVERPOLICYMANAGER_H
27 #include <e32hashtab.h>
30 class CMMCameraServerSession;
32 typedef TDblQue<CMMCameraServerSession> TCamSessionQue;
33 typedef TDblQueIter<CMMCameraServerSession> TCamSessionIter;
36 // ECAM Server Policies
37 static _LIT_SECURITY_POLICY_C1 (KMMCameraServerPolicyUserEnvironment, ECapabilityUserEnvironment);
38 static _LIT_SECURITY_POLICY_C1 (KMMCameraServerPolicyMultimediaDD, ECapabilityMultimediaDD);
41 * Manages policy for the ECAM server.
43 * Handles both Platsec capability checks and Reserve/Release of camera devices.
45 class CMMCameraServerPolicyManager : public CBase
48 static CMMCameraServerPolicyManager* NewL();
50 ~CMMCameraServerPolicyManager();
52 void ReleaseClient(CMMCameraServerSession* aSession);
53 TBool ReserveClient(CMMCameraServerSession* aSession);
55 void OnConnectL (const RMessage2& aMessage);
56 void ServiceHandlerL(const RMessage2& aMessage);
59 CMMCameraServerPolicyManager(); // Named Constructor Idiom concept used
62 CMMCameraServerSession* FindFirstInQue(TInt aIndex);
63 CMMCameraServerSession* FindLastInQue(TInt aIndex);
64 void ReserveUpdate(CMMCameraServerSession* aSession);
65 TBool CheckControlOvertaking(CMMCameraServerSession* aSession); // informs whether the new client can overtake camera control from the previously reserved ones
68 TCamSessionQue iReservedSessionQ;
69 TCamSessionIter iIter;
77 #endif // MMCAMERASERVERPOLICYMANAGER_H