Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
daf61598923e501d64ec78cdcbb4746dc1506614
[xestiaab/.git] / source / contacteditor / cdo / ContactDataObject-Save.cpp
1 // ContactDataObject-Save.cpp - Client Data Object.
2 //
3 // (c) 2012-2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
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.
10 //
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.
15 //
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::SaveFile(wxString SaveFilename){
23         
24         // Get the data using SaveString.
25         
26         wxString SaveData = "";
27         SaveString(&SaveData);
28         
29         // Open a file and try to write into it.
30         
31         wxFile ContactFile;
32         
33         if (!ContactFile.Open(SaveFilename, wxFile::write, wxS_DEFAULT)){
34         
35                 return CONTACTSAVE_FILEERROR;
36         
37         }
38         
39         if (ContactFile.Write(SaveData, wxConvUTF8) == false){
40                 
41                 return CONTACTSAVE_WRITEERROR;
42                 
43         }
44         
45         ContactFile.Close();
46         
47         return CONTACTSAVE_OK;
48         
49 }
51 ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
52         
53         ContactSaveStatus SaveDataStatus = CONTACTSAVE_UNITTESTFAIL;
54         
55         // Write the header for the vCard data file.
56         
57         SaveData->Append("BEGIN:VCARD\n");
58         SaveData->Append("VERSION:4.0\n");
59         
60         // Write the product ID.
61         
62 #ifdef XAB_UNITTEST
63         
64         SaveData->Append("PRODID:-//Xestia//Address Book Unit Testing//KW\n");
65         
66 #else
67         
68         SaveData->Append(wxT("PRODID:-//Xestia//Address Book Version "));
69         SaveData->Append(wxT(XSDAB_VERSION));
70         SaveData->Append(wxT("//KW\n"));
71         
72 #endif
74         wxString ProcessData = "";
76         // Process UID.
78         if (UIDToken.size() > 0){
79                 
80                 ProcessData.Append("UID:");
81                 ProcessData.Append(UIDToken);
82                 ProcessData.Append("\n");
83                 SaveData->Append(ProcessData);
84                 ProcessData.clear();
85                 
86         }
87         
88         // Process KIND.
89         
90         switch(ContactKind){
92                 case CONTACTKIND_NONE:
93                         break;
94                 case CONTACTKIND_INDIVIDUAL:
95                         SaveData->Append("KIND:individual\n");
96                         break;
97                 case CONTACTKIND_GROUP:
98                         SaveData->Append("KIND:group\n");
99                         break;
100                 case CONTACTKIND_ORGANISATION:
101                         SaveData->Append("KIND:org\n");
102                         break;
103                 case CONTACTKIND_LOCATION:
104                         SaveData->Append("KIND:location\n");
105                         break;
106                 default:
107                         break;
108                 
109         }
110         
111         // Process REV.
112         
113         wxDateTime DateTimeSave;
114         DateTimeSave = DateTimeSave.SetToCurrent();
115         wxString DateTimeSaveValue;
116         
117 #ifdef XAB_UNITTEST
118         
119         DateTimeSaveValue += "20160703T091000Z";
120         
121 #else
122     
123         DateTimeSaveValue += wxString::Format("%04i", DateTimeSave.GetYear());
124         DateTimeSaveValue += wxString::Format("%02i", (DateTimeSave.GetMonth() + 1));
125         DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetDay());
126         DateTimeSaveValue += "T";
127         DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetHour());
128         DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetMinute());
129         DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetSecond());
130         DateTimeSaveValue += "Z";
131     
132 #endif
133         
134         if (!RevisionTokens.IsEmpty()){
135                 
136                 ProcessData.Append("REV;");
137                 ProcessData.Append(RevisionTokens);
138                 ProcessData.Append(":");
139                 ProcessData.Append(DateTimeSaveValue);
140                 ProcessData.Append("\n");
141                 
142                 ProcessData = OutputText(&ProcessData);
143                 
144                 SaveData->Append(ProcessData);
145                 ProcessData.clear();            
146                 
147         } else {
148         
149                 ProcessData.Append("REV:");
150                 ProcessData.Append(DateTimeSaveValue);
151                 ProcessData.Append("\n");
152                 
153                 ProcessData = OutputText(&ProcessData);
154                 
155                 SaveData->Append(ProcessData);
156                 ProcessData.clear();
157                 
158         }
159         
160         // Process XML.
162         for (std::map<int, wxString>::iterator XMLIter = XMLList.begin();
163                 XMLIter != XMLList.end(); XMLIter++){
164         
165                 ProcessData.Append("XML");
166                         
167                 if (XMLListAltID[XMLIter->first].size() > 0){
168                 
169                         ProcessData.Append(";ALTID=");
170                         ProcessData.Append(XMLListAltID[XMLIter->first]);
171                         
172                 }
173                         
174                 ProcessData.Append(":");
175                 ProcessData.Append(XMLIter->second);
176                 ProcessData.Append("\n");
177                 
178                 ProcessData = OutputText(&ProcessData);
179                 
180                 SaveData->Append(ProcessData);
181                 ProcessData.clear();
182                         
183         }
184         
185         // Process SOURCE.
186         
187         SaveSource(&SourceList, &SourceListAltID, 
188                 &SourceListPID, &SourceListType,
189                 &SourceListMediatype, &SourceListPref, 
190                 &SourceListTokens, SaveData);
191         
192         // Process MEMBER (if contact kind is CONTACTKIND_GROUP).
193         
194         if (ContactKind == CONTACTKIND_GROUP){
195                 
196                 SaveMember(&GroupsList, &GroupsListAltID, 
197                         &GroupsListPID, &GroupsListType,
198                         &GroupsListMediaType, &GroupsListPref, 
199                         &GroupsListTokens, SaveData);
200                 
201         }
202         
203         // Process CLIENTPIDMAP.
204         
205         for (std::map<int, wxString>::iterator CPIDIter = ClientPIDList.begin();
206                 CPIDIter != ClientPIDList.end(); CPIDIter++){
207         
208                 ProcessData.Append("CLIENTPIDMAP");
209                         
210                 if (ClientPIDListTokens[CPIDIter->first].size() > 0){
211                 
212                         ProcessData.Append(";");
213                         ProcessData.Append(ClientPIDListTokens[CPIDIter->first]);
214                         
215                 }
216                         
217                 ProcessData.Append(":");
218                 ProcessData.Append(CPIDIter->second);
219                 ProcessData.Append("\n");
220                 
221                 ProcessData = OutputText(&ProcessData);
222                 
223                 SaveData->Append(ProcessData);
224                 ProcessData.clear();
225                         
226         }
227         
228         // Process FN.
229         
230         for (std::map<int, wxString>::iterator FNIter = FullNamesList.begin();
231                 FNIter != FullNamesList.end(); FNIter++){
232                 
233                 ProcessData.Append("FN");
235                 // Check if there is a value for TYPE.
236                 
237                 if (FullNamesListType[FNIter->first].size() > 0){
238                 
239                         ProcessData.Append(";TYPE=");
240                         ProcessData.Append(FullNamesListType[FNIter->first]);
241                         
242                 }
244                 // Check if there is a value for LANGUAGE.
245                 
246                 if (FullNamesListLanguage[FNIter->first].size() > 0){
247                 
248                         ProcessData.Append(";LANGUAGE=");
249                         ProcessData.Append(FullNamesListLanguage[FNIter->first]);
250                         
251                 }
252                 
253                 // Check if there is a value for ALTID.
254                 
255                 if (FullNamesListAltID[FNIter->first].size() > 0){
256                 
257                         ProcessData.Append(";ALTID=");
258                         ProcessData.Append(FullNamesListAltID[FNIter->first]);
259                         
260                 }
261                 
262                 // Check if there is a value for PID.
264                 if (FullNamesListPID[FNIter->first].size() > 0){
265                 
266                         ProcessData.Append(";PID=");
267                         ProcessData.Append(FullNamesListPID[FNIter->first]);
268                         
269                 }
271                 // Check if there is a value for PREF.
273                 if (FullNamesListPref[FNIter->first] > 0){
274                 
275                         ProcessData.Append(";PREF=");
276                         ProcessData.Append(wxString::Format("%i", FullNamesListPref[FNIter->first]));
277                         
278                 }
280                 // Check if there is a value for tokens.
282                 if (FullNamesListTokens[FNIter->first].size() > 0){
283                 
284                         ProcessData.Append(";");
285                         ProcessData.Append(FullNamesListTokens[FNIter->first]);
286                         
287                 }
288                 
289                 ProcessData.Append(":");
290                 ProcessData.Append(FNIter->second);
291                 ProcessData.Append("\n");
292                 
293                 ProcessData = OutputText(&ProcessData);
294                 
295                 SaveData->Append(ProcessData);
296                 ProcessData.clear();
297                         
298         }
299         
300         // Process NICKNAME.
301         
302         SaveNickname(&GeneralNicknamesList, &GeneralNicknamesListAltID, 
303                 &GeneralNicknamesListPID, &GeneralNicknamesListType,
304                 &GeneralNicknamesListLanguage, &GeneralNicknamesListPref, 
305                 &GeneralNicknamesListTokens, SaveData, "");
306         SaveNickname(&HomeNicknamesList, &HomeNicknamesListAltID, 
307                 &HomeNicknamesListPID, &HomeNicknamesListType,
308                 &HomeNicknamesListLanguage, &HomeNicknamesListPref, 
309                 &HomeNicknamesListTokens, SaveData, "home");
310         SaveNickname(&BusinessNicknamesList, &BusinessNicknamesListAltID, 
311                 &BusinessNicknamesListPID, &BusinessNicknamesListType,
312                 &BusinessNicknamesListLanguage, &BusinessNicknamesListPref, 
313                 &BusinessNicknamesListTokens, SaveData, "work");
314         
315         // Process TITLE.
317         SaveTitle(&GeneralTitleList, &GeneralTitleListLanguage,
318                 &GeneralTitleListAltID, &GeneralTitleListPID,
319                 &GeneralTitleListType, &GeneralTitleListPref,
320                 &GeneralTitleListTokens, SaveData, "");
321         SaveTitle(&HomeTitleList, &HomeTitleListLanguage,
322                 &HomeTitleListAltID, &HomeTitleListPID,
323                 &HomeTitleListType, &HomeTitleListPref,
324                 &HomeTitleListTokens, SaveData, "home");
325         SaveTitle(&BusinessTitleList, &BusinessTitleListLanguage,
326                 &BusinessTitleListAltID, &BusinessTitleListPID,
327                 &BusinessTitleListType, &BusinessTitleListPref,
328                 &BusinessTitleListTokens, SaveData, "work");
329         
330         // Process TZ.
331         
332         SaveTimezone(&GeneralTZList, &GeneralTZListAltID, 
333                 &GeneralTZListPID, &GeneralTZListType,
334                 &GeneralTZListMediatype, &GeneralTZListPref, 
335                 &GeneralTZListTokens, SaveData, "");
336         SaveTimezone(&HomeTZList, &HomeTZListAltID, 
337                 &HomeTZListPID, &HomeTZListType,
338                 &HomeTZListMediatype, &HomeTZListPref, 
339                 &HomeTZListTokens, SaveData, "home");
340         SaveTimezone(&BusinessTZList, &BusinessTZListAltID, 
341                 &BusinessTZListPID, &BusinessTZListType,
342                 &BusinessTZListMediatype, &BusinessTZListPref, 
343                 &BusinessTZListTokens, SaveData, "work");
345         // Process ADR.
346         
347         SaveAddress(&GeneralAddressList, &GeneralAddressListTown,
348                 &GeneralAddressListCounty, &GeneralAddressListPostCode,
349                 &GeneralAddressListCountry, &GeneralAddressListLabel,
350                 &GeneralAddressListLang, &GeneralAddressListAltID,
351                 &GeneralAddressListPID, &GeneralAddressListGeo, 
352                 &GeneralAddressListTimezone, &GeneralAddressListType, 
353                 &GeneralAddressListMediatype, &GeneralAddressListPref,
354                 &GeneralAddressListTokens, SaveData, "");
355         SaveAddress(&HomeAddressList, &HomeAddressListTown,
356                 &HomeAddressListCounty, &HomeAddressListPostCode,
357                 &HomeAddressListCountry, &HomeAddressListLabel,
358                 &HomeAddressListLang, &HomeAddressListAltID,
359                 &HomeAddressListPID, &HomeAddressListGeo, 
360                 &HomeAddressListTimezone, &HomeAddressListType, 
361                 &HomeAddressListMediatype, &HomeAddressListPref,
362                 &HomeAddressListTokens, SaveData, "home");
363         SaveAddress(&BusinessAddressList, &BusinessAddressListTown,
364                 &BusinessAddressListCounty, &BusinessAddressListPostCode,
365                 &BusinessAddressListCountry, &BusinessAddressListLabel,
366                 &BusinessAddressListLang, &BusinessAddressListAltID,
367                 &BusinessAddressListPID, &BusinessAddressListGeo, 
368                 &BusinessAddressListTimezone, &BusinessAddressListType, 
369                 &BusinessAddressListMediatype, &BusinessAddressListPref,
370                 &BusinessAddressListTokens, SaveData, "work");
372         // Process EMAIL.
373         
374         SaveEmail(&GeneralEmailList, &GeneralEmailListAltID, 
375                 &GeneralEmailListPID, &GeneralEmailListType,
376                 &GeneralEmailListPref, &GeneralEmailListTokens, 
377                 SaveData, "");
378         SaveEmail(&HomeEmailList, &HomeEmailListAltID, 
379                 &HomeEmailListPID, &HomeEmailListType,
380                 &HomeEmailListPref, &HomeEmailListTokens, 
381                 SaveData, "home");
382         SaveEmail(&BusinessEmailList, &BusinessEmailListAltID, 
383                 &BusinessEmailListPID, &BusinessEmailListType,
384                 &BusinessEmailListPref, &BusinessEmailListTokens, 
385                 SaveData, "work");
387         // Process IMPP.
388         
389         SaveIMPP(&GeneralIMList, &GeneralIMListAltID, 
390                 &GeneralIMListPID, &GeneralIMListType,
391                 &GeneralIMListTypeInfo, &GeneralIMListMediatype, 
392                 &GeneralIMListPref, &GeneralIMListTokens,
393                 SaveData, "");
394         SaveIMPP(&HomeIMList, &HomeIMListAltID, 
395                 &HomeIMListPID, &HomeIMListType,
396                 &HomeIMListTypeInfo, &HomeIMListMediatype, 
397                 &HomeIMListPref, &HomeIMListTokens,
398                 SaveData, "home");
399         SaveIMPP(&BusinessIMList, &BusinessIMListAltID, 
400                 &BusinessIMListPID, &BusinessIMListType,
401                 &BusinessIMListTypeInfo, &BusinessIMListMediatype, 
402                 &BusinessIMListPref, &BusinessIMListTokens,
403                 SaveData, "work");
405         // Process TEL.
406         
407         SaveTelephone(&GeneralTelephoneList, &GeneralTelephoneListAltID, 
408                 &GeneralTelephoneListPID, &GeneralTelephoneListType,
409                 &GeneralTelephoneListTypeInfo, &GeneralTelephoneListDataType, 
410                 &GeneralTelephoneListPref, &GeneralTelephoneListTokens, 
411                 SaveData, "");
412         SaveTelephone(&HomeTelephoneList, &HomeTelephoneListAltID, 
413                 &HomeTelephoneListPID, &HomeTelephoneListType,
414                 &HomeTelephoneListTypeInfo, &HomeTelephoneListDataType, 
415                 &HomeTelephoneListPref, &HomeTelephoneListTokens, 
416                 SaveData, "home");
417         SaveTelephone(&BusinessTelephoneList, &BusinessTelephoneListAltID, 
418                 &BusinessTelephoneListPID, &BusinessTelephoneListType,
419                 &BusinessTelephoneListTypeInfo, &BusinessTelephoneListDataType, 
420                 &BusinessTelephoneListPref, &BusinessTelephoneListTokens, 
421                 SaveData, "work");
423         // Process LANG.
424         
425         SaveLanguage(&GeneralLanguageList, &GeneralLanguageListAltID, 
426                 &GeneralLanguageListPID, &GeneralLanguageListType,
427                 &GeneralLanguageListPref, &GeneralLanguageListTokens, 
428                 SaveData, "");
429         SaveLanguage(&HomeLanguageList, &HomeLanguageListAltID, 
430                 &HomeLanguageListPID, &HomeLanguageListType,
431                 &HomeLanguageListPref, &HomeLanguageListTokens, 
432                 SaveData, "home");
433         SaveLanguage(&BusinessLanguageList, &BusinessLanguageListAltID, 
434                 &BusinessLanguageListPID, &BusinessLanguageListType,
435                 &BusinessLanguageListPref, &BusinessLanguageListTokens, 
436                 SaveData, "work");
438         // Process GEO.
439         
440         SaveGeoposition(&GeneralGeographyList, &GeneralGeographyListAltID, 
441                 &GeneralGeographyListPID, &GeneralGeographyListType,
442                 &GeneralGeographyListMediatype, &GeneralGeographyListDataType,
443                 &GeneralGeographyListPref, &GeneralGeographyListTokens, 
444                 SaveData, "");
445         SaveGeoposition(&HomeGeographyList, &HomeGeographyListAltID, 
446                 &HomeGeographyListPID, &HomeGeographyListType,
447                 &HomeGeographyListMediatype, &HomeGeographyListDataType,
448                 &HomeGeographyListPref, &HomeGeographyListTokens, 
449                 SaveData, "home");
450         SaveGeoposition(&BusinessGeographyList, &BusinessGeographyListAltID, 
451                 &BusinessGeographyListPID, &BusinessGeographyListType,
452                 &BusinessGeographyListMediatype, &BusinessGeographyListDataType,
453                 &BusinessGeographyListPref, &BusinessGeographyListTokens, 
454                 SaveData, "work");
456         // Process RELATED.
457         
458         int Moo = 0;
460         for (std::map<int, wxString>::iterator RelatedIter = GeneralRelatedList.begin();
461                 RelatedIter != GeneralRelatedList.end(); RelatedIter++){
462                 
463                 ProcessData.Append("RELATED");
465                 // Check if there is a value for TYPE.
466                 
467                 if (GeneralRelatedListRelType[RelatedIter->first].size() > 0){
468                 
469                         wxString RelatedType = "";
470                         
471                         ProcessData.Append(";TYPE=");
472                         
473                         if (GeneralRelatedListRelType[RelatedIter->first] == _("Contact")){
475                                 RelatedType = wxT("contact");
477                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Acquaintance")){
479                                 RelatedType = wxT("acquaintance");
481                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Friend")){
483                                 RelatedType = wxT("friend");
485                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Met")){
487                                 RelatedType = wxT("met");
489                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Co-worker")){
491                                 RelatedType = wxT("co-worker");
493                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Colleague")){
495                                 RelatedType = wxT("colleague");
497                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Co-resident")){
499                                 RelatedType = wxT("co-resident");
501                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Neighbour")){
503                                 RelatedType = wxT("neighbor");
505                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Child")){
507                                 RelatedType = wxT("child");
509                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Parent")){
511                                 RelatedType = wxT("parent");
513                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Sibling")){
515                                 RelatedType = wxT("sibling");
517                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Spouse")){
519                                 RelatedType = wxT("spouse");
521                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Kin")){
523                                 RelatedType = wxT("kin");
525                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Muse")){
527                                 RelatedType = wxT("muse");
529                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Crush")){
531                                 RelatedType = wxT("crush");
533                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Date")){
535                                 RelatedType = wxT("date");
537                         } else if (GeneralRelatedListRelType[RelatedIter->first]== _("Sweetheart")){
539                                 RelatedType = wxT("sweetheart");
541                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Me")){
543                                 RelatedType = wxT("me");
545                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Agent")){
547                                 RelatedType = wxT("agent");
549                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Emergency")){
551                                 RelatedType = wxT("emergency");
553                         } else {
555                                 RelatedType = GeneralRelatedListRelType[RelatedIter->first];
557                         }
558                         
559                         ProcessData.Append(RelatedType);
560                         
561                 }
563                 // Check if there is a value for LANGUAGE.
564                 
565                 if (GeneralRelatedListLanguage[RelatedIter->first].size() > 0){
566                 
567                         ProcessData.Append(";LANGUAGE=");
568                         ProcessData.Append(GeneralRelatedListLanguage[RelatedIter->first]);
569                         
570                 }
571                 
572                 // Check if there is a value for ALTID.
573                 
574                 if (GeneralRelatedListAltID[RelatedIter->first].size() > 0){
575                 
576                         ProcessData.Append(";ALTID=");
577                         ProcessData.Append(GeneralRelatedListAltID[RelatedIter->first]);
578                         
579                 }
580                 
581                 // Check if there is a value for PID.
583                 if (GeneralRelatedListPID[RelatedIter->first].size() > 0){
584                 
585                         ProcessData.Append(";PID=");
586                         ProcessData.Append(GeneralRelatedListPID[RelatedIter->first]);
587                         
588                 }
590                 // Check if there is a value for PREF.
592                 if (GeneralRelatedListPref[RelatedIter->first] > 0){
593                 
594                         ProcessData.Append(";PREF=");
595                         ProcessData.Append(wxString::Format("%i", GeneralRelatedListPref[RelatedIter->first]));
596                         
597                 }
599                 // Check if there is a value for tokens.
601                 if (GeneralRelatedListTokens[RelatedIter->first].size() > 0){
602                 
603                         ProcessData.Append(";");
604                         ProcessData.Append(GeneralRelatedListTokens[RelatedIter->first]);
605                         
606                 }
607                 
608                 ProcessData.Append(":");
609                 ProcessData.Append(RelatedIter->second);
610                 ProcessData.Append("\n");
611                 
612                 ProcessData = OutputText(&ProcessData);
613                 
614                 SaveData->Append(ProcessData);
615                 ProcessData.clear();
616                         
617         }
618         
619         // Process URL.
620         
621         SaveURL(&GeneralWebsiteList, &GeneralWebsiteListAltID, 
622                 &GeneralWebsiteListPID, &GeneralWebsiteListType,
623                 &GeneralWebsiteListMediatype, &GeneralWebsiteListPref, 
624                 &GeneralWebsiteListTokens, SaveData, "");
625         SaveURL(&HomeWebsiteList, &HomeWebsiteListAltID, 
626                 &HomeWebsiteListPID, &HomeWebsiteListType,
627                 &HomeWebsiteListMediatype, &HomeWebsiteListPref, 
628                 &HomeWebsiteListTokens, SaveData, "home");
629         SaveURL(&BusinessWebsiteList, &BusinessWebsiteListAltID, 
630                 &BusinessWebsiteListPID, &BusinessWebsiteListType,
631                 &BusinessWebsiteListMediatype, &BusinessWebsiteListPref, 
632                 &BusinessWebsiteListTokens, SaveData, "work");
634         // Process ROLE.
635         
636         SaveRole(&GeneralRoleList, &GeneralRoleListLanguage,
637                 &GeneralRoleListAltID, &GeneralRoleListPID,
638                 &GeneralRoleListType, &GeneralRoleListPref,
639                 &GeneralRoleListTokens, SaveData, "");
640         SaveRole(&HomeRoleList, &HomeRoleListLanguage,
641                 &HomeRoleListAltID, &HomeRoleListPID,
642                 &HomeRoleListType, &HomeRoleListPref,
643                 &HomeRoleListTokens, SaveData, "home");
644         SaveRole(&BusinessRoleList, &BusinessRoleListLanguage,
645                 &BusinessRoleListAltID, &BusinessRoleListPID,
646                 &BusinessRoleListType, &BusinessRoleListPref,
647                 &BusinessRoleListTokens, SaveData, "work");
649         // Process ORG.
650         
651         SaveOrganisation(&GeneralOrganisationsList, &GeneralOrganisationsListAltID,
652                 &GeneralOrganisationsListPID, &GeneralOrganisationsListLanguage, 
653                 &GeneralOrganisationsListSortAs, &GeneralOrganisationsListType, 
654                 &GeneralOrganisationsListPref, &GeneralOrganisationsListTokens, 
655                 SaveData, "");
656         SaveOrganisation(&HomeOrganisationsList, &HomeOrganisationsListAltID,
657                 &HomeOrganisationsListPID, &HomeOrganisationsListLanguage, 
658                 &HomeOrganisationsListSortAs, &HomeOrganisationsListType, 
659                 &HomeOrganisationsListPref, &HomeOrganisationsListTokens, 
660                 SaveData, "home");
661         SaveOrganisation(&BusinessOrganisationsList, &BusinessOrganisationsListAltID,
662                 &BusinessOrganisationsListPID, &BusinessOrganisationsListLanguage, 
663                 &BusinessOrganisationsListSortAs, &BusinessOrganisationsListType, 
664                 &BusinessOrganisationsListPref, &BusinessOrganisationsListTokens, 
665                 SaveData, "work");
667         // Process NOTE.
668         
669         SaveNote(&GeneralNoteList, &GeneralNoteListLanguage,
670                 &GeneralNoteListAltID, &GeneralNoteListPID,
671                 &GeneralNoteListType, &GeneralNoteListPref,
672                 &GeneralNoteListTokens, SaveData, "");
673         SaveNote(&HomeNoteList, &HomeNoteListLanguage,
674                 &HomeNoteListAltID, &HomeNoteListPID,
675                 &HomeNoteListType, &HomeNoteListPref,
676                 &HomeNoteListTokens, SaveData, "home");
677         SaveNote(&BusinessNoteList, &BusinessNoteListLanguage,
678                 &BusinessNoteListAltID, &BusinessNoteListPID,
679                 &BusinessNoteListType, &BusinessNoteListPref,
680                 &BusinessNoteListTokens, SaveData, "work");
682         // Process CATEGORIES.
683         
684         SaveCategory(&CategoriesList, &CategoriesListLanguage,
685                 &CategoriesListAltID, &CategoriesListPID,
686                 &CategoriesListType, &CategoriesListPref,
687                 &CategoriesListTokens, SaveData);
689         // Process PHOTO.
690         
691         SavePhoto(&PicturesList, &PicturesListAltID, 
692                 &PicturesListPID, &PicturesListType,
693                 &PicturesListPicEncType, &PicturesListPictureType,
694                 &PicturesListMediatype, &PicturesListPref,
695                 &PicturesListTokens, SaveData);
696         
697         // Process LOGO.
698         
699         SaveLogo(&LogosList, &LogosListAltID, 
700                 &LogosListPID, &LogosListType,
701                 &LogosListPicEncType, &LogosListPictureType,
702                 &LogosListMediatype, &LogosListPref,
703                 &LogosListTokens, SaveData);
704         
705         // Process SOUND.
707         SaveSound(&SoundsList, &SoundsListAltID, 
708                 &SoundsListPID, &SoundsListType,
709                 &SoundsListAudioEncType, &SoundsListAudioType,
710                 &SoundsListMediatype, &SoundsListLanguage, 
711                 &SoundsListPref, &SoundsListTokens, 
712                 SaveData);
714         // Process CALURI.
715         
716         SaveCalendarURI(&CalendarList, &CalendarListMediatype,
717                 &CalendarListAltID, &CalendarListPID,
718                 &CalendarListType, &CalendarListPref,
719                 &CalendarListTokens, SaveData);
720         
721         // Process CALADRURI.
722         
723         SaveCalendarRequestURI(&CalendarRequestList, &CalendarRequestListMediatype,
724                 &CalendarRequestListAltID, &CalendarRequestListPID,
725                 &CalendarRequestListType, &CalendarRequestListPref,
726                 &CalendarRequestListTokens, SaveData);
728         // Process FBURL.
729         
730         SaveFreeBusyURI(&FreeBusyList, &FreeBusyListAltID, 
731                 &FreeBusyListPID, &FreeBusyListType,
732                 &FreeBusyListMediatype, &FreeBusyListPref, 
733                 &FreeBusyListTokens, SaveData);
735         // Process KEY.
736         
737         SaveKey(&KeyList, &KeyListAltID, 
738                 &KeyListPID, &KeyListType,
739                 &KeyListKeyType, &KeyListDataEncType, 
740                 &KeyListDataType, &KeyListPref, 
741                 &KeyListTokens, SaveData);
743         // Process VND-*
744         
745         SaveVendor(&VendorList, &VendorListPEN, 
746                 &VendorListElement, SaveData);
748         // Process X-Tokens.
749         
750         SaveXToken(&XTokenList, &XTokenListTokens, 
751                 SaveData);
753         // Write the end part of the vCard data file.
754         
755         SaveData->Append("END:VCARD");
756         
757         SaveDataStatus = CONTACTSAVE_OK;
758         
759         return SaveDataStatus;
760         
763 void ContactDataObject::SaveTitle(map<int, wxString> *TitleList, map<int, wxString> *TitleListLanguage,
764         map<int, wxString> *TitleListAltID, map<int, wxString> *TitleListPID,
765         map<int, wxString> *TitleListType, map<int, int> *TitleListPref,
766         map<int, wxString> *TitleListTokens, wxString *SaveData, wxString DataType){
768         wxString ProcessData = "";
769                 
770         for (std::map<int, wxString>::iterator TitleIter = TitleList->begin();
771                 TitleIter != TitleList->end(); TitleIter++){
773                 ProcessData.Append("TITLE");
774                         
775                 // Check if there is a value for TYPE.
776                 
777                 if (DataType.size() > 0){
778                 
779                         ProcessData.Append(";TYPE=");
780                         ProcessData.Append(DataType);
781                         
782                 }
783                 
784                 // Check if there is a value for ALTID.
785                 
786                 if ((*TitleListAltID)[TitleIter->first].size() > 0){
787                 
788                         ProcessData.Append(";ALTID=");
789                         ProcessData.Append((*TitleListAltID)[TitleIter->first]);
790                         
791                 }
793                 // Check if there is a value for LANGUAGE.
794                 
795                 if ((*TitleListLanguage)[TitleIter->first].size() > 0){
796                 
797                         ProcessData.Append(";LANGUAGE=");
798                         ProcessData.Append((*TitleListLanguage)[TitleIter->first]);
799                         
800                 }
801                 
802                 // Check if there is a value for PID.
804                 if ((*TitleListPID)[TitleIter->first].size() > 0){
805                 
806                         ProcessData.Append(";PID=");
807                         ProcessData.Append((*TitleListPID)[TitleIter->first]);
808                         
809                 }
811                 // Check if there is a value for PREF.
813                 if ((*TitleListPref)[TitleIter->first] > 0){
814                 
815                         ProcessData.Append(";PREF=");
816                         ProcessData.Append(wxString::Format("%i", (*TitleListPref)[TitleIter->first]));
817                         
818                 }
820                 // Check if there is a value for tokens.
822                 if ((*TitleListTokens)[TitleIter->first].size() > 0){
823                 
824                         ProcessData.Append(";");
825                         ProcessData.Append((*TitleListTokens)[TitleIter->first]);
826                         
827                 }
828                         
829                 ProcessData.Append(":");
830                 ProcessData.Append(TitleIter->second);
831                 ProcessData.Append("\n");
833                 ProcessData = OutputText(&ProcessData);
834                         
835                 SaveData->Append(ProcessData);
836                 ProcessData.clear();
837                         
838         }
839                 
842 void ContactDataObject::SaveSource(map<int, wxString> *SourceList, map<int, wxString> *SourceListAltID, 
843         map<int, wxString> *SourceListPID, map<int, wxString> *SourceListType,
844         map<int, wxString> *SourceListMediatype, map<int, int> *SourceListPref, 
845         map<int, wxString> *SourceListTokens, wxString *SaveData){
847         wxString ProcessData = "";
848         
849         for (std::map<int, wxString>::iterator SourceIter = SourceList->begin();
850                 SourceIter != SourceList->end(); SourceIter++){
852                 ProcessData.Append("SOURCE");
853                         
854                 // Check if there is a value for TYPE.
855                 
856                 if ((*SourceListType)[SourceIter->first].size() > 0){
857                 
858                         ProcessData.Append(";TYPE=");
859                         ProcessData.Append((*SourceListType)[SourceIter->first]);
860                         
861                 }
862                 
863                 // Check if there is a value for ALTID.
864                 
865                 if ((*SourceListAltID)[SourceIter->first].size() > 0){
866                 
867                         ProcessData.Append(";ALTID=");
868                         ProcessData.Append((*SourceListAltID)[SourceIter->first]);
869                         
870                 }
872                 // Check if there is a value for MEDIATYPE.
873                 
874                 if ((*SourceListMediatype)[SourceIter->first].size() > 0){
875                 
876                         ProcessData.Append(";MEDIATYPE=");
877                         ProcessData.Append((*SourceListMediatype)[SourceIter->first]);
878                         
879                 }
880                 
881                 // Check if there is a value for PID.
883                 if ((*SourceListPID)[SourceIter->first].size() > 0){
884                 
885                         ProcessData.Append(";PID=");
886                         ProcessData.Append((*SourceListPID)[SourceIter->first]);
887                         
888                 }
890                 // Check if there is a value for PREF.
892                 if ((*SourceListPref)[SourceIter->first] > 0){
893                 
894                         ProcessData.Append(";PREF=");
895                         ProcessData.Append(wxString::Format("%i", (*SourceListPref)[SourceIter->first]));
896                         
897                 }
899                 // Check if there is a value for tokens.
901                 if ((*SourceListTokens)[SourceIter->first].size() > 0){
902                 
903                         ProcessData.Append(";");
904                         ProcessData.Append((*SourceListTokens)[SourceIter->first]);
905                         
906                 }
907                         
908                 ProcessData.Append(":");
909                 ProcessData.Append(SourceIter->second);
910                 ProcessData.Append("\n");
912                 ProcessData = OutputText(&ProcessData);
913                         
914                 SaveData->Append(ProcessData);
915                 ProcessData.clear();
916                         
917         }
918                 
921 void ContactDataObject::SaveMember(std::map<int, wxString> *GroupsList, std::map<int, wxString> *GroupsListAltID, 
922         std::map<int, wxString> *GroupsListPID, std::map<int, wxString> *GroupsListType,
923         std::map<int, wxString> *GroupsListMediaType, std::map<int, int> *GroupsListPref, 
924         std::map<int, wxString> *GroupsListTokens, wxString *SaveData){
926         wxString ProcessData = "";
927                 
928         for (std::map<int, wxString>::iterator GroupsIter = GroupsList->begin();
929                 GroupsIter != GroupsList->end(); GroupsIter++){
931                 ProcessData.Append("MEMBER");
932                         
933                 // Check if there is a value for TYPE.
934                 
935                 if ((*GroupsListType)[GroupsIter->first].size() > 0){
936                 
937                         ProcessData.Append(";TYPE=");
938                         ProcessData.Append((*GroupsListType)[GroupsIter->first]);
939                         
940                 }
941                 
942                 // Check if there is a value for ALTID.
943                 
944                 if ((*GroupsListAltID)[GroupsIter->first].size() > 0){
945                 
946                         ProcessData.Append(";ALTID=");
947                         ProcessData.Append((*GroupsListAltID)[GroupsIter->first]);
948                         
949                 }
951                 // Check if there is a value for MEDIATYPE.
952                 
953                 if ((*GroupsListMediaType)[GroupsIter->first].size() > 0){
954                 
955                         ProcessData.Append(";MEDIATYPE=");
956                         ProcessData.Append((*GroupsListMediaType)[GroupsIter->first]);
957                         
958                 }
959                 
960                 // Check if there is a value for PID.
962                 if ((*GroupsListPID)[GroupsIter->first].size() > 0){
963                 
964                         ProcessData.Append(";PID=");
965                         ProcessData.Append((*GroupsListPID)[GroupsIter->first]);
966                         
967                 }
969                 // Check if there is a value for PREF.
971                 if ((*GroupsListPref)[GroupsIter->first] > 0){
972                 
973                         ProcessData.Append(";PREF=");
974                         ProcessData.Append(wxString::Format("%i", (*GroupsListPref)[GroupsIter->first]));
975                         
976                 }
978                 // Check if there is a value for tokens.
980                 if ((*GroupsListTokens)[GroupsIter->first].size() > 0){
981                 
982                         ProcessData.Append(";");
983                         ProcessData.Append((*GroupsListTokens)[GroupsIter->first]);
984                         
985                 }
986                         
987                 ProcessData.Append(":");
988                 ProcessData.Append(GroupsIter->second);
989                 ProcessData.Append("\n");
991                 ProcessData = OutputText(&ProcessData);
992                 
993                 SaveData->Append(ProcessData);
994                 ProcessData.clear();
995                         
996         }
997                 
1000 void ContactDataObject::SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID, 
1001         map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
1002         map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref, 
1003         map<int, wxString> *NicknameListTokens, wxString *SaveData, wxString DataType){
1005         wxString ProcessData = "";
1006         
1007         for (std::map<int, wxString>::iterator NicknameIter = NicknameList->begin();
1008                 NicknameIter != NicknameList->end(); NicknameIter++){
1010                 ProcessData.Append("NICKNAME");
1011                         
1012                 // Check if there is a value for TYPE.
1013                 
1014                 if (DataType.size() > 0){
1015                 
1016                         ProcessData.Append(";TYPE=");
1017                         ProcessData.Append(DataType);
1018                         
1019                 }
1020                 
1021                 // Check if there is a value for ALTID.
1022                 
1023                 if ((*NicknameListAltID)[NicknameIter->first].size() > 0){
1024                 
1025                         ProcessData.Append(";ALTID=");
1026                         ProcessData.Append((*NicknameListAltID)[NicknameIter->first]);
1027                         
1028                 }
1030                 // Check if there is a value for MEDIATYPE.
1031                 
1032                 if ((*NicknameListLanguage)[NicknameIter->first].size() > 0){
1033                 
1034                         ProcessData.Append(";LANGUAGE=");
1035                         ProcessData.Append((*NicknameListLanguage)[NicknameIter->first]);
1036                         
1037                 }
1038                 
1039                 // Check if there is a value for PID.
1041                 if ((*NicknameListPID)[NicknameIter->first].size() > 0){
1042                 
1043                         ProcessData.Append(";PID=");
1044                         ProcessData.Append((*NicknameListPID)[NicknameIter->first]);
1045                         
1046                 }
1048                 // Check if there is a value for PREF.
1050                 if ((*NicknameListPref)[NicknameIter->first] > 0){
1051                 
1052                         ProcessData.Append(";PREF=");
1053                         ProcessData.Append(wxString::Format("%i", (*NicknameListPref)[NicknameIter->first]));
1054                         
1055                 }
1057                 // Check if there is a value for tokens.
1059                 if ((*NicknameListTokens)[NicknameIter->first].size() > 0){
1060                 
1061                         ProcessData.Append(";");
1062                         ProcessData.Append((*NicknameListTokens)[NicknameIter->first]);
1063                         
1064                 }
1065                         
1066                 ProcessData.Append(":");
1067                 ProcessData.Append(NicknameIter->second);
1068                 ProcessData.Append("\n");
1070                 ProcessData = OutputText(&ProcessData);
1071                         
1072                 SaveData->Append(ProcessData);
1073                 ProcessData.clear();
1074                         
1075         }
1076                 
1079 void ContactDataObject::SaveTimezone(map<int, wxString> *TZList, map<int, wxString> *TZListAltID, 
1080         map<int, wxString> *TZListPID, map<int, wxString> *TZListType,
1081         map<int, wxString> *TZListMediatype, map<int, int> *TZListPref, 
1082         map<int, wxString> *TZListTokens, wxString *SaveData, wxString DataType){
1084         wxString ProcessData = "";
1085         
1086         for (std::map<int, wxString>::iterator TZIter = TZList->begin();
1087                 TZIter != TZList->end(); TZIter++){
1089                 ProcessData.Append("TZ");
1090                         
1091                 // Check if there is a value for TYPE.
1092                 
1093                 if (DataType.size() > 0){
1094                 
1095                         ProcessData.Append(";TYPE=");
1096                         ProcessData.Append(DataType);
1097                         
1098                 }
1099                 
1100                 // Check if there is a value for ALTID.
1101                 
1102                 if ((*TZListAltID)[TZIter->first].size() > 0){
1103                 
1104                         ProcessData.Append(";ALTID=");
1105                         ProcessData.Append((*TZListAltID)[TZIter->first]);
1106                         
1107                 }
1109                 // Check if there is a value for MEDIATYPE.
1110                 
1111                 if ((*TZListMediatype)[TZIter->first].size() > 0){
1112                 
1113                         ProcessData.Append(";MEDIATYPE=");
1114                         ProcessData.Append((*TZListMediatype)[TZIter->first]);
1115                         
1116                 }
1117                 
1118                 // Check if there is a value for PID.
1120                 if ((*TZListPID)[TZIter->first].size() > 0){
1121                 
1122                         ProcessData.Append(";PID=");
1123                         ProcessData.Append((*TZListPID)[TZIter->first]);
1124                         
1125                 }
1127                 // Check if there is a value for PREF.
1129                 if ((*TZListPref)[TZIter->first] > 0){
1130                 
1131                         ProcessData.Append(";PREF=");
1132                         ProcessData.Append(wxString::Format("%i", (*TZListPref)[TZIter->first]));
1133                         
1134                 }
1136                 // Check if there is a value for tokens.
1138                 if ((*TZListTokens)[TZIter->first].size() > 0){
1139                 
1140                         ProcessData.Append(";");
1141                         ProcessData.Append((*TZListTokens)[TZIter->first]);
1142                         
1143                 }
1144                         
1145                 ProcessData.Append(":");
1146                 ProcessData.Append(TZIter->second);
1147                 ProcessData.Append("\n");
1149                 ProcessData = OutputText(&ProcessData);
1150                         
1151                 SaveData->Append(ProcessData);
1152                 ProcessData.clear();
1153                         
1154         }
1155                 
1158 void ContactDataObject::SaveAddress(map<int, wxString> *AddressList, map<int, wxString> *AddressListTown,
1159                 map<int, wxString> *AddressListCounty, map<int, wxString> *AddressListPostCode,
1160                 map<int, wxString> *AddressListCountry, map<int, wxString> *AddressListLabel,
1161                 map<int, wxString> *AddressListLang, map<int, wxString> *AddressListAltID,
1162                 map<int, wxString> *AddressListPID, map<int, wxString> *AddressListGeo, 
1163                 map<int, wxString> *AddressListTimezone, map<int, wxString> *AddressListType, 
1164                 map<int, wxString> *AddressListMediatype, map<int, int> *AddressListPref, 
1165                 map<int, wxString> *AddressListTokens, wxString *SaveData, wxString DataType){
1167         wxString ProcessData = "";
1168                         
1169         for (std::map<int, wxString>::iterator AddressIter = AddressList->begin();
1170                 AddressIter != AddressList->end(); AddressIter++){
1171                         
1172                 ProcessData.Append("ADR");
1173                         
1174                 // Check if there is a value for TYPE.
1175                 
1176                 if (DataType.size() > 0){
1177                 
1178                         ProcessData.Append(";TYPE=");
1179                         ProcessData.Append(DataType);
1180                         
1181                 }
1182                 
1183                 // Check if there is a value for ALTID.
1184                 
1185                 if ((*AddressListAltID)[AddressIter->first].size() > 0){
1186                 
1187                         ProcessData.Append(";ALTID=");
1188                         ProcessData.Append((*AddressListAltID)[AddressIter->first]);
1189                         
1190                 }
1192                 // Check if there is a value for GEO.
1193                 
1194                 if ((*AddressListGeo)[AddressIter->first].size() > 0){
1195                 
1196                         ProcessData.Append(";GEO=\"");
1197                         ProcessData.Append((*AddressListGeo)[AddressIter->first]);
1198                         ProcessData.Append("\"");
1199                         
1200                 }
1202                 // Check if there is a value for LABEL.
1204                 if ((*AddressListLabel)[AddressIter->first].size() > 0){
1205                 
1206                         wxString AddressProcessed = "";
1207                         AddressProcessed = (*AddressListLabel)[AddressIter->first];
1208                         
1209                         AddressProcessed.Replace("\n", "\\n", true);
1210                         
1211                         ProcessData.Append(";LABEL=");
1212                         ProcessData.Append(AddressProcessed);
1213                         
1214                 }
1215                 
1216                 // Check if there is a value for LANGUAGE.
1217                 
1218                 if ((*AddressListLang)[AddressIter->first].size() > 0){
1219                 
1220                         ProcessData.Append(";LANGUAGE=");
1221                         ProcessData.Append((*AddressListLang)[AddressIter->first]);
1222                         
1223                 }
1224                 
1225                 // Check if there is a value for MEDIATYPE.
1226                 
1227                 if ((*AddressListMediatype)[AddressIter->first].size() > 0){
1228                 
1229                         ProcessData.Append(";MEDIATYPE=");
1230                         ProcessData.Append((*AddressListMediatype)[AddressIter->first]);
1231                         
1232                 }
1233                 
1234                 // Check if there is a value for PID.
1236                 if ((*AddressListPID)[AddressIter->first].size() > 0){
1237                 
1238                         ProcessData.Append(";PID=");
1239                         ProcessData.Append((*AddressListPID)[AddressIter->first]);
1240                         
1241                 }
1243                 // Check if there is a value for PREF.
1245                 if ((*AddressListPref)[AddressIter->first] > 0){
1246                 
1247                         ProcessData.Append(";PREF=");
1248                         ProcessData.Append(wxString::Format("%i", (*AddressListPref)[AddressIter->first]));
1249                         
1250                 }
1252                 // Check if there is a value for TZ.
1254                 if ((*AddressListTimezone)[AddressIter->first].size() > 0){
1255                 
1256                         ProcessData.Append(";TZ=");
1257                         ProcessData.Append((*AddressListTimezone)[AddressIter->first]);
1258                         
1259                 }
1260                 
1261                 // Check if there is a value for tokens.
1263                 if ((*AddressListTokens)[AddressIter->first].size() > 0){
1264                 
1265                         ProcessData.Append(";");
1266                         ProcessData.Append((*AddressListTokens)[AddressIter->first]);
1267                         
1268                 }
1269                 
1270                 // Build the address.
1271                 
1272                 ProcessData.Append(":;;");
1273                 ProcessData.Append((*AddressList)[AddressIter->first]);
1274                 ProcessData.Append(";");
1275                 ProcessData.Append((*AddressListTown)[AddressIter->first]);
1276                 ProcessData.Append(";");
1277                 ProcessData.Append((*AddressListCounty)[AddressIter->first]);
1278                 ProcessData.Append(";");
1279                 ProcessData.Append((*AddressListPostCode)[AddressIter->first]);
1280                 ProcessData.Append(";");
1281                 ProcessData.Append((*AddressListCountry)[AddressIter->first]);
1282                 ProcessData.Append("\n");
1283                 
1284                 ProcessData = OutputText(&ProcessData);
1285                         
1286                 SaveData->Append(ProcessData);
1287                 ProcessData.clear();
1288                         
1289         }
1290                         
1293 void ContactDataObject::SaveEmail(map<int, wxString> *EmailList, map<int, wxString> *EmailListAltID, 
1294         map<int, wxString> *EmailListPID, map<int, wxString> *EmailListType,
1295         map<int, int> *EmailListPref, map<int, wxString> *EmailListTokens, 
1296         wxString *SaveData, wxString DataType){
1298         wxString ProcessData = "";
1299         
1300         for (std::map<int, wxString>::iterator EmailIter = EmailList->begin();
1301                 EmailIter != EmailList->end(); EmailIter++){
1303                 ProcessData.Append("EMAIL");
1304                         
1305                 // Check if there is a value for TYPE.
1306                 
1307                 if (DataType.size() > 0){
1308                 
1309                         ProcessData.Append(";TYPE=");
1310                         ProcessData.Append(DataType);
1311                         
1312                 }
1313                 
1314                 // Check if there is a value for ALTID.
1315                 
1316                 if ((*EmailListAltID)[EmailIter->first].size() > 0){
1317                 
1318                         ProcessData.Append(";ALTID=");
1319                         ProcessData.Append((*EmailListAltID)[EmailIter->first]);
1320                         
1321                 }
1322                 
1323                 // Check if there is a value for PID.
1325                 if ((*EmailListPID)[EmailIter->first].size() > 0){
1326                 
1327                         ProcessData.Append(";PID=");
1328                         ProcessData.Append((*EmailListPID)[EmailIter->first]);
1329                         
1330                 }
1332                 // Check if there is a value for PREF.
1334                 if ((*EmailListPref)[EmailIter->first] > 0){
1335                 
1336                         ProcessData.Append(";PREF=");
1337                         ProcessData.Append(wxString::Format("%i", (*EmailListPref)[EmailIter->first]));
1338                         
1339                 }
1341                 // Check if there is a value for tokens.
1343                 if ((*EmailListTokens)[EmailIter->first].size() > 0){
1344                 
1345                         ProcessData.Append(";");
1346                         ProcessData.Append((*EmailListTokens)[EmailIter->first]);
1347                         
1348                 }
1349                         
1350                 ProcessData.Append(":");
1351                 ProcessData.Append(EmailIter->second);
1352                 ProcessData.Append("\n");
1354                 ProcessData = OutputText(&ProcessData);
1355                         
1356                 SaveData->Append(ProcessData);
1357                 ProcessData.clear();
1358                         
1359         }
1360                 
1363 void ContactDataObject::SaveIMPP(map<int, wxString> *IMList, map<int, wxString> *IMListAltID, 
1364         map<int, wxString> *IMListPID, map<int, wxString> *IMListType,
1365         map<int, wxString> *IMListTypeInfo, map<int, wxString> *IMListMediatype, 
1366         map<int, int> *IMListPref, map<int, wxString> *IMListTokens, 
1367         wxString *SaveData, wxString DataType){
1369         wxString ProcessData = "";
1370         
1371         for (std::map<int, wxString>::iterator IMIter = IMList->begin();
1372                 IMIter != IMList->end(); IMIter++){
1374                 ProcessData.Append("IMPP");
1375                         
1376                 // Check if there is a value for TYPE.
1377                 
1378                 if (DataType.size() > 0){
1379                 
1380                         ProcessData.Append(";TYPE=");
1381                         ProcessData.Append(DataType);
1382                         
1383                 }
1384                 
1385                 // Check if there is a value for ALTID.
1386                 
1387                 if ((*IMListAltID)[IMIter->first].size() > 0){
1388                 
1389                         ProcessData.Append(";ALTID=");
1390                         ProcessData.Append((*IMListAltID)[IMIter->first]);
1391                         
1392                 }
1393                 
1394                 // Check if there is a value for MEDIATYPE.
1395                 
1396                 if ((*IMListMediatype)[IMIter->first].size() > 0){
1397                 
1398                         ProcessData.Append(";MEDIATYPE=");
1399                         ProcessData.Append((*IMListMediatype)[IMIter->first]);
1400                         
1401                 }
1402                 
1403                 // Check if there is a value for PID.
1405                 if ((*IMListPID)[IMIter->first].size() > 0){
1406                 
1407                         ProcessData.Append(";PID=");
1408                         ProcessData.Append((*IMListPID)[IMIter->first]);
1409                         
1410                 }
1412                 // Check if there is a value for PREF.
1414                 if ((*IMListPref)[IMIter->first] > 0){
1415                 
1416                         ProcessData.Append(";PREF=");
1417                         ProcessData.Append(wxString::Format("%i", (*IMListPref)[IMIter->first]));
1418                         
1419                 }
1421                 // Check if there is a value for tokens.
1423                 if ((*IMListTokens)[IMIter->first].size() > 0){
1424                 
1425                         ProcessData.Append(";");
1426                         ProcessData.Append((*IMListTokens)[IMIter->first]);
1427                         
1428                 }
1430                 ProcessData.Append(":");
1431                 ProcessData.Append((*IMListTypeInfo)[IMIter->first]);
1432                 ProcessData.Append(":");
1433                 ProcessData.Append(IMIter->second);
1434                 ProcessData.Append("\n");
1436                 ProcessData = OutputText(&ProcessData);
1437                         
1438                 SaveData->Append(ProcessData);
1439                 ProcessData.clear();
1440                         
1441         }
1442                 
1445 void ContactDataObject::SaveTelephone(map<int, wxString> *TelephoneList, map<int, wxString> *TelephoneListAltID, 
1446         map<int, wxString> *TelephoneListPID, map<int, wxString> *TelephoneListType,
1447         map<int, wxString> *TelephoneListTypeInfo, map<int, wxString> *TelephoneListDataType, 
1448         map<int, int> *TelephoneListPref, map<int, wxString> *TelephoneListTokens, 
1449         wxString *SaveData, wxString DataType){
1451         wxString ProcessData = "";
1452         
1453         for (std::map<int, wxString>::iterator TelephoneIter = TelephoneList->begin();
1454                 TelephoneIter != TelephoneList->end(); TelephoneIter++){
1456                 ProcessData.Append("TEL");
1457                         
1458                 // Check if there is a value for TYPE.
1460                 if (DataType.size() > 0 || (*TelephoneListAltID)[TelephoneIter->first].size() > 0){
1462                         ProcessData.Append(";TYPE=\"");
1463                         
1464                         bool ProcessedType = false;
1465                         
1466                         if (DataType.size() > 0){
1467                 
1468                                 ProcessData.Append(DataType);
1469                                 ProcessedType = true;
1470                         
1471                         }
1472                         
1473                         if ((*TelephoneListAltID)[TelephoneIter->first].size() > 0){
1474                                 
1475                                 if (ProcessedType == true){
1476                                         ProcessData.Append(",");
1477                                 }
1478                                 ProcessData.Append((*TelephoneListTypeInfo)[TelephoneIter->first]);
1479                                 
1480                         }
1481                         
1482                         ProcessData.Append("\"");
1483                 
1484                 }
1485                 
1486                 // Check if there is a value for ALTID.
1487                 
1488                 if ((*TelephoneListAltID)[TelephoneIter->first].size() > 0){
1489                 
1490                         ProcessData.Append(";ALTID=");
1491                         ProcessData.Append((*TelephoneListAltID)[TelephoneIter->first]);
1492                         
1493                 }
1494                 
1495                 // Check if there is a value for PID.
1497                 if ((*TelephoneListPID)[TelephoneIter->first].size() > 0){
1498                 
1499                         ProcessData.Append(";PID=");
1500                         ProcessData.Append((*TelephoneListPID)[TelephoneIter->first]);
1501                         
1502                 }
1504                 // Check if there is a value for PREF.
1506                 if ((*TelephoneListPref)[TelephoneIter->first] > 0){
1507                 
1508                         ProcessData.Append(";PREF=");
1509                         ProcessData.Append(wxString::Format("%i", (*TelephoneListPref)[TelephoneIter->first]));
1510                         
1511                 }
1513                 // Check if there is a value for tokens.
1515                 if ((*TelephoneListTokens)[TelephoneIter->first].size() > 0){
1516                 
1517                         ProcessData.Append(";");
1518                         ProcessData.Append((*TelephoneListTokens)[TelephoneIter->first]);
1519                         
1520                 }
1522                 ProcessData.Append(":");
1523                 ProcessData.Append((*TelephoneListDataType)[TelephoneIter->first]);
1524                 ProcessData.Append(":");
1525                 ProcessData.Append(TelephoneIter->second);
1526                 ProcessData.Append("\n");
1528                 ProcessData = OutputText(&ProcessData);
1529                         
1530                 SaveData->Append(ProcessData);
1531                 ProcessData.clear();
1532                         
1533         }
1534                 
1537 void ContactDataObject::SaveLanguage(map<int, wxString> *LanguageList, map<int, wxString> *LanguageListAltID, 
1538         map<int, wxString> *LanguageListPID, map<int, wxString> *LanguageListType,
1539         map<int, int> *LangaugeListPref, map<int, wxString> *LanguageListTokens, 
1540         wxString *SaveData, wxString DataType){
1542         wxString ProcessData = "";
1543         
1544         for (std::map<int, wxString>::iterator LanguageIter = LanguageList->begin();
1545                 LanguageIter != LanguageList->end(); LanguageIter++){
1547                 ProcessData.Append("LANG");
1548                         
1549                 // Check if there is a value for TYPE.
1550                 
1551                 if (DataType.size() > 0){
1552                 
1553                         ProcessData.Append(";TYPE=");
1554                         ProcessData.Append(DataType);
1555                         
1556                 }
1557                 
1558                 // Check if there is a value for ALTID.
1559                 
1560                 if ((*LanguageListAltID)[LanguageIter->first].size() > 0){
1561                 
1562                         ProcessData.Append(";ALTID=");
1563                         ProcessData.Append((*LanguageListAltID)[LanguageIter->first]);
1564                         
1565                 }
1566                 
1567                 // Check if there is a value for PID.
1569                 if ((*LanguageListPID)[LanguageIter->first].size() > 0){
1570                 
1571                         ProcessData.Append(";PID=");
1572                         ProcessData.Append((*LanguageListPID)[LanguageIter->first]);
1573                         
1574                 }
1576                 // Check if there is a value for PREF.
1578                 if ((*LangaugeListPref)[LanguageIter->first] > 0){
1579                 
1580                         ProcessData.Append(";PREF=");
1581                         ProcessData.Append(wxString::Format("%i", (*LangaugeListPref)[LanguageIter->first]));
1582                         
1583                 }
1585                 // Check if there is a value for tokens.
1587                 if ((*LanguageListTokens)[LanguageIter->first].size() > 0){
1588                 
1589                         ProcessData.Append(";");
1590                         ProcessData.Append((*LanguageListTokens)[LanguageIter->first]);
1591                         
1592                 }
1593                         
1594                 ProcessData.Append(":");
1595                 ProcessData.Append(LanguageIter->second);
1596                 ProcessData.Append("\n");
1598                 ProcessData = OutputText(&ProcessData);
1599                         
1600                 SaveData->Append(ProcessData);
1601                 ProcessData.clear();
1602                         
1603         }
1604                 
1607 void ContactDataObject::SaveGeoposition(map<int, wxString> *GeographyList, map<int, wxString> *GeographyListAltID, 
1608         map<int, wxString> *GeographyListPID, map<int, wxString> *GeographyListType,
1609         map<int, wxString> *GeographyListMediatype, map<int, wxString> *GeographyListDataType,
1610         map<int, int> *GeographyListPref, map<int, wxString> *GeographyListTokens, 
1611         wxString *SaveData, wxString DataType){
1613         wxString ProcessData = "";
1614         
1615         for (std::map<int, wxString>::iterator GeographyIter = GeographyList->begin();
1616                 GeographyIter != GeographyList->end(); GeographyIter++){
1618                 ProcessData.Append("GEO");
1619                         
1620                 // Check if there is a value for TYPE.
1621                 
1622                 if (DataType.size() > 0){
1623                 
1624                         ProcessData.Append(";TYPE=");
1625                         ProcessData.Append(DataType);
1626                         
1627                 }
1628                 
1629                 // Check if there is a value for ALTID.
1630                 
1631                 if ((*GeographyListAltID)[GeographyIter->first].size() > 0){
1632                 
1633                         ProcessData.Append(";ALTID=");
1634                         ProcessData.Append((*GeographyListAltID)[GeographyIter->first]);
1635                         
1636                 }
1637                 
1638                 // Check if there is a value for MEDIATYPE.
1639                 
1640                 if ((*GeographyListMediatype)[GeographyIter->first].size() > 0){
1641                 
1642                         ProcessData.Append(";MEDIATYPE=");
1643                         ProcessData.Append((*GeographyListMediatype)[GeographyIter->first]);
1644                         
1645                 }
1646                 
1647                 // Check if there is a value for PID.
1649                 if ((*GeographyListPID)[GeographyIter->first].size() > 0){
1650                 
1651                         ProcessData.Append(";PID=");
1652                         ProcessData.Append((*GeographyListPID)[GeographyIter->first]);
1653                         
1654                 }
1656                 // Check if there is a value for PREF.
1658                 if ((*GeographyListPref)[GeographyIter->first] > 0){
1659                 
1660                         ProcessData.Append(";PREF=");
1661                         ProcessData.Append(wxString::Format("%i", (*GeographyListPref)[GeographyIter->first]));
1662                         
1663                 }
1665                 // Check if there is a value for tokens.
1667                 if ((*GeographyListTokens)[GeographyIter->first].size() > 0){
1668                 
1669                         ProcessData.Append(";");
1670                         ProcessData.Append((*GeographyListTokens)[GeographyIter->first]);
1671                         
1672                 }
1673                         
1674                 ProcessData.Append(":");
1675                 ProcessData.Append((*GeographyListDataType)[GeographyIter->first]);
1676                 ProcessData.Append(":");
1677                 ProcessData.Append(GeographyIter->second);
1678                 ProcessData.Append("\n");
1680                 ProcessData = OutputText(&ProcessData);
1681                         
1682                 SaveData->Append(ProcessData);
1683                 ProcessData.clear();
1684                         
1685         }
1686                 
1689 void ContactDataObject::SaveURL(map<int, wxString> *WebsiteList, map<int, wxString> *WebsiteListAltID, 
1690                 map<int, wxString> *WebsiteListPID, map<int, wxString> *WebsiteListType,
1691                 map<int, wxString> *WebsiteListMediatype, map<int, int> *WebsiteListPref, 
1692                 map<int, wxString> *WebsiteListTokens, wxString *SaveData, wxString DataType){
1694         wxString ProcessData = "";
1695         
1696         for (std::map<int, wxString>::iterator WebsiteIter = WebsiteList->begin();
1697                 WebsiteIter != WebsiteList->end(); WebsiteIter++){
1699                 ProcessData.Append("URL");
1700                         
1701                 // Check if there is a value for TYPE.
1702                 
1703                 if (DataType.size() > 0){
1704                 
1705                         ProcessData.Append(";TYPE=");
1706                         ProcessData.Append(DataType);
1707                         
1708                 }
1709                 
1710                 // Check if there is a value for ALTID.
1711                 
1712                 if ((*WebsiteListAltID)[WebsiteIter->first].size() > 0){
1713                 
1714                         ProcessData.Append(";ALTID=");
1715                         ProcessData.Append((*WebsiteListAltID)[WebsiteIter->first]);
1716                         
1717                 }
1718                 
1719                 // Check if there is a value for MEDIATYPE.
1720                 
1721                 if ((*WebsiteListMediatype)[WebsiteIter->first].size() > 0){
1722                 
1723                         ProcessData.Append(";MEDIATYPE=");
1724                         ProcessData.Append((*WebsiteListMediatype)[WebsiteIter->first]);
1725                         
1726                 }
1727                 
1728                 // Check if there is a value for PID.
1730                 if ((*WebsiteListPID)[WebsiteIter->first].size() > 0){
1731                 
1732                         ProcessData.Append(";PID=");
1733                         ProcessData.Append((*WebsiteListPID)[WebsiteIter->first]);
1734                         
1735                 }
1737                 // Check if there is a value for PREF.
1739                 if ((*WebsiteListPref)[WebsiteIter->first] > 0){
1740                 
1741                         ProcessData.Append(";PREF=");
1742                         ProcessData.Append(wxString::Format("%i", (*WebsiteListPref)[WebsiteIter->first]));
1743                         
1744                 }
1746                 // Check if there is a value for tokens.
1748                 if ((*WebsiteListTokens)[WebsiteIter->first].size() > 0){
1749                 
1750                         ProcessData.Append(";");
1751                         ProcessData.Append((*WebsiteListTokens)[WebsiteIter->first]);
1752                         
1753                 }
1754                         
1755                 ProcessData.Append(":");
1756                 ProcessData.Append(WebsiteIter->second);
1757                 ProcessData.Append("\n");
1759                 ProcessData = OutputText(&ProcessData);
1760                         
1761                 SaveData->Append(ProcessData);
1762                 ProcessData.clear();
1763                         
1764         }
1765                         
1768 void ContactDataObject::SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
1769         map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
1770         map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
1771         map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType){
1773         wxString ProcessData = "";
1774                 
1775         for (std::map<int, wxString>::iterator RoleIter = RoleList->begin();
1776                 RoleIter != RoleList->end(); RoleIter++){
1778                 ProcessData.Append("ROLE");
1779                         
1780                 // Check if there is a value for TYPE.
1781                 
1782                 if (DataType.size() > 0){
1783                 
1784                         ProcessData.Append(";TYPE=");
1785                         ProcessData.Append(DataType);
1786                         
1787                 }
1788                 
1789                 // Check if there is a value for ALTID.
1790                 
1791                 if ((*RoleListAltID)[RoleIter->first].size() > 0){
1792                 
1793                         ProcessData.Append(";ALTID=");
1794                         ProcessData.Append((*RoleListAltID)[RoleIter->first]);
1795                         
1796                 }
1798                 // Check if there is a value for LANGUAGE.
1799                 
1800                 if ((*RoleListLanguage)[RoleIter->first].size() > 0){
1801                 
1802                         ProcessData.Append(";LANGUAGE=");
1803                         ProcessData.Append((*RoleListLanguage)[RoleIter->first]);
1804                         
1805                 }
1806                 
1807                 // Check if there is a value for PID.
1809                 if ((*RoleListPID)[RoleIter->first].size() > 0){
1810                 
1811                         ProcessData.Append(";PID=");
1812                         ProcessData.Append((*RoleListPID)[RoleIter->first]);
1813                         
1814                 }
1816                 // Check if there is a value for PREF.
1818                 if ((*RoleListPref)[RoleIter->first] > 0){
1819                 
1820                         ProcessData.Append(";PREF=");
1821                         ProcessData.Append(wxString::Format("%i", (*RoleListPref)[RoleIter->first]));
1822                         
1823                 }
1825                 // Check if there is a value for tokens.
1827                 if ((*RoleListTokens)[RoleIter->first].size() > 0){
1828                 
1829                         ProcessData.Append(";");
1830                         ProcessData.Append((*RoleListTokens)[RoleIter->first]);
1831                         
1832                 }
1833                         
1834                 ProcessData.Append(":");
1835                 ProcessData.Append(RoleIter->second);
1836                 ProcessData.Append("\n");
1838                 ProcessData = OutputText(&ProcessData);
1839                 
1840                 SaveData->Append(ProcessData);
1841                 ProcessData.clear();
1842                         
1843         }
1844                 
1847 void ContactDataObject::SaveOrganisation(map<int, wxString> *OrganisationList, map<int, wxString> *OrganisationListAltID,
1848         map<int, wxString> *OrganisationListPID, map<int, wxString> *OrganisationListLanguage, 
1849         map<int, wxString> *OrganisationListSortAs, map<int, wxString> *OrganisationListType, 
1850         map<int, int> *OrganisationListPref, map<int, wxString> *OrganisationListTokens, 
1851         wxString *SaveData, wxString DataType){
1853         wxString ProcessData = "";
1854                 
1855         for (std::map<int, wxString>::iterator OrganisationIter = OrganisationList->begin();
1856                 OrganisationIter != OrganisationList->end(); OrganisationIter++){
1858                 ProcessData.Append("ORG");
1859                         
1860                 // Check if there is a value for TYPE.
1861                 
1862                 if (DataType.size() > 0){
1863                 
1864                         ProcessData.Append(";TYPE=");
1865                         ProcessData.Append(DataType);
1866                         
1867                 }
1868                 
1869                 // Check if there is a value for ALTID.
1870                 
1871                 if ((*OrganisationListAltID)[OrganisationIter->first].size() > 0){
1872                 
1873                         ProcessData.Append(";ALTID=");
1874                         ProcessData.Append((*OrganisationListAltID)[OrganisationIter->first]);
1875                         
1876                 }
1878                 // Check if there is a value for LANGUAGE.
1879                 
1880                 if ((*OrganisationListLanguage)[OrganisationIter->first].size() > 0){
1881                 
1882                         ProcessData.Append(";LANGUAGE=");
1883                         ProcessData.Append((*OrganisationListLanguage)[OrganisationIter->first]);
1884                         
1885                 }
1886                 
1887                 // Check if there is a value for PID.
1889                 if ((*OrganisationListPID)[OrganisationIter->first].size() > 0){
1890                 
1891                         ProcessData.Append(";PID=");
1892                         ProcessData.Append((*OrganisationListPID)[OrganisationIter->first]);
1893                         
1894                 }
1896                 // Check if there is a value for PREF.
1898                 if ((*OrganisationListPref)[OrganisationIter->first] > 0){
1899                 
1900                         ProcessData.Append(";PREF=");
1901                         ProcessData.Append(wxString::Format("%i", (*OrganisationListPref)[OrganisationIter->first]));
1902                         
1903                 }
1904                 
1905                 // Check if there is a value for SORT-AS.
1906                 
1907                 if ((*OrganisationListSortAs)[OrganisationIter->first].size() > 0){
1908                 
1909                         ProcessData.Append(";SORT-AS=\"");
1910                         ProcessData.Append((*OrganisationListSortAs)[OrganisationIter->first]);
1911                         ProcessData.Append("\"");
1912                         
1913                 }
1915                 // Check if there is a value for tokens.
1917                 if ((*OrganisationListTokens)[OrganisationIter->first].size() > 0){
1918                 
1919                         ProcessData.Append(";");
1920                         ProcessData.Append((*OrganisationListTokens)[OrganisationIter->first]);
1921                         
1922                 }
1923                         
1924                 ProcessData.Append(":");
1925                 ProcessData.Append(OrganisationIter->second);
1926                 ProcessData.Append("\n");
1928                 ProcessData = OutputText(&ProcessData);
1929                 
1930                 SaveData->Append(ProcessData);
1931                 ProcessData.clear();
1932                         
1933         }
1934                 
1937 void ContactDataObject::SaveNote(map<int, wxString> *NoteList, map<int, wxString> *NoteListLanguage,
1938         map<int, wxString> *NoteListAltID, map<int, wxString> *NoteListPID,
1939         map<int, wxString> *NoteListType, map<int, int> *NoteListPref,
1940         map<int, wxString> *NoteListTokens, wxString *SaveData, wxString DataType){
1942         wxString ProcessData = "";
1943                 
1944         for (std::map<int, wxString>::iterator NoteIter = NoteList->begin();
1945                 NoteIter != NoteList->end(); NoteIter++){
1947                 ProcessData.Append("NOTE");
1948                         
1949                 // Check if there is a value for TYPE.
1950                 
1951                 if (DataType.size() > 0){
1952                 
1953                         ProcessData.Append(";TYPE=");
1954                         ProcessData.Append(DataType);
1955                         
1956                 }
1957                 
1958                 // Check if there is a value for ALTID.
1959                 
1960                 if ((*NoteListAltID)[NoteIter->first].size() > 0){
1961                 
1962                         ProcessData.Append(";ALTID=");
1963                         ProcessData.Append((*NoteListAltID)[NoteIter->first]);
1964                         
1965                 }
1967                 // Check if there is a value for LANGUAGE.
1968                 
1969                 if ((*NoteListLanguage)[NoteIter->first].size() > 0){
1970                 
1971                         ProcessData.Append(";LANGUAGE=");
1972                         ProcessData.Append((*NoteListLanguage)[NoteIter->first]);
1973                         
1974                 }
1975                 
1976                 // Check if there is a value for PID.
1978                 if ((*NoteListPID)[NoteIter->first].size() > 0){
1979                 
1980                         ProcessData.Append(";PID=");
1981                         ProcessData.Append((*NoteListPID)[NoteIter->first]);
1982                         
1983                 }
1985                 // Check if there is a value for PREF.
1987                 if ((*NoteListPref)[NoteIter->first] > 0){
1988                 
1989                         ProcessData.Append(";PREF=");
1990                         ProcessData.Append(wxString::Format("%i", (*NoteListPref)[NoteIter->first]));
1991                         
1992                 }
1994                 // Check if there is a value for tokens.
1996                 if ((*NoteListTokens)[NoteIter->first].size() > 0){
1997                 
1998                         ProcessData.Append(";");
1999                         ProcessData.Append((*NoteListTokens)[NoteIter->first]);
2000                         
2001                 }
2002                         
2003                 ProcessData.Append(":");
2004                 ProcessData.Append(NoteIter->second);
2005                 ProcessData.Replace("\n", "\\n", true);
2006                 ProcessData.Append("\n");
2008                 ProcessData = OutputText(&ProcessData);
2009                 
2010                 SaveData->Append(ProcessData);
2011                 ProcessData.clear();
2012                         
2013         }
2014                 
2017 void ContactDataObject::SaveCategory(map<int, wxString> *CategoryList, map<int, wxString> *CategoryListLanguage,
2018         map<int, wxString> *CategoryListAltID, map<int, wxString> *CategoryListPID,
2019         map<int, wxString> *CategoryListType, map<int, int> *CategoryListPref,
2020         map<int, wxString> *CategoryListTokens, wxString *SaveData){
2022         wxString ProcessData = "";
2023                 
2024         for (std::map<int, wxString>::iterator CategoryIter = CategoryList->begin();
2025                 CategoryIter != CategoryList->end(); CategoryIter++){
2027                 ProcessData.Append("CATEGORIES");
2028                         
2029                 // Check if there is a value for TYPE.
2030                 
2031                 if ((*CategoryListType)[CategoryIter->first].size() > 0){
2032                 
2033                         ProcessData.Append(";TYPE=");
2034                         ProcessData.Append((*CategoryListType)[CategoryIter->first]);
2035                         
2036                 }
2037                 
2038                 // Check if there is a value for ALTID.
2039                 
2040                 if ((*CategoryListAltID)[CategoryIter->first].size() > 0){
2041                 
2042                         ProcessData.Append(";ALTID=");
2043                         ProcessData.Append((*CategoryListAltID)[CategoryIter->first]);
2044                         
2045                 }
2047                 // Check if there is a value for LANGUAGE.
2048                 
2049                 if ((*CategoryListLanguage)[CategoryIter->first].size() > 0){
2050                 
2051                         ProcessData.Append(";LANGUAGE=");
2052                         ProcessData.Append((*CategoryListLanguage)[CategoryIter->first]);
2053                         
2054                 }
2055                 
2056                 // Check if there is a value for PID.
2058                 if ((*CategoryListPID)[CategoryIter->first].size() > 0){
2059                 
2060                         ProcessData.Append(";PID=");
2061                         ProcessData.Append((*CategoryListPID)[CategoryIter->first]);
2062                         
2063                 }
2065                 // Check if there is a value for PREF.
2067                 if ((*CategoryListPref)[CategoryIter->first] > 0){
2068                 
2069                         ProcessData.Append(";PREF=");
2070                         ProcessData.Append(wxString::Format("%i", (*CategoryListPref)[CategoryIter->first]));
2071                         
2072                 }
2074                 // Check if there is a value for tokens.
2076                 if ((*CategoryListTokens)[CategoryIter->first].size() > 0){
2077                 
2078                         ProcessData.Append(";");
2079                         ProcessData.Append((*CategoryListTokens)[CategoryIter->first]);
2080                         
2081                 }
2082                         
2083                 ProcessData.Append(":");
2084                 ProcessData.Append(CategoryIter->second);
2085                 ProcessData.Append("\n");
2087                 ProcessData = OutputText(&ProcessData);
2088                 
2089                 SaveData->Append(ProcessData);
2090                 ProcessData.clear();
2091                         
2092         }
2093                 
2096 void ContactDataObject::SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID, 
2097                 map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
2098                 map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
2099                 map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
2100                 map<int, wxString> *PicturesListTokens, wxString *SaveData){
2102         wxString ProcessData = "";
2103                 
2104         for (std::map<int, string>::iterator PicturesIter = PicturesList->begin();
2105                 PicturesIter != PicturesList->end(); PicturesIter++){
2107                 ProcessData.Append("PHOTO");
2108                         
2109                 // Check if there is a value for TYPE.
2110                 
2111                 if ((*PicturesListType)[PicturesIter->first].size() > 0){
2112                 
2113                         ProcessData.Append(";TYPE=");
2114                         ProcessData.Append((*PicturesListType)[PicturesIter->first]);
2115                         
2116                 }
2117                 
2118                 // Check if there is a value for ALTID.
2119                 
2120                 if ((*PicturesListAltID)[PicturesIter->first].size() > 0){
2121                 
2122                         ProcessData.Append(";ALTID=");
2123                         ProcessData.Append((*PicturesListAltID)[PicturesIter->first]);
2124                         
2125                 }
2127                 // Check if there is a value for MEDIATYPE..
2128                 
2129                 if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){
2130                 
2131                         ProcessData.Append(";MEDIATYPE=");
2132                         ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]);
2133                         
2134                 }
2135                 
2136                 // Check if there is a value for PID.
2138                 if ((*PicturesListPID)[PicturesIter->first].size() > 0){
2139                 
2140                         ProcessData.Append(";PID=");
2141                         ProcessData.Append((*PicturesListPID)[PicturesIter->first]);
2142                         
2143                 }
2145                 // Check if there is a value for PREF.
2147                 if ((*PicturesListPref)[PicturesIter->first] > 0){
2148                 
2149                         ProcessData.Append(";PREF=");
2150                         ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first]));
2151                         
2152                 }
2154                 // Check if there is a value for tokens.
2156                 if ((*PicturesListTokens)[PicturesIter->first].size() > 0){
2157                 
2158                         ProcessData.Append(";");
2159                         ProcessData.Append((*PicturesListTokens)[PicturesIter->first]);
2160                         
2161                 }
2162                 
2163                 ProcessData.Append(":data:");
2164                 ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]);
2165                 ProcessData.Append(";");
2166                 ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]);
2167                 ProcessData.Append(",");
2168                 ProcessData.Append(PicturesIter->second);
2169                 ProcessData.Append("\n");
2171                 ProcessData = OutputText(&ProcessData);
2172                 
2173                 SaveData->Append(ProcessData);
2174                 ProcessData.clear();
2175                         
2176         }
2177                         
2180 void ContactDataObject::SaveLogo(map<int, string> *LogosList, map<int, wxString> *LogosListAltID, 
2181         map<int, wxString> *LogosListPID, map<int, wxString> *LogosListType,
2182         map<int, wxString> *LogosListPicEncType, map<int, wxString> *LogosListPictureType,
2183         map<int, wxString> *LogosListMediatype, map<int, int> *LogosListPref,
2184         map<int, wxString> *LogosListTokens, wxString *SaveData){
2186         wxString ProcessData = "";
2187                 
2188         for (std::map<int, string>::iterator LogosIter = LogosList->begin();
2189                 LogosIter != LogosList->end(); LogosIter++){
2191                 ProcessData.Append("LOGO");
2192                         
2193                 // Check if there is a value for TYPE.
2194                 
2195                 if ((*LogosListType)[LogosIter->first].size() > 0){
2196                 
2197                         ProcessData.Append(";TYPE=");
2198                         ProcessData.Append((*LogosListType)[LogosIter->first]);
2199                         
2200                 }
2201                 
2202                 // Check if there is a value for ALTID.
2203                 
2204                 if ((*LogosListAltID)[LogosIter->first].size() > 0){
2205                 
2206                         ProcessData.Append(";ALTID=");
2207                         ProcessData.Append((*LogosListAltID)[LogosIter->first]);
2208                         
2209                 }
2211                 // Check if there is a value for MEDIATYPE..
2212                 
2213                 if ((*LogosListMediatype)[LogosIter->first].size() > 0){
2214                 
2215                         ProcessData.Append(";MEDIATYPE=");
2216                         ProcessData.Append((*LogosListMediatype)[LogosIter->first]);
2217                         
2218                 }
2219                 
2220                 // Check if there is a value for PID.
2222                 if ((*LogosListPID)[LogosIter->first].size() > 0){
2223                 
2224                         ProcessData.Append(";PID=");
2225                         ProcessData.Append((*LogosListPID)[LogosIter->first]);
2226                         
2227                 }
2229                 // Check if there is a value for PREF.
2231                 if ((*LogosListPref)[LogosIter->first] > 0){
2232                 
2233                         ProcessData.Append(";PREF=");
2234                         ProcessData.Append(wxString::Format("%i", (*LogosListPref)[LogosIter->first]));
2235                         
2236                 }
2238                 // Check if there is a value for tokens.
2240                 if ((*LogosListTokens)[LogosIter->first].size() > 0){
2241                 
2242                         ProcessData.Append(";");
2243                         ProcessData.Append((*LogosListTokens)[LogosIter->first]);
2244                         
2245                 }
2246                 
2247                 ProcessData.Append(":data:");
2248                 ProcessData.Append((*LogosListPictureType)[LogosIter->first]);
2249                 ProcessData.Append(";");
2250                 ProcessData.Append((*LogosListPicEncType)[LogosIter->first]);
2251                 ProcessData.Append(",");
2252                 ProcessData.Append(LogosIter->second);
2253                 ProcessData.Append("\n");
2255                 ProcessData = OutputText(&ProcessData);
2256                 
2257                 SaveData->Append(ProcessData);
2258                 ProcessData.clear();
2259                         
2260         }
2261                 
2264 void ContactDataObject::SaveSound(map<int, string> *SoundsList, map<int, wxString> *SoundsListAltID, 
2265         map<int, wxString> *SoundsListPID, map<int, wxString> *SoundsListType,
2266         map<int, wxString> *SoundsListAudioEncType, map<int, wxString> *SoundsListAudioType,
2267         map<int, wxString> *SoundsListMediatype, map<int, wxString> *SoundsListLanguage, 
2268         map<int, int> *SoundsListPref, map<int, wxString> *SoundsListTokens, 
2269         wxString *SaveData){
2271         wxString ProcessData = "";
2272                 
2273         for (std::map<int, string>::iterator SoundsIter = SoundsList->begin();
2274                 SoundsIter != SoundsList->end(); SoundsIter++){
2276                 ProcessData.Append("SOUND");
2277                         
2278                 // Check if there is a value for TYPE.
2279                 
2280                 if ((*SoundsListType)[SoundsIter->first].size() > 0){
2281                 
2282                         ProcessData.Append(";TYPE=");
2283                         ProcessData.Append((*SoundsListType)[SoundsIter->first]);
2284                         
2285                 }
2286                 
2287                 // Check if there is a value for ALTID.
2288                 
2289                 if ((*SoundsListAltID)[SoundsIter->first].size() > 0){
2290                 
2291                         ProcessData.Append(";ALTID=");
2292                         ProcessData.Append((*SoundsListAltID)[SoundsIter->first]);
2293                         
2294                 }
2296                 // Check if there is a value for LANGUAGE.
2297                 
2298                 if ((*SoundsListLanguage)[SoundsIter->first].size() > 0){
2299                 
2300                         ProcessData.Append(";LANGUAGE=");
2301                         ProcessData.Append((*SoundsListLanguage)[SoundsIter->first]);
2302                         
2303                 }
2304                 
2305                 // Check if there is a value for MEDIATYPE.
2306                 
2307                 if ((*SoundsListMediatype)[SoundsIter->first].size() > 0){
2308                 
2309                         ProcessData.Append(";MEDIATYPE=");
2310                         ProcessData.Append((*SoundsListMediatype)[SoundsIter->first]);
2311                         
2312                 }
2313                 
2314                 // Check if there is a value for PID.
2316                 if ((*SoundsListPID)[SoundsIter->first].size() > 0){
2317                 
2318                         ProcessData.Append(";PID=");
2319                         ProcessData.Append((*SoundsListPID)[SoundsIter->first]);
2320                         
2321                 }
2323                 // Check if there is a value for PREF.
2325                 if ((*SoundsListPref)[SoundsIter->first] > 0){
2326                 
2327                         ProcessData.Append(";PREF=");
2328                         ProcessData.Append(wxString::Format("%i", (*SoundsListPref)[SoundsIter->first]));
2329                         
2330                 }
2332                 // Check if there is a value for tokens.
2334                 if ((*SoundsListTokens)[SoundsIter->first].size() > 0){
2335                 
2336                         ProcessData.Append(";");
2337                         ProcessData.Append((*SoundsListTokens)[SoundsIter->first]);
2338                         
2339                 }
2340                 
2341                 ProcessData.Append(":data:");
2342                 ProcessData.Append((*SoundsListAudioType)[SoundsIter->first]);
2343                 ProcessData.Append(";");
2344                 ProcessData.Append((*SoundsListAudioEncType)[SoundsIter->first]);
2345                 ProcessData.Append(",");
2346                 ProcessData.Append(SoundsIter->second);
2347                 ProcessData.Append("\n");
2349                 ProcessData = OutputText(&ProcessData);
2350                 
2351                 SaveData->Append(ProcessData);
2352                 ProcessData.clear();
2353                         
2354         }
2355                 
2358 void ContactDataObject::SaveCalendarURI(map<int, wxString> *CalendarList, map<int, wxString> *CalendarListMediatype,
2359         map<int, wxString> *CalendarListAltID, map<int, wxString> *CalendarListPID,
2360         map<int, wxString> *CalendarListType, map<int, int> *CalendarListPref,
2361         map<int, wxString> *CalendarListTokens, wxString *SaveData){
2363         wxString ProcessData = "";
2364                 
2365         for (std::map<int, wxString>::iterator CalendarIter = CalendarList->begin();
2366                 CalendarIter != CalendarList->end(); CalendarIter++){
2368                 ProcessData.Append("CALURI");
2369                         
2370                 // Check if there is a value for TYPE.
2371                 
2372                 if ((*CalendarListType)[CalendarIter->first].size() > 0){
2373                 
2374                         ProcessData.Append(";TYPE=");
2375                         ProcessData.Append((*CalendarListType)[CalendarIter->first]);
2376                         
2377                 }
2378                 
2379                 // Check if there is a value for ALTID.
2380                 
2381                 if ((*CalendarListAltID)[CalendarIter->first].size() > 0){
2382                 
2383                         ProcessData.Append(";ALTID=");
2384                         ProcessData.Append((*CalendarListAltID)[CalendarIter->first]);
2385                         
2386                 }
2388                 // Check if there is a value for MEDIATYPE.
2389                 
2390                 if ((*CalendarListMediatype)[CalendarIter->first].size() > 0){
2391                 
2392                         ProcessData.Append(";MEDIATYPE=");
2393                         ProcessData.Append((*CalendarListMediatype)[CalendarIter->first]);
2394                         
2395                 }
2396                 
2397                 // Check if there is a value for PID.
2399                 if ((*CalendarListPID)[CalendarIter->first].size() > 0){
2400                 
2401                         ProcessData.Append(";PID=");
2402                         ProcessData.Append((*CalendarListPID)[CalendarIter->first]);
2403                         
2404                 }
2406                 // Check if there is a value for PREF.
2408                 if ((*CalendarListPref)[CalendarIter->first] > 0){
2409                 
2410                         ProcessData.Append(";PREF=");
2411                         ProcessData.Append(wxString::Format("%i", (*CalendarListPref)[CalendarIter->first]));
2412                         
2413                 }
2415                 // Check if there is a value for tokens.
2417                 if ((*CalendarListTokens)[CalendarIter->first].size() > 0){
2418                 
2419                         ProcessData.Append(";");
2420                         ProcessData.Append((*CalendarListTokens)[CalendarIter->first]);
2421                         
2422                 }
2423                         
2424                 ProcessData.Append(":");
2425                 ProcessData.Append(CalendarIter->second);
2426                 ProcessData.Append("\n");
2428                 ProcessData = OutputText(&ProcessData);
2429                 
2430                 SaveData->Append(ProcessData);
2431                 ProcessData.clear();
2432                         
2433         }
2434                 
2437 void ContactDataObject::SaveCalendarRequestURI(map<int, wxString> *CalendarRequestList, map<int, wxString> *CalendarRequestListMediatype,
2438         map<int, wxString> *CalendarRequestListAltID, map<int, wxString> *CalendarRequestListPID,
2439         map<int, wxString> *CalendarRequestListType, map<int, int> *CalendarRequestListPref,
2440         map<int, wxString> *CalendarRequestListTokens, wxString *SaveData){
2442         wxString ProcessData = "";
2443                 
2444         for (std::map<int, wxString>::iterator CalendarRequestIter = CalendarRequestList->begin();
2445                 CalendarRequestIter != CalendarRequestList->end(); CalendarRequestIter++){
2447                 ProcessData.Append("CALADRURI");
2448                         
2449                 // Check if there is a value for TYPE.
2450                 
2451                 if ((*CalendarRequestListType)[CalendarRequestIter->first].size() > 0){
2452                 
2453                         ProcessData.Append(";TYPE=");
2454                         ProcessData.Append((*CalendarRequestListType)[CalendarRequestIter->first]);
2455                         
2456                 }
2457                 
2458                 // Check if there is a value for ALTID.
2459                 
2460                 if ((*CalendarRequestListAltID)[CalendarRequestIter->first].size() > 0){
2461                 
2462                         ProcessData.Append(";ALTID=");
2463                         ProcessData.Append((*CalendarRequestListAltID)[CalendarRequestIter->first]);
2464                         
2465                 }
2467                 // Check if there is a value for MEDIATYPE.
2468                 
2469                 if ((*CalendarRequestListMediatype)[CalendarRequestIter->first].size() > 0){
2470                 
2471                         ProcessData.Append(";MEDIATYPE=");
2472                         ProcessData.Append((*CalendarRequestListMediatype)[CalendarRequestIter->first]);
2473                         
2474                 }
2475                 
2476                 // Check if there is a value for PID.
2478                 if ((*CalendarRequestListPID)[CalendarRequestIter->first].size() > 0){
2479                 
2480                         ProcessData.Append(";PID=");
2481                         ProcessData.Append((*CalendarRequestListPID)[CalendarRequestIter->first]);
2482                         
2483                 }
2485                 // Check if there is a value for PREF.
2487                 if ((*CalendarRequestListPref)[CalendarRequestIter->first] > 0){
2488                 
2489                         ProcessData.Append(";PREF=");
2490                         ProcessData.Append(wxString::Format("%i", (*CalendarRequestListPref)[CalendarRequestIter->first]));
2491                         
2492                 }
2494                 // Check if there is a value for tokens.
2496                 if ((*CalendarRequestListTokens)[CalendarRequestIter->first].size() > 0){
2497                 
2498                         ProcessData.Append(";");
2499                         ProcessData.Append((*CalendarRequestListTokens)[CalendarRequestIter->first]);
2500                         
2501                 }
2502                         
2503                 ProcessData.Append(":");
2504                 ProcessData.Append(CalendarRequestIter->second);
2505                 ProcessData.Append("\n");
2507                 ProcessData = OutputText(&ProcessData);
2508                 
2509                 SaveData->Append(ProcessData);
2510                 ProcessData.clear();
2511                         
2512         }
2513                 
2516 void ContactDataObject::SaveFreeBusyURI(std::map<int, wxString> *FreeBusyList, std::map<int, wxString> *FreeBusyListAltID, 
2517         std::map<int, wxString> *FreeBusyListPID, std::map<int, wxString> *FreeBusyListType,
2518         std::map<int, wxString> *FreeBusyListMediatype, std::map<int, int> *FreeBusyListPref, 
2519         std::map<int, wxString> *FreeBusyListTokens, wxString *SaveData){
2521         wxString ProcessData = "";
2522                 
2523         for (std::map<int, wxString>::iterator FreeBusyIter = FreeBusyList->begin();
2524                 FreeBusyIter != FreeBusyList->end(); FreeBusyIter++){
2526                 ProcessData.Append("FBURL");
2527                         
2528                 // Check if there is a value for TYPE.
2529                 
2530                 if ((*FreeBusyListType)[FreeBusyIter->first].size() > 0){
2531                 
2532                         ProcessData.Append(";TYPE=");
2533                         ProcessData.Append((*FreeBusyListType)[FreeBusyIter->first]);
2534                         
2535                 }
2536                 
2537                 // Check if there is a value for ALTID.
2538                 
2539                 if ((*FreeBusyListAltID)[FreeBusyIter->first].size() > 0){
2540                 
2541                         ProcessData.Append(";ALTID=");
2542                         ProcessData.Append((*FreeBusyListAltID)[FreeBusyIter->first]);
2543                         
2544                 }
2546                 // Check if there is a value for MEDIATYPE.
2547                 
2548                 if ((*FreeBusyListMediatype)[FreeBusyIter->first].size() > 0){
2549                 
2550                         ProcessData.Append(";MEDIATYPE=");
2551                         ProcessData.Append((*FreeBusyListMediatype)[FreeBusyIter->first]);
2552                         
2553                 }
2554                 
2555                 // Check if there is a value for PID.
2557                 if ((*FreeBusyListPID)[FreeBusyIter->first].size() > 0){
2558                 
2559                         ProcessData.Append(";PID=");
2560                         ProcessData.Append((*FreeBusyListPID)[FreeBusyIter->first]);
2561                         
2562                 }
2564                 // Check if there is a value for PREF.
2566                 if ((*FreeBusyListPref)[FreeBusyIter->first] > 0){
2567                 
2568                         ProcessData.Append(";PREF=");
2569                         ProcessData.Append(wxString::Format("%i", (*FreeBusyListPref)[FreeBusyIter->first]));
2570                         
2571                 }
2573                 // Check if there is a value for tokens.
2575                 if ((*FreeBusyListTokens)[FreeBusyIter->first].size() > 0){
2576                 
2577                         ProcessData.Append(";");
2578                         ProcessData.Append((*FreeBusyListTokens)[FreeBusyIter->first]);
2579                         
2580                 }
2581                         
2582                 ProcessData.Append(":");
2583                 ProcessData.Append(FreeBusyIter->second);
2584                 ProcessData.Append("\n");
2586                 ProcessData = OutputText(&ProcessData);
2587                 
2588                 SaveData->Append(ProcessData);
2589                 ProcessData.clear();
2590                         
2591         }
2592                 
2595 void ContactDataObject::SaveKey(map<int, wxString> *KeyList, map<int, wxString> *KeyListAltID, 
2596         map<int, wxString> *KeyListPID, map<int, wxString> *KeyListType,
2597         map<int, bool> *KeyListKeyType, map<int, wxString> *KeyListDataEncType, 
2598         map<int, wxString> *KeyListDataType, map<int, int> *KeyListPref, 
2599         map<int, wxString> *KeyListTokens, wxString *SaveData){
2601         wxString ProcessData = "";
2602                 
2603         for (std::map<int, wxString>::iterator KeyIter = KeyList->begin();
2604                 KeyIter != KeyList->end(); KeyIter++){
2606                 ProcessData.Append("KEY");
2607                         
2608                 // Check if there is a value for TYPE.
2609                 
2610                 if ((*KeyListType)[KeyIter->first].size() > 0){
2611                 
2612                         ProcessData.Append(";TYPE=");
2613                         ProcessData.Append((*KeyListType)[KeyIter->first]);
2614                         
2615                 }
2616                 
2617                 // Check if there is a value for ALTID.
2618                 
2619                 if ((*KeyListAltID)[KeyIter->first].size() > 0){
2620                 
2621                         ProcessData.Append(";ALTID=");
2622                         ProcessData.Append((*KeyListAltID)[KeyIter->first]);
2623                         
2624                 }
2625                 
2626                 // Check if there is a value for PID.
2628                 if ((*KeyListPID)[KeyIter->first].size() > 0){
2629                 
2630                         ProcessData.Append(";PID=");
2631                         ProcessData.Append((*KeyListPID)[KeyIter->first]);
2632                         
2633                 }
2635                 // Check if there is a value for PREF.
2637                 if ((*KeyListPref)[KeyIter->first] > 0){
2638                 
2639                         ProcessData.Append(";PREF=");
2640                         ProcessData.Append(wxString::Format("%i", (*KeyListPref)[KeyIter->first]));
2641                         
2642                 }
2644                 // Check if there is a value for tokens.
2646                 if ((*KeyListTokens)[KeyIter->first].size() > 0){
2647                 
2648                         ProcessData.Append(";");
2649                         ProcessData.Append((*KeyListTokens)[KeyIter->first]);
2650                         
2651                 }
2652                         
2653                 ProcessData.Append(":data:");
2654                 ProcessData.Append((*KeyListDataType)[KeyIter->first]);
2655                 ProcessData.Append(";");
2656                 ProcessData.Append((*KeyListDataEncType)[KeyIter->first]);
2657                 ProcessData.Append(",");
2658                 ProcessData.Append(KeyIter->second);
2659                 ProcessData.Append("\n");
2661                 ProcessData = OutputText(&ProcessData);
2662                 
2663                 SaveData->Append(ProcessData);
2664                 ProcessData.clear();
2665                         
2666         }
2667                 
2670 void ContactDataObject::SaveVendor(map<int, wxString> *VendorList, map<int, wxString> *VendorListPEN, 
2671         map<int, wxString> *VendorListElement, wxString *SaveData){
2673         wxString ProcessData = "";
2674                 
2675         for (std::map<int, wxString>::iterator VendorIter = VendorList->begin();
2676                 VendorIter != VendorList->end(); VendorIter++){
2678                 ProcessData.Append("VND-");
2679                 ProcessData.Append((*VendorListPEN)[VendorIter->first]);
2680                 ProcessData.Append("-");
2681                 ProcessData.Append((*VendorListElement)[VendorIter->first]);
2682                 ProcessData.Append(":");
2683                 ProcessData.Append(VendorIter->second);
2684                 ProcessData.Append("\n");
2686                 ProcessData = OutputText(&ProcessData);
2687                 
2688                 SaveData->Append(ProcessData);
2689                 ProcessData.clear();
2690                         
2691         }
2692                 
2695 void ContactDataObject::SaveXToken(map<int, wxString> *XTokenList, map<int, wxString> *XTokenListTokens, 
2696         wxString *SaveData){
2698         wxString ProcessData = "";
2699                 
2700         for (std::map<int, wxString>::iterator XTokenIter = XTokenList->begin();
2701                 XTokenIter != XTokenList->end(); XTokenIter++){
2703                 ProcessData.Append("X-");
2704                 ProcessData.Append((*XTokenListTokens)[XTokenIter->first]);
2705                 ProcessData.Append(":");
2706                 ProcessData.Append(XTokenIter->second);
2707                 ProcessData.Append("\n");
2709                 ProcessData = OutputText(&ProcessData);
2710                 
2711                 SaveData->Append(ProcessData);
2712                 ProcessData.clear();
2713                         
2714         }       
2715                 
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy