|
1 // Copyright (c) 2001-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 // Contains definition for classes that implement the battery charging state |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalAll |
|
21 */ |
|
22 |
|
23 #ifndef __CSimBatteryCharger_H__ |
|
24 #define __CSimBatteryCharger_H__ |
|
25 |
|
26 #include <et_phone.h> |
|
27 #include "csimtimer.h" |
|
28 #include <etelmm.h> |
|
29 |
|
30 class CSimPhone; |
|
31 class CTestConfigSection; |
|
32 |
|
33 /** |
|
34 * Implements the RMobilePhone based functions that constitute the Battery charger |
|
35 * functionality provided by the SIM TSY. |
|
36 */ |
|
37 class CSimBatteryCharger : public CBase, MTimerCallBack |
|
38 { |
|
39 public: |
|
40 static CSimBatteryCharger* NewL(CSimPhone* aPhone); |
|
41 CSimBatteryCharger(CSimPhone* aPhone); |
|
42 ~CSimBatteryCharger(); |
|
43 TInt GetBatteryCaps(TTsyReqHandle aReqHandle,TDes8* aCaps); |
|
44 TInt GetBatteryInfo(TTsyReqHandle aReqHandle, TDes8* aInfo); |
|
45 TInt NotifyBatteryInfoChange(TTsyReqHandle aReqHandle, TDes8* aInfo); |
|
46 void NotifyBatteryInfoCancel(); |
|
47 const CTestConfigSection* CfgFile(); |
|
48 |
|
49 inline RMobilePhone::TMobilePhoneBatteryStatus Status() const {return iCurrentStatus;} |
|
50 |
|
51 private: |
|
52 void ConstructL(); |
|
53 void TimerCallBack(TInt aId); |
|
54 |
|
55 private: |
|
56 CSimPhone* iPhone; // < Pointer to the parent phone class. |
|
57 CSimTimer* iTimer; // < Pointer to the owned timer class. |
|
58 |
|
59 struct TBatteryChargerInfo |
|
60 { |
|
61 TInt iDuration; //< Duration of Battery Charger state |
|
62 RMobilePhone::TMobilePhoneBatteryStatus iStatus; //< Status of the Battery Charger |
|
63 TUint iChargeLevel; //< The Battery level |
|
64 TInt iError; //< Request complete with this error code |
|
65 }; |
|
66 |
|
67 CArrayFixFlat<TBatteryChargerInfo>* iBatteryChargerInfo; //< Array containing the Battery Charger changes for this test |
|
68 TInt iBatteryChargerIndex; //< Current index from iBatteryChargerInfo array |
|
69 TInt iCurrentBatteryCharger; //< Current value of the Battery Charger |
|
70 RMobilePhone::TMobilePhoneBatteryStatus iCurrentStatus; //< Current status of the battery charger |
|
71 TInt iCurrentErr; //< error code to return to client |
|
72 |
|
73 TBool iBatteryChargerNotificationPending; //< Battery Charger notification request outstanding |
|
74 TTsyReqHandle iBatteryChargerNotificationReqHandle; //< Battery Charger notification outstanding request handle |
|
75 RMobilePhone::TMobilePhoneBatteryInfoV1* iBatteryChargerNofificationValue; //< Battery Charger value pointer |
|
76 }; |
|
77 |
|
78 #endif |