|
1 /* |
|
2 * Copyright (c) 2007 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: BatIndicatorPanePlugin plugin implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BATINDICATORPANEPLUGINIMPL_H |
|
20 #define BATINDICATORPANEPLUGINIMPL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AknIndicatorPlugin.h> // CAknIndicatorPlugin |
|
24 #include <eikcmobs.h> |
|
25 #include <psmclientobserver.h> // CPsmClient |
|
26 #include <ConeResLoader.h> // RConeResourceLoader |
|
27 #include "batterypopupcontrol.h" |
|
28 |
|
29 class CPsmClient; |
|
30 class CBSUtil; |
|
31 |
|
32 /** |
|
33 * BatIndicatorPanePlugin Plug-in implementation |
|
34 * |
|
35 * @lib BatIndicatorPanePlugin |
|
36 * @since S60 5.0 |
|
37 */ |
|
38 class CBatIndicatorPanePluginImpl : public CAknIndicatorPlugin, |
|
39 public MEikCommandObserver, |
|
40 public MPsmClientObserver |
|
41 { |
|
42 |
|
43 private: |
|
44 |
|
45 // Preview popup command ids |
|
46 enum TLinkCommandID |
|
47 { |
|
48 ELinkNone = 0, |
|
49 ELinkFirst = 1 |
|
50 }; |
|
51 |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * @since S60 5.0 |
|
57 * @param aCallback Callback for psm client. |
|
58 */ |
|
59 static CBatIndicatorPanePluginImpl* NewL( ); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 ~CBatIndicatorPanePluginImpl(); |
|
65 |
|
66 // From MEikCommandObserver |
|
67 |
|
68 /** |
|
69 * @see MEikCommandObserver |
|
70 */ |
|
71 void ProcessCommandL( TInt aCommandId ); |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 * C++ default constructor. |
|
77 */ |
|
78 CBatIndicatorPanePluginImpl(); |
|
79 |
|
80 /** |
|
81 * By default Symbian 2nd phase constructor is private. |
|
82 */ |
|
83 void ConstructL( ); |
|
84 |
|
85 /** |
|
86 * Shows preview popup. |
|
87 * |
|
88 * @since S60 5.0 |
|
89 */ |
|
90 void ShowPreviewPopupL( ); |
|
91 |
|
92 /** |
|
93 * Enables or disables power save mode. |
|
94 * If the wished state is already active, does nothing. |
|
95 * |
|
96 * @since S60 5.0 |
|
97 */ |
|
98 void SetPowerSaveModeEnabled( ); |
|
99 |
|
100 /** |
|
101 * Gets local variation for plugin. |
|
102 * |
|
103 * @since S60 5.0 |
|
104 */ |
|
105 void GetFeatures( ); |
|
106 |
|
107 /** |
|
108 * This method can check if feature is supported or not. |
|
109 * @param TInt aFeatureId (defined in batindpanepluginprivatecrkeys.h) |
|
110 * @return TInt: aFeatureId supported if != 0 |
|
111 * |
|
112 * @since S60 5.0 |
|
113 */ |
|
114 TInt Supported( TInt aFeatureId ); |
|
115 |
|
116 // From CAknIndicatorPlugin |
|
117 |
|
118 /** |
|
119 * @see CAknIndicatorPlugin |
|
120 */ |
|
121 void HandleIndicatorTapL( const TInt aUid ); |
|
122 |
|
123 // from MPsmClientObserver |
|
124 |
|
125 /** |
|
126 * @see MPsmClientObserver |
|
127 */ |
|
128 virtual void PowerSaveModeChanged( const TPsmsrvMode aMode ); |
|
129 |
|
130 /** |
|
131 * @see MPsmClientObserver |
|
132 */ |
|
133 virtual void PowerSaveModeChangeError( const TInt aError ); |
|
134 |
|
135 private: // data |
|
136 |
|
137 /** |
|
138 * Actual content |
|
139 * Own. |
|
140 */ |
|
141 HBufC* iContentText; |
|
142 |
|
143 /** |
|
144 * Link text |
|
145 * Own. |
|
146 */ |
|
147 HBufC* iLinkText; |
|
148 |
|
149 /** |
|
150 * PSM Server client. |
|
151 * Own. |
|
152 */ |
|
153 CPsmClient* iPsmClient; |
|
154 |
|
155 /** |
|
156 * Battery status utility. |
|
157 * Own. |
|
158 */ |
|
159 CBSUtil* iBatteryStateUtil; |
|
160 |
|
161 /** |
|
162 * Control for preview popup. |
|
163 * Own. |
|
164 */ |
|
165 CBatteryPopupControl* iPopupControl; |
|
166 |
|
167 /** |
|
168 * Resource loader. |
|
169 */ |
|
170 RConeResourceLoader iResourceLoader; |
|
171 |
|
172 /** |
|
173 * Value of KBatIndPanePlugin. |
|
174 */ |
|
175 TInt iBatIndPanePluginFeatures; |
|
176 }; |
|
177 |
|
178 #endif // BATINDICATORPANEPLUGINIMPL_H |
|
179 |
|
180 // End of File |