X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2Fcdo%2FContactDataObject-Save.cpp;h=8a04c55c4434fe18ca3eef7a2b9ce823d9b15a0c;hb=53225dcec7940087f46e777fb9a3cc2a4d5bb341;hp=3ee868c3e15db448a98e29c02998d1515333365f;hpb=32778e9d9c1a7659a1fa29432f63902db4e3a9aa;p=xestiaab%2F.git diff --git a/source/contacteditor/cdo/ContactDataObject-Save.cpp b/source/contacteditor/cdo/ContactDataObject-Save.cpp index 3ee868c..8a04c55 100644 --- a/source/contacteditor/cdo/ContactDataObject-Save.cpp +++ b/source/contacteditor/cdo/ContactDataObject-Save.cpp @@ -526,7 +526,106 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ &BusinessRoleListAltID, &BusinessRoleListPID, &BusinessRoleListType, &BusinessRoleListPref, &BusinessRoleListTokens, SaveData, "work"); + + // Process ORG. + + SaveOrganisation(&GeneralOrganisationsList, &GeneralOrganisationsListAltID, + &GeneralOrganisationsListPID, &GeneralOrganisationsListLanguage, + &GeneralOrganisationsListSortAs, &GeneralOrganisationsListType, + &GeneralOrganisationsListPref, &GeneralOrganisationsListTokens, + SaveData, ""); + SaveOrganisation(&HomeOrganisationsList, &HomeOrganisationsListAltID, + &HomeOrganisationsListPID, &HomeOrganisationsListLanguage, + &HomeOrganisationsListSortAs, &HomeOrganisationsListType, + &HomeOrganisationsListPref, &HomeOrganisationsListTokens, + SaveData, "home"); + SaveOrganisation(&BusinessOrganisationsList, &BusinessOrganisationsListAltID, + &BusinessOrganisationsListPID, &BusinessOrganisationsListLanguage, + &BusinessOrganisationsListSortAs, &BusinessOrganisationsListType, + &BusinessOrganisationsListPref, &BusinessOrganisationsListTokens, + SaveData, "work"); + + // Process NOTE. + + SaveNote(&GeneralNoteList, &GeneralNoteListLanguage, + &GeneralNoteListAltID, &GeneralNoteListPID, + &GeneralNoteListType, &GeneralNoteListPref, + &GeneralNoteListTokens, SaveData, ""); + SaveNote(&HomeNoteList, &HomeNoteListLanguage, + &HomeNoteListAltID, &HomeNoteListPID, + &HomeNoteListType, &HomeNoteListPref, + &HomeNoteListTokens, SaveData, "home"); + SaveNote(&BusinessNoteList, &BusinessNoteListLanguage, + &BusinessNoteListAltID, &BusinessNoteListPID, + &BusinessNoteListType, &BusinessNoteListPref, + &BusinessNoteListTokens, SaveData, "work"); + + // Process CATEGORIES. + + SaveCategory(&CategoriesList, &CategoriesListLanguage, + &CategoriesListAltID, &CategoriesListPID, + &CategoriesListType, &CategoriesListPref, + &CategoriesListTokens, SaveData); + + // Process PHOTO. + + SavePhoto(&PicturesList, &PicturesListAltID, + &PicturesListPID, &PicturesListType, + &PicturesListPicEncType, &PicturesListPictureType, + &PicturesListMediatype, &PicturesListPref, + &PicturesListTokens, SaveData); + + // Process LOGO. + + SaveLogo(&LogosList, &LogosListAltID, + &LogosListPID, &LogosListType, + &LogosListPicEncType, &LogosListPictureType, + &LogosListMediatype, &LogosListPref, + &LogosListTokens, SaveData); + + // Process SOUND. + + SaveSound(&SoundsList, &SoundsListAltID, + &SoundsListPID, &SoundsListType, + &SoundsListAudioEncType, &SoundsListAudioType, + &SoundsListMediatype, &SoundsListLanguage, + &SoundsListPref, &SoundsListTokens, + SaveData); + + // Process CALURI. + + SaveCalendarURI(&CalendarList, &CalendarListMediatype, + &CalendarListAltID, &CalendarListPID, + &CalendarListType, &CalendarListPref, + &CalendarListTokens, SaveData); + // Process CALADRURI. + + SaveCalendarRequestURI(&CalendarRequestList, &CalendarRequestListMediatype, + &CalendarRequestListAltID, &CalendarRequestListPID, + &CalendarRequestListType, &CalendarRequestListPref, + &CalendarRequestListTokens, SaveData); + + // Process FBURL. + + SaveFreeBusyURI(&FreeBusyList, &FreeBusyListAltID, + &FreeBusyListPID, &FreeBusyListType, + &FreeBusyListMediatype, &FreeBusyListPref, + &FreeBusyListTokens, SaveData); + + // Process KEY. + + SaveKey(&KeyList, &KeyListAltID, + &KeyListPID, &KeyListType, + &KeyListKeyType, &KeyListDataEncType, + &KeyListDataType, &KeyListPref, + &KeyListTokens, SaveData); + + // Process VND-* + + SaveVendor(&VendorList, &VendorListPEN, + &VendorListElement, SaveData); + // Write the end part of the vCard data file. SaveData->Append("END:VCARD"); @@ -1366,4 +1465,852 @@ void ContactDataObject::SaveRole(map *RoleList, map *OrganisationList, map *OrganisationListAltID, + map *OrganisationListPID, map *OrganisationListLanguage, + map *OrganisationListSortAs, map *OrganisationListType, + map *OrganisationListPref, map *OrganisationListTokens, + wxString *SaveData, wxString DataType){ + + wxString ProcessData = ""; + + for (std::map::iterator OrganisationIter = OrganisationList->begin(); + OrganisationIter != OrganisationList->end(); OrganisationIter++){ + + ProcessData.Append("ORG"); + + // Check if there is a value for TYPE. + + if (DataType.size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append(DataType); + + } + + // Check if there is a value for ALTID. + + if ((*OrganisationListAltID)[OrganisationIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*OrganisationListAltID)[OrganisationIter->first]); + + } + + // Check if there is a value for LANGUAGE. + + if ((*OrganisationListLanguage)[OrganisationIter->first].size() > 0){ + + ProcessData.Append(";LANGUAGE="); + ProcessData.Append((*OrganisationListLanguage)[OrganisationIter->first]); + + } + + // Check if there is a value for PID. + + if ((*OrganisationListPID)[OrganisationIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*OrganisationListPID)[OrganisationIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*OrganisationListPref)[OrganisationIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*OrganisationListPref)[OrganisationIter->first])); + + } + + // Check if there is a value for SORT-AS. + + if ((*OrganisationListSortAs)[OrganisationIter->first].size() > 0){ + + ProcessData.Append(";SORT-AS=\""); + ProcessData.Append((*OrganisationListSortAs)[OrganisationIter->first]); + ProcessData.Append("\""); + + } + + // Check if there is a value for tokens. + + if ((*OrganisationListTokens)[OrganisationIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*OrganisationListTokens)[OrganisationIter->first]); + + } + + ProcessData.Append(":"); + ProcessData.Append(OrganisationIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveNote(map *NoteList, map *NoteListLanguage, + map *NoteListAltID, map *NoteListPID, + map *NoteListType, map *NoteListPref, + map *NoteListTokens, wxString *SaveData, wxString DataType){ + + wxString ProcessData = ""; + + for (std::map::iterator NoteIter = NoteList->begin(); + NoteIter != NoteList->end(); NoteIter++){ + + ProcessData.Append("NOTE"); + + // Check if there is a value for TYPE. + + if (DataType.size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append(DataType); + + } + + // Check if there is a value for ALTID. + + if ((*NoteListAltID)[NoteIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*NoteListAltID)[NoteIter->first]); + + } + + // Check if there is a value for LANGUAGE. + + if ((*NoteListLanguage)[NoteIter->first].size() > 0){ + + ProcessData.Append(";LANGUAGE="); + ProcessData.Append((*NoteListLanguage)[NoteIter->first]); + + } + + // Check if there is a value for PID. + + if ((*NoteListPID)[NoteIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*NoteListPID)[NoteIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*NoteListPref)[NoteIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*NoteListPref)[NoteIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*NoteListTokens)[NoteIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*NoteListTokens)[NoteIter->first]); + + } + + ProcessData.Append(":"); + ProcessData.Append(NoteIter->second); + ProcessData.Replace("\n", "\\n", true); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveCategory(map *CategoryList, map *CategoryListLanguage, + map *CategoryListAltID, map *CategoryListPID, + map *CategoryListType, map *CategoryListPref, + map *CategoryListTokens, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator CategoryIter = CategoryList->begin(); + CategoryIter != CategoryList->end(); CategoryIter++){ + + ProcessData.Append("CATEGORIES"); + + // Check if there is a value for TYPE. + + if ((*CategoryListType)[CategoryIter->first].size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append((*CategoryListType)[CategoryIter->first]); + + } + + // Check if there is a value for ALTID. + + if ((*CategoryListAltID)[CategoryIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*CategoryListAltID)[CategoryIter->first]); + + } + + // Check if there is a value for LANGUAGE. + + if ((*CategoryListLanguage)[CategoryIter->first].size() > 0){ + + ProcessData.Append(";LANGUAGE="); + ProcessData.Append((*CategoryListLanguage)[CategoryIter->first]); + + } + + // Check if there is a value for PID. + + if ((*CategoryListPID)[CategoryIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*CategoryListPID)[CategoryIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*CategoryListPref)[CategoryIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*CategoryListPref)[CategoryIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*CategoryListTokens)[CategoryIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*CategoryListTokens)[CategoryIter->first]); + + } + + ProcessData.Append(":"); + ProcessData.Append(CategoryIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SavePhoto(map *PicturesList, map *PicturesListAltID, + map *PicturesListPID, map *PicturesListType, + map *PicturesListPicEncType, map *PicturesListPictureType, + map *PicturesListMediatype, map *PicturesListPref, + map *PicturesListTokens, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator PicturesIter = PicturesList->begin(); + PicturesIter != PicturesList->end(); PicturesIter++){ + + ProcessData.Append("PHOTO"); + + // Check if there is a value for TYPE. + + if ((*PicturesListType)[PicturesIter->first].size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append((*PicturesListType)[PicturesIter->first]); + + } + + // Check if there is a value for ALTID. + + if ((*PicturesListAltID)[PicturesIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*PicturesListAltID)[PicturesIter->first]); + + } + + // Check if there is a value for MEDIATYPE.. + + if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){ + + ProcessData.Append(";MEDIATYPE="); + ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]); + + } + + // Check if there is a value for PID. + + if ((*PicturesListPID)[PicturesIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*PicturesListPID)[PicturesIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*PicturesListPref)[PicturesIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*PicturesListTokens)[PicturesIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*PicturesListTokens)[PicturesIter->first]); + + } + + ProcessData.Append(":data:"); + ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]); + ProcessData.Append(";"); + ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]); + ProcessData.Append(","); + ProcessData.Append(PicturesIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveLogo(map *LogosList, map *LogosListAltID, + map *LogosListPID, map *LogosListType, + map *LogosListPicEncType, map *LogosListPictureType, + map *LogosListMediatype, map *LogosListPref, + map *LogosListTokens, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator LogosIter = LogosList->begin(); + LogosIter != LogosList->end(); LogosIter++){ + + ProcessData.Append("LOGO"); + + // Check if there is a value for TYPE. + + if ((*LogosListType)[LogosIter->first].size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append((*LogosListType)[LogosIter->first]); + + } + + // Check if there is a value for ALTID. + + if ((*LogosListAltID)[LogosIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*LogosListAltID)[LogosIter->first]); + + } + + // Check if there is a value for MEDIATYPE.. + + if ((*LogosListMediatype)[LogosIter->first].size() > 0){ + + ProcessData.Append(";MEDIATYPE="); + ProcessData.Append((*LogosListMediatype)[LogosIter->first]); + + } + + // Check if there is a value for PID. + + if ((*LogosListPID)[LogosIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*LogosListPID)[LogosIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*LogosListPref)[LogosIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*LogosListPref)[LogosIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*LogosListTokens)[LogosIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*LogosListTokens)[LogosIter->first]); + + } + + ProcessData.Append(":data:"); + ProcessData.Append((*LogosListPictureType)[LogosIter->first]); + ProcessData.Append(";"); + ProcessData.Append((*LogosListPicEncType)[LogosIter->first]); + ProcessData.Append(","); + ProcessData.Append(LogosIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveSound(map *SoundsList, map *SoundsListAltID, + map *SoundsListPID, map *SoundsListType, + map *SoundsListAudioEncType, map *SoundsListAudioType, + map *SoundsListMediatype, map *SoundsListLanguage, + map *SoundsListPref, map *SoundsListTokens, + wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator SoundsIter = SoundsList->begin(); + SoundsIter != SoundsList->end(); SoundsIter++){ + + ProcessData.Append("SOUND"); + + // Check if there is a value for TYPE. + + if ((*SoundsListType)[SoundsIter->first].size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append((*SoundsListType)[SoundsIter->first]); + + } + + // Check if there is a value for ALTID. + + if ((*SoundsListAltID)[SoundsIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*SoundsListAltID)[SoundsIter->first]); + + } + + // Check if there is a value for LANGUAGE. + + if ((*SoundsListLanguage)[SoundsIter->first].size() > 0){ + + ProcessData.Append(";LANGUAGE="); + ProcessData.Append((*SoundsListLanguage)[SoundsIter->first]); + + } + + // Check if there is a value for MEDIATYPE. + + if ((*SoundsListMediatype)[SoundsIter->first].size() > 0){ + + ProcessData.Append(";MEDIATYPE="); + ProcessData.Append((*SoundsListMediatype)[SoundsIter->first]); + + } + + // Check if there is a value for PID. + + if ((*SoundsListPID)[SoundsIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*SoundsListPID)[SoundsIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*SoundsListPref)[SoundsIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*SoundsListPref)[SoundsIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*SoundsListTokens)[SoundsIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*SoundsListTokens)[SoundsIter->first]); + + } + + ProcessData.Append(":data:"); + ProcessData.Append((*SoundsListAudioType)[SoundsIter->first]); + ProcessData.Append(";"); + ProcessData.Append((*SoundsListAudioEncType)[SoundsIter->first]); + ProcessData.Append(","); + ProcessData.Append(SoundsIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveCalendarURI(map *CalendarList, map *CalendarListMediatype, + map *CalendarListAltID, map *CalendarListPID, + map *CalendarListType, map *CalendarListPref, + map *CalendarListTokens, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator CalendarIter = CalendarList->begin(); + CalendarIter != CalendarList->end(); CalendarIter++){ + + ProcessData.Append("CALURI"); + + // Check if there is a value for TYPE. + + if ((*CalendarListType)[CalendarIter->first].size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append((*CalendarListType)[CalendarIter->first]); + + } + + // Check if there is a value for ALTID. + + if ((*CalendarListAltID)[CalendarIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*CalendarListAltID)[CalendarIter->first]); + + } + + // Check if there is a value for MEDIATYPE. + + if ((*CalendarListMediatype)[CalendarIter->first].size() > 0){ + + ProcessData.Append(";MEDIATYPE="); + ProcessData.Append((*CalendarListMediatype)[CalendarIter->first]); + + } + + // Check if there is a value for PID. + + if ((*CalendarListPID)[CalendarIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*CalendarListPID)[CalendarIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*CalendarListPref)[CalendarIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*CalendarListPref)[CalendarIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*CalendarListTokens)[CalendarIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*CalendarListTokens)[CalendarIter->first]); + + } + + ProcessData.Append(":"); + ProcessData.Append(CalendarIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveCalendarRequestURI(map *CalendarRequestList, map *CalendarRequestListMediatype, + map *CalendarRequestListAltID, map *CalendarRequestListPID, + map *CalendarRequestListType, map *CalendarRequestListPref, + map *CalendarRequestListTokens, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator CalendarRequestIter = CalendarRequestList->begin(); + CalendarRequestIter != CalendarRequestList->end(); CalendarRequestIter++){ + + ProcessData.Append("CALADRURI"); + + // Check if there is a value for TYPE. + + if ((*CalendarRequestListType)[CalendarRequestIter->first].size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append((*CalendarRequestListType)[CalendarRequestIter->first]); + + } + + // Check if there is a value for ALTID. + + if ((*CalendarRequestListAltID)[CalendarRequestIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*CalendarRequestListAltID)[CalendarRequestIter->first]); + + } + + // Check if there is a value for MEDIATYPE. + + if ((*CalendarRequestListMediatype)[CalendarRequestIter->first].size() > 0){ + + ProcessData.Append(";MEDIATYPE="); + ProcessData.Append((*CalendarRequestListMediatype)[CalendarRequestIter->first]); + + } + + // Check if there is a value for PID. + + if ((*CalendarRequestListPID)[CalendarRequestIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*CalendarRequestListPID)[CalendarRequestIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*CalendarRequestListPref)[CalendarRequestIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*CalendarRequestListPref)[CalendarRequestIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*CalendarRequestListTokens)[CalendarRequestIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*CalendarRequestListTokens)[CalendarRequestIter->first]); + + } + + ProcessData.Append(":"); + ProcessData.Append(CalendarRequestIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveFreeBusyURI(std::map *FreeBusyList, std::map *FreeBusyListAltID, + std::map *FreeBusyListPID, std::map *FreeBusyListType, + std::map *FreeBusyListMediatype, std::map *FreeBusyListPref, + std::map *FreeBusyListTokens, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator FreeBusyIter = FreeBusyList->begin(); + FreeBusyIter != FreeBusyList->end(); FreeBusyIter++){ + + ProcessData.Append("FBURL"); + + // Check if there is a value for TYPE. + + if ((*FreeBusyListType)[FreeBusyIter->first].size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append((*FreeBusyListType)[FreeBusyIter->first]); + + } + + // Check if there is a value for ALTID. + + if ((*FreeBusyListAltID)[FreeBusyIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*FreeBusyListAltID)[FreeBusyIter->first]); + + } + + // Check if there is a value for MEDIATYPE. + + if ((*FreeBusyListMediatype)[FreeBusyIter->first].size() > 0){ + + ProcessData.Append(";MEDIATYPE="); + ProcessData.Append((*FreeBusyListMediatype)[FreeBusyIter->first]); + + } + + // Check if there is a value for PID. + + if ((*FreeBusyListPID)[FreeBusyIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*FreeBusyListPID)[FreeBusyIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*FreeBusyListPref)[FreeBusyIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*FreeBusyListPref)[FreeBusyIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*FreeBusyListTokens)[FreeBusyIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*FreeBusyListTokens)[FreeBusyIter->first]); + + } + + ProcessData.Append(":"); + ProcessData.Append(FreeBusyIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveKey(map *KeyList, map *KeyListAltID, + map *KeyListPID, map *KeyListType, + map *KeyListKeyType, map *KeyListDataEncType, + map *KeyListDataType, map *KeyListPref, + map *KeyListTokens, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator KeyIter = KeyList->begin(); + KeyIter != KeyList->end(); KeyIter++){ + + ProcessData.Append("KEY"); + + // Check if there is a value for TYPE. + + if ((*KeyListType)[KeyIter->first].size() > 0){ + + ProcessData.Append(";TYPE="); + ProcessData.Append((*KeyListType)[KeyIter->first]); + + } + + // Check if there is a value for ALTID. + + if ((*KeyListAltID)[KeyIter->first].size() > 0){ + + ProcessData.Append(";ALTID="); + ProcessData.Append((*KeyListAltID)[KeyIter->first]); + + } + + // Check if there is a value for PID. + + if ((*KeyListPID)[KeyIter->first].size() > 0){ + + ProcessData.Append(";PID="); + ProcessData.Append((*KeyListPID)[KeyIter->first]); + + } + + // Check if there is a value for PREF. + + if ((*KeyListPref)[KeyIter->first] > 0){ + + ProcessData.Append(";PREF="); + ProcessData.Append(wxString::Format("%i", (*KeyListPref)[KeyIter->first])); + + } + + // Check if there is a value for tokens. + + if ((*KeyListTokens)[KeyIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append((*KeyListTokens)[KeyIter->first]); + + } + + ProcessData.Append(":data:"); + ProcessData.Append((*KeyListDataType)[KeyIter->first]); + ProcessData.Append(";"); + ProcessData.Append((*KeyListDataEncType)[KeyIter->first]); + ProcessData.Append(","); + ProcessData.Append(KeyIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + +} + +void ContactDataObject::SaveVendor(map *VendorList, map *VendorListPEN, + map *VendorListElement, wxString *SaveData){ + + wxString ProcessData = ""; + + for (std::map::iterator VendorIter = VendorList->begin(); + VendorIter != VendorList->end(); VendorIter++){ + + ProcessData.Append("VND-"); + ProcessData.Append((*VendorListPEN)[VendorIter->first]); + ProcessData.Append("-"); + ProcessData.Append((*VendorListElement)[VendorIter->first]); + ProcessData.Append(":"); + ProcessData.Append(VendorIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + } \ No newline at end of file