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: 11 % 00009 * 00010 * Copyright © 2002-2006 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 00033 const TInt KHWRMVibraMinIntensity = -100; 00034 00038 const TInt KHWRMVibraMaxIntensity = 100; 00039 00046 const TInt KHWRMVibraMaxDuration = (KMaxTInt / 1000) - 1; 00047 00048 00049 // FORWARD DECLARATIONS 00050 class MHWRMVibraObserver; 00051 00052 // CLASS DECLARATIONS 00053 00089 class CHWRMVibra : public CBase 00090 { 00091 public: // enums 00095 enum TVibraModeState 00096 { 00097 EVibraModeUnknown = 0, 00098 EVibraModeON, 00099 EVibraModeOFF 00100 }; 00101 00105 enum TVibraStatus 00106 { 00107 EVibraStatusUnknown = 0, 00108 00109 EVibraStatusNotAllowed, 00110 00111 EVibraStatusStopped, 00112 EVibraStatusOn 00113 }; 00114 00115 public: // Constructors 00116 00125 IMPORT_C static CHWRMVibra* NewL(); 00126 00136 IMPORT_C static CHWRMVibra* NewLC(); 00137 00148 IMPORT_C static CHWRMVibra* NewL(MHWRMVibraObserver* aCallback); 00149 00161 IMPORT_C static CHWRMVibra* NewLC(MHWRMVibraObserver* aCallback); 00162 00163 public: // New functions 00164 00183 virtual void ReserveVibraL()=0; 00184 00228 virtual void ReserveVibraL(TBool aRestoreState, TBool aForceNoCCoeEnv)=0; 00229 00236 virtual void ReleaseVibra()=0; 00237 00238 00277 virtual void StartVibraL(TInt aDuration)=0; 00278 00328 virtual void StartVibraL(TInt aDuration, TInt aIntensity)=0; 00329 00343 virtual void StopVibraL()=0; 00344 00356 virtual TVibraModeState VibraSettings() const=0; 00357 00366 virtual TVibraStatus VibraStatus() const=0; 00367 }; 00368 00429 class MHWRMVibraObserver 00430 { 00431 public: 00432 00440 virtual void VibraModeChanged(CHWRMVibra::TVibraModeState aStatus) = 0; 00441 00449 virtual void VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus) = 0; 00450 }; 00451 00452 00453 // HWRMVIBRA_H 00454 #endif 00455 00456 // End of File