|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 #ifndef HWRMBATTERYCHARGECURRENTRATEAO_H_ |
|
22 #define HWRMBATTERYCHARGECURRENTRATEAO_H_ |
|
23 |
|
24 #include "HWRMBatteryMeasurementsAO.h" |
|
25 #include "HWRMPower.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 // None |
|
29 |
|
30 /** |
|
31 * Active object wrapper |
|
32 * |
|
33 */ |
|
34 NONSHARABLE_CLASS(CHWRMBatteryChargeRateCurrentAO) : public CHWRMBatteryMeasurementsAttributeAO<TInt> |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * This is a two-phase constructor method that is used to |
|
40 * create a new instance of CHWRMBatteryChargeRateCurrentAO. |
|
41 * |
|
42 * @param aCallback Pointer to a callback instance. |
|
43 * @return A pointer to a new instance of the |
|
44 * CHWRMBatteryChargeRateCurrentAO class. |
|
45 */ |
|
46 static CHWRMBatteryChargeRateCurrentAO* NewL(MHWRMBatteryChargingCurrentObserver* aCallback, RHWRMClient& aClient); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CHWRMBatteryChargeRateCurrentAO(); |
|
52 |
|
53 /** |
|
54 * Set the callback. |
|
55 * This can be used to change the callback. |
|
56 */ |
|
57 virtual void SetCallBack(TAny* aCallBack); |
|
58 |
|
59 //If measurements are stopped by HWRM (because of charger disconnected,...) |
|
60 //complete the callback with KErrCancel. |
|
61 virtual void CancelClientNotification(); |
|
62 |
|
63 protected: |
|
64 |
|
65 // From CActive |
|
66 void RunL(); |
|
67 void DoCancel(); |
|
68 |
|
69 private: |
|
70 |
|
71 /** |
|
72 * Constructor |
|
73 * |
|
74 * @param aCallback Pointer to a callback instance. |
|
75 */ |
|
76 CHWRMBatteryChargeRateCurrentAO(MHWRMBatteryChargingCurrentObserver* aCallback, RHWRMClient& aClient); |
|
77 |
|
78 /** |
|
79 * By default Symbian 2nd phase constructor is private. |
|
80 */ |
|
81 void ConstructL(); |
|
82 |
|
83 private: |
|
84 |
|
85 MHWRMBatteryChargingCurrentObserver* iCallback;// not owned by this class. |
|
86 }; |
|
87 |
|
88 #endif /*HWRMBATTERYCHARGECURRENTRATEAO_H_*/ |
|
89 //End of File |