examples/ForumNokia/CameraExample/inc/CameraWrapperExampleAppView.h

00001 /*
00002  * Copyright (c) 2009 Nokia Corporation.
00003  */
00004 
00005 #ifndef __CAMERAWRAPPEREXAMPLEAPPVIEW_h__
00006 #define __CAMERAWRAPPEREXAMPLEAPPVIEW_h__
00007 
00008 // INCLUDES
00009 #include <coecntrl.h>
00010 #include <fbs.h>
00011 
00012 #include <cameraengine.h>
00013 #include <cameraengineobserver.h>
00014 
00015 
00016 
00017 
00018 class CCameraWrapperExampleAppUi;
00019 
00020 // CLASS DECLARATION
00021 class CCameraWrapperExampleAppView : 
00022 public CCoeControl, public MCameraEngineObserver
00023     {
00024     public: 
00025         // Constructors
00026         static CCameraWrapperExampleAppView* NewL (const TRect& aRect );
00027         static CCameraWrapperExampleAppView* NewLC (const TRect& aRect );
00028         virtual ~CCameraWrapperExampleAppView ();
00029     
00030     private: 
00031         // Functions from base classes
00032         void Draw (const TRect& aRect ) const;
00033         void DrawTexts(CWindowGc& gc) const;
00034         void SizeChanged ();
00035         void HandlePointerEventL (const TPointerEvent& aPointerEvent );
00036         void SetTitle(const TDesC& aTitle);
00037         void SetError( const TDesC& aMsg, TInt aVal );
00038         void SetError( const TDesC& aMsg, TInt aVal1, TInt aVal2 );
00039         void StartFocusing();
00040         void StorePicture( TDesC8* aData );
00041 
00042     public:
00043         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00044         CCameraEngine* CameraEngine(){return iCameraWrapper;};
00045         void CancelCapturedPicture(TBool aCleanTexts=ETrue);
00046         void Capture();        
00047         
00048     private: // From MCameraEngineObserver
00049         void MceoCameraReady();
00050         void MceoFocusComplete();
00051         void MceoCapturedDataReady( TDesC8* aData );
00052         void MceoCapturedBitmapReady( CFbsBitmap* aBitmap );
00053         void MceoViewFinderFrameReady( CFbsBitmap& aFrame );
00054         void MceoHandleError( TCameraEngineError aErrorType, TInt aError );
00055         void MceoHandleOtherEvent( const TECAMEvent& /*aEvent*/ );
00056     
00057     private: 
00058         // Constructors
00059         void ConstructL (const TRect& aRect );
00060         CCameraWrapperExampleAppView ();
00061 
00062     public:
00063 
00064     
00065     private:
00066         void CreateBackBufferL();
00067         void ReleaseBackBuffer();
00068 
00069     
00070     private: 
00071         // Data
00072         
00073         CCameraWrapperExampleAppUi*         iAppUi;
00074 
00075         // CameraWrapper class
00076         CCameraEngine*                      iCameraWrapper;
00077 
00078         TSize                               iViewFinderSize;
00079         TSize                               iCaptureSize;
00080     
00081         CFbsBitmap*                         iBackBuffer;
00082         CFbsBitmapDevice*                   iBackBufferDevice;
00083         CFbsBitGc*                          iBackBufferContext;
00084         
00085         const CFont*                        iTitleFont;
00086         TBuf<50>                            iTitle;
00087         TRect                               iFocusRect;
00088         
00089         // Is new picture focused whit camera shutter key
00090         TBool                               iCameraShutterFocusing;
00091         
00092         HBufC8*                             iData;
00093     
00094     };
00095 
00096 #endif // __CAMERAWRAPPEREXAMPLEAPPVIEW_h__
00097 
00098 // End of File

Generated by  doxygen 1.6.2