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