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: Implementation of CPhoneSystemEventHandler class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <telinformationpskeys.h> |
|
21 #include <telephonyvariant.hrh> |
|
22 #include <UikonInternalPSKeys.h> |
|
23 #include <startupdomainpskeys.h> |
|
24 #include <hwrmdomainpskeys.h> |
|
25 |
|
26 #include "cphonesystemeventhandler.h" |
|
27 #include "mphonestate.h" |
|
28 #include "mphonestatemachine.h" |
|
29 #include "cphonecenrepproxy.h" |
|
30 #include "cphonepubsubproxy.h" |
|
31 |
|
32 // ================= MEMBER FUNCTIONS ======================= |
|
33 |
|
34 // --------------------------------------------------------- |
|
35 // CPhoneSystemEventHandler::CPhoneSystemEventHandler |
|
36 // C++ default constructor |
|
37 // (other items were commented in a header). |
|
38 // --------------------------------------------------------- |
|
39 // |
|
40 CPhoneSystemEventHandler::CPhoneSystemEventHandler( |
|
41 MPhoneStateMachine* aStateMachine ) : |
|
42 iStateMachine( aStateMachine ) |
|
43 { |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------- |
|
47 // CPhoneSystemEventHandler::NewL() |
|
48 // Two-phased constructor |
|
49 // (other items were commented in a header). |
|
50 // ----------------------------------------------------------- |
|
51 // |
|
52 CPhoneSystemEventHandler* CPhoneSystemEventHandler::NewL( |
|
53 MPhoneStateMachine* aStateMachine ) |
|
54 { |
|
55 CPhoneSystemEventHandler* self = |
|
56 new (ELeave) CPhoneSystemEventHandler( aStateMachine ); |
|
57 |
|
58 CleanupStack::PushL( self ); |
|
59 self->ConstructL(); |
|
60 CleanupStack::Pop( self ); |
|
61 |
|
62 return self; |
|
63 } |
|
64 |
|
65 // --------------------------------------------------------- |
|
66 // CPhoneSystemEventHandler::ConstructL() |
|
67 // EPOC default constructor can leave. |
|
68 // (other items were commented in a header). |
|
69 // --------------------------------------------------------- |
|
70 // |
|
71 void CPhoneSystemEventHandler::ConstructL() |
|
72 { |
|
73 // Set up notifications for call state values |
|
74 CPhonePubSubProxy::Instance()->NotifyChangeL( |
|
75 KPSUidCtsyCallInformation, |
|
76 KCTsyCallState, |
|
77 this ); |
|
78 |
|
79 // Set up notifications for displaying Telephony info on the title pane |
|
80 CPhonePubSubProxy::Instance()->NotifyChangeL( |
|
81 KPSUidTelInformation, |
|
82 KTelDisplayInfo, |
|
83 this ); |
|
84 |
|
85 // Set up notifications for Sim security state values. |
|
86 CPhonePubSubProxy::Instance()->NotifyChangeL( |
|
87 KPSUidStartup, |
|
88 KStartupSimSecurityStatus, |
|
89 this ); |
|
90 |
|
91 if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( |
|
92 KTelephonyLVFlagSwivelInDevice )) |
|
93 { |
|
94 // Set up notifications for Swivel state. |
|
95 CPhonePubSubProxy::Instance()->NotifyChangeL( |
|
96 KPSUidHWRM, |
|
97 KHWRMGripStatus, |
|
98 this ); |
|
99 } |
|
100 } |
|
101 |
|
102 // --------------------------------------------------------- |
|
103 // CPhoneSystemEventHandler::CPhoneSystemEventHandler |
|
104 // C++ default constructor |
|
105 // (other items were commented in a header). |
|
106 // --------------------------------------------------------- |
|
107 // |
|
108 CPhoneSystemEventHandler::~CPhoneSystemEventHandler() |
|
109 { |
|
110 } |
|
111 |
|
112 // --------------------------------------------------------- |
|
113 // CPhoneSystemEventHandler::DynInitMenuPaneL |
|
114 // --------------------------------------------------------- |
|
115 // |
|
116 void CPhoneSystemEventHandler::DynInitMenuPaneL( |
|
117 TInt aResourceId, |
|
118 CEikMenuPane* aMenuPane ) |
|
119 { |
|
120 iStateMachine->State()->DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
121 } |
|
122 |
|
123 // --------------------------------------------------------- |
|
124 // CPhoneSystemEventHandler::DynInitMenuBarL |
|
125 // --------------------------------------------------------- |
|
126 // |
|
127 void CPhoneSystemEventHandler::DynInitMenuBarL( |
|
128 TInt aResourceId, |
|
129 CEikMenuBar* aMenuBar ) |
|
130 { |
|
131 iStateMachine->State()->DynInitMenuBarL( aResourceId, aMenuBar ); |
|
132 } |
|
133 |
|
134 // --------------------------------------------------------- |
|
135 // CPhoneSystemEventHandler::HandleSystemEventL |
|
136 // --------------------------------------------------------- |
|
137 // |
|
138 void CPhoneSystemEventHandler::HandleSystemEventL( const TWsEvent& aEvent ) |
|
139 { |
|
140 iStateMachine->State()->HandleSystemEventL( aEvent ); |
|
141 } |
|
142 |
|
143 // --------------------------------------------------------- |
|
144 // CPhoneSystemEventHandler::HandleForegroundEventL |
|
145 // --------------------------------------------------------- |
|
146 // |
|
147 void CPhoneSystemEventHandler::HandleForegroundEventL( TBool aForeground ) |
|
148 { |
|
149 iStateMachine->State()->HandleForegroundEventL( aForeground ); |
|
150 } |
|
151 |
|
152 // --------------------------------------------------------- |
|
153 // CPhoneSystemEventHandler::HandlePhoneForegroundEventL |
|
154 // --------------------------------------------------------- |
|
155 // |
|
156 void CPhoneSystemEventHandler::HandlePhoneForegroundEventL() |
|
157 { |
|
158 iStateMachine->State()->HandlePhoneForegroundEventL(); |
|
159 } |
|
160 |
|
161 // --------------------------------------------------------- |
|
162 // CPhoneSystemEventHandler::HandlePhoneFocusLostEventL |
|
163 // --------------------------------------------------------- |
|
164 // |
|
165 void CPhoneSystemEventHandler::HandlePhoneFocusLostEventL() |
|
166 { |
|
167 iStateMachine->State()->HandlePhoneFocusLostEventL(); |
|
168 } |
|
169 // --------------------------------------------------------- |
|
170 // CPhoneSystemEventHandler::HandleIdleForegroundEventL |
|
171 // --------------------------------------------------------- |
|
172 // |
|
173 void CPhoneSystemEventHandler::HandleIdleForegroundEventL() |
|
174 { |
|
175 iStateMachine->State()->HandleIdleForegroundEventL(); |
|
176 } |
|
177 |
|
178 // --------------------------------------------------------- |
|
179 // CPhoneSystemEventHandler::HandleKeyLockEnabled |
|
180 // --------------------------------------------------------- |
|
181 // |
|
182 void CPhoneSystemEventHandler::HandleKeyLockEnabled( TBool aKeylockEnabled ) |
|
183 { |
|
184 iStateMachine->State()->HandleKeyLockEnabled( aKeylockEnabled ); |
|
185 } |
|
186 |
|
187 // ----------------------------------------------------------- |
|
188 // CPhoneSystemEventHandler::HandleEnvironmentChangeL |
|
189 // ----------------------------------------------------------- |
|
190 // |
|
191 void CPhoneSystemEventHandler::HandleEnvironmentChangeL( const TInt aChanges ) |
|
192 { |
|
193 iStateMachine->State()->HandleEnvironmentChangeL( aChanges ); |
|
194 } |
|
195 |
|
196 // --------------------------------------------------------- |
|
197 // CPhoneSystemEventHandler::HandlePhoneStartupL |
|
198 // --------------------------------------------------------- |
|
199 // |
|
200 void CPhoneSystemEventHandler::HandlePhoneStartupL() |
|
201 { |
|
202 iStateMachine->State()->HandlePhoneStartupL(); |
|
203 } |
|
204 |
|
205 // ----------------------------------------------------------- |
|
206 // CPhoneSystemEventHandler::HandlePropertyChangedL |
|
207 // ----------------------------------------------------------- |
|
208 // |
|
209 void CPhoneSystemEventHandler::HandlePropertyChangedL( |
|
210 const TUid& aCategory, |
|
211 const TUint aKey, |
|
212 const TInt aValue ) |
|
213 { |
|
214 iStateMachine->State()->HandlePropertyChangedL( aCategory, aKey, aValue ); |
|
215 } |
|
216 |
|
217 // ----------------------------------------------------------- |
|
218 // CPhoneSystemEventHandler::HandleCenRepChangeL |
|
219 // ----------------------------------------------------------- |
|
220 // |
|
221 void CPhoneSystemEventHandler::HandleCenRepChangeL( |
|
222 const TUid& aUid, |
|
223 const TUint aId ) |
|
224 { |
|
225 iStateMachine->State()->HandleCenRepChangeL( aUid, aId ); |
|
226 } |
|
227 |
|
228 // End of File |
|