1 /* |
|
2 * Copyright (c) 2004-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: Monitoring status of sim for emergency numbers. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CSOSENPOLICYSIMSTATUSMONITOR_H |
|
21 #define CSOSENPOLICYSIMSTATUSMONITOR_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include "csosemergencynumberpolicyhandler.h" |
|
26 |
|
27 #include <e32base.h> // CActive |
|
28 #include <e32property.h> // RProperty |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CSosEmergencyNumberPolicyHandler; |
|
33 class RSystemAgent; |
|
34 class TSysAgentEvent; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * It is the SIM monitor class for Emergency number manager. |
|
41 * |
|
42 * @since Series60_2.6 |
|
43 */ |
|
44 NONSHARABLE_CLASS( CSosEnPolicySimStatusMonitor ) : public CActive |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Creates a new monitor and starts it. |
|
50 * |
|
51 * @param aObserver The observer class of the SIM status changes. |
|
52 * @return Pointer to created CSosEnPolicySimStatusMonitor instance. |
|
53 */ |
|
54 static CSosEnPolicySimStatusMonitor* NewL( |
|
55 CSosEmergencyNumberPolicyHandler& aObserver ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CSosEnPolicySimStatusMonitor(); |
|
61 |
|
62 public: // New functions |
|
63 /** |
|
64 * Is SIM reading allowed? |
|
65 * |
|
66 * @return Returns ETrue, if SIM reading is allowed. |
|
67 */ |
|
68 TBool IsReadingAllowed(); |
|
69 |
|
70 |
|
71 private: // Functions from base classes |
|
72 |
|
73 /** |
|
74 * @see CActive::RunL() |
|
75 */ |
|
76 void DoCancel(); |
|
77 |
|
78 /** |
|
79 * @see CActive::RunL() |
|
80 */ |
|
81 void RunL(); |
|
82 |
|
83 |
|
84 private: // New functions |
|
85 |
|
86 /** |
|
87 * Requests notifications from system agent. |
|
88 */ |
|
89 void IssueRequest(); |
|
90 |
|
91 /** |
|
92 * Translates system agent's state information. |
|
93 * |
|
94 * @param aState This is the state from SA. |
|
95 */ |
|
96 TBool TranslateState( TInt aState ); |
|
97 |
|
98 private: |
|
99 /** |
|
100 * C++ constructor. |
|
101 * @param aObserver The observer class of the SIM status changes. |
|
102 */ |
|
103 CSosEnPolicySimStatusMonitor( CSosEmergencyNumberPolicyHandler& aObserver ); |
|
104 |
|
105 /** |
|
106 * By default Symbian 2nd phase constructor is private. |
|
107 */ |
|
108 void ConstructL(); |
|
109 |
|
110 |
|
111 private: // Data |
|
112 |
|
113 // The Observer for events. |
|
114 CSosEmergencyNumberPolicyHandler& iObserver; |
|
115 |
|
116 // The RProperty to replace System agent. |
|
117 RProperty iProperty; |
|
118 |
|
119 }; |
|
120 |
|
121 #endif // CSOSENPOLICYSIMSTATUSMONITOR_H |
|
122 |
|
123 |
|
124 // End of File |
|