|
1 /* |
|
2 * Copyright (c) 2004 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: Defines class CNcnSystemAgentObserver. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef NCNSYSTEMAGENTOBSERVER_H |
|
21 #define NCNSYSTEMAGENTOBSERVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <savarset.h> // RSAVarChangeNotify |
|
26 |
|
27 // CLASS DECLARATION |
|
28 class CNcnModelBase; |
|
29 |
|
30 /** |
|
31 * Listens to the Phone idle status through the System Agent session. |
|
32 */ |
|
33 class CNcnSystemAgentObserver : public CActive |
|
34 { |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * C++ default constructor. |
|
39 */ |
|
40 CNcnSystemAgentObserver( CNcnModelBase* aModel ); |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CNcnSystemAgentObserver* NewL( CNcnModelBase* aModel ); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CNcnSystemAgentObserver(); |
|
51 |
|
52 public: |
|
53 |
|
54 /* |
|
55 * Through this System Agent is notified about state changes. |
|
56 */ |
|
57 void NotifySystemAgent( const TUid& aVariable, const TInt aState ); |
|
58 |
|
59 /** |
|
60 * By this method the user of this class orders the observer to start receiving events. |
|
61 */ |
|
62 void IssueRequest(); |
|
63 |
|
64 private: |
|
65 |
|
66 /** |
|
67 * By default Symbian OS constructor is private. |
|
68 */ |
|
69 void ConstructL(); |
|
70 |
|
71 // By default, prohibit copy constructor |
|
72 CNcnSystemAgentObserver( const CNcnSystemAgentObserver& ); |
|
73 // Prohibit assigment operator |
|
74 CNcnSystemAgentObserver& operator= ( const CNcnSystemAgentObserver& ); |
|
75 |
|
76 /** |
|
77 * Cancels the request. |
|
78 */ |
|
79 void DoCancel(); |
|
80 |
|
81 /** |
|
82 * Handles the event. |
|
83 */ |
|
84 void RunL(); |
|
85 |
|
86 private: // Data |
|
87 |
|
88 // For being notified by System Agent |
|
89 RSystemAgent iSystemAgent; |
|
90 |
|
91 // For notifying System Agent |
|
92 RSAVarChangeNotify iSavar; |
|
93 |
|
94 // A pointer to the event monitor. |
|
95 CNcnModelBase* iModel; |
|
96 |
|
97 // The event from System Agent. |
|
98 TSysAgentEvent iSAEvent; |
|
99 |
|
100 // Stores the phone idle state status |
|
101 TInt iPhoneIdleState; |
|
102 |
|
103 // Stores the autolock status |
|
104 TInt iAutolockStatus; |
|
105 |
|
106 // Stores the current call status |
|
107 TInt iCurrentCallStatus; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // NCNSYSTEMAGENTOBSERVER_H |
|
112 |
|
113 // End of File |