|
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: PSM Client API class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PSMCLIENT_H |
|
20 #define PSMCLIENT_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class MPsmClientObserver; |
|
26 class CPsmSettings; |
|
27 |
|
28 /** |
|
29 * PSM Client API class |
|
30 * |
|
31 * Allows clients to change power save mode. Provides also a reference to |
|
32 * PSM Client Settings API. |
|
33 * |
|
34 * @lib psmclient.lib |
|
35 */ |
|
36 class CPsmClient : public CBase |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Creates a new PSM client. |
|
42 * |
|
43 * @param aObserver Observer to observe the power save mode change |
|
44 */ |
|
45 IMPORT_C static CPsmClient* NewL( MPsmClientObserver& aObserver ); |
|
46 IMPORT_C static CPsmClient* NewLC( MPsmClientObserver& aObserver ); |
|
47 |
|
48 public: // API methods |
|
49 |
|
50 /** |
|
51 * Enable power save mode. It is possible to get notification |
|
52 * of mode change by requesting a notification using |
|
53 * RequestPowerSaveModeNotification. On successful change, |
|
54 * client gets indication via PowerSaveModeChanged callback. |
|
55 * Failure in change is indicated to client via |
|
56 * PowerSaveModeChangeError callback. |
|
57 * |
|
58 * @see MPsmClientObserver |
|
59 * @param[in] aPsmMode The power save mode to change to |
|
60 */ |
|
61 virtual void ChangePowerSaveMode( const TInt aPsmMode ) = 0; |
|
62 |
|
63 /** |
|
64 * Cancels ongoing power save mode change and restores previous |
|
65 * power save mode back. If there is no ongoing change, |
|
66 * current mode remains. |
|
67 */ |
|
68 virtual void CancelPowerSaveModeChange() = 0; |
|
69 |
|
70 /** |
|
71 * Requests notification of power save mode change. Client is |
|
72 * notified about mode changes until request cancelled using |
|
73 * CancelPowerSaveModeNotificationRequest. |
|
74 * |
|
75 * @see MPsmClientObserver |
|
76 */ |
|
77 virtual void RequestPowerSaveModeNotification() = 0; |
|
78 |
|
79 /** |
|
80 * Cancels notification request of power save mode change. |
|
81 * |
|
82 * @see MPsmClientObserver |
|
83 */ |
|
84 virtual void CancelPowerSaveModeNotificationRequest() = 0; |
|
85 |
|
86 /** |
|
87 * Reference to PSM Client Settings API. |
|
88 * |
|
89 * @return Reference to PSM Client Settings API |
|
90 */ |
|
91 virtual CPsmSettings& PsmSettings() const = 0; |
|
92 |
|
93 }; |
|
94 |
|
95 #endif // PSMCLIENT_H |