168 // ---------------------------------------------------------------------------- |
168 // ---------------------------------------------------------------------------- |
169 void CIpsSosAOSettingsHandler::SetAlwaysOnlineState( |
169 void CIpsSosAOSettingsHandler::SetAlwaysOnlineState( |
170 const IpsServices::TIpsSetDataAoStates aAlwaysOnlineState ) |
170 const IpsServices::TIpsSetDataAoStates aAlwaysOnlineState ) |
171 { |
171 { |
172 //we're allowed to switch ourselves off, not on. |
172 //we're allowed to switch ourselves off, not on. |
173 if ( aAlwaysOnlineState == IpsServices::EMailAoOff ){ |
173 if ( aAlwaysOnlineState == IpsServices::EMailAoOff ) |
|
174 { |
174 if(!SetSettingValue( |
175 if(!SetSettingValue( |
175 IpsServices::ReceptionActiveProfile, |
176 IpsServices::ReceptionActiveProfile, |
176 IpsServices::EmailSyncProfileManualFetch)){ |
177 IpsServices::EmailSyncProfileManualFetch)) |
|
178 { |
177 |
179 |
178 CreateKeyValuePair( |
180 CreateKeyValuePair( |
179 IpsServices::ReceptionActiveProfile, |
181 IpsServices::ReceptionActiveProfile, |
180 IpsServices::EmailSyncProfileManualFetch); |
182 IpsServices::EmailSyncProfileManualFetch); |
181 } |
183 } |
206 // ---------------------------------------------------------------------------- |
209 // ---------------------------------------------------------------------------- |
207 void CIpsSosAOSettingsHandler::SetEmailNotificationState( |
210 void CIpsSosAOSettingsHandler::SetEmailNotificationState( |
208 const IpsServices::TIpsSetDataEmnStates /*aEmnState*/ ) |
211 const IpsServices::TIpsSetDataEmnStates /*aEmnState*/ ) |
209 { |
212 { |
210 /* Not supported yet |
213 /* Not supported yet |
211 if(!SetSettingValue(IpsServices::EmailNotificationState, aEmnState)){ |
214 if(!SetSettingValue(IpsServices::EmailNotificationState, aEmnState)) |
|
215 { |
212 CreateKeyValuePair(IpsServices::EmailNotificationState, aEmnState); |
216 CreateKeyValuePair(IpsServices::EmailNotificationState, aEmnState); |
213 } |
217 } |
214 */ |
218 */ |
215 } |
219 } |
216 |
220 |
235 // ---------------------------------------------------------------------------- |
240 // ---------------------------------------------------------------------------- |
236 // ---------------------------------------------------------------------------- |
241 // ---------------------------------------------------------------------------- |
237 void CIpsSosAOSettingsHandler::SetFirstEmnReceived( TBool /*aValue*/ ) |
242 void CIpsSosAOSettingsHandler::SetFirstEmnReceived( TBool /*aValue*/ ) |
238 { |
243 { |
239 /* Not supported yet |
244 /* Not supported yet |
240 if(!SetSettingValue( IpsServices::FirstEmnReceived, aValue )){ |
245 if(!SetSettingValue( IpsServices::FirstEmnReceived, aValue )) |
|
246 { |
241 CreateKeyValuePair(IpsServices::FirstEmnReceived, aValue); |
247 CreateKeyValuePair(IpsServices::FirstEmnReceived, aValue); |
242 } |
248 } |
243 */ |
249 */ |
244 } |
250 } |
245 |
251 |
266 // ---------------------------------------------------------------------------- |
273 // ---------------------------------------------------------------------------- |
267 void CIpsSosAOSettingsHandler::SetEmnReceivedButNotSyncedFlag( TBool /*aFlag*/ ) |
274 void CIpsSosAOSettingsHandler::SetEmnReceivedButNotSyncedFlag( TBool /*aFlag*/ ) |
268 { |
275 { |
269 /* Not supported yet |
276 /* Not supported yet |
270 |
277 |
271 if(!SetSettingValue(IpsServices::EmnReceivedNotSynced, aFlag)){ |
278 if(!SetSettingValue(IpsServices::EmnReceivedNotSynced, aFlag)) |
|
279 { |
272 CreateKeyValuePair(IpsServices::EmnReceivedNotSynced, aFlag); |
280 CreateKeyValuePair(IpsServices::EmnReceivedNotSynced, aFlag); |
273 } |
281 } |
274 */ |
282 */ |
275 } |
283 } |
276 |
284 |
296 { |
305 { |
297 QVariant value = NULL; |
306 QVariant value = NULL; |
298 TBool ok = GetSettingValue(IpsServices::ReceptionDayStartTime, value); |
307 TBool ok = GetSettingValue(IpsServices::ReceptionDayStartTime, value); |
299 TDateTime time; |
308 TDateTime time; |
300 |
309 |
301 if(ok){ |
310 if(ok) |
|
311 { |
302 TInt total = value.toInt(); |
312 TInt total = value.toInt(); |
303 TInt minutes = total%KAOMinutesInHour; |
313 TInt minutes = total%KAOMinutesInHour; |
304 TInt hour = total/KAOMinutesInHour; |
314 TInt hour = total/KAOMinutesInHour; |
305 time.SetHour(hour); |
315 time.SetHour(hour); |
306 time.SetMinute(minutes); |
316 time.SetMinute(minutes); |
316 { |
326 { |
317 QVariant value = NULL; |
327 QVariant value = NULL; |
318 TBool ok = GetSettingValue(IpsServices::ReceptionDayEndTime, value); |
328 TBool ok = GetSettingValue(IpsServices::ReceptionDayEndTime, value); |
319 TDateTime time; |
329 TDateTime time; |
320 |
330 |
321 if(ok){ |
331 if(ok) |
|
332 { |
322 TInt total = value.toInt(); |
333 TInt total = value.toInt(); |
323 TInt minutes = total%KAOMinutesInHour; |
334 TInt minutes = total%KAOMinutesInHour; |
324 TInt hour = total/KAOMinutesInHour; |
335 TInt hour = total/KAOMinutesInHour; |
325 time.SetHour(hour); |
336 time.SetHour(hour); |
326 time.SetMinute(minutes); |
337 time.SetMinute(minutes); |
336 const IpsServices::TAOInfo& aLastUpdateInfo ) |
347 const IpsServices::TAOInfo& aLastUpdateInfo ) |
337 { |
348 { |
338 TInt high = I64HIGH(aLastUpdateInfo.iLastSuccessfulUpdate.Int64()); |
349 TInt high = I64HIGH(aLastUpdateInfo.iLastSuccessfulUpdate.Int64()); |
339 TInt low = I64LOW(aLastUpdateInfo.iLastSuccessfulUpdate.Int64()); |
350 TInt low = I64LOW(aLastUpdateInfo.iLastSuccessfulUpdate.Int64()); |
340 |
351 |
341 if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low)){ |
352 if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low)) |
|
353 { |
342 CreateKeyValuePair(IpsServices::AoLastSuccessfulUpdateL, low); |
354 CreateKeyValuePair(IpsServices::AoLastSuccessfulUpdateL, low); |
343 } |
355 } |
344 |
356 |
345 if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high)){ |
357 if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high)) |
|
358 { |
346 CreateKeyValuePair(IpsServices::AoLastSuccessfulUpdateH, high); |
359 CreateKeyValuePair(IpsServices::AoLastSuccessfulUpdateH, high); |
347 } |
360 } |
348 |
361 |
349 if(!SetSettingValue( |
362 if(!SetSettingValue( |
350 IpsServices::AoLastUpdateFailed, |
363 IpsServices::AoLastUpdateFailed, |
351 aLastUpdateInfo.iLastUpdateFailed)){ |
364 aLastUpdateInfo.iLastUpdateFailed)) |
|
365 { |
352 CreateKeyValuePair(IpsServices::AoLastUpdateFailed, |
366 CreateKeyValuePair(IpsServices::AoLastUpdateFailed, |
353 aLastUpdateInfo.iLastUpdateFailed); |
367 aLastUpdateInfo.iLastUpdateFailed); |
354 } |
368 } |
355 |
369 |
356 if(!SetSettingValue( |
370 if(!SetSettingValue( |
357 IpsServices::AoUpdateSuccessfulWithCurSettings, |
371 IpsServices::AoUpdateSuccessfulWithCurSettings, |
358 aLastUpdateInfo.iUpdateSuccessfulWithCurSettings)){ |
372 aLastUpdateInfo.iUpdateSuccessfulWithCurSettings)) |
|
373 { |
359 CreateKeyValuePair(IpsServices::AoUpdateSuccessfulWithCurSettings, |
374 CreateKeyValuePair(IpsServices::AoUpdateSuccessfulWithCurSettings, |
360 aLastUpdateInfo.iUpdateSuccessfulWithCurSettings); |
375 aLastUpdateInfo.iUpdateSuccessfulWithCurSettings); |
361 } |
376 } |
362 } |
377 } |
363 |
378 |
374 QVariant low=NULL; |
389 QVariant low=NULL; |
375 QVariant fail=NULL; |
390 QVariant fail=NULL; |
376 QVariant success=NULL; |
391 QVariant success=NULL; |
377 |
392 |
378 TBool ok = GetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high); |
393 TBool ok = GetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high); |
379 if(ok){ |
394 if( ok ) |
|
395 { |
380 ok = GetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low); |
396 ok = GetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low); |
381 } |
397 } |
382 if(ok){ |
398 if( ok ) |
|
399 { |
383 info.iLastSuccessfulUpdate = MAKE_TINT64( high.toInt(), low.toInt() ); |
400 info.iLastSuccessfulUpdate = MAKE_TINT64( high.toInt(), low.toInt() ); |
384 } |
401 } |
385 |
402 |
386 ok = GetSettingValue(IpsServices::AoLastUpdateFailed, fail); |
403 ok = GetSettingValue(IpsServices::AoLastUpdateFailed, fail); |
387 |
404 |
388 if(ok){ |
405 if( ok ) |
|
406 { |
389 info.iLastUpdateFailed = static_cast<TBool>(fail.toInt()); |
407 info.iLastUpdateFailed = static_cast<TBool>(fail.toInt()); |
390 } |
408 } |
391 |
409 |
392 ok = GetSettingValue(IpsServices::AoUpdateSuccessfulWithCurSettings, success); |
410 ok = GetSettingValue(IpsServices::AoUpdateSuccessfulWithCurSettings, success); |
393 |
411 |
394 if(ok){ |
412 if( ok ) |
|
413 { |
395 info.iUpdateSuccessfulWithCurSettings = static_cast<TBool>(success.toInt()); |
414 info.iUpdateSuccessfulWithCurSettings = static_cast<TBool>(success.toInt()); |
396 } |
415 } |
397 |
416 |
398 return info; |
417 return info; |
399 } |
418 } |
402 // ---------------------------------------------------------------------------- |
421 // ---------------------------------------------------------------------------- |
403 TInt CIpsSosAOSettingsHandler::InboxRefreshTime() const |
422 TInt CIpsSosAOSettingsHandler::InboxRefreshTime() const |
404 { |
423 { |
405 QVariant value = NULL; |
424 QVariant value = NULL; |
406 TBool ok = EFalse; |
425 TBool ok = EFalse; |
407 if(IsDaytime()){ |
426 if( IsDaytime() ) |
|
427 { |
408 ok = GetSettingValue( IpsServices::ReceptionRefreshPeriodDayTime, value); |
428 ok = GetSettingValue( IpsServices::ReceptionRefreshPeriodDayTime, value); |
409 } |
429 } |
410 else{ |
430 else |
|
431 { |
411 ok = GetSettingValue(IpsServices::ReceptionRefreshPeriodOther, value); |
432 ok = GetSettingValue(IpsServices::ReceptionRefreshPeriodOther, value); |
412 } |
433 } |
413 |
434 |
414 TInt ret = 0; |
435 TInt ret = 0; |
415 if(ok){ |
436 if( ok ) |
|
437 { |
416 ret = value.toInt(); |
438 ret = value.toInt(); |
417 } |
439 } |
418 |
440 |
419 return ret; |
441 return ret; |
420 } |
442 } |
508 IpsServices::TIpsSetDataAoStates CIpsSosAOSettingsHandler::ProfileIntoAOState( |
532 IpsServices::TIpsSetDataAoStates CIpsSosAOSettingsHandler::ProfileIntoAOState( |
509 const TInt aProfile) const |
533 const TInt aProfile) const |
510 { |
534 { |
511 IpsServices::TIpsSetDataAoStates ret = IpsServices::EMailAoOff; |
535 IpsServices::TIpsSetDataAoStates ret = IpsServices::EMailAoOff; |
512 |
536 |
513 if ( aProfile != IpsServices::EmailSyncProfileManualFetch ){ |
537 if ( aProfile != IpsServices::EmailSyncProfileManualFetch ) |
|
538 { |
514 ret = IpsServices::EMailAoAlways; |
539 ret = IpsServices::EMailAoAlways; |
515 } |
540 } |
516 |
541 |
517 return ret; |
542 return ret; |
518 } |
543 } |