os/mm/mmplugins/cameraplugins/source/mmcameraclientplugin/mmcameraserver/src/mmcameraserversession.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // mmcamerasession.h
    15 // 
    16 //
    17 
    18 /**
    19  @file
    20  @internalTechnology
    21 */
    22 
    23 #ifndef MMCAMERASERVERSESSION_H
    24 #define MMCAMERASERVERSESSION_H
    25 
    26 #include "mmcameraserver.h"
    27 #include "mmcameraserverpolicymanager.h"
    28 
    29 
    30 class CMMCameraServerSession : public CSession2
    31 	{
    32 friend class CCameraServerController;
    33 
    34 public:
    35 	CMMCameraServerSession();
    36 	~CMMCameraServerSession();  // Close the camera channel. Remove Session from the server list
    37 
    38 	void ServiceL(const RMessage2& aMessage);
    39 	void CreateL();       // Add Session to the Server list. Should open the camera channel. Set Handle no.
    40 
    41 	// Expose session parameters for use with policy manager
    42 	TBool CollaborativeClient() const { return iCollaborativeClient; }
    43 	TBool MMCapability() const { return iMMCapability; }
    44 	TInt Handle() const { return iHandle; }
    45 	TInt Priority() const { return iPriority; }
    46 	TInt CameraIndex() const { return iCameraIndex; }
    47 
    48 	void SetHandle(TInt aHandle);
    49 	void SetPriority(TInt aPriority);
    50 	void SetReserved(TBool aReserved);
    51 	void SetMMCapability(TBool aMMCapability);
    52 	void CompleteOverthrow();
    53 	CMMCameraServerController* CameraController();  // Handle to Camera Controller
    54 
    55 private:
    56 	void Disconnect(const RMessage2& aMessage);
    57 
    58 	void CamerasAvailable(const RMessage2& aMessage);
    59 
    60 	void OpenCamera(const RMessage2& aMessage);
    61 
    62 	void Reserve(const RMessage2& aMessage);
    63 	void Release(const RMessage2& aMessage);
    64 	void CancelReserve(const RMessage2& aMessage);
    65 
    66 	void PowerOn(const RMessage2& aMessage);
    67 	void PowerOff();
    68 	void CancelPowerOn();
    69 
    70 	void PrepareDirectViewFinder(const RMessage2& aMessage);
    71 	void StartDirectViewFinder(const RMessage2& aMessage);
    72 	void StopDirectViewFinder(const RMessage2& aMessage);
    73 	void PauseDirectViewFinder(const RMessage2& aMessage);
    74 	void ResumeDirectViewFinder(const RMessage2& aMessage);
    75 	void SetDirectViewFinderMirror(const RMessage2& aMessage);
    76 	void GetDirectViewFinderMirror(const RMessage2& aMessage);
    77 	void DirectViewFinderState(const RMessage2& aMessage);
    78 	void DirectViewFinderProperties(const RMessage2& aMessage);
    79 
    80 	void SetCameraParameter(const RMessage2& aMessage);
    81 	void GetCameraParameter(const RMessage2& aMessage);
    82 
    83 	void CameraHandle(const RMessage2& aMessage);
    84 
    85 private:
    86 	CMMCameraServer* Server();   // Handle to Server
    87 
    88 	void PanicClient(const RMessage2& aMessage, TServerPanic aPanic);
    89 
    90 public:
    91     TDblQueLink iCamSessionLink;    // Link Object for Policy manager
    92 
    93 private:
    94 	CMMCameraServerController* iCameraController;  // Handle to Camera Controller
    95 	CMMCameraServer* iCameraServer;
    96 	CMMCameraServerPolicyManager* iPolicyManager;
    97 
    98 	TInt iCameraIndex;   // details needed
    99 	TInt iHandle;
   100 	TInt iPriority;
   101 	TBool iMMCapability;  // comes packed in RMessage2. Checked in open camera call
   102 	TBool iCollaborativeClient;
   103 
   104 	TBool iReserved;
   105 	TBool iPoweredUp;
   106 
   107     RMessagePtr2 iOverthrowMessage;
   108   	};
   109 
   110 #endif // MMCAMERASERVERSESSION_H