os/mm/mmplugins/cameraplugins/source/mmcameraclientplugin/mmcameraserver/src/mmcameraserverpolicymanager.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2008-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 "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
// mmcamerapolicymanager.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @internalTechnology
sl@0
    21
*/
sl@0
    22
sl@0
    23
#ifndef MMCAMERASERVERPOLICYMANAGER_H
sl@0
    24
#define MMCAMERASERVERPOLICYMANAGER_H
sl@0
    25
sl@0
    26
#include <e32std.h>
sl@0
    27
#include <e32hashtab.h>
sl@0
    28
#include <e32cmn.h>
sl@0
    29
sl@0
    30
class CMMCameraServerSession;
sl@0
    31
sl@0
    32
typedef TDblQue<CMMCameraServerSession> TCamSessionQue;
sl@0
    33
typedef TDblQueIter<CMMCameraServerSession> TCamSessionIter;
sl@0
    34
sl@0
    35
sl@0
    36
// ECAM Server Policies
sl@0
    37
static _LIT_SECURITY_POLICY_C1 (KMMCameraServerPolicyUserEnvironment, ECapabilityUserEnvironment);
sl@0
    38
static _LIT_SECURITY_POLICY_C1 (KMMCameraServerPolicyMultimediaDD, ECapabilityMultimediaDD);
sl@0
    39
sl@0
    40
/**
sl@0
    41
 * Manages policy for the ECAM server.
sl@0
    42
 * 
sl@0
    43
 * Handles both Platsec capability checks and Reserve/Release of camera devices.
sl@0
    44
 */  
sl@0
    45
class CMMCameraServerPolicyManager : public CBase
sl@0
    46
	{
sl@0
    47
public:
sl@0
    48
	static CMMCameraServerPolicyManager* NewL();
sl@0
    49
sl@0
    50
	~CMMCameraServerPolicyManager();
sl@0
    51
sl@0
    52
	void ReleaseClient(CMMCameraServerSession* aSession);
sl@0
    53
	TBool ReserveClient(CMMCameraServerSession* aSession);
sl@0
    54
sl@0
    55
	void OnConnectL (const RMessage2& aMessage);
sl@0
    56
	void ServiceHandlerL(const RMessage2& aMessage);
sl@0
    57
sl@0
    58
private:
sl@0
    59
	CMMCameraServerPolicyManager();   // Named Constructor Idiom concept used
sl@0
    60
sl@0
    61
	void ConstructL();
sl@0
    62
	CMMCameraServerSession* FindFirstInQue(TInt aIndex);
sl@0
    63
	CMMCameraServerSession* FindLastInQue(TInt aIndex);
sl@0
    64
	void ReserveUpdate(CMMCameraServerSession* aSession);
sl@0
    65
	TBool CheckControlOvertaking(CMMCameraServerSession* aSession); // informs whether the new client can overtake camera control from the previously reserved ones 
sl@0
    66
sl@0
    67
private:
sl@0
    68
	TCamSessionQue iReservedSessionQ;
sl@0
    69
	TCamSessionIter iIter;
sl@0
    70
sl@0
    71
	TInt iCameraIndex;
sl@0
    72
    TInt iHandle;
sl@0
    73
    TInt iPriority;
sl@0
    74
	TBool iMMCapability;   
sl@0
    75
	};
sl@0
    76
sl@0
    77
#endif // MMCAMERASERVERPOLICYMANAGER_H