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: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef MMCAMERACLIENTINTERFACE_H sl@0: #define MMCAMERACLIENTINTERFACE_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: #include sl@0: #include sl@0: sl@0: static const TInt KECamMaxMessage = 100; sl@0: static const TUid KECamServerUid3 = {KUidMMCameraServer}; sl@0: static const TInt KECamNoPriority = -101; sl@0: static const TInt KECamHandleNotKnown = -1; sl@0: static const TInt KECamNumAsynchMsg = 8; sl@0: sl@0: sl@0: _LIT(KMMCameraServerName, "!MMCameraServer"); sl@0: _LIT(KMMCameraServerExe, "MMCameraServer"); // Exe name sl@0: sl@0: enum TECamMsgId // Enums for use in ServiceL() sl@0: { sl@0: ECamQueryCamerasAvailable = 0, // Query MM server to retrieve number of physical cameras available sl@0: ECamCameraAccessControl, // Enums to reserve/release the camera for exclusive use. TBool ETrue/EFalse decides Reserve/Release . sl@0: ECamPowerCamera, // To Power On the camera if TBool passed =ETrue, else power down sl@0: ECamOpenCamera, // Called from ConnectSession to open a particular camera specified by the index sl@0: ECamHandleCamera, // Get the handle of the camera sl@0: ECamGetCameraInfo, // Retrieve the info about camera device sl@0: ECamPrepareDirectViewFinder, // Sets up the direct view finder sl@0: ECamStartDirectViewFinder, // Starts view finder operation sl@0: ECamStopDirectViewFinder, // Stops view finder playback sl@0: ECamPauseDirectViewFinder, // Pauses view finder playback sl@0: ECamResumeDirectViewFinder, // If paused, resumes view finder playback sl@0: ECamDirectViewFinderState, // Retrieves state of direct view finder sl@0: ECamSetDirectViewFinderMirror, // Enables/Disables mirror mode on direct viewfinder sl@0: ECamGetDirectViewFinderMirror, // Retrieves mirror mode status of direct viewfinder sl@0: ECamDirectViewFinderProperties, // Retrieves properties related to the direct viewfinder sl@0: ECamSetParameter, // Maps Set camera parameters sl@0: ECamGetParameter, // Retrives camera parameters sl@0: ECamCameraHandle // Retrieves unique camera handle sl@0: }; sl@0: sl@0: enum TCameraParameterId // Camera parameters to set/get sl@0: { sl@0: EZoomFactor, sl@0: EDigitalZoomFactor, sl@0: EContrast, sl@0: EBrightness, sl@0: EFlash, sl@0: EExposure, sl@0: EWhiteBalance, sl@0: EJpegQuality sl@0: }; sl@0: /* sl@0: enum TCameraMode // Camera modes in which the parameter setting is valid sl@0: { sl@0: ECameraVF = 0x0001, sl@0: ECameraIC = 0x0002, sl@0: ECameraVC = 0x0004 sl@0: }; sl@0: sl@0: */ sl@0: sl@0: enum TCameraAccessControl sl@0: { sl@0: ECameraRelease, sl@0: ECameraReservedNotification, sl@0: ECameraCancelReservedNotification, sl@0: ECameraOverthrowNotification, sl@0: ECameraCancelOverthrowNotification sl@0: }; sl@0: sl@0: enum TCameraPower sl@0: { sl@0: ECameraPowerOnNotification, sl@0: ECameraPowerOff, sl@0: ECameraCancelPowerOnNotification sl@0: }; sl@0: sl@0: enum TServerPanic sl@0: { sl@0: EPanicBadDescriptor, sl@0: EPanicNotSupported sl@0: }; sl@0: sl@0: typedef TPckg TCameraInfoBuf; sl@0: sl@0: struct TCamerasAvailable sl@0: { sl@0: TInt iCameraCount; sl@0: }; sl@0: typedef TPckg TCamerasAvailablePckg; sl@0: sl@0: struct TOpenCamera // Used for passing the infos to the server side session while creating camera channel sl@0: { sl@0: TInt iCameraIndex; // between 0-2 assuming 3 cameras sl@0: TInt iPriority; // If NewDuplicateL called, set KRefCamNoPriority sl@0: TInt iHandle; // If NewL called, set -1 sl@0: TBool iMMCapability; // set ETrue sl@0: TBool iCollaborativeClient; // If NewDuplicateL used sl@0: }; sl@0: typedef TPckg TOpenCameraPckg; sl@0: sl@0: struct TCameraHandle sl@0: { sl@0: TInt iHandle; sl@0: }; sl@0: typedef TPckg TCameraHandlePckg; sl@0: sl@0: struct TDirectViewFinderInfo sl@0: { sl@0: TInt iScreenNum; sl@0: TRect iScreenRect; sl@0: TRect iClipRect; sl@0: TSurfaceId iSurfaceId; sl@0: }; sl@0: typedef TPckg TDirectViewFinderInfoPckg; sl@0: sl@0: struct TDirectViewFinderState sl@0: { sl@0: CCamera::CCameraV2DirectViewFinder::TViewFinderState iState; sl@0: }; sl@0: typedef TPckg TDirectViewFinderStatePckg; sl@0: sl@0: struct TCameraZoom sl@0: { sl@0: TInt iZoom; sl@0: }; sl@0: typedef TPckg TCameraZoomPckg; sl@0: sl@0: struct TCameraDigitalZoom sl@0: { sl@0: TInt iDigitalZoom; sl@0: }; sl@0: typedef TPckg TCameraDigitalZoomPckg; sl@0: sl@0: struct TCameraContrast sl@0: { sl@0: TInt iContrast; sl@0: }; sl@0: typedef TPckg TCameraContrastPckg; sl@0: sl@0: struct TCameraBrightness sl@0: { sl@0: TInt iBrightness; sl@0: }; sl@0: typedef TPckg TCameraBrightnessPckg; sl@0: sl@0: struct TViewFinderMirror sl@0: { sl@0: TBool iMirror; sl@0: }; sl@0: typedef TPckg TViewFinderMirrorPckg; sl@0: sl@0: struct TCameraFlash sl@0: { sl@0: CCamera::TFlash iFlash; sl@0: }; sl@0: typedef TPckg TCameraFlashPckg; sl@0: sl@0: struct TCameraExposure sl@0: { sl@0: CCamera::TExposure iExposure; sl@0: }; sl@0: typedef TPckg TCameraExposurePckg; sl@0: sl@0: struct TCameraWhiteBalance sl@0: { sl@0: CCamera::TWhiteBalance iWhiteBalance; sl@0: }; sl@0: typedef TPckg TCameraWhiteBalancePckg; sl@0: sl@0: sl@0: /** sl@0: * Interface class to allow communication between clients and server. sl@0: * sl@0: * Provides API's for both synchronous and asynchronous methods of communication. sl@0: */ sl@0: class RMMCameraSession : public RSessionBase sl@0: { sl@0: public: sl@0: TInt Connect(); sl@0: sl@0: TInt SendMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TDes8& aMessage); sl@0: TInt SendMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TInt aMessage); sl@0: TInt SendMessage(TECamMsgId aMsgId, TDes8& aMessage); sl@0: TInt SendMessage(TECamMsgId aMsgId, TInt aMessage); sl@0: TInt SendMessage(TECamMsgId aMsgId); sl@0: sl@0: TInt SendRxMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TDes8& aMessage) const; sl@0: TInt SendRxMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TInt aMessage) const; sl@0: TInt SendRxMessage(TECamMsgId aMsgId, TDes8& aMessage) const; sl@0: sl@0: TInt ReceiveMessage(TECamMsgId aMsgId, TDes8& aMessage, TRequestStatus& aStatus); sl@0: void ReceiveMessage(TECamMsgId aMsgId, TInt aMessage, TRequestStatus& aStatus); sl@0: }; sl@0: sl@0: #endif // MMCAMERACLIENTINTERFACE_H