45 |
45 |
46 // Debug includes |
46 // Debug includes |
47 #include <VPbkDebug.h> |
47 #include <VPbkDebug.h> |
48 |
48 |
49 #include <centralrepository.h> |
49 #include <centralrepository.h> |
|
50 #include <MVPbkStoreContactProperties.h> |
50 |
51 |
51 // CONSTANTS |
52 // CONSTANTS |
52 const TInt KNsmlDsGeoField = 0x0000; // defined in DS cenrep |
53 const TInt KNsmlDsGeoField = 0x0000; // defined in DS cenrep |
53 const TUid KCRUidGeoFieldInternalKeys = { 0x20022EE1 }; // 0x20022EE1 defined in DS cenrep |
54 const TUid KCRUidGeoFieldInternalKeys = { 0x20022EE1 }; // 0x20022EE1 defined in DS cenrep |
54 |
55 |
55 _LIT8(KGEO, "GEO"); |
56 _LIT8(KGEO, "GEO"); |
|
57 _LIT8(KREV, "REV"); |
|
58 |
|
59 |
56 |
60 |
57 namespace |
61 namespace |
58 { |
62 { |
59 _LIT8(KPropEncoding, "ENCODING"); |
63 _LIT8(KPropEncoding, "ENCODING"); |
60 _LIT8(KPropBase64, "BASE64"); |
64 _LIT8(KPropBase64, "BASE64"); |
628 if(!iBeamed && err == KErrNone && !aRemainingSteps ) |
632 if(!iBeamed && err == KErrNone && !aRemainingSteps ) |
629 { |
633 { |
630 TRAP( err, HandleOwnCardL() ); |
634 TRAP( err, HandleOwnCardL() ); |
631 if(err == KErrNone ) |
635 if(err == KErrNone ) |
632 TRAP( err, HandleGroupCardL() ); |
636 TRAP( err, HandleGroupCardL() ); |
|
637 |
|
638 // Parse the REV (Revision) field if any |
|
639 if(err == KErrNone ) |
|
640 TRAP( err, AddRevL() ); |
633 } |
641 } |
634 return err; |
642 return err; |
635 } |
643 } |
636 |
644 |
637 // ---------------------------------------------------------------------------- |
645 // ---------------------------------------------------------------------------- |
718 { |
726 { |
719 Start(); |
727 Start(); |
720 } |
728 } |
721 } |
729 } |
722 |
730 |
|
731 void CVPbkVCardPropertyExporter::AddRevL() |
|
732 { |
|
733 MVPbkStoreContact* tempContact = const_cast<MVPbkStoreContact*>(iContact); |
|
734 if( tempContact ) |
|
735 { |
|
736 MVPbkStoreContact2* tempContact2 = reinterpret_cast<MVPbkStoreContact2*> |
|
737 (tempContact->StoreContactExtension (KMVPbkStoreContactExtension2Uid) ); |
|
738 if(tempContact2) |
|
739 { |
|
740 MVPbkStoreContactProperties* propreties = tempContact2->PropertiesL(); |
|
741 CleanupDeletePushL(propreties); |
|
742 |
|
743 // Convert the last_modified field defined in Contact Model database |
|
744 // to REV (Revision) field in vCard Specification 2.1 |
|
745 CParserPropertyValueDateTime* valueDateTime = |
|
746 CreateDateTimePropertyL( |
|
747 propreties->LastModifiedL(), |
|
748 TVersitDateTime::EIsUTC ); |
|
749 CleanupStack::PopAndDestroy(propreties); |
|
750 |
|
751 CleanupStack::PushL(valueDateTime); |
|
752 CParserProperty* property = |
|
753 CParserGroupedProperty::NewL(*valueDateTime, KREV, NULL, NULL); |
|
754 |
|
755 CleanupStack::PushL( property ); |
|
756 iParser->AddPropertyL(property); //takes ownership |
|
757 CleanupStack::Pop(2);//valueDateTime and property |
|
758 } |
|
759 } |
|
760 } |
|
761 |
|
762 CParserPropertyValueDateTime* CVPbkVCardPropertyExporter::CreateDateTimePropertyL |
|
763 (const TTime& aDateTime, TVersitDateTime::TRelativeTime aRelativeTime) |
|
764 { |
|
765 TVersitDateTime* dateTime= new(ELeave)TVersitDateTime(aDateTime.DateTime(), aRelativeTime); |
|
766 CleanupStack::PushL(dateTime); |
|
767 CParserPropertyValueDateTime* dateTimeValue=new(ELeave) CParserPropertyValueDateTime(dateTime); |
|
768 CleanupStack::Pop(dateTime); |
|
769 return dateTimeValue; |
|
770 } |
723 |
771 |
724 // End of file |
772 // End of file |