equal
deleted
inserted
replaced
214 } |
214 } |
215 |
215 |
216 |
216 |
217 void CCalEntryImpl::AddAttendeeL(CCalAttendee* aAttendee) |
217 void CCalEntryImpl::AddAttendeeL(CCalAttendee* aAttendee) |
218 { |
218 { |
219 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
219 if (!aAttendee) |
220 User::Leave(KErrNotSupported)); |
220 { |
221 |
221 User::Leave( KErrArgument ); |
222 if (!aAttendee) |
222 } |
223 { |
|
224 User::Leave( KErrArgument ); |
|
225 } |
|
226 |
223 |
227 CleanupStack::PushL(aAttendee); |
224 CleanupStack::PushL(aAttendee); |
228 __ASSERT_ALWAYS(aAttendee != NULL, User::Leave(KErrArgument)); |
225 __ASSERT_ALWAYS(aAttendee != NULL, User::Leave(KErrArgument)); |
229 PopulateAttendeeListL(); |
226 PopulateAttendeeListL(); |
230 |
227 |
263 iFullEntry->DeleteAttendee(aIndex); |
260 iFullEntry->DeleteAttendee(aIndex); |
264 } |
261 } |
265 |
262 |
266 void CCalEntryImpl::SetOrganizerL(CCalUser* aUser) |
263 void CCalEntryImpl::SetOrganizerL(CCalUser* aUser) |
267 { |
264 { |
268 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
269 User::Leave(KErrNotSupported)); |
|
270 |
|
271 CleanupStack::PushL(aUser); |
265 CleanupStack::PushL(aUser); |
272 __ASSERT_ALWAYS(aUser != NULL, User::Leave(KErrArgument)); |
266 __ASSERT_ALWAYS(aUser != NULL, User::Leave(KErrArgument)); |
273 LoadFullEntryL(); |
267 LoadFullEntryL(); |
274 |
268 |
275 aUser->Impl()->SetOwnsCAgnAttendee(EFalse); |
269 aUser->Impl()->SetOwnsCAgnAttendee(EFalse); |
280 CleanupStack::Pop(aUser); |
274 CleanupStack::Pop(aUser); |
281 } |
275 } |
282 |
276 |
283 void CCalEntryImpl::SetPhoneOwnerL(const CCalUser* aOwner) |
277 void CCalEntryImpl::SetPhoneOwnerL(const CCalUser* aOwner) |
284 { |
278 { |
285 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
286 User::Leave(KErrNotSupported)); |
|
287 __ASSERT_ALWAYS(aOwner != NULL, User::Leave(KErrArgument)); |
279 __ASSERT_ALWAYS(aOwner != NULL, User::Leave(KErrArgument)); |
288 LoadFullEntryL(); |
280 LoadFullEntryL(); |
289 CCalUserImpl* userImpl = aOwner->Impl(); |
281 CCalUserImpl* userImpl = aOwner->Impl(); |
290 iFullEntry->SetPhoneOwnerL(userImpl->Attendee()); |
282 iFullEntry->SetPhoneOwnerL(userImpl->Attendee()); |
291 } |
283 } |
342 } |
334 } |
343 |
335 |
344 return iCalOrganizer; |
336 return iCalOrganizer; |
345 } |
337 } |
346 |
338 |
|
339 void CCalEntryImpl::ClearMRSpecificDataL() |
|
340 { |
|
341 LoadFullEntryL(); |
|
342 iFullEntry->ClearMRSpecificData(); // Clear Organizer and Phone Owner. |
|
343 if( iCalOrganizer ) |
|
344 { |
|
345 delete iCalOrganizer; |
|
346 iCalOrganizer = NULL; |
|
347 } |
|
348 } |
|
349 |
347 CTzRules* CCalEntryImpl::GetTzRulesL() |
350 CTzRules* CCalEntryImpl::GetTzRulesL() |
348 { |
351 { |
349 CAgnRptDef* rptDef = SimpleEntry()->RptDef(); |
352 CAgnRptDef* rptDef = SimpleEntry()->RptDef(); |
350 |
353 |
351 if (rptDef == NULL) |
354 if (rptDef == NULL) |
355 return rptDef->CloneTzRulesL(); |
358 return rptDef->CloneTzRulesL(); |
356 } |
359 } |
357 |
360 |
358 void CCalEntryImpl::SetTzRulesL(const CTzRules& aTzRules) |
361 void CCalEntryImpl::SetTzRulesL(const CTzRules& aTzRules) |
359 { |
362 { |
360 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
361 User::Leave(KErrNotSupported)); |
|
362 LoadFullEntryL(); |
363 LoadFullEntryL(); |
363 |
364 |
364 if (TimeMode() == MAgnCalendarTimeMode::EFloating) |
365 if (TimeMode() == MAgnCalendarTimeMode::EFloating) |
365 { |
366 { |
366 User::Leave(KErrArgument); |
367 User::Leave(KErrArgument); |
376 rptDef->SetTimeZoneL(aTzRules); // rptDef doesn't take ownership of aTzRules |
377 rptDef->SetTimeZoneL(aTzRules); // rptDef doesn't take ownership of aTzRules |
377 } |
378 } |
378 |
379 |
379 void CCalEntryImpl::SetTzRulesL() |
380 void CCalEntryImpl::SetTzRulesL() |
380 { |
381 { |
381 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
382 User::Leave(KErrNotSupported)); |
|
383 LoadFullEntryL(); |
382 LoadFullEntryL(); |
384 |
383 |
385 if (TimeMode() == MAgnCalendarTimeMode::EFloating) |
384 if (TimeMode() == MAgnCalendarTimeMode::EFloating) |
386 { |
385 { |
387 User::Leave(KErrArgument); |
386 User::Leave(KErrArgument); |
395 rptDef->SetTimeZoneL(); |
394 rptDef->SetTimeZoneL(); |
396 } |
395 } |
397 |
396 |
398 void CCalEntryImpl::SetRDatesL(const RArray<TCalTime>& aRDates) |
397 void CCalEntryImpl::SetRDatesL(const RArray<TCalTime>& aRDates) |
399 { |
398 { |
400 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
401 User::Leave(KErrNotSupported)); |
|
402 LoadFullEntryL(); |
399 LoadFullEntryL(); |
403 SetDatesL(ETrue, aRDates); |
400 SetDatesL(ETrue, aRDates); |
404 } |
401 } |
405 |
402 |
406 void CCalEntryImpl::SetExceptionDatesL(const RArray<TCalTime>& aExDates) |
403 void CCalEntryImpl::SetExceptionDatesL(const RArray<TCalTime>& aExDates) |
407 { |
404 { |
408 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
409 User::Leave(KErrNotSupported)); |
|
410 LoadFullEntryL(); |
405 LoadFullEntryL(); |
411 |
406 |
412 if (iFullEntry->RptDef() == NULL) |
407 if (iFullEntry->RptDef() == NULL) |
413 { |
408 { |
414 User::Leave(KErrNotFound); |
409 User::Leave(KErrNotFound); |
574 return *iCalCategoryList; |
569 return *iCalCategoryList; |
575 } |
570 } |
576 |
571 |
577 void CCalEntryImpl::AddCategoryL(CCalCategory* aCategory) |
572 void CCalEntryImpl::AddCategoryL(CCalCategory* aCategory) |
578 { |
573 { |
579 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
580 User::Leave(KErrNotSupported)); |
|
581 |
|
582 CleanupStack::PushL(aCategory); |
574 CleanupStack::PushL(aCategory); |
583 __ASSERT_ALWAYS(aCategory != NULL, User::Leave(KErrArgument)); |
575 __ASSERT_ALWAYS(aCategory != NULL, User::Leave(KErrArgument)); |
584 |
576 |
585 PopulateCategoryListL(); |
577 PopulateCategoryListL(); |
586 |
578 |
603 aCategory->Impl()->SetOwnAgnCategory(EFalse); |
595 aCategory->Impl()->SetOwnAgnCategory(EFalse); |
604 } |
596 } |
605 |
597 |
606 void CCalEntryImpl::DeleteCategoryL(TInt aIndex) |
598 void CCalEntryImpl::DeleteCategoryL(TInt aIndex) |
607 { |
599 { |
608 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
609 User::Leave(KErrNotSupported)); |
|
610 LoadFullEntryL(); |
600 LoadFullEntryL(); |
611 |
601 |
612 if (aIndex < 0 || aIndex >= iFullEntry->CategoryCount()) |
602 if (aIndex < 0 || aIndex >= iFullEntry->CategoryCount()) |
613 { |
603 { |
614 User::Leave(KErrArgument); |
604 User::Leave(KErrArgument); |
849 iFullEntry->SetCollectionId(collectionId); |
839 iFullEntry->SetCollectionId(collectionId); |
850 } |
840 } |
851 |
841 |
852 void CCalEntryImpl::SetAlarmL(CCalAlarm* aAlarm) |
842 void CCalEntryImpl::SetAlarmL(CCalAlarm* aAlarm) |
853 { |
843 { |
854 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
855 User::Leave(KErrNotSupported)); |
|
856 |
|
857 LoadFullEntryL(); |
844 LoadFullEntryL(); |
858 |
845 |
859 if ( aAlarm == NULL ) |
846 if ( aAlarm == NULL ) |
860 { |
847 { |
861 // if aAlarm is NULL, clear the alarm data |
848 // if aAlarm is NULL, clear the alarm data |
960 } |
947 } |
961 } |
948 } |
962 |
949 |
963 void CCalEntryImpl::SetRRuleL(const TCalRRule& aRpt) |
950 void CCalEntryImpl::SetRRuleL(const TCalRRule& aRpt) |
964 { |
951 { |
965 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
966 User::Leave(KErrNotSupported)); |
|
967 |
|
968 if (aRpt.Until().TimeLocalL() != Time::NullTTime() && aRpt.DtStart().TimeLocalL() >= aRpt.Until().TimeLocalL()) |
952 if (aRpt.Until().TimeLocalL() != Time::NullTTime() && aRpt.DtStart().TimeLocalL() >= aRpt.Until().TimeLocalL()) |
969 { |
953 { |
970 // if Until time is set to earlier than the start time and is non-NULL, leave |
954 // if Until time is set to earlier than the start time and is non-NULL, leave |
971 User::Leave(KErrArgument); |
955 User::Leave(KErrArgument); |
972 } |
956 } |
1231 return dTStampTime; |
1215 return dTStampTime; |
1232 } |
1216 } |
1233 |
1217 |
1234 void CCalEntryImpl::SetLocationL(const TDesC& aLocation) |
1218 void CCalEntryImpl::SetLocationL(const TDesC& aLocation) |
1235 { |
1219 { |
1236 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
1237 User::Leave(KErrNotSupported)); |
|
1238 LoadFullEntryL(); |
1220 LoadFullEntryL(); |
1239 iFullEntry->SetLocationL(aLocation); |
1221 iFullEntry->SetLocationL(aLocation); |
1240 } |
1222 } |
1241 |
1223 |
1242 const TDesC& CCalEntryImpl::LocationL() |
1224 const TDesC& CCalEntryImpl::LocationL() |
1245 return iFullEntry->Location(); |
1227 return iFullEntry->Location(); |
1246 } |
1228 } |
1247 |
1229 |
1248 void CCalEntryImpl::SetPriorityL(TUint aPriority) |
1230 void CCalEntryImpl::SetPriorityL(TUint aPriority) |
1249 { |
1231 { |
1250 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
1251 User::Leave(KErrNotSupported)); |
|
1252 LoadFullEntryL(); |
1232 LoadFullEntryL(); |
1253 iFullEntry->SetPriority(aPriority); |
1233 iFullEntry->SetPriority(aPriority); |
1254 } |
1234 } |
1255 |
1235 |
1256 TUint CCalEntryImpl::PriorityL() |
1236 TUint CCalEntryImpl::PriorityL() |
1273 return calEndTime; |
1253 return calEndTime; |
1274 } |
1254 } |
1275 |
1255 |
1276 void CCalEntryImpl::SetStartAndEndTimeL(const TCalTime& aStartTime, const TCalTime& aEndTime) |
1256 void CCalEntryImpl::SetStartAndEndTimeL(const TCalTime& aStartTime, const TCalTime& aEndTime) |
1277 { |
1257 { |
1278 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
1279 User::Leave(KErrNotSupported)); |
|
1280 LoadFullEntryL(); |
1258 LoadFullEntryL(); |
1281 TCalTime::TTimeMode mode = aStartTime.TimeMode(); |
1259 TCalTime::TTimeMode mode = aStartTime.TimeMode(); |
1282 if (aEndTime.TimeUtcL() != Time::NullTTime()) |
1260 if (aEndTime.TimeUtcL() != Time::NullTTime()) |
1283 { |
1261 { |
1284 if (aStartTime.TimeUtcL() != Time::NullTTime()) |
1262 if (aStartTime.TimeUtcL() != Time::NullTTime()) |
1377 } |
1355 } |
1378 } |
1356 } |
1379 |
1357 |
1380 void CCalEntryImpl::SetSummaryL(const TDesC& aSummary) |
1358 void CCalEntryImpl::SetSummaryL(const TDesC& aSummary) |
1381 { |
1359 { |
1382 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
1383 User::Leave(KErrNotSupported)); |
|
1384 LoadFullEntryL(); |
1360 LoadFullEntryL(); |
1385 HBufC* summ = aSummary.AllocL(); |
1361 HBufC* summ = aSummary.AllocL(); |
1386 iFullEntry->SetSummary(summ); // takes ownership of aSummary |
1362 iFullEntry->SetSummary(summ); // takes ownership of aSummary |
1387 } |
1363 } |
1388 |
1364 |
1463 iFullEntry->SetStatus(aStatus); |
1439 iFullEntry->SetStatus(aStatus); |
1464 } |
1440 } |
1465 |
1441 |
1466 void CCalEntryImpl::SetReplicationStatusL(CCalEntry::TReplicationStatus aReplicationStatus) |
1442 void CCalEntryImpl::SetReplicationStatusL(CCalEntry::TReplicationStatus aReplicationStatus) |
1467 { |
1443 { |
1468 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
1469 User::Leave(KErrNotSupported)); |
|
1470 LoadFullEntryL(); |
1444 LoadFullEntryL(); |
1471 iFullEntry->SetReplicationStatusL(aReplicationStatus); |
1445 iFullEntry->SetReplicationStatusL(aReplicationStatus); |
1472 } |
1446 } |
1473 |
1447 |
1474 CCalEntry::TReplicationStatus CCalEntryImpl::ReplicationStatusL() |
1448 CCalEntry::TReplicationStatus CCalEntryImpl::ReplicationStatusL() |
1496 |
1470 |
1497 void CCalEntryImpl::SetLastModifiedDateL(const TCalTime& aModifiedTime) |
1471 void CCalEntryImpl::SetLastModifiedDateL(const TCalTime& aModifiedTime) |
1498 { |
1472 { |
1499 LoadFullEntryL(); |
1473 LoadFullEntryL(); |
1500 iFullEntry->SetLastModifiedDateUtc(aModifiedTime.TimeUtcL()); |
1474 iFullEntry->SetLastModifiedDateUtc(aModifiedTime.TimeUtcL()); |
1501 |
1475 } |
1502 // for entry type ENote,set the modified time as the start/end time |
1476 |
1503 if(EntryTypeL() == CCalEntry::ENote) |
|
1504 { |
|
1505 TAgnCalendarTime agnModifiedTime = |
|
1506 CalUtils::TCalTimeToTAgnCalendarTimeL(aModifiedTime); |
|
1507 iFullEntry->SetStartAndEndTimeL(agnModifiedTime, agnModifiedTime); |
|
1508 } |
|
1509 } |
|
1510 |
|
1511 void CCalEntryImpl::SetDTStampL(const TCalTime& aDTStampTime) |
1477 void CCalEntryImpl::SetDTStampL(const TCalTime& aDTStampTime) |
1512 { |
1478 { |
1513 LoadFullEntryL(); |
1479 LoadFullEntryL(); |
1514 iFullEntry->SetDTStampUtcL(aDTStampTime.TimeUtcL()); |
1480 iFullEntry->SetDTStampUtcL(aDTStampTime.TimeUtcL()); |
1515 } |
1481 } |
1544 return iLiteEntry->LiteEntry().CollectionId(); |
1510 return iLiteEntry->LiteEntry().CollectionId(); |
1545 } |
1511 } |
1546 else |
1512 else |
1547 { |
1513 { |
1548 return iFullEntry->CollectionId(); |
1514 return iFullEntry->CollectionId(); |
1549 } |
1515 } |
1550 } |
1516 } |
1551 |
1517 |
1552 CCalEntry::TTransp CCalEntryImpl::BusyStatusL() |
1518 CCalEntry::TTransp CCalEntryImpl::BusyStatusL() |
1553 { |
1519 { |
1554 LoadFullEntryL(); |
1520 LoadFullEntryL(); |
1555 return iFullEntry->BusyStatus(); |
1521 return iFullEntry->BusyStatus(); |
1556 } |
1522 } |
1557 |
1523 |
1558 void CCalEntryImpl::SetBusyStatusL(CCalEntry::TTransp aBusyStatus) |
1524 void CCalEntryImpl::SetBusyStatusL(CCalEntry::TTransp aBusyStatus) |
1559 { |
1525 { |
1560 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
1561 User::Leave(KErrNotSupported)); |
|
1562 LoadFullEntryL(); |
1526 LoadFullEntryL(); |
1563 iFullEntry->SetBusyStatusL(aBusyStatus); |
1527 iFullEntry->SetBusyStatusL(aBusyStatus); |
1564 } |
1528 } |
1565 |
1529 |
1566 CCalGeoValue* CCalEntryImpl::GeoValueL() |
1530 CCalGeoValue* CCalEntryImpl::GeoValueL() |
1575 CleanupStack::PushL(geoValue); |
1539 CleanupStack::PushL(geoValue); |
1576 geoValue->SetLatLongL(geoLatitude,geoLongitude); |
1540 geoValue->SetLatLongL(geoLatitude,geoLongitude); |
1577 CleanupStack::Pop(geoValue); |
1541 CleanupStack::Pop(geoValue); |
1578 return geoValue; |
1542 return geoValue; |
1579 } |
1543 } |
1580 return NULL; |
1544 return NULL; |
1581 } |
1545 } |
1582 |
1546 |
1583 void CCalEntryImpl::SetGeoValueL(const CCalGeoValue& aGeoValue) |
1547 void CCalEntryImpl::SetGeoValueL(const CCalGeoValue& aGeoValue) |
1584 { |
1548 { |
1585 __ASSERT_ALWAYS( EntryTypeL() != CCalEntry::ENote, |
|
1586 User::Leave(KErrNotSupported)); |
|
1587 |
|
1588 LoadFullEntryL(); |
1549 LoadFullEntryL(); |
1589 TReal geoLatitude; |
1550 TReal geoLatitude; |
1590 TReal geoLongitude; |
1551 TReal geoLongitude; |
1591 aGeoValue.GetLatLong(geoLatitude,geoLongitude); |
1552 aGeoValue.GetLatLong(geoLatitude,geoLongitude); |
1592 iFullEntry->SetGeoValueL(geoLatitude,geoLongitude); |
1553 iFullEntry->SetGeoValueL(geoLatitude,geoLongitude); |
1705 } |
1666 } |
1706 return iFullEntry; |
1667 return iFullEntry; |
1707 } |
1668 } |
1708 |
1669 |
1709 void CCalEntryImpl::SetUserIntL( TUint32 aUserInt ) |
1670 void CCalEntryImpl::SetUserIntL( TUint32 aUserInt ) |
1710 { |
1671 { |
1711 SimpleEntry()->SetUserInt(aUserInt); |
1672 SimpleEntry()->SetUserInt(aUserInt); |
1712 } |
1673 } |
1713 |
1674 |
1714 TUint32 CCalEntryImpl::UserIntL() |
1675 TUint32 CCalEntryImpl::UserIntL() |
1715 { |
1676 { |
1716 return SimpleEntry()->UserInt(); |
1677 return SimpleEntry()->UserInt(); |
1717 } |
1678 } |
1718 |
1679 |
|
1680 void CCalEntryImpl::SetUserInt32L( TUint32 aUserInt ) |
|
1681 { |
|
1682 iFullEntry->SetUserDataInt( aUserInt ); |
|
1683 } |
|
1684 |
|
1685 TUint32 CCalEntryImpl::UserInt32L() |
|
1686 { |
|
1687 return iFullEntry->UserDataInt(); |
|
1688 } |
1719 |
1689 |
1720 // CCalEntryIdImpl // |
1690 // CCalEntryIdImpl // |
1721 |
1691 |
1722 CCalEntryIdImpl* CCalEntryIdImpl::NewL(TDesC8* aFlatData) |
1692 CCalEntryIdImpl* CCalEntryIdImpl::NewL(TDesC8* aFlatData) |
1723 { |
1693 { |