|
1 /* |
|
2 * Copyright (c) 2005-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 the License "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: Statemachine for updating power mode |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CORE_OPERATION_UPDATE_POWER_MODE_H |
|
20 #define CORE_OPERATION_UPDATE_POWER_MODE_H |
|
21 |
|
22 #include "core_operation_base.h" |
|
23 |
|
24 /** |
|
25 * Statemachine for updating the device IP address. |
|
26 * |
|
27 * @lib wlmserversrv.lib |
|
28 * @since S60 v3.1 |
|
29 */ |
|
30 NONSHARABLE_CLASS( core_operation_update_power_mode_c ) : public core_operation_base_c |
|
31 { |
|
32 |
|
33 public: |
|
34 |
|
35 /** The possible states of the operation. */ |
|
36 enum core_state_e |
|
37 { |
|
38 core_state_init = core_base_state_next, |
|
39 core_state_req_set_power_mode, |
|
40 core_state_MAX |
|
41 }; |
|
42 |
|
43 /** |
|
44 * Constructor. |
|
45 * |
|
46 * When the operation is instantiated through this constructor, the power save mode |
|
47 * is determined from core_settings_c parameters. |
|
48 */ |
|
49 core_operation_update_power_mode_c( |
|
50 u32_t request_id, |
|
51 core_server_c* server, |
|
52 abs_core_driverif_c* drivers, |
|
53 abs_core_server_callback_c* adaptation ); |
|
54 |
|
55 /** |
|
56 * Constructor. |
|
57 * |
|
58 * When the operation is instantiated through this constructor, the power save mode |
|
59 * is passed as an argument. |
|
60 */ |
|
61 core_operation_update_power_mode_c( |
|
62 u32_t request_id, |
|
63 core_server_c* server, |
|
64 abs_core_driverif_c* drivers, |
|
65 abs_core_server_callback_c* adaptation, |
|
66 const core_power_save_mode_s& mode ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~core_operation_update_power_mode_c(); |
|
72 |
|
73 protected: |
|
74 |
|
75 /** |
|
76 * This method is called when a pending request has been completed |
|
77 * and so sub-operations are pending. |
|
78 * |
|
79 * @since S60 v3.1 |
|
80 * @return status of the operation: |
|
81 * core_error_request_pending if the operation is not finished, |
|
82 * otherwise the status code of the finished operation |
|
83 */ |
|
84 core_error_e next_state(); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * Determine the power mode to be used. |
|
90 * |
|
91 * @since S60 v3.2 |
|
92 * @return The power save mode to be used. |
|
93 */ |
|
94 core_power_mode_s determine_power_mode() const; |
|
95 |
|
96 private: // data |
|
97 |
|
98 /** The power save mode to be used. */ |
|
99 core_power_save_mode_s preferred_mode_m; |
|
100 |
|
101 /** The power mode to be set. */ |
|
102 core_power_mode_s power_mode_m; |
|
103 |
|
104 }; |
|
105 |
|
106 #endif // CORE_OPERATION_UPDATE_POWER_MODE_H |