2010-05-03 17:24:11 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2009 Nokia Corporation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CAMERAWRAPPEREXAMPLEAPPUI_h__
|
|
|
|
#define __CAMERAWRAPPEREXAMPLEAPPUI_h__
|
|
|
|
|
|
|
|
// INCLUDES
|
|
|
|
#include <aknappui.h>
|
|
|
|
|
|
|
|
//#define EKeyZoomIn EKeyApplicationC
|
|
|
|
//#define EKeyZoomOut EKeyApplicationD
|
|
|
|
//#define EKeyVolumeUp EKeyIncVolume
|
|
|
|
//#define EKeyVolumeDown EKeyDecVolume
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_CAMERA_SHUTTER
|
|
|
|
// Focus key events (shutter key pressed half-way down)
|
|
|
|
const TInt KStdKeyCameraFocus = 0xe2;
|
|
|
|
const TInt KStdKeyCameraFocus2 = 0xeb; // S60 3.2 and onwards
|
|
|
|
|
|
|
|
// All known event codes used for the camera shutter key on S60 3.x devices
|
|
|
|
const TUint KKeyCameraShutter1 = 0xf883;
|
|
|
|
const TUint KKeyCameraShutter2 = 0xf849; // S60 3.2
|
|
|
|
const TUint KKeyCameraNseries1 = 0xf881; // S60 3.2 Nseries
|
|
|
|
const TUint KKeyCameraNseries2 = 0xf88c;
|
|
|
|
|
|
|
|
const TUint KCameraShutterKeyEventCodes[6] = {
|
|
|
|
EKeyCamera, // general camera key
|
|
|
|
KKeyCameraShutter1,
|
|
|
|
KKeyCameraShutter2,
|
|
|
|
KKeyCameraNseries1,
|
|
|
|
KKeyCameraNseries2,
|
|
|
|
0 };
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// FORWARD DECLARATIONS
|
2010-05-04 16:28:04 -07:00
|
|
|
class CZXingBarcodeReaderAppView;
|
2010-05-03 17:24:11 -07:00
|
|
|
|
|
|
|
// CLASS DECLARATION
|
2010-05-04 16:28:04 -07:00
|
|
|
class CZXingBarcodeReaderAppUi : public CAknAppUi,
|
2010-05-03 17:24:11 -07:00
|
|
|
public MCoeForegroundObserver
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Constructors and destructor
|
|
|
|
void ConstructL ();
|
2010-05-04 16:28:04 -07:00
|
|
|
CZXingBarcodeReaderAppUi ();
|
|
|
|
virtual ~CZXingBarcodeReaderAppUi ();
|
2010-05-03 17:24:11 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
|
|
|
void HandleCommandL (TInt aCommand );
|
|
|
|
void HandleResourceChangeL(TInt aType);
|
|
|
|
|
|
|
|
#ifdef ENABLE_CAMERA_SHUTTER
|
|
|
|
void CaptureCameraShutter(TBool aEnable);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
public:
|
|
|
|
void UseOptionsExitCbaL();
|
|
|
|
void UseOptionsBackCbaL();
|
|
|
|
TBool IsBackCBA();
|
|
|
|
|
|
|
|
private: // From MCoeForegroundObserver
|
|
|
|
void HandleGainingForeground();
|
|
|
|
void HandleLosingForeground();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Data
|
2010-05-04 16:28:04 -07:00
|
|
|
CZXingBarcodeReaderAppView* iAppView;
|
2010-05-03 17:24:11 -07:00
|
|
|
RArray<TInt32> iShutterKeyHandles;
|
|
|
|
TBool iCameraKeyCaptured;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __CAMERAWRAPPEREXAMPLEAPPUI_h__
|
|
|
|
|
|
|
|
// End of File
|