1 // ContactDataObject-Save.cpp - Client Data Object.
3 // (c) 2012-2016 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include "ContactDataObject.h"
20 #include "../../version.h"
22 ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
24 ContactSaveStatus SaveDataStatus = CONTACTSAVE_UNITTESTFAIL;
26 // Write the header for the vCard data file.
28 SaveData->Append("BEGIN:VCARD\n");
29 SaveData->Append("VERSION:4.0\n");
31 // Write the product ID.
35 SaveData->Append("PRODID:-//Xestia//Address Book Unit Testing//KW\n");
39 SaveData->Append(wxT("PRODID:-//Xestia//Address Book Version "));
40 SaveData->Append(wxT(XSDAB_VERSION));
41 SaveData->Append(wxT("//KW\n"));
45 wxString ProcessData = "";
49 if (UIDToken.size() > 0){
51 ProcessData.Append("UID:");
52 ProcessData.Append(UIDToken);
53 ProcessData.Append("\n");
54 SaveData->Append(ProcessData);
63 case CONTACTKIND_NONE:
65 case CONTACTKIND_INDIVIDUAL:
66 SaveData->Append("KIND:individual\n");
68 case CONTACTKIND_GROUP:
69 SaveData->Append("KIND:group\n");
71 case CONTACTKIND_ORGANISATION:
72 SaveData->Append("KIND:org\n");
74 case CONTACTKIND_LOCATION:
75 SaveData->Append("KIND:location\n");
84 wxDateTime DateTimeSave;
85 DateTimeSave = DateTimeSave.SetToCurrent();
86 wxString DateTimeSaveValue;
90 DateTimeSaveValue += "20160703T091000Z";
94 DateTimeSaveValue += wxString::Format("%04i", DateTimeSave.GetYear());
95 DateTimeSaveValue += wxString::Format("%02i", (DateTimeSave.GetMonth() + 1));
96 DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetDay());
97 DateTimeSaveValue += "T";
98 DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetHour());
99 DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetMinute());
100 DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetSecond());
101 DateTimeSaveValue += "Z";
105 if (!RevisionTokens.IsEmpty()){
107 ProcessData.Append("REV;");
108 ProcessData.Append(RevisionTokens);
109 ProcessData.Append(":");
110 ProcessData.Append(DateTimeSaveValue);
111 ProcessData.Append("\n");
113 ProcessData = OutputText(&ProcessData);
115 SaveData->Append(ProcessData);
120 ProcessData.Append("REV:");
121 ProcessData.Append(DateTimeSaveValue);
122 ProcessData.Append("\n");
124 ProcessData = OutputText(&ProcessData);
126 SaveData->Append(ProcessData);
133 for (std::map<int, wxString>::iterator XMLIter = XMLList.begin();
134 XMLIter != XMLList.end(); XMLIter++){
136 ProcessData.Append("XML");
138 if (XMLListAltID[XMLIter->first].size() > 0){
140 ProcessData.Append(";ALTID=");
141 ProcessData.Append(XMLListAltID[XMLIter->first]);
145 ProcessData.Append(":");
146 ProcessData.Append(XMLIter->second);
147 ProcessData.Append("\n");
149 ProcessData = OutputText(&ProcessData);
151 SaveData->Append(ProcessData);
158 SaveSource(&SourceList, &SourceListAltID,
159 &SourceListPID, &SourceListType,
160 &SourceListMediatype, &SourceListPref,
161 &SourceListTokens, SaveData);
163 // Process MEMBER (if contact kind is CONTACTKIND_GROUP).
165 if (ContactKind == CONTACTKIND_GROUP){
167 SaveMember(&GroupsList, &GroupsListAltID,
168 &GroupsListPID, &GroupsListType,
169 &GroupsListMediaType, &GroupsListPref,
170 &GroupsListTokens, SaveData);
174 // Process CLIENTPIDMAP.
176 for (std::map<int, wxString>::iterator CPIDIter = ClientPIDList.begin();
177 CPIDIter != ClientPIDList.end(); CPIDIter++){
179 ProcessData.Append("CLIENTPIDMAP");
181 if (ClientPIDListTokens[CPIDIter->first].size() > 0){
183 ProcessData.Append(";");
184 ProcessData.Append(ClientPIDListTokens[CPIDIter->first]);
188 ProcessData.Append(":");
189 ProcessData.Append(CPIDIter->second);
190 ProcessData.Append("\n");
192 ProcessData = OutputText(&ProcessData);
194 SaveData->Append(ProcessData);
201 for (std::map<int, wxString>::iterator FNIter = FullNamesList.begin();
202 FNIter != FullNamesList.end(); FNIter++){
204 ProcessData.Append("FN");
206 // Check if there is a value for TYPE.
208 if (FullNamesListType[FNIter->first].size() > 0){
210 ProcessData.Append(";TYPE=");
211 ProcessData.Append(FullNamesListType[FNIter->first]);
215 // Check if there is a value for LANGUAGE.
217 if (FullNamesListLanguage[FNIter->first].size() > 0){
219 ProcessData.Append(";LANGUAGE=");
220 ProcessData.Append(FullNamesListLanguage[FNIter->first]);
224 // Check if there is a value for ALTID.
226 if (FullNamesListAltID[FNIter->first].size() > 0){
228 ProcessData.Append(";ALTID=");
229 ProcessData.Append(FullNamesListAltID[FNIter->first]);
233 // Check if there is a value for PID.
235 if (FullNamesListPID[FNIter->first].size() > 0){
237 ProcessData.Append(";PID=");
238 ProcessData.Append(FullNamesListPID[FNIter->first]);
242 // Check if there is a value for PREF.
244 if (FullNamesListPref[FNIter->first] > 0){
246 ProcessData.Append(";PREF=");
247 ProcessData.Append(wxString::Format("%i", FullNamesListPref[FNIter->first]));
251 // Check if there is a value for tokens.
253 if (FullNamesListTokens[FNIter->first].size() > 0){
255 ProcessData.Append(";");
256 ProcessData.Append(FullNamesListTokens[FNIter->first]);
260 ProcessData.Append(":");
261 ProcessData.Append(FNIter->second);
262 ProcessData.Append("\n");
264 ProcessData = OutputText(&ProcessData);
266 SaveData->Append(ProcessData);
273 SaveNickname(&GeneralNicknamesList, &GeneralNicknamesListAltID,
274 &GeneralNicknamesListPID, &GeneralNicknamesListType,
275 &GeneralNicknamesListLanguage, &GeneralNicknamesListPref,
276 &GeneralNicknamesListTokens, SaveData, "");
277 SaveNickname(&HomeNicknamesList, &HomeNicknamesListAltID,
278 &HomeNicknamesListPID, &HomeNicknamesListType,
279 &HomeNicknamesListLanguage, &HomeNicknamesListPref,
280 &HomeNicknamesListTokens, SaveData, "home");
281 SaveNickname(&BusinessNicknamesList, &BusinessNicknamesListAltID,
282 &BusinessNicknamesListPID, &BusinessNicknamesListType,
283 &BusinessNicknamesListLanguage, &BusinessNicknamesListPref,
284 &BusinessNicknamesListTokens, SaveData, "work");
288 SaveTitle(&GeneralTitleList, &GeneralTitleListLanguage,
289 &GeneralTitleListAltID, &GeneralTitleListPID,
290 &GeneralTitleListType, &GeneralTitleListPref,
291 &GeneralTitleListTokens, SaveData, "");
292 SaveTitle(&HomeTitleList, &HomeTitleListLanguage,
293 &HomeTitleListAltID, &HomeTitleListPID,
294 &HomeTitleListType, &HomeTitleListPref,
295 &HomeTitleListTokens, SaveData, "home");
296 SaveTitle(&BusinessTitleList, &BusinessTitleListLanguage,
297 &BusinessTitleListAltID, &BusinessTitleListPID,
298 &BusinessTitleListType, &BusinessTitleListPref,
299 &BusinessTitleListTokens, SaveData, "work");
303 SaveTimezone(&GeneralTZList, &GeneralTZListAltID,
304 &GeneralTZListPID, &GeneralTZListType,
305 &GeneralTZListMediatype, &GeneralTZListPref,
306 &GeneralTZListTokens, SaveData, "");
307 SaveTimezone(&HomeTZList, &HomeTZListAltID,
308 &HomeTZListPID, &HomeTZListType,
309 &HomeTZListMediatype, &HomeTZListPref,
310 &HomeTZListTokens, SaveData, "home");
311 SaveTimezone(&BusinessTZList, &BusinessTZListAltID,
312 &BusinessTZListPID, &BusinessTZListType,
313 &BusinessTZListMediatype, &BusinessTZListPref,
314 &BusinessTZListTokens, SaveData, "work");
318 SaveAddress(&GeneralAddressList, &GeneralAddressListTown,
319 &GeneralAddressListCounty, &GeneralAddressListPostCode,
320 &GeneralAddressListCountry, &GeneralAddressListLabel,
321 &GeneralAddressListLang, &GeneralAddressListAltID,
322 &GeneralAddressListPID, &GeneralAddressListGeo,
323 &GeneralAddressListTimezone, &GeneralAddressListType,
324 &GeneralAddressListMediatype, &GeneralAddressListPref,
325 &GeneralAddressListTokens, SaveData, "");
326 SaveAddress(&HomeAddressList, &HomeAddressListTown,
327 &HomeAddressListCounty, &HomeAddressListPostCode,
328 &HomeAddressListCountry, &HomeAddressListLabel,
329 &HomeAddressListLang, &HomeAddressListAltID,
330 &HomeAddressListPID, &HomeAddressListGeo,
331 &HomeAddressListTimezone, &HomeAddressListType,
332 &HomeAddressListMediatype, &HomeAddressListPref,
333 &HomeAddressListTokens, SaveData, "home");
334 SaveAddress(&BusinessAddressList, &BusinessAddressListTown,
335 &BusinessAddressListCounty, &BusinessAddressListPostCode,
336 &BusinessAddressListCountry, &BusinessAddressListLabel,
337 &BusinessAddressListLang, &BusinessAddressListAltID,
338 &BusinessAddressListPID, &BusinessAddressListGeo,
339 &BusinessAddressListTimezone, &BusinessAddressListType,
340 &BusinessAddressListMediatype, &BusinessAddressListPref,
341 &BusinessAddressListTokens, SaveData, "work");
345 SaveEmail(&GeneralEmailList, &GeneralEmailListAltID,
346 &GeneralEmailListPID, &GeneralEmailListType,
347 &GeneralEmailListPref, &GeneralEmailListTokens,
349 SaveEmail(&HomeEmailList, &HomeEmailListAltID,
350 &HomeEmailListPID, &HomeEmailListType,
351 &HomeEmailListPref, &HomeEmailListTokens,
353 SaveEmail(&BusinessEmailList, &BusinessEmailListAltID,
354 &BusinessEmailListPID, &BusinessEmailListType,
355 &BusinessEmailListPref, &BusinessEmailListTokens,
360 SaveIMPP(&GeneralIMList, &GeneralIMListAltID,
361 &GeneralIMListPID, &GeneralIMListType,
362 &GeneralIMListTypeInfo, &GeneralIMListMediatype,
363 &GeneralIMListPref, &GeneralIMListTokens,
365 SaveIMPP(&HomeIMList, &HomeIMListAltID,
366 &HomeIMListPID, &HomeIMListType,
367 &HomeIMListTypeInfo, &HomeIMListMediatype,
368 &HomeIMListPref, &HomeIMListTokens,
370 SaveIMPP(&BusinessIMList, &BusinessIMListAltID,
371 &BusinessIMListPID, &BusinessIMListType,
372 &BusinessIMListTypeInfo, &BusinessIMListMediatype,
373 &BusinessIMListPref, &BusinessIMListTokens,
376 // TODO: Process TEL.
382 SaveLanguage(&GeneralLanguageList, &GeneralLanguageListAltID,
383 &GeneralLanguageListPID, &GeneralLanguageListType,
384 &GeneralLanguageListPref, &GeneralLanguageListTokens,
386 SaveLanguage(&HomeLanguageList, &HomeLanguageListAltID,
387 &HomeLanguageListPID, &HomeLanguageListType,
388 &HomeLanguageListPref, &HomeLanguageListTokens,
390 SaveLanguage(&BusinessLanguageList, &BusinessLanguageListAltID,
391 &BusinessLanguageListPID, &BusinessLanguageListType,
392 &BusinessLanguageListPref, &BusinessLanguageListTokens,
397 SaveGeoposition(&GeneralGeographyList, &GeneralGeographyListAltID,
398 &GeneralGeographyListPID, &GeneralGeographyListType,
399 &GeneralGeographyListMediatype, &GeneralGeographyListDataType,
400 &GeneralGeographyListPref, &GeneralGeographyListTokens,
402 SaveGeoposition(&HomeGeographyList, &HomeGeographyListAltID,
403 &HomeGeographyListPID, &HomeGeographyListType,
404 &HomeGeographyListMediatype, &HomeGeographyListDataType,
405 &HomeGeographyListPref, &HomeGeographyListTokens,
407 SaveGeoposition(&BusinessGeographyList, &BusinessGeographyListAltID,
408 &BusinessGeographyListPID, &BusinessGeographyListType,
409 &BusinessGeographyListMediatype, &BusinessGeographyListDataType,
410 &BusinessGeographyListPref, &BusinessGeographyListTokens,
417 for (std::map<int, wxString>::iterator RelatedIter = GeneralRelatedList.begin();
418 RelatedIter != GeneralRelatedList.end(); RelatedIter++){
420 ProcessData.Append("RELATED");
422 // Check if there is a value for TYPE.
424 if (GeneralRelatedListRelType[RelatedIter->first].size() > 0){
426 wxString RelatedType = "";
428 ProcessData.Append(";TYPE=");
430 if (GeneralRelatedListRelType[RelatedIter->first] == _("Contact")){
432 RelatedType = wxT("contact");
434 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Acquaintance")){
436 RelatedType = wxT("acquaintance");
438 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Friend")){
440 RelatedType = wxT("friend");
442 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Met")){
444 RelatedType = wxT("met");
446 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Co-worker")){
448 RelatedType = wxT("co-worker");
450 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Colleague")){
452 RelatedType = wxT("colleague");
454 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Co-resident")){
456 RelatedType = wxT("co-resident");
458 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Neighbour")){
460 RelatedType = wxT("neighbor");
462 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Child")){
464 RelatedType = wxT("child");
466 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Parent")){
468 RelatedType = wxT("parent");
470 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Sibling")){
472 RelatedType = wxT("sibling");
474 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Spouse")){
476 RelatedType = wxT("spouse");
478 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Kin")){
480 RelatedType = wxT("kin");
482 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Muse")){
484 RelatedType = wxT("muse");
486 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Crush")){
488 RelatedType = wxT("crush");
490 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Date")){
492 RelatedType = wxT("date");
494 } else if (GeneralRelatedListRelType[RelatedIter->first]== _("Sweetheart")){
496 RelatedType = wxT("sweetheart");
498 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Me")){
500 RelatedType = wxT("me");
502 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Agent")){
504 RelatedType = wxT("agent");
506 } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Emergency")){
508 RelatedType = wxT("emergency");
512 RelatedType = GeneralRelatedListRelType[RelatedIter->first];
516 ProcessData.Append(RelatedType);
520 // Check if there is a value for LANGUAGE.
522 if (GeneralRelatedListLanguage[RelatedIter->first].size() > 0){
524 ProcessData.Append(";LANGUAGE=");
525 ProcessData.Append(GeneralRelatedListLanguage[RelatedIter->first]);
529 // Check if there is a value for ALTID.
531 if (GeneralRelatedListAltID[RelatedIter->first].size() > 0){
533 ProcessData.Append(";ALTID=");
534 ProcessData.Append(GeneralRelatedListAltID[RelatedIter->first]);
538 // Check if there is a value for PID.
540 if (GeneralRelatedListPID[RelatedIter->first].size() > 0){
542 ProcessData.Append(";PID=");
543 ProcessData.Append(GeneralRelatedListPID[RelatedIter->first]);
547 // Check if there is a value for PREF.
549 if (GeneralRelatedListPref[RelatedIter->first] > 0){
551 ProcessData.Append(";PREF=");
552 ProcessData.Append(wxString::Format("%i", GeneralRelatedListPref[RelatedIter->first]));
556 // Check if there is a value for tokens.
558 if (GeneralRelatedListTokens[RelatedIter->first].size() > 0){
560 ProcessData.Append(";");
561 ProcessData.Append(GeneralRelatedListTokens[RelatedIter->first]);
565 ProcessData.Append(":");
566 ProcessData.Append(RelatedIter->second);
567 ProcessData.Append("\n");
569 ProcessData = OutputText(&ProcessData);
571 SaveData->Append(ProcessData);
578 SaveURL(&GeneralWebsiteList, &GeneralWebsiteListAltID,
579 &GeneralWebsiteListPID, &GeneralWebsiteListType,
580 &GeneralWebsiteListMediatype, &GeneralWebsiteListPref,
581 &GeneralWebsiteListTokens, SaveData, "");
582 SaveURL(&HomeWebsiteList, &HomeWebsiteListAltID,
583 &HomeWebsiteListPID, &HomeWebsiteListType,
584 &HomeWebsiteListMediatype, &HomeWebsiteListPref,
585 &HomeWebsiteListTokens, SaveData, "home");
586 SaveURL(&BusinessWebsiteList, &BusinessWebsiteListAltID,
587 &BusinessWebsiteListPID, &BusinessWebsiteListType,
588 &BusinessWebsiteListMediatype, &BusinessWebsiteListPref,
589 &BusinessWebsiteListTokens, SaveData, "work");
593 SaveRole(&GeneralRoleList, &GeneralRoleListLanguage,
594 &GeneralRoleListAltID, &GeneralRoleListPID,
595 &GeneralRoleListType, &GeneralRoleListPref,
596 &GeneralRoleListTokens, SaveData, "");
597 SaveRole(&HomeRoleList, &HomeRoleListLanguage,
598 &HomeRoleListAltID, &HomeRoleListPID,
599 &HomeRoleListType, &HomeRoleListPref,
600 &HomeRoleListTokens, SaveData, "home");
601 SaveRole(&BusinessRoleList, &BusinessRoleListLanguage,
602 &BusinessRoleListAltID, &BusinessRoleListPID,
603 &BusinessRoleListType, &BusinessRoleListPref,
604 &BusinessRoleListTokens, SaveData, "work");
608 SaveOrganisation(&GeneralOrganisationsList, &GeneralOrganisationsListAltID,
609 &GeneralOrganisationsListPID, &GeneralOrganisationsListLanguage,
610 &GeneralOrganisationsListSortAs, &GeneralOrganisationsListType,
611 &GeneralOrganisationsListPref, &GeneralOrganisationsListTokens,
613 SaveOrganisation(&HomeOrganisationsList, &HomeOrganisationsListAltID,
614 &HomeOrganisationsListPID, &HomeOrganisationsListLanguage,
615 &HomeOrganisationsListSortAs, &HomeOrganisationsListType,
616 &HomeOrganisationsListPref, &HomeOrganisationsListTokens,
618 SaveOrganisation(&BusinessOrganisationsList, &BusinessOrganisationsListAltID,
619 &BusinessOrganisationsListPID, &BusinessOrganisationsListLanguage,
620 &BusinessOrganisationsListSortAs, &BusinessOrganisationsListType,
621 &BusinessOrganisationsListPref, &BusinessOrganisationsListTokens,
626 SaveNote(&GeneralNoteList, &GeneralNoteListLanguage,
627 &GeneralNoteListAltID, &GeneralNoteListPID,
628 &GeneralNoteListType, &GeneralNoteListPref,
629 &GeneralNoteListTokens, SaveData, "");
630 SaveNote(&HomeNoteList, &HomeNoteListLanguage,
631 &HomeNoteListAltID, &HomeNoteListPID,
632 &HomeNoteListType, &HomeNoteListPref,
633 &HomeNoteListTokens, SaveData, "home");
634 SaveNote(&BusinessNoteList, &BusinessNoteListLanguage,
635 &BusinessNoteListAltID, &BusinessNoteListPID,
636 &BusinessNoteListType, &BusinessNoteListPref,
637 &BusinessNoteListTokens, SaveData, "work");
639 // Process CATEGORIES.
641 SaveCategory(&CategoriesList, &CategoriesListLanguage,
642 &CategoriesListAltID, &CategoriesListPID,
643 &CategoriesListType, &CategoriesListPref,
644 &CategoriesListTokens, SaveData);
648 SavePhoto(&PicturesList, &PicturesListAltID,
649 &PicturesListPID, &PicturesListType,
650 &PicturesListPicEncType, &PicturesListPictureType,
651 &PicturesListMediatype, &PicturesListPref,
652 &PicturesListTokens, SaveData);
656 SaveLogo(&LogosList, &LogosListAltID,
657 &LogosListPID, &LogosListType,
658 &LogosListPicEncType, &LogosListPictureType,
659 &LogosListMediatype, &LogosListPref,
660 &LogosListTokens, SaveData);
664 SaveSound(&SoundsList, &SoundsListAltID,
665 &SoundsListPID, &SoundsListType,
666 &SoundsListAudioEncType, &SoundsListAudioType,
667 &SoundsListMediatype, &SoundsListLanguage,
668 &SoundsListPref, &SoundsListTokens,
673 SaveCalendarURI(&CalendarList, &CalendarListMediatype,
674 &CalendarListAltID, &CalendarListPID,
675 &CalendarListType, &CalendarListPref,
676 &CalendarListTokens, SaveData);
678 // Process CALADRURI.
680 SaveCalendarRequestURI(&CalendarRequestList, &CalendarRequestListMediatype,
681 &CalendarRequestListAltID, &CalendarRequestListPID,
682 &CalendarRequestListType, &CalendarRequestListPref,
683 &CalendarRequestListTokens, SaveData);
687 SaveFreeBusyURI(&FreeBusyList, &FreeBusyListAltID,
688 &FreeBusyListPID, &FreeBusyListType,
689 &FreeBusyListMediatype, &FreeBusyListPref,
690 &FreeBusyListTokens, SaveData);
694 SaveKey(&KeyList, &KeyListAltID,
695 &KeyListPID, &KeyListType,
696 &KeyListKeyType, &KeyListDataEncType,
697 &KeyListDataType, &KeyListPref,
698 &KeyListTokens, SaveData);
702 SaveVendor(&VendorList, &VendorListPEN,
703 &VendorListElement, SaveData);
707 SaveXToken(&XTokenList, &XTokenListTokens,
710 // Write the end part of the vCard data file.
712 SaveData->Append("END:VCARD");
714 SaveDataStatus = CONTACTSAVE_OK;
716 return SaveDataStatus;
720 void ContactDataObject::SaveTitle(map<int, wxString> *TitleList, map<int, wxString> *TitleListLanguage,
721 map<int, wxString> *TitleListAltID, map<int, wxString> *TitleListPID,
722 map<int, wxString> *TitleListType, map<int, int> *TitleListPref,
723 map<int, wxString> *TitleListTokens, wxString *SaveData, wxString DataType){
725 wxString ProcessData = "";
727 for (std::map<int, wxString>::iterator TitleIter = TitleList->begin();
728 TitleIter != TitleList->end(); TitleIter++){
730 ProcessData.Append("TITLE");
732 // Check if there is a value for TYPE.
734 if (DataType.size() > 0){
736 ProcessData.Append(";TYPE=");
737 ProcessData.Append(DataType);
741 // Check if there is a value for ALTID.
743 if ((*TitleListAltID)[TitleIter->first].size() > 0){
745 ProcessData.Append(";ALTID=");
746 ProcessData.Append((*TitleListAltID)[TitleIter->first]);
750 // Check if there is a value for LANGUAGE.
752 if ((*TitleListLanguage)[TitleIter->first].size() > 0){
754 ProcessData.Append(";LANGUAGE=");
755 ProcessData.Append((*TitleListLanguage)[TitleIter->first]);
759 // Check if there is a value for PID.
761 if ((*TitleListPID)[TitleIter->first].size() > 0){
763 ProcessData.Append(";PID=");
764 ProcessData.Append((*TitleListPID)[TitleIter->first]);
768 // Check if there is a value for PREF.
770 if ((*TitleListPref)[TitleIter->first] > 0){
772 ProcessData.Append(";PREF=");
773 ProcessData.Append(wxString::Format("%i", (*TitleListPref)[TitleIter->first]));
777 // Check if there is a value for tokens.
779 if ((*TitleListTokens)[TitleIter->first].size() > 0){
781 ProcessData.Append(";");
782 ProcessData.Append((*TitleListTokens)[TitleIter->first]);
786 ProcessData.Append(":");
787 ProcessData.Append(TitleIter->second);
788 ProcessData.Append("\n");
790 ProcessData = OutputText(&ProcessData);
792 SaveData->Append(ProcessData);
799 void ContactDataObject::SaveSource(map<int, wxString> *SourceList, map<int, wxString> *SourceListAltID,
800 map<int, wxString> *SourceListPID, map<int, wxString> *SourceListType,
801 map<int, wxString> *SourceListMediatype, map<int, int> *SourceListPref,
802 map<int, wxString> *SourceListTokens, wxString *SaveData){
804 wxString ProcessData = "";
806 for (std::map<int, wxString>::iterator SourceIter = SourceList->begin();
807 SourceIter != SourceList->end(); SourceIter++){
809 ProcessData.Append("SOURCE");
811 // Check if there is a value for TYPE.
813 if ((*SourceListType)[SourceIter->first].size() > 0){
815 ProcessData.Append(";TYPE=");
816 ProcessData.Append((*SourceListType)[SourceIter->first]);
820 // Check if there is a value for ALTID.
822 if ((*SourceListAltID)[SourceIter->first].size() > 0){
824 ProcessData.Append(";ALTID=");
825 ProcessData.Append((*SourceListAltID)[SourceIter->first]);
829 // Check if there is a value for MEDIATYPE.
831 if ((*SourceListMediatype)[SourceIter->first].size() > 0){
833 ProcessData.Append(";MEDIATYPE=");
834 ProcessData.Append((*SourceListMediatype)[SourceIter->first]);
838 // Check if there is a value for PID.
840 if ((*SourceListPID)[SourceIter->first].size() > 0){
842 ProcessData.Append(";PID=");
843 ProcessData.Append((*SourceListPID)[SourceIter->first]);
847 // Check if there is a value for PREF.
849 if ((*SourceListPref)[SourceIter->first] > 0){
851 ProcessData.Append(";PREF=");
852 ProcessData.Append(wxString::Format("%i", (*SourceListPref)[SourceIter->first]));
856 // Check if there is a value for tokens.
858 if ((*SourceListTokens)[SourceIter->first].size() > 0){
860 ProcessData.Append(";");
861 ProcessData.Append((*SourceListTokens)[SourceIter->first]);
865 ProcessData.Append(":");
866 ProcessData.Append(SourceIter->second);
867 ProcessData.Append("\n");
869 ProcessData = OutputText(&ProcessData);
871 SaveData->Append(ProcessData);
878 void ContactDataObject::SaveMember(std::map<int, wxString> *GroupsList, std::map<int, wxString> *GroupsListAltID,
879 std::map<int, wxString> *GroupsListPID, std::map<int, wxString> *GroupsListType,
880 std::map<int, wxString> *GroupsListMediaType, std::map<int, int> *GroupsListPref,
881 std::map<int, wxString> *GroupsListTokens, wxString *SaveData){
883 wxString ProcessData = "";
885 for (std::map<int, wxString>::iterator GroupsIter = GroupsList->begin();
886 GroupsIter != GroupsList->end(); GroupsIter++){
888 ProcessData.Append("MEMBER");
890 // Check if there is a value for TYPE.
892 if ((*GroupsListType)[GroupsIter->first].size() > 0){
894 ProcessData.Append(";TYPE=");
895 ProcessData.Append((*GroupsListType)[GroupsIter->first]);
899 // Check if there is a value for ALTID.
901 if ((*GroupsListAltID)[GroupsIter->first].size() > 0){
903 ProcessData.Append(";ALTID=");
904 ProcessData.Append((*GroupsListAltID)[GroupsIter->first]);
908 // Check if there is a value for MEDIATYPE.
910 if ((*GroupsListMediaType)[GroupsIter->first].size() > 0){
912 ProcessData.Append(";MEDIATYPE=");
913 ProcessData.Append((*GroupsListMediaType)[GroupsIter->first]);
917 // Check if there is a value for PID.
919 if ((*GroupsListPID)[GroupsIter->first].size() > 0){
921 ProcessData.Append(";PID=");
922 ProcessData.Append((*GroupsListPID)[GroupsIter->first]);
926 // Check if there is a value for PREF.
928 if ((*GroupsListPref)[GroupsIter->first] > 0){
930 ProcessData.Append(";PREF=");
931 ProcessData.Append(wxString::Format("%i", (*GroupsListPref)[GroupsIter->first]));
935 // Check if there is a value for tokens.
937 if ((*GroupsListTokens)[GroupsIter->first].size() > 0){
939 ProcessData.Append(";");
940 ProcessData.Append((*GroupsListTokens)[GroupsIter->first]);
944 ProcessData.Append(":");
945 ProcessData.Append(GroupsIter->second);
946 ProcessData.Append("\n");
948 ProcessData = OutputText(&ProcessData);
950 SaveData->Append(ProcessData);
957 void ContactDataObject::SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID,
958 map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
959 map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref,
960 map<int, wxString> *NicknameListTokens, wxString *SaveData, wxString DataType){
962 wxString ProcessData = "";
964 for (std::map<int, wxString>::iterator NicknameIter = NicknameList->begin();
965 NicknameIter != NicknameList->end(); NicknameIter++){
967 ProcessData.Append("NICKNAME");
969 // Check if there is a value for TYPE.
971 if (DataType.size() > 0){
973 ProcessData.Append(";TYPE=");
974 ProcessData.Append(DataType);
978 // Check if there is a value for ALTID.
980 if ((*NicknameListAltID)[NicknameIter->first].size() > 0){
982 ProcessData.Append(";ALTID=");
983 ProcessData.Append((*NicknameListAltID)[NicknameIter->first]);
987 // Check if there is a value for MEDIATYPE.
989 if ((*NicknameListLanguage)[NicknameIter->first].size() > 0){
991 ProcessData.Append(";LANGUAGE=");
992 ProcessData.Append((*NicknameListLanguage)[NicknameIter->first]);
996 // Check if there is a value for PID.
998 if ((*NicknameListPID)[NicknameIter->first].size() > 0){
1000 ProcessData.Append(";PID=");
1001 ProcessData.Append((*NicknameListPID)[NicknameIter->first]);
1005 // Check if there is a value for PREF.
1007 if ((*NicknameListPref)[NicknameIter->first] > 0){
1009 ProcessData.Append(";PREF=");
1010 ProcessData.Append(wxString::Format("%i", (*NicknameListPref)[NicknameIter->first]));
1014 // Check if there is a value for tokens.
1016 if ((*NicknameListTokens)[NicknameIter->first].size() > 0){
1018 ProcessData.Append(";");
1019 ProcessData.Append((*NicknameListTokens)[NicknameIter->first]);
1023 ProcessData.Append(":");
1024 ProcessData.Append(NicknameIter->second);
1025 ProcessData.Append("\n");
1027 ProcessData = OutputText(&ProcessData);
1029 SaveData->Append(ProcessData);
1030 ProcessData.clear();
1036 void ContactDataObject::SaveTimezone(map<int, wxString> *TZList, map<int, wxString> *TZListAltID,
1037 map<int, wxString> *TZListPID, map<int, wxString> *TZListType,
1038 map<int, wxString> *TZListMediatype, map<int, int> *TZListPref,
1039 map<int, wxString> *TZListTokens, wxString *SaveData, wxString DataType){
1041 wxString ProcessData = "";
1043 for (std::map<int, wxString>::iterator TZIter = TZList->begin();
1044 TZIter != TZList->end(); TZIter++){
1046 ProcessData.Append("TZ");
1048 // Check if there is a value for TYPE.
1050 if (DataType.size() > 0){
1052 ProcessData.Append(";TYPE=");
1053 ProcessData.Append(DataType);
1057 // Check if there is a value for ALTID.
1059 if ((*TZListAltID)[TZIter->first].size() > 0){
1061 ProcessData.Append(";ALTID=");
1062 ProcessData.Append((*TZListAltID)[TZIter->first]);
1066 // Check if there is a value for MEDIATYPE.
1068 if ((*TZListMediatype)[TZIter->first].size() > 0){
1070 ProcessData.Append(";MEDIATYPE=");
1071 ProcessData.Append((*TZListMediatype)[TZIter->first]);
1075 // Check if there is a value for PID.
1077 if ((*TZListPID)[TZIter->first].size() > 0){
1079 ProcessData.Append(";PID=");
1080 ProcessData.Append((*TZListPID)[TZIter->first]);
1084 // Check if there is a value for PREF.
1086 if ((*TZListPref)[TZIter->first] > 0){
1088 ProcessData.Append(";PREF=");
1089 ProcessData.Append(wxString::Format("%i", (*TZListPref)[TZIter->first]));
1093 // Check if there is a value for tokens.
1095 if ((*TZListTokens)[TZIter->first].size() > 0){
1097 ProcessData.Append(";");
1098 ProcessData.Append((*TZListTokens)[TZIter->first]);
1102 ProcessData.Append(":");
1103 ProcessData.Append(TZIter->second);
1104 ProcessData.Append("\n");
1106 ProcessData = OutputText(&ProcessData);
1108 SaveData->Append(ProcessData);
1109 ProcessData.clear();
1115 void ContactDataObject::SaveAddress(map<int, wxString> *AddressList, map<int, wxString> *AddressListTown,
1116 map<int, wxString> *AddressListCounty, map<int, wxString> *AddressListPostCode,
1117 map<int, wxString> *AddressListCountry, map<int, wxString> *AddressListLabel,
1118 map<int, wxString> *AddressListLang, map<int, wxString> *AddressListAltID,
1119 map<int, wxString> *AddressListPID, map<int, wxString> *AddressListGeo,
1120 map<int, wxString> *AddressListTimezone, map<int, wxString> *AddressListType,
1121 map<int, wxString> *AddressListMediatype, map<int, int> *AddressListPref,
1122 map<int, wxString> *AddressListTokens, wxString *SaveData, wxString DataType){
1124 wxString ProcessData = "";
1126 for (std::map<int, wxString>::iterator AddressIter = AddressList->begin();
1127 AddressIter != AddressList->end(); AddressIter++){
1129 ProcessData.Append("ADR");
1131 // Check if there is a value for TYPE.
1133 if (DataType.size() > 0){
1135 ProcessData.Append(";TYPE=");
1136 ProcessData.Append(DataType);
1140 // Check if there is a value for ALTID.
1142 if ((*AddressListAltID)[AddressIter->first].size() > 0){
1144 ProcessData.Append(";ALTID=");
1145 ProcessData.Append((*AddressListAltID)[AddressIter->first]);
1149 // Check if there is a value for GEO.
1151 if ((*AddressListGeo)[AddressIter->first].size() > 0){
1153 ProcessData.Append(";GEO=\"");
1154 ProcessData.Append((*AddressListGeo)[AddressIter->first]);
1155 ProcessData.Append("\"");
1159 // Check if there is a value for LABEL.
1161 if ((*AddressListLabel)[AddressIter->first].size() > 0){
1163 wxString AddressProcessed = "";
1164 AddressProcessed = (*AddressListLabel)[AddressIter->first];
1166 AddressProcessed.Replace("\n", "\\n", true);
1168 ProcessData.Append(";LABEL=");
1169 ProcessData.Append(AddressProcessed);
1173 // Check if there is a value for LANGUAGE.
1175 if ((*AddressListLang)[AddressIter->first].size() > 0){
1177 ProcessData.Append(";LANGUAGE=");
1178 ProcessData.Append((*AddressListLang)[AddressIter->first]);
1182 // Check if there is a value for MEDIATYPE.
1184 if ((*AddressListMediatype)[AddressIter->first].size() > 0){
1186 ProcessData.Append(";MEDIATYPE=");
1187 ProcessData.Append((*AddressListMediatype)[AddressIter->first]);
1191 // Check if there is a value for PID.
1193 if ((*AddressListPID)[AddressIter->first].size() > 0){
1195 ProcessData.Append(";PID=");
1196 ProcessData.Append((*AddressListPID)[AddressIter->first]);
1200 // Check if there is a value for PREF.
1202 if ((*AddressListPref)[AddressIter->first] > 0){
1204 ProcessData.Append(";PREF=");
1205 ProcessData.Append(wxString::Format("%i", (*AddressListPref)[AddressIter->first]));
1209 // Check if there is a value for TZ.
1211 if ((*AddressListTimezone)[AddressIter->first].size() > 0){
1213 ProcessData.Append(";TZ=");
1214 ProcessData.Append((*AddressListTimezone)[AddressIter->first]);
1218 // Check if there is a value for tokens.
1220 if ((*AddressListTokens)[AddressIter->first].size() > 0){
1222 ProcessData.Append(";");
1223 ProcessData.Append((*AddressListTokens)[AddressIter->first]);
1227 // Build the address.
1229 ProcessData.Append(":;;");
1230 ProcessData.Append((*AddressList)[AddressIter->first]);
1231 ProcessData.Append(";");
1232 ProcessData.Append((*AddressListTown)[AddressIter->first]);
1233 ProcessData.Append(";");
1234 ProcessData.Append((*AddressListCounty)[AddressIter->first]);
1235 ProcessData.Append(";");
1236 ProcessData.Append((*AddressListPostCode)[AddressIter->first]);
1237 ProcessData.Append(";");
1238 ProcessData.Append((*AddressListCountry)[AddressIter->first]);
1239 ProcessData.Append("\n");
1241 ProcessData = OutputText(&ProcessData);
1243 SaveData->Append(ProcessData);
1244 ProcessData.clear();
1250 void ContactDataObject::SaveEmail(map<int, wxString> *EmailList, map<int, wxString> *EmailListAltID,
1251 map<int, wxString> *EmailListPID, map<int, wxString> *EmailListType,
1252 map<int, int> *EmailListPref, map<int, wxString> *EmailListTokens,
1253 wxString *SaveData, wxString DataType){
1255 wxString ProcessData = "";
1257 for (std::map<int, wxString>::iterator EmailIter = EmailList->begin();
1258 EmailIter != EmailList->end(); EmailIter++){
1260 ProcessData.Append("EMAIL");
1262 // Check if there is a value for TYPE.
1264 if (DataType.size() > 0){
1266 ProcessData.Append(";TYPE=");
1267 ProcessData.Append(DataType);
1271 // Check if there is a value for ALTID.
1273 if ((*EmailListAltID)[EmailIter->first].size() > 0){
1275 ProcessData.Append(";ALTID=");
1276 ProcessData.Append((*EmailListAltID)[EmailIter->first]);
1280 // Check if there is a value for PID.
1282 if ((*EmailListPID)[EmailIter->first].size() > 0){
1284 ProcessData.Append(";PID=");
1285 ProcessData.Append((*EmailListPID)[EmailIter->first]);
1289 // Check if there is a value for PREF.
1291 if ((*EmailListPref)[EmailIter->first] > 0){
1293 ProcessData.Append(";PREF=");
1294 ProcessData.Append(wxString::Format("%i", (*EmailListPref)[EmailIter->first]));
1298 // Check if there is a value for tokens.
1300 if ((*EmailListTokens)[EmailIter->first].size() > 0){
1302 ProcessData.Append(";");
1303 ProcessData.Append((*EmailListTokens)[EmailIter->first]);
1307 ProcessData.Append(":");
1308 ProcessData.Append(EmailIter->second);
1309 ProcessData.Append("\n");
1311 ProcessData = OutputText(&ProcessData);
1313 SaveData->Append(ProcessData);
1314 ProcessData.clear();
1320 void ContactDataObject::SaveIMPP(map<int, wxString> *IMList, map<int, wxString> *IMListAltID,
1321 map<int, wxString> *IMListPID, map<int, wxString> *IMListType,
1322 map<int, wxString> *IMListTypeInfo, map<int, wxString> *IMListMediatype,
1323 map<int, int> *IMListPref, map<int, wxString> *IMListTokens,
1324 wxString *SaveData, wxString DataType){
1326 wxString ProcessData = "";
1328 for (std::map<int, wxString>::iterator IMIter = IMList->begin();
1329 IMIter != IMList->end(); IMIter++){
1331 ProcessData.Append("IMPP");
1333 // Check if there is a value for TYPE.
1335 if (DataType.size() > 0){
1337 ProcessData.Append(";TYPE=");
1338 ProcessData.Append(DataType);
1342 // Check if there is a value for ALTID.
1344 if ((*IMListAltID)[IMIter->first].size() > 0){
1346 ProcessData.Append(";ALTID=");
1347 ProcessData.Append((*IMListAltID)[IMIter->first]);
1351 // Check if there is a value for MEDIATYPE.
1353 if ((*IMListMediatype)[IMIter->first].size() > 0){
1355 ProcessData.Append(";MEDIATYPE=");
1356 ProcessData.Append((*IMListMediatype)[IMIter->first]);
1360 // Check if there is a value for PID.
1362 if ((*IMListPID)[IMIter->first].size() > 0){
1364 ProcessData.Append(";PID=");
1365 ProcessData.Append((*IMListPID)[IMIter->first]);
1369 // Check if there is a value for PREF.
1371 if ((*IMListPref)[IMIter->first] > 0){
1373 ProcessData.Append(";PREF=");
1374 ProcessData.Append(wxString::Format("%i", (*IMListPref)[IMIter->first]));
1378 // Check if there is a value for tokens.
1380 if ((*IMListTokens)[IMIter->first].size() > 0){
1382 ProcessData.Append(";");
1383 ProcessData.Append((*IMListTokens)[IMIter->first]);
1387 ProcessData.Append(":");
1388 ProcessData.Append((*IMListTypeInfo)[IMIter->first]);
1389 ProcessData.Append(":");
1390 ProcessData.Append(IMIter->second);
1391 ProcessData.Append("\n");
1393 ProcessData = OutputText(&ProcessData);
1395 SaveData->Append(ProcessData);
1396 ProcessData.clear();
1402 void ContactDataObject::SaveLanguage(map<int, wxString> *LanguageList, map<int, wxString> *LanguageListAltID,
1403 map<int, wxString> *LanguageListPID, map<int, wxString> *LanguageListType,
1404 map<int, int> *LangaugeListPref, map<int, wxString> *LanguageListTokens,
1405 wxString *SaveData, wxString DataType){
1407 wxString ProcessData = "";
1409 for (std::map<int, wxString>::iterator LanguageIter = LanguageList->begin();
1410 LanguageIter != LanguageList->end(); LanguageIter++){
1412 ProcessData.Append("LANG");
1414 // Check if there is a value for TYPE.
1416 if (DataType.size() > 0){
1418 ProcessData.Append(";TYPE=");
1419 ProcessData.Append(DataType);
1423 // Check if there is a value for ALTID.
1425 if ((*LanguageListAltID)[LanguageIter->first].size() > 0){
1427 ProcessData.Append(";ALTID=");
1428 ProcessData.Append((*LanguageListAltID)[LanguageIter->first]);
1432 // Check if there is a value for PID.
1434 if ((*LanguageListPID)[LanguageIter->first].size() > 0){
1436 ProcessData.Append(";PID=");
1437 ProcessData.Append((*LanguageListPID)[LanguageIter->first]);
1441 // Check if there is a value for PREF.
1443 if ((*LangaugeListPref)[LanguageIter->first] > 0){
1445 ProcessData.Append(";PREF=");
1446 ProcessData.Append(wxString::Format("%i", (*LangaugeListPref)[LanguageIter->first]));
1450 // Check if there is a value for tokens.
1452 if ((*LanguageListTokens)[LanguageIter->first].size() > 0){
1454 ProcessData.Append(";");
1455 ProcessData.Append((*LanguageListTokens)[LanguageIter->first]);
1459 ProcessData.Append(":");
1460 ProcessData.Append(LanguageIter->second);
1461 ProcessData.Append("\n");
1463 ProcessData = OutputText(&ProcessData);
1465 SaveData->Append(ProcessData);
1466 ProcessData.clear();
1472 void ContactDataObject::SaveGeoposition(map<int, wxString> *GeographyList, map<int, wxString> *GeographyListAltID,
1473 map<int, wxString> *GeographyListPID, map<int, wxString> *GeographyListType,
1474 map<int, wxString> *GeographyListMediatype, map<int, wxString> *GeographyListDataType,
1475 map<int, int> *GeographyListPref, map<int, wxString> *GeographyListTokens,
1476 wxString *SaveData, wxString DataType){
1478 wxString ProcessData = "";
1480 for (std::map<int, wxString>::iterator GeographyIter = GeographyList->begin();
1481 GeographyIter != GeographyList->end(); GeographyIter++){
1483 ProcessData.Append("GEO");
1485 // Check if there is a value for TYPE.
1487 if (DataType.size() > 0){
1489 ProcessData.Append(";TYPE=");
1490 ProcessData.Append(DataType);
1494 // Check if there is a value for ALTID.
1496 if ((*GeographyListAltID)[GeographyIter->first].size() > 0){
1498 ProcessData.Append(";ALTID=");
1499 ProcessData.Append((*GeographyListAltID)[GeographyIter->first]);
1503 // Check if there is a value for MEDIATYPE.
1505 if ((*GeographyListMediatype)[GeographyIter->first].size() > 0){
1507 ProcessData.Append(";MEDIATYPE=");
1508 ProcessData.Append((*GeographyListMediatype)[GeographyIter->first]);
1512 // Check if there is a value for PID.
1514 if ((*GeographyListPID)[GeographyIter->first].size() > 0){
1516 ProcessData.Append(";PID=");
1517 ProcessData.Append((*GeographyListPID)[GeographyIter->first]);
1521 // Check if there is a value for PREF.
1523 if ((*GeographyListPref)[GeographyIter->first] > 0){
1525 ProcessData.Append(";PREF=");
1526 ProcessData.Append(wxString::Format("%i", (*GeographyListPref)[GeographyIter->first]));
1530 // Check if there is a value for tokens.
1532 if ((*GeographyListTokens)[GeographyIter->first].size() > 0){
1534 ProcessData.Append(";");
1535 ProcessData.Append((*GeographyListTokens)[GeographyIter->first]);
1539 ProcessData.Append(":");
1540 ProcessData.Append((*GeographyListDataType)[GeographyIter->first]);
1541 ProcessData.Append(":");
1542 ProcessData.Append(GeographyIter->second);
1543 ProcessData.Append("\n");
1545 ProcessData = OutputText(&ProcessData);
1547 SaveData->Append(ProcessData);
1548 ProcessData.clear();
1554 void ContactDataObject::SaveURL(map<int, wxString> *WebsiteList, map<int, wxString> *WebsiteListAltID,
1555 map<int, wxString> *WebsiteListPID, map<int, wxString> *WebsiteListType,
1556 map<int, wxString> *WebsiteListMediatype, map<int, int> *WebsiteListPref,
1557 map<int, wxString> *WebsiteListTokens, wxString *SaveData, wxString DataType){
1559 wxString ProcessData = "";
1561 for (std::map<int, wxString>::iterator WebsiteIter = WebsiteList->begin();
1562 WebsiteIter != WebsiteList->end(); WebsiteIter++){
1564 ProcessData.Append("URL");
1566 // Check if there is a value for TYPE.
1568 if (DataType.size() > 0){
1570 ProcessData.Append(";TYPE=");
1571 ProcessData.Append(DataType);
1575 // Check if there is a value for ALTID.
1577 if ((*WebsiteListAltID)[WebsiteIter->first].size() > 0){
1579 ProcessData.Append(";ALTID=");
1580 ProcessData.Append((*WebsiteListAltID)[WebsiteIter->first]);
1584 // Check if there is a value for MEDIATYPE.
1586 if ((*WebsiteListMediatype)[WebsiteIter->first].size() > 0){
1588 ProcessData.Append(";MEDIATYPE=");
1589 ProcessData.Append((*WebsiteListMediatype)[WebsiteIter->first]);
1593 // Check if there is a value for PID.
1595 if ((*WebsiteListPID)[WebsiteIter->first].size() > 0){
1597 ProcessData.Append(";PID=");
1598 ProcessData.Append((*WebsiteListPID)[WebsiteIter->first]);
1602 // Check if there is a value for PREF.
1604 if ((*WebsiteListPref)[WebsiteIter->first] > 0){
1606 ProcessData.Append(";PREF=");
1607 ProcessData.Append(wxString::Format("%i", (*WebsiteListPref)[WebsiteIter->first]));
1611 // Check if there is a value for tokens.
1613 if ((*WebsiteListTokens)[WebsiteIter->first].size() > 0){
1615 ProcessData.Append(";");
1616 ProcessData.Append((*WebsiteListTokens)[WebsiteIter->first]);
1620 ProcessData.Append(":");
1621 ProcessData.Append(WebsiteIter->second);
1622 ProcessData.Append("\n");
1624 ProcessData = OutputText(&ProcessData);
1626 SaveData->Append(ProcessData);
1627 ProcessData.clear();
1633 void ContactDataObject::SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
1634 map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
1635 map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
1636 map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType){
1638 wxString ProcessData = "";
1640 for (std::map<int, wxString>::iterator RoleIter = RoleList->begin();
1641 RoleIter != RoleList->end(); RoleIter++){
1643 ProcessData.Append("ROLE");
1645 // Check if there is a value for TYPE.
1647 if (DataType.size() > 0){
1649 ProcessData.Append(";TYPE=");
1650 ProcessData.Append(DataType);
1654 // Check if there is a value for ALTID.
1656 if ((*RoleListAltID)[RoleIter->first].size() > 0){
1658 ProcessData.Append(";ALTID=");
1659 ProcessData.Append((*RoleListAltID)[RoleIter->first]);
1663 // Check if there is a value for LANGUAGE.
1665 if ((*RoleListLanguage)[RoleIter->first].size() > 0){
1667 ProcessData.Append(";LANGUAGE=");
1668 ProcessData.Append((*RoleListLanguage)[RoleIter->first]);
1672 // Check if there is a value for PID.
1674 if ((*RoleListPID)[RoleIter->first].size() > 0){
1676 ProcessData.Append(";PID=");
1677 ProcessData.Append((*RoleListPID)[RoleIter->first]);
1681 // Check if there is a value for PREF.
1683 if ((*RoleListPref)[RoleIter->first] > 0){
1685 ProcessData.Append(";PREF=");
1686 ProcessData.Append(wxString::Format("%i", (*RoleListPref)[RoleIter->first]));
1690 // Check if there is a value for tokens.
1692 if ((*RoleListTokens)[RoleIter->first].size() > 0){
1694 ProcessData.Append(";");
1695 ProcessData.Append((*RoleListTokens)[RoleIter->first]);
1699 ProcessData.Append(":");
1700 ProcessData.Append(RoleIter->second);
1701 ProcessData.Append("\n");
1703 ProcessData = OutputText(&ProcessData);
1705 SaveData->Append(ProcessData);
1706 ProcessData.clear();
1712 void ContactDataObject::SaveOrganisation(map<int, wxString> *OrganisationList, map<int, wxString> *OrganisationListAltID,
1713 map<int, wxString> *OrganisationListPID, map<int, wxString> *OrganisationListLanguage,
1714 map<int, wxString> *OrganisationListSortAs, map<int, wxString> *OrganisationListType,
1715 map<int, int> *OrganisationListPref, map<int, wxString> *OrganisationListTokens,
1716 wxString *SaveData, wxString DataType){
1718 wxString ProcessData = "";
1720 for (std::map<int, wxString>::iterator OrganisationIter = OrganisationList->begin();
1721 OrganisationIter != OrganisationList->end(); OrganisationIter++){
1723 ProcessData.Append("ORG");
1725 // Check if there is a value for TYPE.
1727 if (DataType.size() > 0){
1729 ProcessData.Append(";TYPE=");
1730 ProcessData.Append(DataType);
1734 // Check if there is a value for ALTID.
1736 if ((*OrganisationListAltID)[OrganisationIter->first].size() > 0){
1738 ProcessData.Append(";ALTID=");
1739 ProcessData.Append((*OrganisationListAltID)[OrganisationIter->first]);
1743 // Check if there is a value for LANGUAGE.
1745 if ((*OrganisationListLanguage)[OrganisationIter->first].size() > 0){
1747 ProcessData.Append(";LANGUAGE=");
1748 ProcessData.Append((*OrganisationListLanguage)[OrganisationIter->first]);
1752 // Check if there is a value for PID.
1754 if ((*OrganisationListPID)[OrganisationIter->first].size() > 0){
1756 ProcessData.Append(";PID=");
1757 ProcessData.Append((*OrganisationListPID)[OrganisationIter->first]);
1761 // Check if there is a value for PREF.
1763 if ((*OrganisationListPref)[OrganisationIter->first] > 0){
1765 ProcessData.Append(";PREF=");
1766 ProcessData.Append(wxString::Format("%i", (*OrganisationListPref)[OrganisationIter->first]));
1770 // Check if there is a value for SORT-AS.
1772 if ((*OrganisationListSortAs)[OrganisationIter->first].size() > 0){
1774 ProcessData.Append(";SORT-AS=\"");
1775 ProcessData.Append((*OrganisationListSortAs)[OrganisationIter->first]);
1776 ProcessData.Append("\"");
1780 // Check if there is a value for tokens.
1782 if ((*OrganisationListTokens)[OrganisationIter->first].size() > 0){
1784 ProcessData.Append(";");
1785 ProcessData.Append((*OrganisationListTokens)[OrganisationIter->first]);
1789 ProcessData.Append(":");
1790 ProcessData.Append(OrganisationIter->second);
1791 ProcessData.Append("\n");
1793 ProcessData = OutputText(&ProcessData);
1795 SaveData->Append(ProcessData);
1796 ProcessData.clear();
1802 void ContactDataObject::SaveNote(map<int, wxString> *NoteList, map<int, wxString> *NoteListLanguage,
1803 map<int, wxString> *NoteListAltID, map<int, wxString> *NoteListPID,
1804 map<int, wxString> *NoteListType, map<int, int> *NoteListPref,
1805 map<int, wxString> *NoteListTokens, wxString *SaveData, wxString DataType){
1807 wxString ProcessData = "";
1809 for (std::map<int, wxString>::iterator NoteIter = NoteList->begin();
1810 NoteIter != NoteList->end(); NoteIter++){
1812 ProcessData.Append("NOTE");
1814 // Check if there is a value for TYPE.
1816 if (DataType.size() > 0){
1818 ProcessData.Append(";TYPE=");
1819 ProcessData.Append(DataType);
1823 // Check if there is a value for ALTID.
1825 if ((*NoteListAltID)[NoteIter->first].size() > 0){
1827 ProcessData.Append(";ALTID=");
1828 ProcessData.Append((*NoteListAltID)[NoteIter->first]);
1832 // Check if there is a value for LANGUAGE.
1834 if ((*NoteListLanguage)[NoteIter->first].size() > 0){
1836 ProcessData.Append(";LANGUAGE=");
1837 ProcessData.Append((*NoteListLanguage)[NoteIter->first]);
1841 // Check if there is a value for PID.
1843 if ((*NoteListPID)[NoteIter->first].size() > 0){
1845 ProcessData.Append(";PID=");
1846 ProcessData.Append((*NoteListPID)[NoteIter->first]);
1850 // Check if there is a value for PREF.
1852 if ((*NoteListPref)[NoteIter->first] > 0){
1854 ProcessData.Append(";PREF=");
1855 ProcessData.Append(wxString::Format("%i", (*NoteListPref)[NoteIter->first]));
1859 // Check if there is a value for tokens.
1861 if ((*NoteListTokens)[NoteIter->first].size() > 0){
1863 ProcessData.Append(";");
1864 ProcessData.Append((*NoteListTokens)[NoteIter->first]);
1868 ProcessData.Append(":");
1869 ProcessData.Append(NoteIter->second);
1870 ProcessData.Replace("\n", "\\n", true);
1871 ProcessData.Append("\n");
1873 ProcessData = OutputText(&ProcessData);
1875 SaveData->Append(ProcessData);
1876 ProcessData.clear();
1882 void ContactDataObject::SaveCategory(map<int, wxString> *CategoryList, map<int, wxString> *CategoryListLanguage,
1883 map<int, wxString> *CategoryListAltID, map<int, wxString> *CategoryListPID,
1884 map<int, wxString> *CategoryListType, map<int, int> *CategoryListPref,
1885 map<int, wxString> *CategoryListTokens, wxString *SaveData){
1887 wxString ProcessData = "";
1889 for (std::map<int, wxString>::iterator CategoryIter = CategoryList->begin();
1890 CategoryIter != CategoryList->end(); CategoryIter++){
1892 ProcessData.Append("CATEGORIES");
1894 // Check if there is a value for TYPE.
1896 if ((*CategoryListType)[CategoryIter->first].size() > 0){
1898 ProcessData.Append(";TYPE=");
1899 ProcessData.Append((*CategoryListType)[CategoryIter->first]);
1903 // Check if there is a value for ALTID.
1905 if ((*CategoryListAltID)[CategoryIter->first].size() > 0){
1907 ProcessData.Append(";ALTID=");
1908 ProcessData.Append((*CategoryListAltID)[CategoryIter->first]);
1912 // Check if there is a value for LANGUAGE.
1914 if ((*CategoryListLanguage)[CategoryIter->first].size() > 0){
1916 ProcessData.Append(";LANGUAGE=");
1917 ProcessData.Append((*CategoryListLanguage)[CategoryIter->first]);
1921 // Check if there is a value for PID.
1923 if ((*CategoryListPID)[CategoryIter->first].size() > 0){
1925 ProcessData.Append(";PID=");
1926 ProcessData.Append((*CategoryListPID)[CategoryIter->first]);
1930 // Check if there is a value for PREF.
1932 if ((*CategoryListPref)[CategoryIter->first] > 0){
1934 ProcessData.Append(";PREF=");
1935 ProcessData.Append(wxString::Format("%i", (*CategoryListPref)[CategoryIter->first]));
1939 // Check if there is a value for tokens.
1941 if ((*CategoryListTokens)[CategoryIter->first].size() > 0){
1943 ProcessData.Append(";");
1944 ProcessData.Append((*CategoryListTokens)[CategoryIter->first]);
1948 ProcessData.Append(":");
1949 ProcessData.Append(CategoryIter->second);
1950 ProcessData.Append("\n");
1952 ProcessData = OutputText(&ProcessData);
1954 SaveData->Append(ProcessData);
1955 ProcessData.clear();
1961 void ContactDataObject::SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID,
1962 map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
1963 map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
1964 map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
1965 map<int, wxString> *PicturesListTokens, wxString *SaveData){
1967 wxString ProcessData = "";
1969 for (std::map<int, string>::iterator PicturesIter = PicturesList->begin();
1970 PicturesIter != PicturesList->end(); PicturesIter++){
1972 ProcessData.Append("PHOTO");
1974 // Check if there is a value for TYPE.
1976 if ((*PicturesListType)[PicturesIter->first].size() > 0){
1978 ProcessData.Append(";TYPE=");
1979 ProcessData.Append((*PicturesListType)[PicturesIter->first]);
1983 // Check if there is a value for ALTID.
1985 if ((*PicturesListAltID)[PicturesIter->first].size() > 0){
1987 ProcessData.Append(";ALTID=");
1988 ProcessData.Append((*PicturesListAltID)[PicturesIter->first]);
1992 // Check if there is a value for MEDIATYPE..
1994 if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){
1996 ProcessData.Append(";MEDIATYPE=");
1997 ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]);
2001 // Check if there is a value for PID.
2003 if ((*PicturesListPID)[PicturesIter->first].size() > 0){
2005 ProcessData.Append(";PID=");
2006 ProcessData.Append((*PicturesListPID)[PicturesIter->first]);
2010 // Check if there is a value for PREF.
2012 if ((*PicturesListPref)[PicturesIter->first] > 0){
2014 ProcessData.Append(";PREF=");
2015 ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first]));
2019 // Check if there is a value for tokens.
2021 if ((*PicturesListTokens)[PicturesIter->first].size() > 0){
2023 ProcessData.Append(";");
2024 ProcessData.Append((*PicturesListTokens)[PicturesIter->first]);
2028 ProcessData.Append(":data:");
2029 ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]);
2030 ProcessData.Append(";");
2031 ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]);
2032 ProcessData.Append(",");
2033 ProcessData.Append(PicturesIter->second);
2034 ProcessData.Append("\n");
2036 ProcessData = OutputText(&ProcessData);
2038 SaveData->Append(ProcessData);
2039 ProcessData.clear();
2045 void ContactDataObject::SaveLogo(map<int, string> *LogosList, map<int, wxString> *LogosListAltID,
2046 map<int, wxString> *LogosListPID, map<int, wxString> *LogosListType,
2047 map<int, wxString> *LogosListPicEncType, map<int, wxString> *LogosListPictureType,
2048 map<int, wxString> *LogosListMediatype, map<int, int> *LogosListPref,
2049 map<int, wxString> *LogosListTokens, wxString *SaveData){
2051 wxString ProcessData = "";
2053 for (std::map<int, string>::iterator LogosIter = LogosList->begin();
2054 LogosIter != LogosList->end(); LogosIter++){
2056 ProcessData.Append("LOGO");
2058 // Check if there is a value for TYPE.
2060 if ((*LogosListType)[LogosIter->first].size() > 0){
2062 ProcessData.Append(";TYPE=");
2063 ProcessData.Append((*LogosListType)[LogosIter->first]);
2067 // Check if there is a value for ALTID.
2069 if ((*LogosListAltID)[LogosIter->first].size() > 0){
2071 ProcessData.Append(";ALTID=");
2072 ProcessData.Append((*LogosListAltID)[LogosIter->first]);
2076 // Check if there is a value for MEDIATYPE..
2078 if ((*LogosListMediatype)[LogosIter->first].size() > 0){
2080 ProcessData.Append(";MEDIATYPE=");
2081 ProcessData.Append((*LogosListMediatype)[LogosIter->first]);
2085 // Check if there is a value for PID.
2087 if ((*LogosListPID)[LogosIter->first].size() > 0){
2089 ProcessData.Append(";PID=");
2090 ProcessData.Append((*LogosListPID)[LogosIter->first]);
2094 // Check if there is a value for PREF.
2096 if ((*LogosListPref)[LogosIter->first] > 0){
2098 ProcessData.Append(";PREF=");
2099 ProcessData.Append(wxString::Format("%i", (*LogosListPref)[LogosIter->first]));
2103 // Check if there is a value for tokens.
2105 if ((*LogosListTokens)[LogosIter->first].size() > 0){
2107 ProcessData.Append(";");
2108 ProcessData.Append((*LogosListTokens)[LogosIter->first]);
2112 ProcessData.Append(":data:");
2113 ProcessData.Append((*LogosListPictureType)[LogosIter->first]);
2114 ProcessData.Append(";");
2115 ProcessData.Append((*LogosListPicEncType)[LogosIter->first]);
2116 ProcessData.Append(",");
2117 ProcessData.Append(LogosIter->second);
2118 ProcessData.Append("\n");
2120 ProcessData = OutputText(&ProcessData);
2122 SaveData->Append(ProcessData);
2123 ProcessData.clear();
2129 void ContactDataObject::SaveSound(map<int, string> *SoundsList, map<int, wxString> *SoundsListAltID,
2130 map<int, wxString> *SoundsListPID, map<int, wxString> *SoundsListType,
2131 map<int, wxString> *SoundsListAudioEncType, map<int, wxString> *SoundsListAudioType,
2132 map<int, wxString> *SoundsListMediatype, map<int, wxString> *SoundsListLanguage,
2133 map<int, int> *SoundsListPref, map<int, wxString> *SoundsListTokens,
2134 wxString *SaveData){
2136 wxString ProcessData = "";
2138 for (std::map<int, string>::iterator SoundsIter = SoundsList->begin();
2139 SoundsIter != SoundsList->end(); SoundsIter++){
2141 ProcessData.Append("SOUND");
2143 // Check if there is a value for TYPE.
2145 if ((*SoundsListType)[SoundsIter->first].size() > 0){
2147 ProcessData.Append(";TYPE=");
2148 ProcessData.Append((*SoundsListType)[SoundsIter->first]);
2152 // Check if there is a value for ALTID.
2154 if ((*SoundsListAltID)[SoundsIter->first].size() > 0){
2156 ProcessData.Append(";ALTID=");
2157 ProcessData.Append((*SoundsListAltID)[SoundsIter->first]);
2161 // Check if there is a value for LANGUAGE.
2163 if ((*SoundsListLanguage)[SoundsIter->first].size() > 0){
2165 ProcessData.Append(";LANGUAGE=");
2166 ProcessData.Append((*SoundsListLanguage)[SoundsIter->first]);
2170 // Check if there is a value for MEDIATYPE.
2172 if ((*SoundsListMediatype)[SoundsIter->first].size() > 0){
2174 ProcessData.Append(";MEDIATYPE=");
2175 ProcessData.Append((*SoundsListMediatype)[SoundsIter->first]);
2179 // Check if there is a value for PID.
2181 if ((*SoundsListPID)[SoundsIter->first].size() > 0){
2183 ProcessData.Append(";PID=");
2184 ProcessData.Append((*SoundsListPID)[SoundsIter->first]);
2188 // Check if there is a value for PREF.
2190 if ((*SoundsListPref)[SoundsIter->first] > 0){
2192 ProcessData.Append(";PREF=");
2193 ProcessData.Append(wxString::Format("%i", (*SoundsListPref)[SoundsIter->first]));
2197 // Check if there is a value for tokens.
2199 if ((*SoundsListTokens)[SoundsIter->first].size() > 0){
2201 ProcessData.Append(";");
2202 ProcessData.Append((*SoundsListTokens)[SoundsIter->first]);
2206 ProcessData.Append(":data:");
2207 ProcessData.Append((*SoundsListAudioType)[SoundsIter->first]);
2208 ProcessData.Append(";");
2209 ProcessData.Append((*SoundsListAudioEncType)[SoundsIter->first]);
2210 ProcessData.Append(",");
2211 ProcessData.Append(SoundsIter->second);
2212 ProcessData.Append("\n");
2214 ProcessData = OutputText(&ProcessData);
2216 SaveData->Append(ProcessData);
2217 ProcessData.clear();
2223 void ContactDataObject::SaveCalendarURI(map<int, wxString> *CalendarList, map<int, wxString> *CalendarListMediatype,
2224 map<int, wxString> *CalendarListAltID, map<int, wxString> *CalendarListPID,
2225 map<int, wxString> *CalendarListType, map<int, int> *CalendarListPref,
2226 map<int, wxString> *CalendarListTokens, wxString *SaveData){
2228 wxString ProcessData = "";
2230 for (std::map<int, wxString>::iterator CalendarIter = CalendarList->begin();
2231 CalendarIter != CalendarList->end(); CalendarIter++){
2233 ProcessData.Append("CALURI");
2235 // Check if there is a value for TYPE.
2237 if ((*CalendarListType)[CalendarIter->first].size() > 0){
2239 ProcessData.Append(";TYPE=");
2240 ProcessData.Append((*CalendarListType)[CalendarIter->first]);
2244 // Check if there is a value for ALTID.
2246 if ((*CalendarListAltID)[CalendarIter->first].size() > 0){
2248 ProcessData.Append(";ALTID=");
2249 ProcessData.Append((*CalendarListAltID)[CalendarIter->first]);
2253 // Check if there is a value for MEDIATYPE.
2255 if ((*CalendarListMediatype)[CalendarIter->first].size() > 0){
2257 ProcessData.Append(";MEDIATYPE=");
2258 ProcessData.Append((*CalendarListMediatype)[CalendarIter->first]);
2262 // Check if there is a value for PID.
2264 if ((*CalendarListPID)[CalendarIter->first].size() > 0){
2266 ProcessData.Append(";PID=");
2267 ProcessData.Append((*CalendarListPID)[CalendarIter->first]);
2271 // Check if there is a value for PREF.
2273 if ((*CalendarListPref)[CalendarIter->first] > 0){
2275 ProcessData.Append(";PREF=");
2276 ProcessData.Append(wxString::Format("%i", (*CalendarListPref)[CalendarIter->first]));
2280 // Check if there is a value for tokens.
2282 if ((*CalendarListTokens)[CalendarIter->first].size() > 0){
2284 ProcessData.Append(";");
2285 ProcessData.Append((*CalendarListTokens)[CalendarIter->first]);
2289 ProcessData.Append(":");
2290 ProcessData.Append(CalendarIter->second);
2291 ProcessData.Append("\n");
2293 ProcessData = OutputText(&ProcessData);
2295 SaveData->Append(ProcessData);
2296 ProcessData.clear();
2302 void ContactDataObject::SaveCalendarRequestURI(map<int, wxString> *CalendarRequestList, map<int, wxString> *CalendarRequestListMediatype,
2303 map<int, wxString> *CalendarRequestListAltID, map<int, wxString> *CalendarRequestListPID,
2304 map<int, wxString> *CalendarRequestListType, map<int, int> *CalendarRequestListPref,
2305 map<int, wxString> *CalendarRequestListTokens, wxString *SaveData){
2307 wxString ProcessData = "";
2309 for (std::map<int, wxString>::iterator CalendarRequestIter = CalendarRequestList->begin();
2310 CalendarRequestIter != CalendarRequestList->end(); CalendarRequestIter++){
2312 ProcessData.Append("CALADRURI");
2314 // Check if there is a value for TYPE.
2316 if ((*CalendarRequestListType)[CalendarRequestIter->first].size() > 0){
2318 ProcessData.Append(";TYPE=");
2319 ProcessData.Append((*CalendarRequestListType)[CalendarRequestIter->first]);
2323 // Check if there is a value for ALTID.
2325 if ((*CalendarRequestListAltID)[CalendarRequestIter->first].size() > 0){
2327 ProcessData.Append(";ALTID=");
2328 ProcessData.Append((*CalendarRequestListAltID)[CalendarRequestIter->first]);
2332 // Check if there is a value for MEDIATYPE.
2334 if ((*CalendarRequestListMediatype)[CalendarRequestIter->first].size() > 0){
2336 ProcessData.Append(";MEDIATYPE=");
2337 ProcessData.Append((*CalendarRequestListMediatype)[CalendarRequestIter->first]);
2341 // Check if there is a value for PID.
2343 if ((*CalendarRequestListPID)[CalendarRequestIter->first].size() > 0){
2345 ProcessData.Append(";PID=");
2346 ProcessData.Append((*CalendarRequestListPID)[CalendarRequestIter->first]);
2350 // Check if there is a value for PREF.
2352 if ((*CalendarRequestListPref)[CalendarRequestIter->first] > 0){
2354 ProcessData.Append(";PREF=");
2355 ProcessData.Append(wxString::Format("%i", (*CalendarRequestListPref)[CalendarRequestIter->first]));
2359 // Check if there is a value for tokens.
2361 if ((*CalendarRequestListTokens)[CalendarRequestIter->first].size() > 0){
2363 ProcessData.Append(";");
2364 ProcessData.Append((*CalendarRequestListTokens)[CalendarRequestIter->first]);
2368 ProcessData.Append(":");
2369 ProcessData.Append(CalendarRequestIter->second);
2370 ProcessData.Append("\n");
2372 ProcessData = OutputText(&ProcessData);
2374 SaveData->Append(ProcessData);
2375 ProcessData.clear();
2381 void ContactDataObject::SaveFreeBusyURI(std::map<int, wxString> *FreeBusyList, std::map<int, wxString> *FreeBusyListAltID,
2382 std::map<int, wxString> *FreeBusyListPID, std::map<int, wxString> *FreeBusyListType,
2383 std::map<int, wxString> *FreeBusyListMediatype, std::map<int, int> *FreeBusyListPref,
2384 std::map<int, wxString> *FreeBusyListTokens, wxString *SaveData){
2386 wxString ProcessData = "";
2388 for (std::map<int, wxString>::iterator FreeBusyIter = FreeBusyList->begin();
2389 FreeBusyIter != FreeBusyList->end(); FreeBusyIter++){
2391 ProcessData.Append("FBURL");
2393 // Check if there is a value for TYPE.
2395 if ((*FreeBusyListType)[FreeBusyIter->first].size() > 0){
2397 ProcessData.Append(";TYPE=");
2398 ProcessData.Append((*FreeBusyListType)[FreeBusyIter->first]);
2402 // Check if there is a value for ALTID.
2404 if ((*FreeBusyListAltID)[FreeBusyIter->first].size() > 0){
2406 ProcessData.Append(";ALTID=");
2407 ProcessData.Append((*FreeBusyListAltID)[FreeBusyIter->first]);
2411 // Check if there is a value for MEDIATYPE.
2413 if ((*FreeBusyListMediatype)[FreeBusyIter->first].size() > 0){
2415 ProcessData.Append(";MEDIATYPE=");
2416 ProcessData.Append((*FreeBusyListMediatype)[FreeBusyIter->first]);
2420 // Check if there is a value for PID.
2422 if ((*FreeBusyListPID)[FreeBusyIter->first].size() > 0){
2424 ProcessData.Append(";PID=");
2425 ProcessData.Append((*FreeBusyListPID)[FreeBusyIter->first]);
2429 // Check if there is a value for PREF.
2431 if ((*FreeBusyListPref)[FreeBusyIter->first] > 0){
2433 ProcessData.Append(";PREF=");
2434 ProcessData.Append(wxString::Format("%i", (*FreeBusyListPref)[FreeBusyIter->first]));
2438 // Check if there is a value for tokens.
2440 if ((*FreeBusyListTokens)[FreeBusyIter->first].size() > 0){
2442 ProcessData.Append(";");
2443 ProcessData.Append((*FreeBusyListTokens)[FreeBusyIter->first]);
2447 ProcessData.Append(":");
2448 ProcessData.Append(FreeBusyIter->second);
2449 ProcessData.Append("\n");
2451 ProcessData = OutputText(&ProcessData);
2453 SaveData->Append(ProcessData);
2454 ProcessData.clear();
2460 void ContactDataObject::SaveKey(map<int, wxString> *KeyList, map<int, wxString> *KeyListAltID,
2461 map<int, wxString> *KeyListPID, map<int, wxString> *KeyListType,
2462 map<int, bool> *KeyListKeyType, map<int, wxString> *KeyListDataEncType,
2463 map<int, wxString> *KeyListDataType, map<int, int> *KeyListPref,
2464 map<int, wxString> *KeyListTokens, wxString *SaveData){
2466 wxString ProcessData = "";
2468 for (std::map<int, wxString>::iterator KeyIter = KeyList->begin();
2469 KeyIter != KeyList->end(); KeyIter++){
2471 ProcessData.Append("KEY");
2473 // Check if there is a value for TYPE.
2475 if ((*KeyListType)[KeyIter->first].size() > 0){
2477 ProcessData.Append(";TYPE=");
2478 ProcessData.Append((*KeyListType)[KeyIter->first]);
2482 // Check if there is a value for ALTID.
2484 if ((*KeyListAltID)[KeyIter->first].size() > 0){
2486 ProcessData.Append(";ALTID=");
2487 ProcessData.Append((*KeyListAltID)[KeyIter->first]);
2491 // Check if there is a value for PID.
2493 if ((*KeyListPID)[KeyIter->first].size() > 0){
2495 ProcessData.Append(";PID=");
2496 ProcessData.Append((*KeyListPID)[KeyIter->first]);
2500 // Check if there is a value for PREF.
2502 if ((*KeyListPref)[KeyIter->first] > 0){
2504 ProcessData.Append(";PREF=");
2505 ProcessData.Append(wxString::Format("%i", (*KeyListPref)[KeyIter->first]));
2509 // Check if there is a value for tokens.
2511 if ((*KeyListTokens)[KeyIter->first].size() > 0){
2513 ProcessData.Append(";");
2514 ProcessData.Append((*KeyListTokens)[KeyIter->first]);
2518 ProcessData.Append(":data:");
2519 ProcessData.Append((*KeyListDataType)[KeyIter->first]);
2520 ProcessData.Append(";");
2521 ProcessData.Append((*KeyListDataEncType)[KeyIter->first]);
2522 ProcessData.Append(",");
2523 ProcessData.Append(KeyIter->second);
2524 ProcessData.Append("\n");
2526 ProcessData = OutputText(&ProcessData);
2528 SaveData->Append(ProcessData);
2529 ProcessData.clear();
2535 void ContactDataObject::SaveVendor(map<int, wxString> *VendorList, map<int, wxString> *VendorListPEN,
2536 map<int, wxString> *VendorListElement, wxString *SaveData){
2538 wxString ProcessData = "";
2540 for (std::map<int, wxString>::iterator VendorIter = VendorList->begin();
2541 VendorIter != VendorList->end(); VendorIter++){
2543 ProcessData.Append("VND-");
2544 ProcessData.Append((*VendorListPEN)[VendorIter->first]);
2545 ProcessData.Append("-");
2546 ProcessData.Append((*VendorListElement)[VendorIter->first]);
2547 ProcessData.Append(":");
2548 ProcessData.Append(VendorIter->second);
2549 ProcessData.Append("\n");
2551 ProcessData = OutputText(&ProcessData);
2553 SaveData->Append(ProcessData);
2554 ProcessData.clear();
2560 void ContactDataObject::SaveXToken(map<int, wxString> *XTokenList, map<int, wxString> *XTokenListTokens,
2561 wxString *SaveData){
2563 wxString ProcessData = "";
2565 for (std::map<int, wxString>::iterator XTokenIter = XTokenList->begin();
2566 XTokenIter != XTokenList->end(); XTokenIter++){
2568 ProcessData.Append("X-");
2569 ProcessData.Append((*XTokenListTokens)[XTokenIter->first]);
2570 ProcessData.Append(":");
2571 ProcessData.Append(XTokenIter->second);
2572 ProcessData.Append("\n");
2574 ProcessData = OutputText(&ProcessData);
2576 SaveData->Append(ProcessData);
2577 ProcessData.clear();