HWRMVibra.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : HWRMVibra.h
00004 *  Part of     : HW Resources and Enhancements / HWResourceManager
00005 *  Interface   : SDK
00006 *  Description : This file contains the header of the 
00007 *                CHWRMVibra class.
00008 *  Version     : %version: ou1s60rt#14 %
00009 *
00010 *  Copyright © 2002-2007 Nokia. All rights reserved.
00011 *  This material, including documentation and any related 
00012 *  computer programs, is protected by copyright controlled by 
00013 *  Nokia. All rights are reserved. Copying, including 
00014 *  reproducing, storing, adapting or translating, any 
00015 *  or all of this material requires the prior written consent of 
00016 *  Nokia. This material also contains confidential 
00017 *  information which may not be disclosed to others without the 
00018 *  prior written consent of Nokia.
00019 * ==============================================================================
00020 */
00021 
00022 #ifndef HWRMVIBRA_H
00023 #define HWRMVIBRA_H
00024 
00025 // INCLUDES
00026 #include <e32base.h>
00027 
00028 // CONSTANTS
00029 
00034 const TInt KHWRMVibraMinIntensity = -100;
00035 
00039 const TInt KHWRMVibraMinPulseIntensity = 1;
00040 
00046 const TInt KHWRMVibraMaxIntensity = 100;
00047 
00055 const TInt KHWRMVibraMaxDuration = (KMaxTInt / 1000) - 1;
00056 
00062 const TInt KHWRMVibraInfiniteDuration = 0;
00063 
00064 // FORWARD DECLARATIONS
00065 class MHWRMVibraObserver;
00066 class MHWRMVibraFeedbackObserver;
00067 
00068 // CLASS DECLARATIONS
00069 
00107 class CHWRMVibra : public CBase
00108     {
00109     public: // enums
00113         enum TVibraModeState 
00114             {
00115             EVibraModeUnknown = 0, 
00116             EVibraModeON,          
00117             EVibraModeOFF          
00118             };
00119 
00123         enum TVibraStatus 
00124             {
00125             EVibraStatusUnknown = 0, 
00126 
00127             EVibraStatusNotAllowed,  
00128 
00129             EVibraStatusStopped,     
00130             EVibraStatusOn           
00131             };
00132             
00136         enum TVibraFeedbackModeState 
00137             {
00138             EVibraFeedbackModeUnknown = 0, 
00139             EVibraFeedbackModeON,          
00140             EVibraFeedbackModeOFF          
00141             };
00142 
00143     public:  // Constructors
00144         
00153         IMPORT_C static CHWRMVibra* NewL();
00154         
00164         IMPORT_C static CHWRMVibra* NewLC();
00165 
00176         IMPORT_C static CHWRMVibra* NewL(MHWRMVibraObserver* aCallback);
00177         
00189         IMPORT_C static CHWRMVibra* NewLC(MHWRMVibraObserver* aCallback);
00190 
00191     public: // New functions
00192 
00213         virtual void ReserveVibraL()=0;
00214         
00260         virtual void ReserveVibraL(TBool aRestoreState, TBool aForceNoCCoeEnv)=0;
00261 
00268         virtual void ReleaseVibra()=0;
00269 
00270 
00309         virtual void StartVibraL(TInt aDuration)=0;
00310                 
00361             virtual void StartVibraL(TInt aDuration, TInt aIntensity)=0;
00362             
00376         virtual void StopVibraL()=0; 
00377                 
00389         virtual TVibraModeState VibraSettings() const=0;
00390 
00399         virtual TVibraStatus VibraStatus() const=0;
00400         
00440         virtual void PulseVibraL()=0;
00441                 
00482         virtual void PulseVibraL(TInt aDuration)=0;
00483                 
00531         virtual void PulseVibraL(TInt aDuration, TInt aIntensity)=0;
00532                 
00538         virtual void SetFeedbackObserver(MHWRMVibraFeedbackObserver* aCallback)=0;
00539 
00552         virtual TVibraFeedbackModeState VibraFeedbackSettings() const=0;
00553     };
00554     
00615 class MHWRMVibraObserver
00616     {    
00617     public:
00618         
00626         virtual void VibraModeChanged(CHWRMVibra::TVibraModeState aStatus) = 0;
00627         
00635         virtual void VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus) = 0;
00636         };
00637 
00706 class MHWRMVibraFeedbackObserver
00707     {    
00708     public:
00709         
00717         virtual void VibraFeedbackModeChanged(CHWRMVibra::TVibraFeedbackModeState aMode) = 0;
00718         };
00719 
00720 
00721 #endif      // HWRMVIBRA_H   
00722             
00723 // End of File

Copyright © Nokia Corporation 2001-2007
Back to top