mmplugins/cameraplugins/source/webcamera/ecamwebcameraactive.h
branchRCL_3
changeset 9 9ae0fe04e757
child 64 92a82bc706f7
equal deleted inserted replaced
8:bc06d8566074 9:9ae0fe04e757
       
     1 /*
       
     2 * Copyright (c) 2010 ISB.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * ISB - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef ECAMWEBCAMERAACTIVE_H
       
    19 #define ECAMWEBCAMERAACTIVE_H
       
    20 
       
    21 #include "ecamwebcameraplugin.h"
       
    22 
       
    23 /**
       
    24  *  Perform an Async demand of the camera application
       
    25  */
       
    26 class CWebCameraActive : public CActive
       
    27 	{
       
    28 private:
       
    29 	
       
    30 	/**
       
    31     Active Operation of ECamWebCamera
       
    32     */
       
    33 	enum TECamWebCameraActiveOperation
       
    34 		{
       
    35 		ECamActiveIdle = 0,
       
    36 		ECamActiveReserve,
       
    37 		ECamActivePowerOn,
       
    38 		ECamActiveImageCapture,
       
    39 		};
       
    40 
       
    41 public:
       
    42     /** Constructor */
       
    43     /**
       
    44      * @param aOwner 
       
    45      		  pointer to callback object.
       
    46      * @param aDriver 
       
    47      		  reference to driver.
       
    48      */
       
    49     CWebCameraActive(MWebCameraActiveCallBack* aOwner, RWebcameraDevice& aDriver);
       
    50 	
       
    51 	/**> Destructor */
       
    52 	~CWebCameraActive();
       
    53 	
       
    54     /**
       
    55      * Two-phased constructor.
       
    56      * @param aOwner 
       
    57      		  pointer to callback object.
       
    58      * @param aDriver 
       
    59      		  reference to driver.
       
    60      */
       
    61 	static CWebCameraActive* NewL(MWebCameraActiveCallBack* aOwner, RWebcameraDevice& aDriver);
       
    62 
       
    63 	/** 
       
    64 	Asynchronous function that performs any required initialisation and reserves
       
    65 	the camera for exclusive use.
       
    66 
       
    67 	Calls CWebCamera::ReserveCallBack when complete. 
       
    68 	*/
       
    69 	void Reserve();
       
    70 
       
    71 	/** 
       
    72 	Asynchronous method to switch on camera power.
       
    73 
       
    74 	User must have successfully called Reserve() prior to calling this function.
       
    75 
       
    76 	Calls CWebCamera::PowerOnCallBack when power on is complete. 
       
    77 	*/
       
    78 	void PowerOn();
       
    79 	
       
    80 	/** 
       
    81 	Cancels the asynchronous still image capture. 
       
    82 	
       
    83 	Calls CWebCamera::ImageCaptureCallBack when capture is complete. 
       
    84 	
       
    85 	* @param aDes descriptor to store a capture image
       
    86 	*/
       
    87 	void ImageCapture(TDes8& aDes);
       
    88 	
       
    89 	/** 
       
    90 	Cancels the asynchronous still image capture. 
       
    91 	
       
    92 	@see CWebCamera::CancelCaptureImage
       
    93 	*/
       
    94 	void CancelCaptureImage();
       
    95 
       
    96 private:
       
    97 	void ConstructL();
       
    98 
       
    99 private:
       
   100     /**
       
   101      * RunL.
       
   102      */
       
   103 	void RunL();
       
   104 	void DoCancel();
       
   105 	void ViewFinderComplete(TInt aError);
       
   106 
       
   107 private:
       
   108 
       
   109 	MWebCameraActiveCallBack*		iOwner;		// origin of start.
       
   110 	TECamWebCameraActiveOperation	iOperation;	// Status of the Active Operation of ECamWebCamera
       
   111 	RWebcameraDevice				iDriver;	// Camera driver
       
   112 	};
       
   113 
       
   114 
       
   115 #endif // ECAMWEBCAMERAPLUGIN_H