os/mm/mmplugins/cameraplugins/source/mmcameraclientplugin/mmcameraclientsession/src/mmcameraclientinterface.h
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #ifndef MMCAMERACLIENTINTERFACE_H
22 #define MMCAMERACLIENTINTERFACE_H
26 #include <ecamuids.hrh>
27 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
28 #include <ecamuidsdef.hrh>
30 #include <ecamviewfinder.h>
31 #include <graphics/surface.h>
33 static const TInt KECamMaxMessage = 100;
34 static const TUid KECamServerUid3 = {KUidMMCameraServer};
35 static const TInt KECamNoPriority = -101;
36 static const TInt KECamHandleNotKnown = -1;
37 static const TInt KECamNumAsynchMsg = 8;
40 _LIT(KMMCameraServerName, "!MMCameraServer");
41 _LIT(KMMCameraServerExe, "MMCameraServer"); // Exe name
43 enum TECamMsgId // Enums for use in ServiceL()
45 ECamQueryCamerasAvailable = 0, // Query MM server to retrieve number of physical cameras available
46 ECamCameraAccessControl, // Enums to reserve/release the camera for exclusive use. TBool ETrue/EFalse decides Reserve/Release .
47 ECamPowerCamera, // To Power On the camera if TBool passed =ETrue, else power down
48 ECamOpenCamera, // Called from ConnectSession to open a particular camera specified by the index
49 ECamHandleCamera, // Get the handle of the camera
50 ECamGetCameraInfo, // Retrieve the info about camera device
51 ECamPrepareDirectViewFinder, // Sets up the direct view finder
52 ECamStartDirectViewFinder, // Starts view finder operation
53 ECamStopDirectViewFinder, // Stops view finder playback
54 ECamPauseDirectViewFinder, // Pauses view finder playback
55 ECamResumeDirectViewFinder, // If paused, resumes view finder playback
56 ECamDirectViewFinderState, // Retrieves state of direct view finder
57 ECamSetDirectViewFinderMirror, // Enables/Disables mirror mode on direct viewfinder
58 ECamGetDirectViewFinderMirror, // Retrieves mirror mode status of direct viewfinder
59 ECamDirectViewFinderProperties, // Retrieves properties related to the direct viewfinder
60 ECamSetParameter, // Maps Set camera parameters
61 ECamGetParameter, // Retrives camera parameters
62 ECamCameraHandle // Retrieves unique camera handle
65 enum TCameraParameterId // Camera parameters to set/get
77 enum TCameraMode // Camera modes in which the parameter setting is valid
86 enum TCameraAccessControl
89 ECameraReservedNotification,
90 ECameraCancelReservedNotification,
91 ECameraOverthrowNotification,
92 ECameraCancelOverthrowNotification
97 ECameraPowerOnNotification,
99 ECameraCancelPowerOnNotification
108 typedef TPckg <TCameraInfo> TCameraInfoBuf;
110 struct TCamerasAvailable
114 typedef TPckg <TCamerasAvailable> TCamerasAvailablePckg;
116 struct TOpenCamera // Used for passing the infos to the server side session while creating camera channel
118 TInt iCameraIndex; // between 0-2 assuming 3 cameras
119 TInt iPriority; // If NewDuplicateL called, set KRefCamNoPriority
120 TInt iHandle; // If NewL called, set -1
121 TBool iMMCapability; // set ETrue
122 TBool iCollaborativeClient; // If NewDuplicateL used
124 typedef TPckg <TOpenCamera> TOpenCameraPckg;
130 typedef TPckg <TCameraHandle> TCameraHandlePckg;
132 struct TDirectViewFinderInfo
137 TSurfaceId iSurfaceId;
139 typedef TPckg <TDirectViewFinderInfo> TDirectViewFinderInfoPckg;
141 struct TDirectViewFinderState
143 CCamera::CCameraV2DirectViewFinder::TViewFinderState iState;
145 typedef TPckg <TDirectViewFinderState> TDirectViewFinderStatePckg;
151 typedef TPckg <TCameraZoom> TCameraZoomPckg;
153 struct TCameraDigitalZoom
157 typedef TPckg <TCameraDigitalZoom> TCameraDigitalZoomPckg;
159 struct TCameraContrast
163 typedef TPckg <TCameraContrast> TCameraContrastPckg;
165 struct TCameraBrightness
169 typedef TPckg <TCameraBrightness> TCameraBrightnessPckg;
171 struct TViewFinderMirror
175 typedef TPckg <TViewFinderMirror> TViewFinderMirrorPckg;
179 CCamera::TFlash iFlash;
181 typedef TPckg <TCameraFlash> TCameraFlashPckg;
183 struct TCameraExposure
185 CCamera::TExposure iExposure;
187 typedef TPckg <TCameraExposure> TCameraExposurePckg;
189 struct TCameraWhiteBalance
191 CCamera::TWhiteBalance iWhiteBalance;
193 typedef TPckg <TCameraWhiteBalance> TCameraWhiteBalancePckg;
197 * Interface class to allow communication between clients and server.
199 * Provides API's for both synchronous and asynchronous methods of communication.
201 class RMMCameraSession : public RSessionBase
206 TInt SendMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TDes8& aMessage);
207 TInt SendMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TInt aMessage);
208 TInt SendMessage(TECamMsgId aMsgId, TDes8& aMessage);
209 TInt SendMessage(TECamMsgId aMsgId, TInt aMessage);
210 TInt SendMessage(TECamMsgId aMsgId);
212 TInt SendRxMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TDes8& aMessage) const;
213 TInt SendRxMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TInt aMessage) const;
214 TInt SendRxMessage(TECamMsgId aMsgId, TDes8& aMessage) const;
216 TInt ReceiveMessage(TECamMsgId aMsgId, TDes8& aMessage, TRequestStatus& aStatus);
217 void ReceiveMessage(TECamMsgId aMsgId, TInt aMessage, TRequestStatus& aStatus);
220 #endif // MMCAMERACLIENTINTERFACE_H