examples/ForumNokia/CameraExample/inc/CameraWrapperExampleAppUi.h

00001 /*
00002  * Copyright (c) 2009 Nokia Corporation.
00003  */
00004 
00005 #ifndef __CAMERAWRAPPEREXAMPLEAPPUI_h__
00006 #define __CAMERAWRAPPEREXAMPLEAPPUI_h__
00007 
00008 // INCLUDES
00009 #include <aknappui.h>
00010 
00011 //#define EKeyZoomIn      EKeyApplicationC
00012 //#define EKeyZoomOut     EKeyApplicationD
00013 //#define EKeyVolumeUp    EKeyIncVolume
00014 //#define EKeyVolumeDown  EKeyDecVolume
00015 
00016 
00017 #ifdef ENABLE_CAMERA_SHUTTER
00018 // Focus key events (shutter key pressed half-way down)
00019 const TInt KStdKeyCameraFocus   = 0xe2;
00020 const TInt KStdKeyCameraFocus2  = 0xeb;     // S60 3.2 and onwards
00021 
00022 // All known event codes used for the camera shutter key on S60 3.x devices
00023 const TUint KKeyCameraShutter1   = 0xf883;
00024 const TUint KKeyCameraShutter2   = 0xf849;   // S60 3.2
00025 const TUint KKeyCameraNseries1   = 0xf881;   // S60 3.2 Nseries
00026 const TUint KKeyCameraNseries2   = 0xf88c;
00027 
00028 const TUint KCameraShutterKeyEventCodes[6] = {
00029     EKeyCamera, // general camera key
00030     KKeyCameraShutter1,
00031     KKeyCameraShutter2,
00032     KKeyCameraNseries1,
00033     KKeyCameraNseries2,
00034     0 };
00035 #endif
00036 
00037 
00038 // FORWARD DECLARATIONS
00039 class CCameraWrapperExampleAppView;
00040 
00041 // CLASS DECLARATION
00042 class CCameraWrapperExampleAppUi : public CAknAppUi,
00043                                    public MCoeForegroundObserver
00044     {
00045     public:
00046         // Constructors and destructor
00047         void ConstructL ();
00048         CCameraWrapperExampleAppUi ();
00049         virtual ~CCameraWrapperExampleAppUi ();
00050         
00051     private:
00052         TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00053         void HandleCommandL (TInt aCommand );
00054         void HandleResourceChangeL(TInt aType);
00055         
00056         #ifdef ENABLE_CAMERA_SHUTTER
00057         void CaptureCameraShutter(TBool aEnable);
00058         #endif
00059         
00060     public:
00061         void UseOptionsExitCbaL();
00062         void UseOptionsBackCbaL();
00063         TBool IsBackCBA();        
00064         
00065     private: // From MCoeForegroundObserver
00066         void HandleGainingForeground();
00067         void HandleLosingForeground();
00068         
00069     private:
00070         // Data
00071         CCameraWrapperExampleAppView*   iAppView;
00072         RArray<TInt32>                  iShutterKeyHandles;
00073         TBool                           iCameraKeyCaptured;
00074 
00075     };
00076 
00077 #endif // __CAMERAWRAPPEREXAMPLEAPPUI_h__
00078 
00079 // End of File

Generated by  doxygen 1.6.2