|
1 /* |
|
2 * Copyright (c) 2006-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalTechnology |
|
24 */ |
|
25 |
|
26 #ifndef HWRMPOWERSTATEPLUGINHANDLER_H |
|
27 #define HWRMPOWERSTATEPLUGINHANDLER_H |
|
28 |
|
29 // INCLUDES |
|
30 #include <e32base.h> |
|
31 #include <e32property.h> |
|
32 #include "HWRMPowerStatePlugin.h" |
|
33 |
|
34 // CONSTANTS |
|
35 // None |
|
36 |
|
37 // MACROS |
|
38 // None |
|
39 |
|
40 // DATA TYPES |
|
41 |
|
42 // FUNCTION PROTOTYPES |
|
43 // None |
|
44 |
|
45 // FORWARD DECLARATIONS |
|
46 // None |
|
47 |
|
48 // CLASS DECLARATIONS |
|
49 |
|
50 /** |
|
51 * Hardware Resource Manager server side power state plugin |
|
52 * handler implementation. |
|
53 * |
|
54 */ |
|
55 class CHWRMPowerStatePluginHandler : public CBase, |
|
56 public MHWRMPowerStatePluginCallback |
|
57 |
|
58 { |
|
59 public: // Constructors and Destructor |
|
60 |
|
61 /** |
|
62 * Constructor method for instance. |
|
63 * @param aChargerBlockVibra ETrue if charger connection should block vibra |
|
64 * @param aChargerBlockFeedback ETrue if charger connection should block feedback vibration |
|
65 */ |
|
66 static CHWRMPowerStatePluginHandler* NewL(TBool aChargerBlockVibra, |
|
67 TBool aChargerBlockFeedbackVibration); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 virtual ~CHWRMPowerStatePluginHandler(); |
|
73 |
|
74 public: // New functions |
|
75 |
|
76 /** |
|
77 * Implementation of power state callback method |
|
78 * |
|
79 * @param aKey The key that has changed state |
|
80 * @param aValue New value of key |
|
81 */ |
|
82 void NotifyStateChange( const TUint32 aKey, TInt aValue ); |
|
83 |
|
84 private: |
|
85 |
|
86 /** |
|
87 * C++ default constructor. |
|
88 */ |
|
89 CHWRMPowerStatePluginHandler(TBool aChargerBlockVibra, TBool aChargerBlockFeedbackVibration); |
|
90 /** |
|
91 * This 2nd phase constructor. |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 private: // data |
|
96 |
|
97 // Reference to plugin |
|
98 CHWRMPowerStatePlugin* iPlugin; |
|
99 |
|
100 // Property for each key |
|
101 RProperty iBattLevelProp; |
|
102 RProperty iBattStatusProp; |
|
103 RProperty iChargingStatusProp; |
|
104 |
|
105 // If ETrue, connecting charger blocks vibra |
|
106 TBool iChargerBlockVibra; |
|
107 // If ETrue, connecting charger blocks feedback vibration |
|
108 TBool iChargerBlockVibraFeedback; |
|
109 }; |
|
110 |
|
111 #endif // HWRMPOWERSTATEPLUGINHANDLER_H |
|
112 |
|
113 // End of File |