|
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 * This file contains the class declarations for the power state plugin and power state callback APIs. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 @file |
|
24 @publishedPartner |
|
25 @released |
|
26 */ |
|
27 |
|
28 |
|
29 #ifndef HWRMPOWERSTATEPLUGIN_H |
|
30 #define HWRMPOWERSTATEPLUGIN_H |
|
31 |
|
32 #include <e32base.h> |
|
33 // included so only this header is necessary to use power state plugin API |
|
34 #include <hwrmpowerstatesdkpskeys.h> |
|
35 |
|
36 /** ECOM Power state plugin interface UID |
|
37 @publishedPartner |
|
38 @released |
|
39 */ |
|
40 const TUid KCHWRMPowerStatePluginInterfaceUid = { 0x10205042 }; |
|
41 |
|
42 |
|
43 /** |
|
44 * Callback interface for the HWRM Power state plugin. |
|
45 * Used to indicate state changes for battery and charging state. |
|
46 * Implemented by the HWRM server handler. |
|
47 * |
|
48 @publishedPartner |
|
49 @released |
|
50 */ |
|
51 class MHWRMPowerStatePluginCallback |
|
52 { |
|
53 public: |
|
54 /** |
|
55 * Callback method used to notify power state changes. |
|
56 * This includes charging and battery state information. |
|
57 * |
|
58 * @param aKey Key type that is to be updated, can be one of: |
|
59 * EPSHWRMBatteryLevel |
|
60 * EPSHWRMBatteryStatus |
|
61 * EPSHWRMChargingStatus |
|
62 * @param aValue Key value, see the associated enum for the key |
|
63 * in HWRMPowerStateSDKPSKeys.h |
|
64 */ |
|
65 virtual void NotifyStateChange( const TUint32 aKey, |
|
66 TInt aValue ) = 0; |
|
67 }; |
|
68 |
|
69 |
|
70 /** |
|
71 * Plugin interface class to be implemented by adaptation. |
|
72 * Responsible for invoking the adaptation implementation. |
|
73 * |
|
74 @publishedPartner |
|
75 @released |
|
76 */ |
|
77 class CHWRMPowerStatePlugin : public CBase |
|
78 { |
|
79 public: // construction and destruction |
|
80 |
|
81 /** |
|
82 * Constructor method for instance. |
|
83 * Uses ECom to find correct instance. |
|
84 * |
|
85 * @param aNotificationCallback Pointer to plugin callback handler. |
|
86 */ |
|
87 inline static CHWRMPowerStatePlugin* NewL( |
|
88 MHWRMPowerStatePluginCallback* aNotificationCallback); |
|
89 |
|
90 /** |
|
91 * Destructor |
|
92 */ |
|
93 inline virtual ~CHWRMPowerStatePlugin(); |
|
94 |
|
95 protected: |
|
96 |
|
97 /** |
|
98 * Destructor identifier to be used with ECom framework. |
|
99 */ |
|
100 TUid iDestructorIDKey; |
|
101 |
|
102 /** |
|
103 * Callback pointer to be used for notifications. |
|
104 * This pointer is not owned by this class. |
|
105 */ |
|
106 MHWRMPowerStatePluginCallback* iNotificationCallback; // not owned |
|
107 }; |
|
108 |
|
109 #include <hwrm/hwrmpowerstateplugin.inl> |
|
110 |
|
111 |
|
112 #endif // HWRMPOWERSTATEPLUGIN_H |
|
113 |
|
114 // End of File |