|
1 /* |
|
2 * Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Control to show battery strength indicator on the |
|
15 * status pane's battery pane. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef AKNBATTRERYSTRENGTH_H |
|
21 #define AKNBATTRERYSTRENGTH_H |
|
22 |
|
23 #include <coecntrl.h> |
|
24 |
|
25 |
|
26 /** |
|
27 * A signal icon control in the status pane's signal pane |
|
28 * The control draws signal icon indicator graphics. |
|
29 */ |
|
30 |
|
31 NONSHARABLE_CLASS(CAknBatteryStrength) : public CCoeControl |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Destructor |
|
37 */ |
|
38 ~CAknBatteryStrength(); |
|
39 |
|
40 static CAknBatteryStrength* NewL(); |
|
41 |
|
42 static CAknBatteryStrength* NewLC(); |
|
43 |
|
44 void SetBatteryLevel(TInt aLevel); |
|
45 |
|
46 TInt BatteryLevel(); |
|
47 |
|
48 void SetRecharging(TBool aRecharging); |
|
49 |
|
50 TBool Recharging(); |
|
51 |
|
52 public: // From CCoeControl |
|
53 |
|
54 /** |
|
55 * Handles a change to the control's resources of type aType |
|
56 * which are shared across the environment. |
|
57 * @param aType Event type. |
|
58 */ |
|
59 void HandleResourceChange( TInt aType ); |
|
60 |
|
61 protected: // From CCoeControl |
|
62 |
|
63 /** |
|
64 * From CCoeControl. Handle the size change events. |
|
65 */ |
|
66 void SizeChanged(); |
|
67 |
|
68 /** |
|
69 * From CCoeControl. Handles the position change events. |
|
70 */ |
|
71 void PositionChanged(); |
|
72 |
|
73 private: // From CCoeControl |
|
74 virtual void Draw(const TRect& aRect) const; |
|
75 |
|
76 private: |
|
77 /** |
|
78 * Standard constructor |
|
79 */ |
|
80 CAknBatteryStrength(); |
|
81 |
|
82 void LoadDefaultBitmapsL(); |
|
83 |
|
84 void LoadStaconBitmapsL(); |
|
85 |
|
86 void LoadFlatBitmapsL(); |
|
87 |
|
88 void DeleteBitmaps(); |
|
89 |
|
90 void DrawInNormalStatusPane(const TRect& aRect) const; |
|
91 |
|
92 void DrawInStaconPane(const TRect& aRect) const; |
|
93 |
|
94 void DrawInFlatStatusPane(const TRect& aRect) const; |
|
95 |
|
96 private: |
|
97 TInt iBatteryLevel; |
|
98 TBool iRecharging; |
|
99 TInt iDefaultBatteryBitmapOffset; |
|
100 TInt iStaconBatteryBitmapOffset; |
|
101 TInt iFlatBatteryBitmapOffset; |
|
102 |
|
103 CFbsBitmap* iDefaultBatteryIndicatorBitmap; |
|
104 CFbsBitmap* iDefaultBatteryIndicatorBitmapMask; |
|
105 |
|
106 CFbsBitmap* iStaconLeftSideBatteryIndicatorBitmap; |
|
107 CFbsBitmap* iStaconLeftSideBatteryIndicatorBitmapMask; |
|
108 CFbsBitmap* iStaconRightSideBatteryIndicatorBitmap; |
|
109 CFbsBitmap* iStaconRightSideBatteryIndicatorBitmapMask; |
|
110 |
|
111 CFbsBitmap* iFlatBatteryIndicatorBitmap; |
|
112 CFbsBitmap* iFlatBatteryIndicatorBitmapMask; |
|
113 |
|
114 TSize iLastDefaultSize; |
|
115 TSize iLastStaconSize; |
|
116 TSize iLastFlatSize; |
|
117 }; |
|
118 |
|
119 #endif // AKNBATTERYSTRENGTH_H |