00001 /* 00002 * ============================================================================== 00003 * Name : VibraCtrl.h 00004 * Part of : VibraControl 00005 * Interface : VibraControl 00006 * Description : Vibra Control API 00007 * Version : 00008 * 00009 * Copyright (c) 2003-2005 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * ============================================================================== 00019 */ 00020 00021 #ifndef VIBRA_CTRL_H__ 00022 #define VIBRA_CTRL_H__ 00023 00024 // INCLUDES 00025 #include <e32base.h> 00026 #include <e32std.h> 00027 00039 class CVibraControl : public CBase 00040 { 00041 public: 00046 enum TVibraModeState 00047 { 00048 EVibraModeON = 0, // Vibration setting in the user profile is on. 00049 EVibraModeOFF, // Vibration setting in the user profile is off. 00050 EVibraModeUnknown // For debugging/development and signalling an error condition. 00051 }; 00052 00057 enum TVibraRequestStatus 00058 { 00059 EVibraRequestOK = 0, // Request is OK. 00060 EVibraRequestFail, // Request has failed. 00061 EVibraRequestNotAllowed, // Vibra is set off in the user profile 00062 EVibraRequestStopped, // Vibra is stopped 00063 EVibraRequestUnableToStop,// Unable to stop vibra 00064 EVibraRequestUnknown // For debugging/development and signalling an error condition. 00065 }; 00066 00071 enum TVibraCtrlPanic 00072 { 00073 EPanicUnableToGetVibraSetting, 00074 EPanicVibraGeneral 00075 }; 00076 00077 public: 00082 virtual ~CVibraControl(); 00083 00112 virtual void StartVibraL(TUint16 aDuration) = 0; 00113 00122 virtual void StopVibraL(void) = 0; 00123 00135 virtual TVibraModeState VibraSettings(void) const = 0; 00136 00174 virtual void StartVibraL(TUint16 aDuration, TInt aIntensity) = 0; 00175 00176 protected: 00182 CVibraControl(); 00183 }; 00184 00192 class MVibraControlObserver 00193 { 00194 public: 00200 virtual void VibraModeStatus(CVibraControl::TVibraModeState aStatus) = 0; 00206 virtual void VibraRequestStatus(CVibraControl::TVibraRequestStatus aStatus) = 0; 00207 }; 00208 00216 class VibraFactory 00217 { 00218 public: 00223 IMPORT_C static CVibraControl* NewL(); 00224 00238 IMPORT_C static CVibraControl* NewL(MVibraControlObserver* aCallback); 00239 00253 IMPORT_C static CVibraControl* NewLC(MVibraControlObserver* aCallback); 00254 00255 private: 00260 VibraFactory(); 00261 }; 00262 00263 // VIBRA_CTRL_H__ 00264 #endif