2 * Copyright (c) 2009 Nokia Corporation.
\r
5 #ifndef __CAMERAWRAPPEREXAMPLEAPPVIEW_h__
\r
6 #define __CAMERAWRAPPEREXAMPLEAPPVIEW_h__
\r
9 #include <coecntrl.h>
\r
12 #include <cameraengine.h>
\r
13 #include <cameraengineobserver.h>
\r
14 #include <akninfopopupnotecontroller.h>
\r
15 #include <e32base.h>
\r
18 class CZXingBarcodeReaderAppUi;
\r
20 // CLASS DECLARATION
\r
21 class CZXingBarcodeReaderAppView :
\r
22 public CCoeControl, public MCameraEngineObserver
\r
26 static CZXingBarcodeReaderAppView* NewL (const TRect& aRect );
\r
27 static CZXingBarcodeReaderAppView* NewLC (const TRect& aRect );
\r
28 virtual ~CZXingBarcodeReaderAppView ();
\r
31 // Functions from base classes
\r
32 void Draw (const TRect& aRect ) const;
\r
33 void DrawTexts(CWindowGc& gc) const;
\r
34 void SizeChanged ();
\r
35 void HandlePointerEventL (const TPointerEvent& aPointerEvent );
\r
36 void SetTitle(const TDesC& aTitle);
\r
37 void SetError( const TDesC& aMsg, TInt aVal );
\r
38 void SetError( const TDesC& aMsg, TInt aVal1, TInt aVal2 );
\r
39 void StartFocusing();
\r
40 void StorePicture( TDesC8* aData );
\r
43 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
\r
44 CCameraEngine* CameraEngine(){return iCameraWrapper;};
\r
45 void CancelCapturedPicture(TBool aCleanTexts=ETrue);
\r
48 private: // From MCameraEngineObserver
\r
49 void MceoCameraReady();
\r
50 void MceoFocusComplete();
\r
51 void MceoCapturedDataReady( TDesC8* aData );
\r
52 void MceoCapturedBitmapReady( CFbsBitmap* aBitmap );
\r
53 void MceoViewFinderFrameReady( CFbsBitmap& aFrame );
\r
54 void MceoHandleError( TCameraEngineError aErrorType, TInt aError );
\r
55 void MceoHandleOtherEvent( const TECAMEvent& /*aEvent*/ );
\r
59 void ConstructL (const TRect& aRect );
\r
60 CZXingBarcodeReaderAppView ();
\r
63 void decodeBackbufferImage();
\r
66 void CreateBackBufferL();
\r
67 void ReleaseBackBuffer();
\r
68 void ShowResultL(TDesC16& message);
\r
73 static TInt Tick(TAny* aObject);
\r
78 CZXingBarcodeReaderAppUi* iAppUi;
\r
80 // CameraWrapper class
\r
81 CCameraEngine* iCameraWrapper;
\r
83 TSize iViewFinderSize;
\r
86 CFbsBitmap* iBackBuffer;
\r
87 CFbsBitmapDevice* iBackBufferDevice;
\r
88 CFbsBitGc* iBackBufferContext;
\r
90 const CFont* iTitleFont;
\r
94 // Is new picture focused whit camera shutter key
\r
95 TBool iCameraShutterFocusing;
\r
100 // Set the note as the member variable of your application view (for example, CAknView)
\r
102 CAknInfoPopupNoteController* iNote;
\r
103 CPeriodic* iPeriodic;
\r
107 #endif // __CAMERAWRAPPEREXAMPLEAPPVIEW_h__
\r