diff -r b048e15729d6 -r 36d60d12b4af perfapps/perfmon/engine/inc/perfmon_powerlistener.h --- a/perfapps/perfmon/engine/inc/perfmon_powerlistener.h Fri Sep 03 17:11:21 2010 +0300 +++ b/perfapps/perfmon/engine/inc/perfmon_powerlistener.h Fri Sep 17 14:22:55 2010 +0300 @@ -25,10 +25,12 @@ #include "perfmon.hrh" // HWRM reporting interval multiplier -const TInt KSampleIntervalMultiple = 1; -const TInt KReportingDuration = 0; // Infinite duration +const TInt KHWRMSampleIntervalMultiple = 1; +const TInt KHWRMReportingDuration = 0; // Infinite duration -class CPerfMonPowerListener : public CBase, public MHWRMBatteryPowerObserver +class CPerfMonPowerListenerImpl; + +class CPerfMonPowerListener : public CBase { public: static CPerfMonPowerListener* NewL(); @@ -38,13 +40,42 @@ CPerfMonPowerListener(); void ConstructL(); +public: + // Is power monitoring feature suported by platform + static inline TBool IsSupported() { return iIsSupported; }; + + // Start monitoring power data + TInt Activate(); + // Stop monitoring power data + void DeActivate(); + + // Get average power since last read. + TInt GetPower(); + // Maximum power value since measurement started + TInt GetMaxPower(); + +private: + static TBool iIsSupported; + CPerfMonPowerListenerImpl* iPowerListenerImpl; + }; + + + +class CPerfMonPowerListenerImpl : public CBase, public MHWRMBatteryPowerObserver + { +public: + static CPerfMonPowerListenerImpl* NewL(); + ~CPerfMonPowerListenerImpl(); + +private: + CPerfMonPowerListenerImpl(); + void ConstructL(); + // Handling central repository max reporting period key - void GetReportingPeriodL(); + TInt GetReportingPeriodL(); void SetReportingPeriodL(TInt aDuration); public: - static TBool IsSupported(); - // Start monitoring power values TInt Activate(); // Stop monitoring power values