sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // mmcamerapolicymanager.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef MMCAMERASERVERPOLICYMANAGER_H sl@0: #define MMCAMERASERVERPOLICYMANAGER_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class CMMCameraServerSession; sl@0: sl@0: typedef TDblQue TCamSessionQue; sl@0: typedef TDblQueIter TCamSessionIter; sl@0: sl@0: sl@0: // ECAM Server Policies sl@0: static _LIT_SECURITY_POLICY_C1 (KMMCameraServerPolicyUserEnvironment, ECapabilityUserEnvironment); sl@0: static _LIT_SECURITY_POLICY_C1 (KMMCameraServerPolicyMultimediaDD, ECapabilityMultimediaDD); sl@0: sl@0: /** sl@0: * Manages policy for the ECAM server. sl@0: * sl@0: * Handles both Platsec capability checks and Reserve/Release of camera devices. sl@0: */ sl@0: class CMMCameraServerPolicyManager : public CBase sl@0: { sl@0: public: sl@0: static CMMCameraServerPolicyManager* NewL(); sl@0: sl@0: ~CMMCameraServerPolicyManager(); sl@0: sl@0: void ReleaseClient(CMMCameraServerSession* aSession); sl@0: TBool ReserveClient(CMMCameraServerSession* aSession); sl@0: sl@0: void OnConnectL (const RMessage2& aMessage); sl@0: void ServiceHandlerL(const RMessage2& aMessage); sl@0: sl@0: private: sl@0: CMMCameraServerPolicyManager(); // Named Constructor Idiom concept used sl@0: sl@0: void ConstructL(); sl@0: CMMCameraServerSession* FindFirstInQue(TInt aIndex); sl@0: CMMCameraServerSession* FindLastInQue(TInt aIndex); sl@0: void ReserveUpdate(CMMCameraServerSession* aSession); sl@0: TBool CheckControlOvertaking(CMMCameraServerSession* aSession); // informs whether the new client can overtake camera control from the previously reserved ones sl@0: sl@0: private: sl@0: TCamSessionQue iReservedSessionQ; sl@0: TCamSessionIter iIter; sl@0: sl@0: TInt iCameraIndex; sl@0: TInt iHandle; sl@0: TInt iPriority; sl@0: TBool iMMCapability; sl@0: }; sl@0: sl@0: #endif // MMCAMERASERVERPOLICYMANAGER_H