os/mm/mmplugins/cameraplugins/source/mmcameraclientplugin/mmcameraclientsession/src/mmcameraclientinterface.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmplugins/cameraplugins/source/mmcameraclientplugin/mmcameraclientsession/src/mmcameraclientinterface.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,220 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @internalTechnology
    1.22 +*/
    1.23 +
    1.24 +#ifndef MMCAMERACLIENTINTERFACE_H
    1.25 +#define MMCAMERACLIENTINTERFACE_H
    1.26 +
    1.27 +#include <e32base.h>
    1.28 +#include <e32std.h>
    1.29 +#include <ecamuids.hrh>
    1.30 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.31 +#include <ecamuidsdef.hrh>
    1.32 +#endif
    1.33 +#include <ecamviewfinder.h>
    1.34 +#include <graphics/surface.h>
    1.35 +
    1.36 +static const TInt KECamMaxMessage = 100;
    1.37 +static const TUid KECamServerUid3 = {KUidMMCameraServer};
    1.38 +static const TInt KECamNoPriority = -101;
    1.39 +static const TInt KECamHandleNotKnown = -1;
    1.40 +static const TInt KECamNumAsynchMsg = 8;
    1.41 +
    1.42 +
    1.43 +_LIT(KMMCameraServerName, "!MMCameraServer");
    1.44 +_LIT(KMMCameraServerExe, "MMCameraServer");  // Exe name
    1.45 +
    1.46 +enum TECamMsgId // Enums for use in ServiceL()
    1.47 +	{    
    1.48 +	ECamQueryCamerasAvailable = 0,	// Query MM server to retrieve number of physical cameras available
    1.49 +	ECamCameraAccessControl,    	// Enums to reserve/release the camera for exclusive use. TBool ETrue/EFalse decides Reserve/Release . 
    1.50 +	ECamPowerCamera,      			// To Power On the camera if TBool passed =ETrue, else power down 
    1.51 +  	ECamOpenCamera,        			// Called from ConnectSession to open a particular camera specified by the index 
    1.52 +	ECamHandleCamera,     			// Get the handle of the camera 
    1.53 +	ECamGetCameraInfo,    			// Retrieve the info about camera device
    1.54 +	ECamPrepareDirectViewFinder,	// Sets up the direct view finder
    1.55 +	ECamStartDirectViewFinder,		// Starts view finder operation
    1.56 +	ECamStopDirectViewFinder,  		// Stops view finder playback
    1.57 +	ECamPauseDirectViewFinder,		// Pauses view finder playback
    1.58 +	ECamResumeDirectViewFinder,		// If paused, resumes view finder playback
    1.59 +	ECamDirectViewFinderState,		// Retrieves state of direct view finder
    1.60 +	ECamSetDirectViewFinderMirror,	// Enables/Disables mirror mode on direct viewfinder
    1.61 +	ECamGetDirectViewFinderMirror,	// Retrieves mirror mode status of direct viewfinder
    1.62 +	ECamDirectViewFinderProperties, // Retrieves properties related to the direct viewfinder
    1.63 +	ECamSetParameter,				// Maps Set camera parameters
    1.64 +	ECamGetParameter,				// Retrives camera parameters
    1.65 +	ECamCameraHandle  		   		// Retrieves unique camera handle
    1.66 +	};
    1.67 +	
    1.68 +enum TCameraParameterId   // Camera parameters to set/get 
    1.69 +    {
    1.70 +    EZoomFactor,
    1.71 +    EDigitalZoomFactor,
    1.72 +    EContrast,
    1.73 +    EBrightness,
    1.74 +    EFlash,
    1.75 +    EExposure,
    1.76 +    EWhiteBalance,
    1.77 +    EJpegQuality
    1.78 +    };
    1.79 +/*    
    1.80 +enum TCameraMode   // Camera modes in which the parameter setting is valid 
    1.81 +    {
    1.82 +    ECameraVF = 0x0001,
    1.83 +    ECameraIC = 0x0002,
    1.84 +    ECameraVC = 0x0004
    1.85 +    };
    1.86 +	
    1.87 +*/
    1.88 +
    1.89 +enum TCameraAccessControl
    1.90 +	{
    1.91 +	ECameraRelease,
    1.92 +	ECameraReservedNotification,
    1.93 +	ECameraCancelReservedNotification,
    1.94 +	ECameraOverthrowNotification,
    1.95 +	ECameraCancelOverthrowNotification		
    1.96 +	};
    1.97 +	
    1.98 +enum TCameraPower
    1.99 +	{
   1.100 +	ECameraPowerOnNotification,
   1.101 +	ECameraPowerOff,
   1.102 +	ECameraCancelPowerOnNotification		
   1.103 +	};
   1.104 +	
   1.105 +enum TServerPanic
   1.106 +	{
   1.107 +	EPanicBadDescriptor,
   1.108 +	EPanicNotSupported
   1.109 +	};
   1.110 +	
   1.111 +typedef TPckg <TCameraInfo> TCameraInfoBuf;
   1.112 +
   1.113 +struct TCamerasAvailable
   1.114 +	{
   1.115 +	TInt iCameraCount;
   1.116 +	};
   1.117 +typedef TPckg <TCamerasAvailable> TCamerasAvailablePckg;
   1.118 +
   1.119 +struct TOpenCamera    // Used for passing the infos to the server side session while creating camera channel 
   1.120 +    {
   1.121 +    TInt iCameraIndex; // between 0-2 assuming 3 cameras 
   1.122 +    TInt iPriority; //  If NewDuplicateL called, set KRefCamNoPriority 
   1.123 +    TInt iHandle;   //  If NewL called, set -1 
   1.124 +    TBool iMMCapability; // set ETrue 
   1.125 +    TBool iCollaborativeClient; //  If NewDuplicateL used 
   1.126 +    };
   1.127 +typedef TPckg <TOpenCamera> TOpenCameraPckg;
   1.128 +
   1.129 +struct TCameraHandle    
   1.130 +    {
   1.131 +    TInt iHandle;   
   1.132 +    };
   1.133 +typedef TPckg <TCameraHandle> TCameraHandlePckg;
   1.134 +
   1.135 +struct TDirectViewFinderInfo    
   1.136 +    {
   1.137 +	TInt iScreenNum;
   1.138 +	TRect iScreenRect;
   1.139 +	TRect iClipRect;
   1.140 +	TSurfaceId iSurfaceId;
   1.141 +    };
   1.142 +typedef TPckg <TDirectViewFinderInfo> TDirectViewFinderInfoPckg;
   1.143 +
   1.144 +struct TDirectViewFinderState
   1.145 +	{
   1.146 +	CCamera::CCameraV2DirectViewFinder::TViewFinderState iState;
   1.147 +	};
   1.148 +typedef TPckg <TDirectViewFinderState> TDirectViewFinderStatePckg;
   1.149 +
   1.150 +struct TCameraZoom
   1.151 +	{
   1.152 +	TInt iZoom;
   1.153 +	};
   1.154 +typedef TPckg <TCameraZoom> TCameraZoomPckg;
   1.155 +
   1.156 +struct TCameraDigitalZoom
   1.157 +	{
   1.158 +	TInt iDigitalZoom;
   1.159 +	};
   1.160 +typedef TPckg <TCameraDigitalZoom> TCameraDigitalZoomPckg;
   1.161 +
   1.162 +struct TCameraContrast
   1.163 +	{
   1.164 +	TInt iContrast;
   1.165 +	};
   1.166 +typedef TPckg <TCameraContrast> TCameraContrastPckg;
   1.167 +
   1.168 +struct TCameraBrightness
   1.169 +	{
   1.170 +	TInt iBrightness;
   1.171 +	};
   1.172 +typedef TPckg <TCameraBrightness> TCameraBrightnessPckg;
   1.173 +
   1.174 +struct TViewFinderMirror  
   1.175 +    {
   1.176 +	TBool iMirror;
   1.177 +    };
   1.178 +typedef TPckg <TViewFinderMirror> TViewFinderMirrorPckg;
   1.179 +
   1.180 +struct TCameraFlash
   1.181 +	{
   1.182 +	CCamera::TFlash iFlash;
   1.183 +	};
   1.184 +typedef TPckg <TCameraFlash> TCameraFlashPckg;
   1.185 +
   1.186 +struct TCameraExposure
   1.187 +	{
   1.188 +	CCamera::TExposure iExposure;
   1.189 +	};
   1.190 +typedef TPckg <TCameraExposure> TCameraExposurePckg;
   1.191 +
   1.192 +struct TCameraWhiteBalance
   1.193 +	{
   1.194 +	CCamera::TWhiteBalance iWhiteBalance;
   1.195 +	};
   1.196 +typedef TPckg <TCameraWhiteBalance> TCameraWhiteBalancePckg;
   1.197 +
   1.198 +
   1.199 +/**
   1.200 + * Interface class to allow communication between clients and server.
   1.201 + * 
   1.202 + * Provides API's for both synchronous and asynchronous methods of communication. 
   1.203 + */
   1.204 +class RMMCameraSession : public RSessionBase
   1.205 +	{
   1.206 +public:
   1.207 +	TInt Connect();
   1.208 +
   1.209 +	TInt SendMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TDes8& aMessage);
   1.210 +	TInt SendMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TInt aMessage);
   1.211 +	TInt SendMessage(TECamMsgId aMsgId, TDes8& aMessage);
   1.212 +	TInt SendMessage(TECamMsgId aMsgId, TInt aMessage);
   1.213 +	TInt SendMessage(TECamMsgId aMsgId);
   1.214 +
   1.215 +	TInt SendRxMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TDes8& aMessage) const;
   1.216 +	TInt SendRxMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TInt aMessage) const;
   1.217 +	TInt SendRxMessage(TECamMsgId aMsgId, TDes8& aMessage) const;
   1.218 +
   1.219 +	TInt ReceiveMessage(TECamMsgId aMsgId, TDes8& aMessage, TRequestStatus& aStatus);
   1.220 +	void ReceiveMessage(TECamMsgId aMsgId, TInt aMessage, TRequestStatus& aStatus);
   1.221 +	}; 
   1.222 +	
   1.223 +#endif // MMCAMERACLIENTINTERFACE_H