S60 3rd Edition SDK for Symbian OS
Example Applications Guide

HWRMTestAppAppUi.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : HWRMTestAppAppUi.h
00004 *  Part of     : HWRMTestApp
00005 *  Interface   : 
00006 *  Description : Declares UI class for application.
00007 *  Version     : 
00008 *
00009 *  Copyright (c) 2002-2006 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation. 
00013 * ==============================================================================
00014 */
00015 
00016 #ifndef HWRMTESTAPPAPPUI_H
00017 #define HWRMTESTAPPAPPUI_H
00018 
00019 // INCLUDES
00020 #include <aknappui.h>
00021 #include <HWRMLight.h>
00022 #include <HWRMVibra.h>
00023 
00024 // FORWARD DECLARATIONS
00025 class CHWRMTestAppContainer;
00026 class CHWRMTestAppPropertyObserver;
00027 
00028 // CONSTANTS
00029 // None
00030 
00031 // CLASS DECLARATION
00032 
00033 /**
00034 * Application UI class.
00035 * Provides support for the following features:
00036 * - EIKON control architecture
00037 *
00038 *  @lib HWRMTestApp.exe
00039 *  @since Series S60 3.0
00040 */
00041 class CHWRMTestAppAppUi : public CAknAppUi,
00042                           public MHWRMVibraObserver,
00043                           public MHWRMLightObserver
00044     {
00045     public: // // Constructors and destructor
00046 
00047         /**
00048         * EPOC default constructor.
00049         */      
00050         void ConstructL();
00051 
00052         /**
00053         * Destructor.
00054         */      
00055         ~CHWRMTestAppAppUi();
00056         
00057     public: // New functions
00058 
00059     public: // Functions from base classes
00060 
00061     private:
00062         // From MEikMenuObserver
00063         void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
00064 
00065     private:
00066         /**
00067         * From CEikAppUi, takes care of command handling.
00068         * @param aCommand command to be handled
00069         */
00070         void HandleCommandL(TInt aCommand);
00071 
00072         /**
00073         * From CEikAppUi, handles key events.
00074         * @param aKeyEvent Event to handled.
00075         * @param aType Type of the key event. 
00076         * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
00077         */
00078         virtual TKeyResponse HandleKeyEventL(
00079             const TKeyEvent& aKeyEvent,TEventCode aType);
00080 
00081         void VibraReserveL();
00082         void VibraReleaseL();
00083         void VibraStartL();
00084         void VibraStopL();
00085         void VibraStatus();
00086         void VibraSettings();
00087 
00088         void LightsReserveL();
00089         void LightsReleaseL();
00090         void LightsOnL();
00091         void LightsBlinkL();
00092         void LightsOffL();
00093         void LightsStatusL();
00094         
00095         // from MHWRMVibraObserver
00096         virtual void VibraModeChanged(CHWRMVibra::TVibraModeState aStatus);
00097         virtual void VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus);
00098 
00099         // from MHWRMLightObserver
00100         virtual void LightStatusChanged(TInt aTarget, 
00101                                         CHWRMLight::TLightStatus aStatus);
00102 
00103                 // Helper methods
00104                 // returns the target or KErrCancel if user pressed cancel
00105                 TInt GetLightsTargetL();
00106                 
00107                 // overridden from CCoeAppUi
00108                 virtual void HandleForegroundEventL(TBool aForeground);
00109                 
00110                 
00111     private: //Data
00112         CHWRMTestAppContainer*        iAppContainer; 
00113         CHWRMLight*                   iLight;
00114         CHWRMVibra*                   iVibra;
00115         
00116         CHWRMTestAppPropertyObserver* iBatteryStatusObserver;
00117         CHWRMTestAppPropertyObserver* iBatteryLevelObserver;
00118         CHWRMTestAppPropertyObserver* iChargingStatusObserver;
00119     };
00120 
00121 #endif  // HWRMTESTAPPAPPUI_H
00122 
00123 // End of File
00124 

© Nokia 2006

Back to top