?? cameraappcontroller.h
字號:
/*
* ============================================================================
* Name : CameraAppController.h
* Part of : CameraApp
* Description:
* Interface between the UI and the external modules
* Created : 05/06/2006 by Forum Nokia
* Version : 2.0
* Copyright: Nokia Corporation, 2006
* ============================================================================
*/
#ifndef __CAMERA_CONTROLLER_H__
#define __CAMERA_CONTROLLER_H__
#include <e32base.h>
#include <eikapp.h>
#include <avkon.hrh>
#include <avkon.rsg>
#include <StringLoader.h>
#include <AknViewAppUi.h>
#include <MdaAudioSamplePlayer.h> // For playing the sounds
#define __WITHIN_MCI_LIBRARY
#include <ImageConversion.h>
#include <CCamAutoFocus.h> // for TAutoFocusRange enum
#include <f32file.h>
#include "CameraApp.hrh"
class TVolumeInfo;
class TRequestStatus;
class TSysAgentEvent;
class CCoeControl;
class CCameraCaptureEngine;
class CPAlbImageData;
class CFbsBitmap;
class CAknKeySoundSystem;
const TInt KWhiteColor = 0;
_LIT(KJpgFileExtension, ".jpg");
_LIT8(KMimeType,"image/jpeg");
// The name for the image file.
_LIT(KImageFileName, "CamApp");
#ifndef __SERIES60_3X__
#define KErrExtensionNotSupported (-47)
#endif
/**
* Interface between the UI and the external modules
*/
class CCameraAppController : public CBase, public MMdaAudioPlayerCallback
{
public: // Constructor and Destructor
/**
* Symbian OS C++ default constructor.
*/
CCameraAppController(CAknViewAppUi& aAppUi);
/**
* Destructor
*/
virtual ~CCameraAppController();
/**
* Symbian OS second phase constructor.
*/
void ConstructL();
public:
/**
* Set the zoom factor
* @param aEnable, enable the zooming
* true == increase the zoom factor
* false == decrease the zoom factor
* @return zoom factor used
*/
TInt SetZoomL(TBool aEnable);
/**
* Check whether the camera is being used by another app.
* @return, true if it used by another app.
*/
TBool IsCameraUsedByAnotherApp();
/**
* Handle the error message from the engine
* @param aError a error message to be handled
*/
void HandleError(TInt aError );
/**
* Set the engine state
* @param aState, new state of the engine
*/
void SetEngineState( TEngineState aState );
/**
* Get the engine state
* @return return the current engine state
*/
TEngineState GetEngineState();
/**
* Redraw the navi pane
*/
void RedrawNaviPaneL();
/**
* Returns whether the image coversion is in progress or not
* @return true if an image is being converted
*/
TBool IsImageConversionInProgress();
/**
* Update the conversion status
* @param aStatus, the status to be shown "Image saving..." etc
*/
void ShowConversionStatusL(const TDesC &aStatus,
TBool aShowFileName = EFalse );
/**
* Set the camera mode
* @param aCameraMode, the new camera mode
*/
void SetCameraMode(TCameraState aCameraMode);
/**
* Set the capture mode
* used for displaying information about capture mode/capabilities
* @param aSize, image size in pixels
* @param aFormat, capture format used (CCamera::TFormat)
* @param
*/
void SetCaptureModeL(const TSize& aSize, TInt aFormat, TBool aAFSupported);
/**
* Checks if capturing in portrait is supported for current
* capture mode/format
*/
TBool IsPortraitModeSupported();
/**
* Checks if AF is supported
*/
TBool IsAutoFocusSupported();
/**
* Sets the AF range
@param aRange the new range
*/
void SetFocusRangeL(CCamAutoFocus::TAutoFocusRange aRange);
/**
* Gives snapped image to be displayed in the current view
* @return CFbsBitmap& image to be displayed
*/
CFbsBitmap& GetSnappedImage();
/**
* Gives camera mode setting
* @return TInt current camera mode
*/
TCameraState CameraMode() const;
/**
* Gives reference to Active view container to Controller
* @param aAppContainer reference to view container
* @param aViewId active view Id
* @return void
*/
void SetAppContainer( CCoeControl* aAppContainer, TCameraViewIds aViewId );
/**
* Initialize Camera
* @return void
*/
void InitializeCameraL(const TRect& aRect);
/**
* Stops view finding
* @return void
*/
void StopViewFinder();
/**
* Starts the Active Objet that calls ViewFinding operation regularly
* @return void
*/
void StartViewFinderL();
/**
* Gets image from image capture engine, and displays it on screen
* @return void
*/
void ViewFinding(CFbsBitmap& aFrame);
/**
* Snaps image through the Camera API
* @return void
*/
void SnapL();
/**
* Starts the optimised autofocus operation.
* Does nothing if AF is not supported
* @return void
*/
void StartFocusL();
/**
* Cancels an ongoing autofocus operation
* @return void
*/
void FocusCancel();
/**
* Returns current quality factor
* @return TJpegQualityFactor
*/
TJpegQualityFactor QualityFactor() const;
/**
* Saves the snapped image on disk
* @return void
*/
void SaveImageL();
/**
* Returns the complete path of the saved image
* @return TDesC& complete path and name of the last saved image
*/
const TDesC& ImagePath() const;
/**
* Initializes snap sound player
* @return void
*/
void CreateSoundPlayerL();
/**
* Returns default display mode
* @return TDisplayMode
*/
TDisplayMode DisplayMode() const;
/**
* Releases camera
* @return void
*/
void ReleaseCamera();
/**
* Bitmaps will be as close as possible to requested size but may not be exactly
* if only certain sizes are supported. The actual size used will be set in aSize
* @param TSize, size of image
* @return void
*/
void SetActualVFSize( const TSize& aSize);
/**
* Plays snap sound by calling engine's StartPlay()
* @param TInt aSoundId
* @return void
*/
void PlaySound( TInt aSoundId = 0 );
/**
* Notify the controller if the client rect size changes
* @param The new client rect
*/
void ClientRectChangedL(const TRect& aRect);
/**
* Skip a specified number of viewfinder frames
* (used for avoiding display mess when changing layout)
* @param TUint number of frames to skip
*/
void SkipFrames( TUint aNumber ) { iSkipFrames = aNumber; }
/**
* Returns true if frames are being currently skipped
*/
TBool IsSkippingFrames() const { return (TBool)iSkipFrames; }
private:
// From MMdaAudioPlayerCallback
void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds &aDuration);
void MapcPlayComplete(TInt aError);
/**
* Powers off the camera
* @return void
*/
void PowerOff();
/**
* Get the next usable file name
* @return void
*/
void GetNextUsableFileName();
private: // data
CAknViewAppUi& iAppUi; // Not owned
TCameraState iCameraMode;
CCameraCaptureEngine* iCameraCaptureEngine;
CFbsBitmap* iBitmapSnap;
HBufC* iImagePath;
TFileName* iPath;
CCoeControl* iContainer; // Not owned
TCameraViewIds iActiveView;
CEikonEnv* iEikEnv; // Not owned
CMdaAudioPlayerUtility* iSoundPlayer;
TFileName iSoundFilePath;
TFileName iNewFileName;
TInt iCaptureFormat;
TUint iSkipFrames;
};
#endif // __CAMERA_CONTROLLER_H__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -