|
1 /* |
|
2 * Copyright (c) 2005 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 #ifndef C_ACTIVEIDLESTATE_H |
|
20 #define C_ACTIVEIDLESTATE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * @ingroup group_aiidleint |
|
26 * |
|
27 * Update idle state flag in system agent |
|
28 * |
|
29 * @since Series 60 2.8 |
|
30 */ |
|
31 NONSHARABLE_CLASS(CActiveIdleState) : public CBase |
|
32 { |
|
33 public: // Constructors and destructor |
|
34 |
|
35 /** |
|
36 * Two-phased constructor. |
|
37 * @param aSystemAgentProxy System Agent object. |
|
38 * @return Idle state monitor object. |
|
39 */ |
|
40 static CActiveIdleState* NewL(); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 ~CActiveIdleState(); |
|
46 |
|
47 public: // new function |
|
48 |
|
49 /** |
|
50 * Update the Idle state |
|
51 */ |
|
52 void SetIsIdleForeground( TBool aIsForeground ); |
|
53 |
|
54 private: |
|
55 |
|
56 /** |
|
57 * C++ default constructor. |
|
58 */ |
|
59 CActiveIdleState( ); |
|
60 |
|
61 /** |
|
62 * Symbian OS constructor. |
|
63 */ |
|
64 void ConstructL( ); |
|
65 |
|
66 /** |
|
67 * Update setting asynchronously. |
|
68 */ |
|
69 void UpdateStateAsync(); |
|
70 |
|
71 /** |
|
72 * Update settings in System Agent. |
|
73 */ |
|
74 void UpdateActiveIdleState(); |
|
75 |
|
76 /** |
|
77 * Callback method, updates system agent setting. |
|
78 */ |
|
79 static TInt DoUpdateState( TAny* aAny ); |
|
80 |
|
81 private: // Data |
|
82 // ETrue if system is in Idle state |
|
83 TBool iIsIdleForeground; |
|
84 |
|
85 // Owned idle callback to update. |
|
86 CIdle* iUpdater; |
|
87 |
|
88 }; |
|
89 |
|
90 #endif // C_ACTIVEIDLESTATE_H |
|
91 |