diff -r 000000000000 -r a41df078684a kerneltest/e32test/examples/camera1/camera1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kerneltest/e32test/examples/camera1/camera1.h Mon Oct 19 15:55:17 2009 +0100 @@ -0,0 +1,304 @@ +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// in its implementation. +// +// + +/** + @file The interface to an example camera device driver which uses Shared Chunks + @publishedPartner + @prototype 9.1 +*/ + +#ifndef __CAMERA1_H__ +#define __CAMERA1_H__ + +#include +#include +#ifndef __KERNEL_MODE__ +#include +#endif + +/** +User interface for 'Camera1' +*/ +class RCamera1 : public RBusLogicalChannel + { +public: + /** + Structure for holding driver capabilities information + (Just a version number in this example.) + */ + class TCaps + { + public: + TVersion iVersion; + }; + + /** + Structure for holding driver configuration data + */ + class TConfig + { + public: + TSize iImageSize; /**< Size of image in pixels */ + TInt iImageBytesPerPixel; /**< Number of bytes used to represent a single pixel */ + TInt iFrameRate; /**< Speed to capture images at in frames per second*/ + TInt iNumImageBuffers; /**< Number of simultanious images the client wishes to process */ + }; + typedef TPckgBuf TConfigBuf; + +#ifndef __KERNEL_MODE__ +public: + TInt Open(); + void Close(); + TInt GetConfig(TConfigBuf& aConfig); + TInt SetConfig(const TConfigBuf& aConfig); + TInt StartCapture(); + TInt EndCapture(); + void CaptureImage(TRequestStatus& aStatus, TInt aReleaseImage=-1); + void CaptureImageCancel(); + TInt ReleaseImage(TInt aReleaseImage); + TInt Duplicate(const RThread& aSrc,TOwnerType aType=EOwnerProcess); + inline RChunk ImageChunk() const; +private: + RChunk iChunk; /**< The chunk into which captured images will be placed */ +#endif + +public: + inline static const TDesC& Name(); + inline static TVersion VersionRequired(); + +private: + /** + Enumeration of Control messages. + */ + enum TControl + { + EGetConfig, + ESetConfig, + EStartCapture, + EEndCapture, + ECaptureImage, + EReleaseImage + }; + + /** + Enumeration of Request messages. + (None used in this example) + */ + enum TRequest + { + ENumRequests, + EAllRequests = (1<