83 MPEPhoneModelInternal& aModel ) |
79 MPEPhoneModelInternal& aModel ) |
84 { |
80 { |
85 TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL" ); |
81 TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL" ); |
86 |
82 |
87 // Instantiate monitor objects |
83 // Instantiate monitor objects |
88 iAudioOutputPreferenceMonitor = CPEAudioOutputPreferenceMonitor::NewL( aModel ); |
84 iAudioOutputPreferenceMonitor = CPEAudioOutputPreferenceMonitor::NewL( aModel ); |
89 iCallDurationDisplay = CPECallDurationDisplaySettingMonitor::NewL(); |
85 iCallDurationDisplay = CPECallDurationDisplaySettingMonitor::NewL(); |
90 iEarVolumeSetting = CPEIncallEarVolumeSettingMonitor::NewL( aModel ); |
86 iProfileSettings = CPEProfileSettingMonitor::NewL( aModel ); |
91 iLoudspeakerVolumeSetting = CPEIncallLoudspeakerVolumeSettingMonitor::NewL( aModel ); |
87 |
|
88 iNetworkHandler = new PeNetworkHandler(aModel); |
|
89 //TODO |
|
90 /* |
92 iNetworkRegistrationStatus = CPENetworkRegistrationStatusMonitor::NewL( aModel ); |
91 iNetworkRegistrationStatus = CPENetworkRegistrationStatusMonitor::NewL( aModel ); |
93 iProfileSettings = CPEProfileSettingMonitor::NewL( aModel ); |
|
94 iAccessoryModeMonitor = CPEAccessoryModeMonitor::NewL(); |
92 iAccessoryModeMonitor = CPEAccessoryModeMonitor::NewL(); |
95 |
93 |
96 // Instantiate repository objects for later use |
94 // Instantiate repository objects for later use |
97 iAccessorySettingsRepository = CRepository::NewL( KCRUidAccessorySettings ); |
95 iAccessorySettingsRepository = CRepository::NewL( KCRUidAccessorySettings );*/ |
98 iTelephonySettingsRepository = CRepository::NewL( KCRUidTelephonySettings ); |
96 //iTelephonySettingsRepository = CRepository::NewL( KCRUidTelephonySettings ); |
99 iTelephonyVariationRepository = CRepository::NewL( KCRUidTelVariation ); |
97 iTelephonyVariationRepository = CRepository::NewL( KCRUidTelVariation ); |
100 iCoreApplicationRepository = CRepository::NewL( KCRUidCoreApplicationUIs ); |
98 iCoreApplicationRepository = CRepository::NewL( KCRUidCoreApplicationUIs ); |
|
99 |
|
100 TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL 2" ); |
101 } |
101 } |
102 |
102 |
103 // ----------------------------------------------------------------------------- |
103 // ----------------------------------------------------------------------------- |
104 // CPEExternalDataHandler::Get |
104 // CPEExternalDataHandler::Get |
105 // Gets the current value of the specified setting, if the operation was successful |
105 // Gets the current value of the specified setting, if the operation was successful |
110 const TPEExternalDataId aSetting, |
110 const TPEExternalDataId aSetting, |
111 TInt& aValue ) const |
111 TInt& aValue ) const |
112 { |
112 { |
113 TInt errorCode( KErrNotFound ); |
113 TInt errorCode( KErrNotFound ); |
114 |
114 |
|
115 //TODO |
|
116 |
|
117 if ( EPETelephonyVariationFlags == aSetting ) |
|
118 { |
|
119 errorCode = iTelephonyVariationRepository->Get( KTelVariationFlags, aValue ); |
|
120 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPETelephonyVariationFlags, error code: %d", errorCode ); |
|
121 } |
|
122 else if ( EPEAudioOutputPreference == aSetting ) |
|
123 { |
|
124 errorCode = iAudioOutputPreferenceMonitor->Get( aValue ); |
|
125 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAudioOutputPreference, error code: %d", errorCode ); |
|
126 } |
|
127 else if ( EPECallDurationDisplaySetting == aSetting ) |
|
128 { |
|
129 errorCode = iCallDurationDisplay->Get( aValue ); |
|
130 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPECallDurationDisplaySetting, error code: %d", errorCode ); |
|
131 } |
|
132 else if ( EPENetworkConnectionAllowedSetting == aSetting ) |
|
133 { |
|
134 // Fetches setting that indicates if network connection is allowed, |
|
135 // i.e. is the phone in off-line mode. |
|
136 errorCode = iCoreApplicationRepository |
|
137 ->Get( KCoreAppUIsNetworkConnectionAllowed, aValue ); |
|
138 } |
|
139 else |
|
140 { |
|
141 errorCode = KErrNone; |
|
142 aValue = 0; |
|
143 } |
|
144 |
115 // Process Common id |
145 // Process Common id |
116 switch ( aSetting ) |
|
117 { |
|
118 case EPEAutomaticAnswerHeadsetSetting: |
|
119 { |
|
120 errorCode = GetAutomaticAnswer( KSettingsHeadsetAutomaticAnswer, aValue ); |
|
121 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerHeadsetSetting, error code: %d",errorCode ); |
|
122 break; |
|
123 } |
|
124 case EPEAutomaticAnswerLoopsetSetting: |
|
125 { |
|
126 errorCode = GetAutomaticAnswer( KSettingsLoopsetAutomaticAnswer, aValue ); |
|
127 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerLoopsetSetting, error code: %d", errorCode ); |
|
128 break; |
|
129 } |
|
130 case EPEAutomaticAnswerCarkitSetting: |
|
131 { |
|
132 errorCode = GetAutomaticAnswer( KSettingsCarKitAutomaticAnswer, aValue ); |
|
133 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerCarkitSetting, error code: %d", errorCode ); |
|
134 break; |
|
135 } |
|
136 case EPEAutomaticAnswerMusicStandSetting: |
|
137 { |
|
138 errorCode = GetAutomaticAnswer( KSettingsMusicStandAutomaticAnswer, aValue ); |
|
139 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerMusicStandSetting, error code: %d", errorCode ); |
|
140 break; |
|
141 } |
|
142 case EPEAutomaticAnswerWirelessCarkitSetting: |
|
143 { |
|
144 errorCode = GetAutomaticAnswer( KSettingsWirelessCarkitAutomaticAnswer, aValue ); |
|
145 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAutomaticAnswerWirelessCarkitSetting, error code: %d", errorCode ); |
|
146 break; |
|
147 } |
|
148 case EPEAudioOutputPreference: |
|
149 { |
|
150 errorCode = iAudioOutputPreferenceMonitor->Get( aValue ); |
|
151 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAudioOutputPreference, error code: %d", errorCode ); |
|
152 break; |
|
153 } |
|
154 case EPECallDurationDisplaySetting: |
|
155 { |
|
156 errorCode = iCallDurationDisplay->Get( aValue ); |
|
157 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPECallDurationDisplaySetting, error code: %d", errorCode ); |
|
158 break; |
|
159 } |
|
160 case EPEDialPrefixChangeSetting: |
|
161 { |
|
162 errorCode = iTelephonySettingsRepository->Get( KSettingsDialPrefixChangeMode, aValue ); |
|
163 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEDialPrefixChangeSetting, error code: %d", errorCode ); |
|
164 break; |
|
165 } |
|
166 case EPEIncallEarVolumeSetting: |
|
167 { |
|
168 errorCode = iEarVolumeSetting->Get( aValue ); |
|
169 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEIncallEarVolumeSetting, error code: %d", errorCode ); |
|
170 break; |
|
171 } |
|
172 case EPEIncallLoudspeakerVolumeSetting: |
|
173 { |
|
174 errorCode = iLoudspeakerVolumeSetting->Get( aValue ); |
|
175 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEIncallLoudspeakerVolumeSetting, error code: %d", errorCode ); |
|
176 break; |
|
177 } |
|
178 case EPENetworkRegistrationStatus: |
|
179 { |
|
180 errorCode = iNetworkRegistrationStatus->Get( aValue ); |
|
181 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPENetworkRegistrationStatus, error code: %d", errorCode ); |
|
182 break; |
|
183 } |
|
184 case EPETelephonyVariationFlags: |
|
185 { |
|
186 errorCode = iTelephonyVariationRepository->Get( KTelVariationFlags, aValue ); |
|
187 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPETelephonyVariationFlags, error code: %d", errorCode ); |
|
188 break; |
|
189 } |
|
190 case EPEAccessoryMode: |
|
191 { |
|
192 errorCode = KErrNone; |
|
193 aValue = iAccessoryModeMonitor->AccessoryMode(); |
|
194 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAccessoryMode, error code: %d", errorCode ); |
|
195 break; |
|
196 } |
|
197 case EPENetworkConnectionAllowedSetting: |
|
198 { |
|
199 // Fetches setting that indicates if network connection is allowed, |
|
200 // i.e. is the phone in off-line mode. This method is used while |
|
201 // attempting an emergency call, so no memory may be consumed. |
|
202 errorCode = iCoreApplicationRepository |
|
203 ->Get( KCoreAppUIsNetworkConnectionAllowed, aValue ); |
|
204 TEFLOGSTRING2( KTAINT, "CPEGsmExternalDataHandler::Get EPENetworkConnectionAllowedSetting, error code: %d",errorCode ); |
|
205 break; |
|
206 } |
|
207 default: |
|
208 { |
|
209 TEFLOGSTRING2( KTAERROR, |
|
210 "PE CPEEXTERNALDATAHANDLER::GET UNKNOWN SETTING ID ! %d", aSetting ); |
|
211 break; |
|
212 } |
|
213 } |
|
214 |
|
215 return errorCode; |
146 return errorCode; |
216 } |
147 } |
217 |
148 |
218 // ----------------------------------------------------------------------------- |
149 // ----------------------------------------------------------------------------- |
219 // CPEExternalDataHandler::Get |
150 // CPEExternalDataHandler::Get |
220 // Gets the current value of the specified setting, if the operation was successful |
151 // Gets the current value of the specified setting, if the operation was successful |
221 // aValue contains the current valid value of the setting |
152 // aValue contains the current valid value of the setting |
222 // ----------------------------------------------------------------------------- |
153 // ----------------------------------------------------------------------------- |
223 // |
154 // |
224 TInt CPEExternalDataHandler::GetText( |
155 TInt CPEExternalDataHandler::GetText( |
225 const TPEExternalDataId aSetting, |
156 const TPEExternalDataId /*aSetting*/, |
226 TDesC& aValue ) const |
157 TDesC& aValue ) const |
227 { |
158 { |
228 TInt errorCode( KErrNotFound ); |
159 TInt errorCode( KErrNotFound ); |
229 |
160 //TODO |
230 // Process Common id |
161 aValue = KNullDesC; |
231 switch ( aSetting ) |
162 errorCode = KErrNone; |
232 { |
|
233 case EPEDialPrefixTextSetting: |
|
234 { |
|
235 TBuf<KPrefixLength> prefixTextSetting; |
|
236 |
|
237 errorCode = iTelephonySettingsRepository->Get( |
|
238 KSettingsDialPrefixText, |
|
239 prefixTextSetting ); |
|
240 |
|
241 aValue = prefixTextSetting; |
|
242 |
|
243 TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::GetText EPEDialPrefixTextSetting, error code: %d", errorCode ); |
|
244 break; |
|
245 } |
|
246 default: |
|
247 { |
|
248 TEFLOGSTRING2( KTAERROR, |
|
249 "PE CPEEXTERNALDATAHANDLER::GETTEXT UNKNOWN SETTING ID ! %d", aSetting ); |
|
250 break; |
|
251 } |
|
252 } |
|
253 |
|
254 return errorCode; |
163 return errorCode; |
255 } |
164 } |
256 |
165 |
257 // ----------------------------------------------------------------------------- |
166 // ----------------------------------------------------------------------------- |
258 // CPEExternalDataHandler::GetAutomaticAnswer |
167 // CPEExternalDataHandler::GetAutomaticAnswer |
259 // Check if automatic answer is defined for connected accessory. |
168 // Check if automatic answer is defined for connected accessory. |
260 // ----------------------------------------------------------------------------- |
169 // ----------------------------------------------------------------------------- |
261 // |
170 // |
262 TInt CPEExternalDataHandler::GetAutomaticAnswer( |
171 TInt CPEExternalDataHandler::GetAutomaticAnswer( |
263 TUint32 aSetting, |
172 TUint32 /*aSetting*/, |
264 TInt& aValue ) const |
173 TInt& aValue ) const |
265 { |
174 { |
266 TInt errorCode( KErrNotFound ); |
175 TInt errorCode( KErrNotFound ); |
267 |
176 |
268 TEFLOGSTRING( KTAINT, "CPEExternalDataHandler::GetAutomaticAnswer" ); |
177 TEFLOGSTRING( KTAINT, "CPEExternalDataHandler::GetAutomaticAnswer" ); |
269 |
178 errorCode = KErrNone; |
270 errorCode = iAccessorySettingsRepository->Get( aSetting, aValue ); |
179 aValue = 0; |
271 |
|
272 return errorCode; |
180 return errorCode; |
273 } |
181 } |
274 |
182 |
275 // ----------------------------------------------------------------------------- |
183 // ----------------------------------------------------------------------------- |
276 // CPEExternalDataHandler::Set |
184 // CPEExternalDataHandler::Set |