Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added VND-* 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         // TODO: Sortout REV.
83         
84         // Process XML.
86         for (std::map<int, wxString>::iterator XMLIter = XMLList.begin();
87                 XMLIter != XMLList.end(); XMLIter++){
88         
89                 ProcessData.Append("XML");
90                         
91                 if (XMLListAltID[XMLIter->first].size() > 0){
92                 
93                         ProcessData.Append(";ALTID=");
94                         ProcessData.Append(XMLListAltID[XMLIter->first]);
95                         
96                 }
97                         
98                 ProcessData.Append(":");
99                 ProcessData.Append(XMLIter->second);
100                 ProcessData.Append("\n");
101                 
102                 ProcessData = OutputText(&ProcessData);
103                 
104                 SaveData->Append(ProcessData);
105                 ProcessData.clear();
106                         
107         }
108         
109         // Process SOURCE.
110         
111         SaveSource(&SourceList, &SourceListAltID, 
112                 &SourceListPID, &SourceListType,
113                 &SourceListMediatype, &SourceListPref, 
114                 &SourceListTokens, SaveData);
115         
116         // Process CLIENTPIDMAP.
117         
118         for (std::map<int, wxString>::iterator CPIDIter = ClientPIDList.begin();
119                 CPIDIter != ClientPIDList.end(); CPIDIter++){
120         
121                 ProcessData.Append("CLIENTPIDMAP");
122                         
123                 if (ClientPIDListTokens[CPIDIter->first].size() > 0){
124                 
125                         ProcessData.Append(";");
126                         ProcessData.Append(ClientPIDListTokens[CPIDIter->first]);
127                         
128                 }
129                         
130                 ProcessData.Append(":");
131                 ProcessData.Append(CPIDIter->second);
132                 ProcessData.Append("\n");
133                 
134                 ProcessData = OutputText(&ProcessData);
135                 
136                 SaveData->Append(ProcessData);
137                 ProcessData.clear();
138                         
139         }
140         
141         // Process FN.
142         
143         for (std::map<int, wxString>::iterator FNIter = FullNamesList.begin();
144                 FNIter != FullNamesList.end(); FNIter++){
145                 
146                 ProcessData.Append("FN");
148                 // Check if there is a value for TYPE.
149                 
150                 if (FullNamesListType[FNIter->first].size() > 0){
151                 
152                         ProcessData.Append(";TYPE=");
153                         ProcessData.Append(FullNamesListType[FNIter->first]);
154                         
155                 }
157                 // Check if there is a value for LANGUAGE.
158                 
159                 if (FullNamesListLanguage[FNIter->first].size() > 0){
160                 
161                         ProcessData.Append(";LANGUAGE=");
162                         ProcessData.Append(FullNamesListLanguage[FNIter->first]);
163                         
164                 }
165                 
166                 // Check if there is a value for ALTID.
167                 
168                 if (FullNamesListAltID[FNIter->first].size() > 0){
169                 
170                         ProcessData.Append(";ALTID=");
171                         ProcessData.Append(FullNamesListAltID[FNIter->first]);
172                         
173                 }
174                 
175                 // Check if there is a value for PID.
177                 if (FullNamesListPID[FNIter->first].size() > 0){
178                 
179                         ProcessData.Append(";PID=");
180                         ProcessData.Append(FullNamesListPID[FNIter->first]);
181                         
182                 }
184                 // Check if there is a value for PREF.
186                 if (FullNamesListPref[FNIter->first] > 0){
187                 
188                         ProcessData.Append(";PREF=");
189                         ProcessData.Append(wxString::Format("%i", FullNamesListPref[FNIter->first]));
190                         
191                 }
193                 // Check if there is a value for tokens.
195                 if (FullNamesListTokens[FNIter->first].size() > 0){
196                 
197                         ProcessData.Append(";");
198                         ProcessData.Append(FullNamesListTokens[FNIter->first]);
199                         
200                 }
201                 
202                 ProcessData.Append(":");
203                 ProcessData.Append(FNIter->second);
204                 ProcessData.Append("\n");
205                 
206                 ProcessData = OutputText(&ProcessData);
207                 
208                 SaveData->Append(ProcessData);
209                 ProcessData.clear();
210                         
211         }
212         
213         // Process NICKNAME.
214         
215         SaveNickname(&GeneralNicknamesList, &GeneralNicknamesListAltID, 
216                 &GeneralNicknamesListPID, &GeneralNicknamesListType,
217                 &GeneralNicknamesListLanguage, &GeneralNicknamesListPref, 
218                 &GeneralNicknamesListTokens, SaveData, "");
219         SaveNickname(&HomeNicknamesList, &HomeNicknamesListAltID, 
220                 &HomeNicknamesListPID, &HomeNicknamesListType,
221                 &HomeNicknamesListLanguage, &HomeNicknamesListPref, 
222                 &HomeNicknamesListTokens, SaveData, "home");
223         SaveNickname(&BusinessNicknamesList, &BusinessNicknamesListAltID, 
224                 &BusinessNicknamesListPID, &BusinessNicknamesListType,
225                 &BusinessNicknamesListLanguage, &BusinessNicknamesListPref, 
226                 &BusinessNicknamesListTokens, SaveData, "work");
227         
228         // Process TITLE.
230         SaveTitle(&GeneralTitleList, &GeneralTitleListLanguage,
231                 &GeneralTitleListAltID, &GeneralTitleListPID,
232                 &GeneralTitleListType, &GeneralTitleListPref,
233                 &GeneralTitleListTokens, SaveData, "");
234         SaveTitle(&HomeTitleList, &HomeTitleListLanguage,
235                 &HomeTitleListAltID, &HomeTitleListPID,
236                 &HomeTitleListType, &HomeTitleListPref,
237                 &HomeTitleListTokens, SaveData, "home");
238         SaveTitle(&BusinessTitleList, &BusinessTitleListLanguage,
239                 &BusinessTitleListAltID, &BusinessTitleListPID,
240                 &BusinessTitleListType, &BusinessTitleListPref,
241                 &BusinessTitleListTokens, SaveData, "work");
242         
243         // Process TZ.
244         
245         SaveTimezone(&GeneralTZList, &GeneralTZListAltID, 
246                 &GeneralTZListPID, &GeneralTZListType,
247                 &GeneralTZListMediatype, &GeneralTZListPref, 
248                 &GeneralTZListTokens, SaveData, "");
249         SaveTimezone(&HomeTZList, &HomeTZListAltID, 
250                 &HomeTZListPID, &HomeTZListType,
251                 &HomeTZListMediatype, &HomeTZListPref, 
252                 &HomeTZListTokens, SaveData, "home");
253         SaveTimezone(&BusinessTZList, &BusinessTZListAltID, 
254                 &BusinessTZListPID, &BusinessTZListType,
255                 &BusinessTZListMediatype, &BusinessTZListPref, 
256                 &BusinessTZListTokens, SaveData, "work");
258         // Process ADR.
259         
260         SaveAddress(&GeneralAddressList, &GeneralAddressListTown,
261                 &GeneralAddressListCounty, &GeneralAddressListPostCode,
262                 &GeneralAddressListCountry, &GeneralAddressListLabel,
263                 &GeneralAddressListLang, &GeneralAddressListAltID,
264                 &GeneralAddressListPID, &GeneralAddressListGeo, 
265                 &GeneralAddressListTimezone, &GeneralAddressListType, 
266                 &GeneralAddressListMediatype, &GeneralAddressListPref,
267                 &GeneralAddressListTokens, SaveData, "");
268         SaveAddress(&HomeAddressList, &HomeAddressListTown,
269                 &HomeAddressListCounty, &HomeAddressListPostCode,
270                 &HomeAddressListCountry, &HomeAddressListLabel,
271                 &HomeAddressListLang, &HomeAddressListAltID,
272                 &HomeAddressListPID, &HomeAddressListGeo, 
273                 &HomeAddressListTimezone, &HomeAddressListType, 
274                 &HomeAddressListMediatype, &HomeAddressListPref,
275                 &HomeAddressListTokens, SaveData, "home");
276         SaveAddress(&BusinessAddressList, &BusinessAddressListTown,
277                 &BusinessAddressListCounty, &BusinessAddressListPostCode,
278                 &BusinessAddressListCountry, &BusinessAddressListLabel,
279                 &BusinessAddressListLang, &BusinessAddressListAltID,
280                 &BusinessAddressListPID, &BusinessAddressListGeo, 
281                 &BusinessAddressListTimezone, &BusinessAddressListType, 
282                 &BusinessAddressListMediatype, &BusinessAddressListPref,
283                 &BusinessAddressListTokens, SaveData, "work");
285         // Process EMAIL.
286         
287         SaveEmail(&GeneralEmailList, &GeneralEmailListAltID, 
288                 &GeneralEmailListPID, &GeneralEmailListType,
289                 &GeneralEmailListPref, &GeneralEmailListTokens, 
290                 SaveData, "");
291         SaveEmail(&HomeEmailList, &HomeEmailListAltID, 
292                 &HomeEmailListPID, &HomeEmailListType,
293                 &HomeEmailListPref, &HomeEmailListTokens, 
294                 SaveData, "home");
295         SaveEmail(&BusinessEmailList, &BusinessEmailListAltID, 
296                 &BusinessEmailListPID, &BusinessEmailListType,
297                 &BusinessEmailListPref, &BusinessEmailListTokens, 
298                 SaveData, "work");
300         // TODO: Process IMPP.
301         
302         // TODO: Process TEL.
303         
304         // Process LANG.
305         
306         SaveLanguage(&GeneralLanguageList, &GeneralLanguageListAltID, 
307                 &GeneralLanguageListPID, &GeneralLanguageListType,
308                 &GeneralLanguageListPref, &GeneralLanguageListTokens, 
309                 SaveData, "");
310         SaveLanguage(&HomeLanguageList, &HomeLanguageListAltID, 
311                 &HomeLanguageListPID, &HomeLanguageListType,
312                 &HomeLanguageListPref, &HomeLanguageListTokens, 
313                 SaveData, "home");
314         SaveLanguage(&BusinessLanguageList, &BusinessLanguageListAltID, 
315                 &BusinessLanguageListPID, &BusinessLanguageListType,
316                 &BusinessLanguageListPref, &BusinessLanguageListTokens, 
317                 SaveData, "work");
319         // Process GEO.
320         
321         SaveGeoposition(&GeneralGeographyList, &GeneralGeographyListAltID, 
322                 &GeneralGeographyListPID, &GeneralGeographyListType,
323                 &GeneralGeographyListMediatype, &GeneralGeographyListDataType,
324                 &GeneralGeographyListPref, &GeneralGeographyListTokens, 
325                 SaveData, "");
326         SaveGeoposition(&HomeGeographyList, &HomeGeographyListAltID, 
327                 &HomeGeographyListPID, &HomeGeographyListType,
328                 &HomeGeographyListMediatype, &HomeGeographyListDataType,
329                 &HomeGeographyListPref, &HomeGeographyListTokens, 
330                 SaveData, "home");
331         SaveGeoposition(&BusinessGeographyList, &BusinessGeographyListAltID, 
332                 &BusinessGeographyListPID, &BusinessGeographyListType,
333                 &BusinessGeographyListMediatype, &BusinessGeographyListDataType,
334                 &BusinessGeographyListPref, &BusinessGeographyListTokens, 
335                 SaveData, "work");
337         // Process RELATED.
338         
339         int Moo = 0;
341         for (std::map<int, wxString>::iterator RelatedIter = GeneralRelatedList.begin();
342                 RelatedIter != GeneralRelatedList.end(); RelatedIter++){
343                 
344                 ProcessData.Append("RELATED");
346                 // Check if there is a value for TYPE.
347                 
348                 if (GeneralRelatedListRelType[RelatedIter->first].size() > 0){
349                 
350                         wxString RelatedType = "";
351                         
352                         ProcessData.Append(";TYPE=");
353                         
354                         if (GeneralRelatedListRelType[RelatedIter->first] == _("Contact")){
356                                 RelatedType = wxT("contact");
358                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Acquaintance")){
360                                 RelatedType = wxT("acquaintance");
362                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Friend")){
364                                 RelatedType = wxT("friend");
366                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Met")){
368                                 RelatedType = wxT("met");
370                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Co-worker")){
372                                 RelatedType = wxT("co-worker");
374                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Colleague")){
376                                 RelatedType = wxT("colleague");
378                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Co-resident")){
380                                 RelatedType = wxT("co-resident");
382                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Neighbour")){
384                                 RelatedType = wxT("neighbor");
386                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Child")){
388                                 RelatedType = wxT("child");
390                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Parent")){
392                                 RelatedType = wxT("parent");
394                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Sibling")){
396                                 RelatedType = wxT("sibling");
398                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Spouse")){
400                                 RelatedType = wxT("spouse");
402                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Kin")){
404                                 RelatedType = wxT("kin");
406                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Muse")){
408                                 RelatedType = wxT("muse");
410                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Crush")){
412                                 RelatedType = wxT("crush");
414                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Date")){
416                                 RelatedType = wxT("date");
418                         } else if (GeneralRelatedListRelType[RelatedIter->first]== _("Sweetheart")){
420                                 RelatedType = wxT("sweetheart");
422                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Me")){
424                                 RelatedType = wxT("me");
426                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Agent")){
428                                 RelatedType = wxT("agent");
430                         } else if (GeneralRelatedListRelType[RelatedIter->first] == _("Emergency")){
432                                 RelatedType = wxT("emergency");
434                         } else {
436                                 RelatedType = GeneralRelatedListRelType[RelatedIter->first];
438                         }
439                         
440                         ProcessData.Append(RelatedType);
441                         
442                 }
444                 // Check if there is a value for LANGUAGE.
445                 
446                 if (GeneralRelatedListLanguage[RelatedIter->first].size() > 0){
447                 
448                         ProcessData.Append(";LANGUAGE=");
449                         ProcessData.Append(GeneralRelatedListLanguage[RelatedIter->first]);
450                         
451                 }
452                 
453                 // Check if there is a value for ALTID.
454                 
455                 if (GeneralRelatedListAltID[RelatedIter->first].size() > 0){
456                 
457                         ProcessData.Append(";ALTID=");
458                         ProcessData.Append(GeneralRelatedListAltID[RelatedIter->first]);
459                         
460                 }
461                 
462                 // Check if there is a value for PID.
464                 if (GeneralRelatedListPID[RelatedIter->first].size() > 0){
465                 
466                         ProcessData.Append(";PID=");
467                         ProcessData.Append(GeneralRelatedListPID[RelatedIter->first]);
468                         
469                 }
471                 // Check if there is a value for PREF.
473                 if (GeneralRelatedListPref[RelatedIter->first] > 0){
474                 
475                         ProcessData.Append(";PREF=");
476                         ProcessData.Append(wxString::Format("%i", GeneralRelatedListPref[RelatedIter->first]));
477                         
478                 }
480                 // Check if there is a value for tokens.
482                 if (GeneralRelatedListTokens[RelatedIter->first].size() > 0){
483                 
484                         ProcessData.Append(";");
485                         ProcessData.Append(GeneralRelatedListTokens[RelatedIter->first]);
486                         
487                 }
488                 
489                 ProcessData.Append(":");
490                 ProcessData.Append(RelatedIter->second);
491                 ProcessData.Append("\n");
492                 
493                 ProcessData = OutputText(&ProcessData);
494                 
495                 SaveData->Append(ProcessData);
496                 ProcessData.clear();
497                         
498         }
499         
500         // Process URL.
501         
502         SaveURL(&GeneralWebsiteList, &GeneralWebsiteListAltID, 
503                 &GeneralWebsiteListPID, &GeneralWebsiteListType,
504                 &GeneralWebsiteListMediatype, &GeneralWebsiteListPref, 
505                 &GeneralWebsiteListTokens, SaveData, "");
506         SaveURL(&HomeWebsiteList, &HomeWebsiteListAltID, 
507                 &HomeWebsiteListPID, &HomeWebsiteListType,
508                 &HomeWebsiteListMediatype, &HomeWebsiteListPref, 
509                 &HomeWebsiteListTokens, SaveData, "home");
510         SaveURL(&BusinessWebsiteList, &BusinessWebsiteListAltID, 
511                 &BusinessWebsiteListPID, &BusinessWebsiteListType,
512                 &BusinessWebsiteListMediatype, &BusinessWebsiteListPref, 
513                 &BusinessWebsiteListTokens, SaveData, "work");
515         // Process ROLE.
516         
517         SaveRole(&GeneralRoleList, &GeneralRoleListLanguage,
518                 &GeneralRoleListAltID, &GeneralRoleListPID,
519                 &GeneralRoleListType, &GeneralRoleListPref,
520                 &GeneralRoleListTokens, SaveData, "");
521         SaveRole(&HomeRoleList, &HomeRoleListLanguage,
522                 &HomeRoleListAltID, &HomeRoleListPID,
523                 &HomeRoleListType, &HomeRoleListPref,
524                 &HomeRoleListTokens, SaveData, "home");
525         SaveRole(&BusinessRoleList, &BusinessRoleListLanguage,
526                 &BusinessRoleListAltID, &BusinessRoleListPID,
527                 &BusinessRoleListType, &BusinessRoleListPref,
528                 &BusinessRoleListTokens, SaveData, "work");
530         // Process ORG.
531         
532         SaveOrganisation(&GeneralOrganisationsList, &GeneralOrganisationsListAltID,
533                 &GeneralOrganisationsListPID, &GeneralOrganisationsListLanguage, 
534                 &GeneralOrganisationsListSortAs, &GeneralOrganisationsListType, 
535                 &GeneralOrganisationsListPref, &GeneralOrganisationsListTokens, 
536                 SaveData, "");
537         SaveOrganisation(&HomeOrganisationsList, &HomeOrganisationsListAltID,
538                 &HomeOrganisationsListPID, &HomeOrganisationsListLanguage, 
539                 &HomeOrganisationsListSortAs, &HomeOrganisationsListType, 
540                 &HomeOrganisationsListPref, &HomeOrganisationsListTokens, 
541                 SaveData, "home");
542         SaveOrganisation(&BusinessOrganisationsList, &BusinessOrganisationsListAltID,
543                 &BusinessOrganisationsListPID, &BusinessOrganisationsListLanguage, 
544                 &BusinessOrganisationsListSortAs, &BusinessOrganisationsListType, 
545                 &BusinessOrganisationsListPref, &BusinessOrganisationsListTokens, 
546                 SaveData, "work");
548         // Process NOTE.
549         
550         SaveNote(&GeneralNoteList, &GeneralNoteListLanguage,
551                 &GeneralNoteListAltID, &GeneralNoteListPID,
552                 &GeneralNoteListType, &GeneralNoteListPref,
553                 &GeneralNoteListTokens, SaveData, "");
554         SaveNote(&HomeNoteList, &HomeNoteListLanguage,
555                 &HomeNoteListAltID, &HomeNoteListPID,
556                 &HomeNoteListType, &HomeNoteListPref,
557                 &HomeNoteListTokens, SaveData, "home");
558         SaveNote(&BusinessNoteList, &BusinessNoteListLanguage,
559                 &BusinessNoteListAltID, &BusinessNoteListPID,
560                 &BusinessNoteListType, &BusinessNoteListPref,
561                 &BusinessNoteListTokens, SaveData, "work");
563         // Process CATEGORIES.
564         
565         SaveCategory(&CategoriesList, &CategoriesListLanguage,
566                 &CategoriesListAltID, &CategoriesListPID,
567                 &CategoriesListType, &CategoriesListPref,
568                 &CategoriesListTokens, SaveData);
570         // Process PHOTO.
571         
572         SavePhoto(&PicturesList, &PicturesListAltID, 
573                 &PicturesListPID, &PicturesListType,
574                 &PicturesListPicEncType, &PicturesListPictureType,
575                 &PicturesListMediatype, &PicturesListPref,
576                 &PicturesListTokens, SaveData);
577         
578         // Process LOGO.
579         
580         SaveLogo(&LogosList, &LogosListAltID, 
581                 &LogosListPID, &LogosListType,
582                 &LogosListPicEncType, &LogosListPictureType,
583                 &LogosListMediatype, &LogosListPref,
584                 &LogosListTokens, SaveData);
585         
586         // Process SOUND.
588         SaveSound(&SoundsList, &SoundsListAltID, 
589                 &SoundsListPID, &SoundsListType,
590                 &SoundsListAudioEncType, &SoundsListAudioType,
591                 &SoundsListMediatype, &SoundsListLanguage, 
592                 &SoundsListPref, &SoundsListTokens, 
593                 SaveData);
595         // Process CALURI.
596         
597         SaveCalendarURI(&CalendarList, &CalendarListMediatype,
598                 &CalendarListAltID, &CalendarListPID,
599                 &CalendarListType, &CalendarListPref,
600                 &CalendarListTokens, SaveData);
601         
602         // Process CALADRURI.
603         
604         SaveCalendarRequestURI(&CalendarRequestList, &CalendarRequestListMediatype,
605                 &CalendarRequestListAltID, &CalendarRequestListPID,
606                 &CalendarRequestListType, &CalendarRequestListPref,
607                 &CalendarRequestListTokens, SaveData);
609         // Process FBURL.
610         
611         SaveFreeBusyURI(&FreeBusyList, &FreeBusyListAltID, 
612                 &FreeBusyListPID, &FreeBusyListType,
613                 &FreeBusyListMediatype, &FreeBusyListPref, 
614                 &FreeBusyListTokens, SaveData);
616         // Process KEY.
617         
618         SaveKey(&KeyList, &KeyListAltID, 
619                 &KeyListPID, &KeyListType,
620                 &KeyListKeyType, &KeyListDataEncType, 
621                 &KeyListDataType, &KeyListPref, 
622                 &KeyListTokens, SaveData);
624         // Process VND-*
625         
626         SaveVendor(&VendorList, &VendorListPEN, 
627                 &VendorListElement, SaveData);
629         // Write the end part of the vCard data file.
630         
631         SaveData->Append("END:VCARD");
632         
633         SaveDataStatus = CONTACTSAVE_OK;
634         
635         return SaveDataStatus;
636         
639 void ContactDataObject::SaveTitle(map<int, wxString> *TitleList, map<int, wxString> *TitleListLanguage,
640         map<int, wxString> *TitleListAltID, map<int, wxString> *TitleListPID,
641         map<int, wxString> *TitleListType, map<int, int> *TitleListPref,
642         map<int, wxString> *TitleListTokens, wxString *SaveData, wxString DataType){
644         wxString ProcessData = "";
645                 
646         for (std::map<int, wxString>::iterator TitleIter = TitleList->begin();
647                 TitleIter != TitleList->end(); TitleIter++){
649                 ProcessData.Append("TITLE");
650                         
651                 // Check if there is a value for TYPE.
652                 
653                 if (DataType.size() > 0){
654                 
655                         ProcessData.Append(";TYPE=");
656                         ProcessData.Append(DataType);
657                         
658                 }
659                 
660                 // Check if there is a value for ALTID.
661                 
662                 if ((*TitleListAltID)[TitleIter->first].size() > 0){
663                 
664                         ProcessData.Append(";ALTID=");
665                         ProcessData.Append((*TitleListAltID)[TitleIter->first]);
666                         
667                 }
669                 // Check if there is a value for LANGUAGE.
670                 
671                 if ((*TitleListLanguage)[TitleIter->first].size() > 0){
672                 
673                         ProcessData.Append(";LANGUAGE=");
674                         ProcessData.Append((*TitleListLanguage)[TitleIter->first]);
675                         
676                 }
677                 
678                 // Check if there is a value for PID.
680                 if ((*TitleListPID)[TitleIter->first].size() > 0){
681                 
682                         ProcessData.Append(";PID=");
683                         ProcessData.Append((*TitleListPID)[TitleIter->first]);
684                         
685                 }
687                 // Check if there is a value for PREF.
689                 if ((*TitleListPref)[TitleIter->first] > 0){
690                 
691                         ProcessData.Append(";PREF=");
692                         ProcessData.Append(wxString::Format("%i", (*TitleListPref)[TitleIter->first]));
693                         
694                 }
696                 // Check if there is a value for tokens.
698                 if ((*TitleListTokens)[TitleIter->first].size() > 0){
699                 
700                         ProcessData.Append(";");
701                         ProcessData.Append((*TitleListTokens)[TitleIter->first]);
702                         
703                 }
704                         
705                 ProcessData.Append(":");
706                 ProcessData.Append(TitleIter->second);
707                 ProcessData.Append("\n");
709                 ProcessData = OutputText(&ProcessData);
710                         
711                 SaveData->Append(ProcessData);
712                 ProcessData.clear();
713                         
714         }
715                 
718 void ContactDataObject::SaveSource(map<int, wxString> *SourceList, map<int, wxString> *SourceListAltID, 
719         map<int, wxString> *SourceListPID, map<int, wxString> *SourceListType,
720         map<int, wxString> *SourceListMediatype, map<int, int> *SourceListPref, 
721         map<int, wxString> *SourceListTokens, wxString *SaveData){
723         wxString ProcessData = "";
724         
725         for (std::map<int, wxString>::iterator SourceIter = SourceList->begin();
726                 SourceIter != SourceList->end(); SourceIter++){
728                 ProcessData.Append("SOURCE");
729                         
730                 // Check if there is a value for TYPE.
731                 
732                 if ((*SourceListType)[SourceIter->first].size() > 0){
733                 
734                         ProcessData.Append(";TYPE=");
735                         ProcessData.Append((*SourceListType)[SourceIter->first]);
736                         
737                 }
738                 
739                 // Check if there is a value for ALTID.
740                 
741                 if ((*SourceListAltID)[SourceIter->first].size() > 0){
742                 
743                         ProcessData.Append(";ALTID=");
744                         ProcessData.Append((*SourceListAltID)[SourceIter->first]);
745                         
746                 }
748                 // Check if there is a value for MEDIATYPE.
749                 
750                 if ((*SourceListMediatype)[SourceIter->first].size() > 0){
751                 
752                         ProcessData.Append(";MEDIATYPE=");
753                         ProcessData.Append((*SourceListMediatype)[SourceIter->first]);
754                         
755                 }
756                 
757                 // Check if there is a value for PID.
759                 if ((*SourceListPID)[SourceIter->first].size() > 0){
760                 
761                         ProcessData.Append(";PID=");
762                         ProcessData.Append((*SourceListPID)[SourceIter->first]);
763                         
764                 }
766                 // Check if there is a value for PREF.
768                 if ((*SourceListPref)[SourceIter->first] > 0){
769                 
770                         ProcessData.Append(";PREF=");
771                         ProcessData.Append(wxString::Format("%i", (*SourceListPref)[SourceIter->first]));
772                         
773                 }
775                 // Check if there is a value for tokens.
777                 if ((*SourceListTokens)[SourceIter->first].size() > 0){
778                 
779                         ProcessData.Append(";");
780                         ProcessData.Append((*SourceListTokens)[SourceIter->first]);
781                         
782                 }
783                         
784                 ProcessData.Append(":");
785                 ProcessData.Append(SourceIter->second);
786                 ProcessData.Append("\n");
788                 ProcessData = OutputText(&ProcessData);
789                         
790                 SaveData->Append(ProcessData);
791                 ProcessData.clear();
792                         
793         }
794                 
797 void ContactDataObject::SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID, 
798         map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
799         map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref, 
800         map<int, wxString> *NicknameListTokens, wxString *SaveData, wxString DataType){
802         wxString ProcessData = "";
803         
804         for (std::map<int, wxString>::iterator NicknameIter = NicknameList->begin();
805                 NicknameIter != NicknameList->end(); NicknameIter++){
807                 ProcessData.Append("NICKNAME");
808                         
809                 // Check if there is a value for TYPE.
810                 
811                 if (DataType.size() > 0){
812                 
813                         ProcessData.Append(";TYPE=");
814                         ProcessData.Append(DataType);
815                         
816                 }
817                 
818                 // Check if there is a value for ALTID.
819                 
820                 if ((*NicknameListAltID)[NicknameIter->first].size() > 0){
821                 
822                         ProcessData.Append(";ALTID=");
823                         ProcessData.Append((*NicknameListAltID)[NicknameIter->first]);
824                         
825                 }
827                 // Check if there is a value for MEDIATYPE.
828                 
829                 if ((*NicknameListLanguage)[NicknameIter->first].size() > 0){
830                 
831                         ProcessData.Append(";LANGUAGE=");
832                         ProcessData.Append((*NicknameListLanguage)[NicknameIter->first]);
833                         
834                 }
835                 
836                 // Check if there is a value for PID.
838                 if ((*NicknameListPID)[NicknameIter->first].size() > 0){
839                 
840                         ProcessData.Append(";PID=");
841                         ProcessData.Append((*NicknameListPID)[NicknameIter->first]);
842                         
843                 }
845                 // Check if there is a value for PREF.
847                 if ((*NicknameListPref)[NicknameIter->first] > 0){
848                 
849                         ProcessData.Append(";PREF=");
850                         ProcessData.Append(wxString::Format("%i", (*NicknameListPref)[NicknameIter->first]));
851                         
852                 }
854                 // Check if there is a value for tokens.
856                 if ((*NicknameListTokens)[NicknameIter->first].size() > 0){
857                 
858                         ProcessData.Append(";");
859                         ProcessData.Append((*NicknameListTokens)[NicknameIter->first]);
860                         
861                 }
862                         
863                 ProcessData.Append(":");
864                 ProcessData.Append(NicknameIter->second);
865                 ProcessData.Append("\n");
867                 ProcessData = OutputText(&ProcessData);
868                         
869                 SaveData->Append(ProcessData);
870                 ProcessData.clear();
871                         
872         }
873                 
876 void ContactDataObject::SaveTimezone(map<int, wxString> *TZList, map<int, wxString> *TZListAltID, 
877         map<int, wxString> *TZListPID, map<int, wxString> *TZListType,
878         map<int, wxString> *TZListMediatype, map<int, int> *TZListPref, 
879         map<int, wxString> *TZListTokens, wxString *SaveData, wxString DataType){
881         wxString ProcessData = "";
882         
883         for (std::map<int, wxString>::iterator TZIter = TZList->begin();
884                 TZIter != TZList->end(); TZIter++){
886                 ProcessData.Append("TZ");
887                         
888                 // Check if there is a value for TYPE.
889                 
890                 if (DataType.size() > 0){
891                 
892                         ProcessData.Append(";TYPE=");
893                         ProcessData.Append(DataType);
894                         
895                 }
896                 
897                 // Check if there is a value for ALTID.
898                 
899                 if ((*TZListAltID)[TZIter->first].size() > 0){
900                 
901                         ProcessData.Append(";ALTID=");
902                         ProcessData.Append((*TZListAltID)[TZIter->first]);
903                         
904                 }
906                 // Check if there is a value for MEDIATYPE.
907                 
908                 if ((*TZListMediatype)[TZIter->first].size() > 0){
909                 
910                         ProcessData.Append(";MEDIATYPE=");
911                         ProcessData.Append((*TZListMediatype)[TZIter->first]);
912                         
913                 }
914                 
915                 // Check if there is a value for PID.
917                 if ((*TZListPID)[TZIter->first].size() > 0){
918                 
919                         ProcessData.Append(";PID=");
920                         ProcessData.Append((*TZListPID)[TZIter->first]);
921                         
922                 }
924                 // Check if there is a value for PREF.
926                 if ((*TZListPref)[TZIter->first] > 0){
927                 
928                         ProcessData.Append(";PREF=");
929                         ProcessData.Append(wxString::Format("%i", (*TZListPref)[TZIter->first]));
930                         
931                 }
933                 // Check if there is a value for tokens.
935                 if ((*TZListTokens)[TZIter->first].size() > 0){
936                 
937                         ProcessData.Append(";");
938                         ProcessData.Append((*TZListTokens)[TZIter->first]);
939                         
940                 }
941                         
942                 ProcessData.Append(":");
943                 ProcessData.Append(TZIter->second);
944                 ProcessData.Append("\n");
946                 ProcessData = OutputText(&ProcessData);
947                         
948                 SaveData->Append(ProcessData);
949                 ProcessData.clear();
950                         
951         }
952                 
955 void ContactDataObject::SaveAddress(map<int, wxString> *AddressList, map<int, wxString> *AddressListTown,
956                 map<int, wxString> *AddressListCounty, map<int, wxString> *AddressListPostCode,
957                 map<int, wxString> *AddressListCountry, map<int, wxString> *AddressListLabel,
958                 map<int, wxString> *AddressListLang, map<int, wxString> *AddressListAltID,
959                 map<int, wxString> *AddressListPID, map<int, wxString> *AddressListGeo, 
960                 map<int, wxString> *AddressListTimezone, map<int, wxString> *AddressListType, 
961                 map<int, wxString> *AddressListMediatype, map<int, int> *AddressListPref, 
962                 map<int, wxString> *AddressListTokens, wxString *SaveData, wxString DataType){
964         wxString ProcessData = "";
965                         
966         for (std::map<int, wxString>::iterator AddressIter = AddressList->begin();
967                 AddressIter != AddressList->end(); AddressIter++){
968                         
969                 ProcessData.Append("ADR");
970                         
971                 // Check if there is a value for TYPE.
972                 
973                 if (DataType.size() > 0){
974                 
975                         ProcessData.Append(";TYPE=");
976                         ProcessData.Append(DataType);
977                         
978                 }
979                 
980                 // Check if there is a value for ALTID.
981                 
982                 if ((*AddressListAltID)[AddressIter->first].size() > 0){
983                 
984                         ProcessData.Append(";ALTID=");
985                         ProcessData.Append((*AddressListAltID)[AddressIter->first]);
986                         
987                 }
989                 // Check if there is a value for GEO.
990                 
991                 if ((*AddressListGeo)[AddressIter->first].size() > 0){
992                 
993                         ProcessData.Append(";GEO=\"");
994                         ProcessData.Append((*AddressListGeo)[AddressIter->first]);
995                         ProcessData.Append("\"");
996                         
997                 }
999                 // Check if there is a value for LABEL.
1001                 if ((*AddressListLabel)[AddressIter->first].size() > 0){
1002                 
1003                         wxString AddressProcessed = "";
1004                         AddressProcessed = (*AddressListLabel)[AddressIter->first];
1005                         
1006                         AddressProcessed.Replace("\n", "\\n", true);
1007                         
1008                         ProcessData.Append(";LABEL=");
1009                         ProcessData.Append(AddressProcessed);
1010                         
1011                 }
1012                 
1013                 // Check if there is a value for LANGUAGE.
1014                 
1015                 if ((*AddressListLang)[AddressIter->first].size() > 0){
1016                 
1017                         ProcessData.Append(";LANGUAGE=");
1018                         ProcessData.Append((*AddressListLang)[AddressIter->first]);
1019                         
1020                 }
1021                 
1022                 // Check if there is a value for MEDIATYPE.
1023                 
1024                 if ((*AddressListMediatype)[AddressIter->first].size() > 0){
1025                 
1026                         ProcessData.Append(";MEDIATYPE=");
1027                         ProcessData.Append((*AddressListMediatype)[AddressIter->first]);
1028                         
1029                 }
1030                 
1031                 // Check if there is a value for PID.
1033                 if ((*AddressListPID)[AddressIter->first].size() > 0){
1034                 
1035                         ProcessData.Append(";PID=");
1036                         ProcessData.Append((*AddressListPID)[AddressIter->first]);
1037                         
1038                 }
1040                 // Check if there is a value for PREF.
1042                 if ((*AddressListPref)[AddressIter->first] > 0){
1043                 
1044                         ProcessData.Append(";PREF=");
1045                         ProcessData.Append(wxString::Format("%i", (*AddressListPref)[AddressIter->first]));
1046                         
1047                 }
1049                 // Check if there is a value for TZ.
1051                 if ((*AddressListTimezone)[AddressIter->first].size() > 0){
1052                 
1053                         ProcessData.Append(";TZ=");
1054                         ProcessData.Append((*AddressListTimezone)[AddressIter->first]);
1055                         
1056                 }
1057                 
1058                 // Check if there is a value for tokens.
1060                 if ((*AddressListTokens)[AddressIter->first].size() > 0){
1061                 
1062                         ProcessData.Append(";");
1063                         ProcessData.Append((*AddressListTokens)[AddressIter->first]);
1064                         
1065                 }
1066                 
1067                 // Build the address.
1068                 
1069                 ProcessData.Append(":;;");
1070                 ProcessData.Append((*AddressList)[AddressIter->first]);
1071                 ProcessData.Append(";");
1072                 ProcessData.Append((*AddressListTown)[AddressIter->first]);
1073                 ProcessData.Append(";");
1074                 ProcessData.Append((*AddressListCounty)[AddressIter->first]);
1075                 ProcessData.Append(";");
1076                 ProcessData.Append((*AddressListPostCode)[AddressIter->first]);
1077                 ProcessData.Append(";");
1078                 ProcessData.Append((*AddressListCountry)[AddressIter->first]);
1079                 ProcessData.Append("\n");
1080                 
1081                 ProcessData = OutputText(&ProcessData);
1082                         
1083                 SaveData->Append(ProcessData);
1084                 ProcessData.clear();
1085                         
1086         }
1087                         
1090 void ContactDataObject::SaveEmail(map<int, wxString> *EmailList, map<int, wxString> *EmailListAltID, 
1091         map<int, wxString> *EmailListPID, map<int, wxString> *EmailListType,
1092         map<int, int> *EmailListPref, map<int, wxString> *EmailListTokens, 
1093         wxString *SaveData, wxString DataType){
1095         wxString ProcessData = "";
1096         
1097         for (std::map<int, wxString>::iterator EmailIter = EmailList->begin();
1098                 EmailIter != EmailList->end(); EmailIter++){
1100                 ProcessData.Append("EMAIL");
1101                         
1102                 // Check if there is a value for TYPE.
1103                 
1104                 if (DataType.size() > 0){
1105                 
1106                         ProcessData.Append(";TYPE=");
1107                         ProcessData.Append(DataType);
1108                         
1109                 }
1110                 
1111                 // Check if there is a value for ALTID.
1112                 
1113                 if ((*EmailListAltID)[EmailIter->first].size() > 0){
1114                 
1115                         ProcessData.Append(";ALTID=");
1116                         ProcessData.Append((*EmailListAltID)[EmailIter->first]);
1117                         
1118                 }
1119                 
1120                 // Check if there is a value for PID.
1122                 if ((*EmailListPID)[EmailIter->first].size() > 0){
1123                 
1124                         ProcessData.Append(";PID=");
1125                         ProcessData.Append((*EmailListPID)[EmailIter->first]);
1126                         
1127                 }
1129                 // Check if there is a value for PREF.
1131                 if ((*EmailListPref)[EmailIter->first] > 0){
1132                 
1133                         ProcessData.Append(";PREF=");
1134                         ProcessData.Append(wxString::Format("%i", (*EmailListPref)[EmailIter->first]));
1135                         
1136                 }
1138                 // Check if there is a value for tokens.
1140                 if ((*EmailListTokens)[EmailIter->first].size() > 0){
1141                 
1142                         ProcessData.Append(";");
1143                         ProcessData.Append((*EmailListTokens)[EmailIter->first]);
1144                         
1145                 }
1146                         
1147                 ProcessData.Append(":");
1148                 ProcessData.Append(EmailIter->second);
1149                 ProcessData.Append("\n");
1151                 ProcessData = OutputText(&ProcessData);
1152                         
1153                 SaveData->Append(ProcessData);
1154                 ProcessData.clear();
1155                         
1156         }
1157                 
1160 void ContactDataObject::SaveLanguage(map<int, wxString> *LanguageList, map<int, wxString> *LanguageListAltID, 
1161         map<int, wxString> *LanguageListPID, map<int, wxString> *LanguageListType,
1162         map<int, int> *LangaugeListPref, map<int, wxString> *LanguageListTokens, 
1163         wxString *SaveData, wxString DataType){
1165         wxString ProcessData = "";
1166         
1167         for (std::map<int, wxString>::iterator LanguageIter = LanguageList->begin();
1168                 LanguageIter != LanguageList->end(); LanguageIter++){
1170                 ProcessData.Append("LANG");
1171                         
1172                 // Check if there is a value for TYPE.
1173                 
1174                 if (DataType.size() > 0){
1175                 
1176                         ProcessData.Append(";TYPE=");
1177                         ProcessData.Append(DataType);
1178                         
1179                 }
1180                 
1181                 // Check if there is a value for ALTID.
1182                 
1183                 if ((*LanguageListAltID)[LanguageIter->first].size() > 0){
1184                 
1185                         ProcessData.Append(";ALTID=");
1186                         ProcessData.Append((*LanguageListAltID)[LanguageIter->first]);
1187                         
1188                 }
1189                 
1190                 // Check if there is a value for PID.
1192                 if ((*LanguageListPID)[LanguageIter->first].size() > 0){
1193                 
1194                         ProcessData.Append(";PID=");
1195                         ProcessData.Append((*LanguageListPID)[LanguageIter->first]);
1196                         
1197                 }
1199                 // Check if there is a value for PREF.
1201                 if ((*LangaugeListPref)[LanguageIter->first] > 0){
1202                 
1203                         ProcessData.Append(";PREF=");
1204                         ProcessData.Append(wxString::Format("%i", (*LangaugeListPref)[LanguageIter->first]));
1205                         
1206                 }
1208                 // Check if there is a value for tokens.
1210                 if ((*LanguageListTokens)[LanguageIter->first].size() > 0){
1211                 
1212                         ProcessData.Append(";");
1213                         ProcessData.Append((*LanguageListTokens)[LanguageIter->first]);
1214                         
1215                 }
1216                         
1217                 ProcessData.Append(":");
1218                 ProcessData.Append(LanguageIter->second);
1219                 ProcessData.Append("\n");
1221                 ProcessData = OutputText(&ProcessData);
1222                         
1223                 SaveData->Append(ProcessData);
1224                 ProcessData.clear();
1225                         
1226         }
1227                 
1230 void ContactDataObject::SaveGeoposition(map<int, wxString> *GeographyList, map<int, wxString> *GeographyListAltID, 
1231         map<int, wxString> *GeographyListPID, map<int, wxString> *GeographyListType,
1232         map<int, wxString> *GeographyListMediatype, map<int, wxString> *GeographyListDataType,
1233         map<int, int> *GeographyListPref, map<int, wxString> *GeographyListTokens, 
1234         wxString *SaveData, wxString DataType){
1236         wxString ProcessData = "";
1237         
1238         for (std::map<int, wxString>::iterator GeographyIter = GeographyList->begin();
1239                 GeographyIter != GeographyList->end(); GeographyIter++){
1241                 ProcessData.Append("GEO");
1242                         
1243                 // Check if there is a value for TYPE.
1244                 
1245                 if (DataType.size() > 0){
1246                 
1247                         ProcessData.Append(";TYPE=");
1248                         ProcessData.Append(DataType);
1249                         
1250                 }
1251                 
1252                 // Check if there is a value for ALTID.
1253                 
1254                 if ((*GeographyListAltID)[GeographyIter->first].size() > 0){
1255                 
1256                         ProcessData.Append(";ALTID=");
1257                         ProcessData.Append((*GeographyListAltID)[GeographyIter->first]);
1258                         
1259                 }
1260                 
1261                 // Check if there is a value for MEDIATYPE.
1262                 
1263                 if ((*GeographyListMediatype)[GeographyIter->first].size() > 0){
1264                 
1265                         ProcessData.Append(";MEDIATYPE=");
1266                         ProcessData.Append((*GeographyListMediatype)[GeographyIter->first]);
1267                         
1268                 }
1269                 
1270                 // Check if there is a value for PID.
1272                 if ((*GeographyListPID)[GeographyIter->first].size() > 0){
1273                 
1274                         ProcessData.Append(";PID=");
1275                         ProcessData.Append((*GeographyListPID)[GeographyIter->first]);
1276                         
1277                 }
1279                 // Check if there is a value for PREF.
1281                 if ((*GeographyListPref)[GeographyIter->first] > 0){
1282                 
1283                         ProcessData.Append(";PREF=");
1284                         ProcessData.Append(wxString::Format("%i", (*GeographyListPref)[GeographyIter->first]));
1285                         
1286                 }
1288                 // Check if there is a value for tokens.
1290                 if ((*GeographyListTokens)[GeographyIter->first].size() > 0){
1291                 
1292                         ProcessData.Append(";");
1293                         ProcessData.Append((*GeographyListTokens)[GeographyIter->first]);
1294                         
1295                 }
1296                         
1297                 ProcessData.Append(":");
1298                 ProcessData.Append((*GeographyListDataType)[GeographyIter->first]);
1299                 ProcessData.Append(":");
1300                 ProcessData.Append(GeographyIter->second);
1301                 ProcessData.Append("\n");
1303                 ProcessData = OutputText(&ProcessData);
1304                         
1305                 SaveData->Append(ProcessData);
1306                 ProcessData.clear();
1307                         
1308         }
1309                 
1312 void ContactDataObject::SaveURL(map<int, wxString> *WebsiteList, map<int, wxString> *WebsiteListAltID, 
1313                 map<int, wxString> *WebsiteListPID, map<int, wxString> *WebsiteListType,
1314                 map<int, wxString> *WebsiteListMediatype, map<int, int> *WebsiteListPref, 
1315                 map<int, wxString> *WebsiteListTokens, wxString *SaveData, wxString DataType){
1317         wxString ProcessData = "";
1318         
1319         for (std::map<int, wxString>::iterator WebsiteIter = WebsiteList->begin();
1320                 WebsiteIter != WebsiteList->end(); WebsiteIter++){
1322                 ProcessData.Append("URL");
1323                         
1324                 // Check if there is a value for TYPE.
1325                 
1326                 if (DataType.size() > 0){
1327                 
1328                         ProcessData.Append(";TYPE=");
1329                         ProcessData.Append(DataType);
1330                         
1331                 }
1332                 
1333                 // Check if there is a value for ALTID.
1334                 
1335                 if ((*WebsiteListAltID)[WebsiteIter->first].size() > 0){
1336                 
1337                         ProcessData.Append(";ALTID=");
1338                         ProcessData.Append((*WebsiteListAltID)[WebsiteIter->first]);
1339                         
1340                 }
1341                 
1342                 // Check if there is a value for MEDIATYPE.
1343                 
1344                 if ((*WebsiteListMediatype)[WebsiteIter->first].size() > 0){
1345                 
1346                         ProcessData.Append(";MEDIATYPE=");
1347                         ProcessData.Append((*WebsiteListMediatype)[WebsiteIter->first]);
1348                         
1349                 }
1350                 
1351                 // Check if there is a value for PID.
1353                 if ((*WebsiteListPID)[WebsiteIter->first].size() > 0){
1354                 
1355                         ProcessData.Append(";PID=");
1356                         ProcessData.Append((*WebsiteListPID)[WebsiteIter->first]);
1357                         
1358                 }
1360                 // Check if there is a value for PREF.
1362                 if ((*WebsiteListPref)[WebsiteIter->first] > 0){
1363                 
1364                         ProcessData.Append(";PREF=");
1365                         ProcessData.Append(wxString::Format("%i", (*WebsiteListPref)[WebsiteIter->first]));
1366                         
1367                 }
1369                 // Check if there is a value for tokens.
1371                 if ((*WebsiteListTokens)[WebsiteIter->first].size() > 0){
1372                 
1373                         ProcessData.Append(";");
1374                         ProcessData.Append((*WebsiteListTokens)[WebsiteIter->first]);
1375                         
1376                 }
1377                         
1378                 ProcessData.Append(":");
1379                 ProcessData.Append(WebsiteIter->second);
1380                 ProcessData.Append("\n");
1382                 ProcessData = OutputText(&ProcessData);
1383                         
1384                 SaveData->Append(ProcessData);
1385                 ProcessData.clear();
1386                         
1387         }
1388                         
1391 void ContactDataObject::SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
1392         map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
1393         map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
1394         map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType){
1396         wxString ProcessData = "";
1397                 
1398         for (std::map<int, wxString>::iterator RoleIter = RoleList->begin();
1399                 RoleIter != RoleList->end(); RoleIter++){
1401                 ProcessData.Append("ROLE");
1402                         
1403                 // Check if there is a value for TYPE.
1404                 
1405                 if (DataType.size() > 0){
1406                 
1407                         ProcessData.Append(";TYPE=");
1408                         ProcessData.Append(DataType);
1409                         
1410                 }
1411                 
1412                 // Check if there is a value for ALTID.
1413                 
1414                 if ((*RoleListAltID)[RoleIter->first].size() > 0){
1415                 
1416                         ProcessData.Append(";ALTID=");
1417                         ProcessData.Append((*RoleListAltID)[RoleIter->first]);
1418                         
1419                 }
1421                 // Check if there is a value for LANGUAGE.
1422                 
1423                 if ((*RoleListLanguage)[RoleIter->first].size() > 0){
1424                 
1425                         ProcessData.Append(";LANGUAGE=");
1426                         ProcessData.Append((*RoleListLanguage)[RoleIter->first]);
1427                         
1428                 }
1429                 
1430                 // Check if there is a value for PID.
1432                 if ((*RoleListPID)[RoleIter->first].size() > 0){
1433                 
1434                         ProcessData.Append(";PID=");
1435                         ProcessData.Append((*RoleListPID)[RoleIter->first]);
1436                         
1437                 }
1439                 // Check if there is a value for PREF.
1441                 if ((*RoleListPref)[RoleIter->first] > 0){
1442                 
1443                         ProcessData.Append(";PREF=");
1444                         ProcessData.Append(wxString::Format("%i", (*RoleListPref)[RoleIter->first]));
1445                         
1446                 }
1448                 // Check if there is a value for tokens.
1450                 if ((*RoleListTokens)[RoleIter->first].size() > 0){
1451                 
1452                         ProcessData.Append(";");
1453                         ProcessData.Append((*RoleListTokens)[RoleIter->first]);
1454                         
1455                 }
1456                         
1457                 ProcessData.Append(":");
1458                 ProcessData.Append(RoleIter->second);
1459                 ProcessData.Append("\n");
1461                 ProcessData = OutputText(&ProcessData);
1462                 
1463                 SaveData->Append(ProcessData);
1464                 ProcessData.clear();
1465                         
1466         }
1467                 
1470 void ContactDataObject::SaveOrganisation(map<int, wxString> *OrganisationList, map<int, wxString> *OrganisationListAltID,
1471         map<int, wxString> *OrganisationListPID, map<int, wxString> *OrganisationListLanguage, 
1472         map<int, wxString> *OrganisationListSortAs, map<int, wxString> *OrganisationListType, 
1473         map<int, int> *OrganisationListPref, map<int, wxString> *OrganisationListTokens, 
1474         wxString *SaveData, wxString DataType){
1476         wxString ProcessData = "";
1477                 
1478         for (std::map<int, wxString>::iterator OrganisationIter = OrganisationList->begin();
1479                 OrganisationIter != OrganisationList->end(); OrganisationIter++){
1481                 ProcessData.Append("ORG");
1482                         
1483                 // Check if there is a value for TYPE.
1484                 
1485                 if (DataType.size() > 0){
1486                 
1487                         ProcessData.Append(";TYPE=");
1488                         ProcessData.Append(DataType);
1489                         
1490                 }
1491                 
1492                 // Check if there is a value for ALTID.
1493                 
1494                 if ((*OrganisationListAltID)[OrganisationIter->first].size() > 0){
1495                 
1496                         ProcessData.Append(";ALTID=");
1497                         ProcessData.Append((*OrganisationListAltID)[OrganisationIter->first]);
1498                         
1499                 }
1501                 // Check if there is a value for LANGUAGE.
1502                 
1503                 if ((*OrganisationListLanguage)[OrganisationIter->first].size() > 0){
1504                 
1505                         ProcessData.Append(";LANGUAGE=");
1506                         ProcessData.Append((*OrganisationListLanguage)[OrganisationIter->first]);
1507                         
1508                 }
1509                 
1510                 // Check if there is a value for PID.
1512                 if ((*OrganisationListPID)[OrganisationIter->first].size() > 0){
1513                 
1514                         ProcessData.Append(";PID=");
1515                         ProcessData.Append((*OrganisationListPID)[OrganisationIter->first]);
1516                         
1517                 }
1519                 // Check if there is a value for PREF.
1521                 if ((*OrganisationListPref)[OrganisationIter->first] > 0){
1522                 
1523                         ProcessData.Append(";PREF=");
1524                         ProcessData.Append(wxString::Format("%i", (*OrganisationListPref)[OrganisationIter->first]));
1525                         
1526                 }
1527                 
1528                 // Check if there is a value for SORT-AS.
1529                 
1530                 if ((*OrganisationListSortAs)[OrganisationIter->first].size() > 0){
1531                 
1532                         ProcessData.Append(";SORT-AS=\"");
1533                         ProcessData.Append((*OrganisationListSortAs)[OrganisationIter->first]);
1534                         ProcessData.Append("\"");
1535                         
1536                 }
1538                 // Check if there is a value for tokens.
1540                 if ((*OrganisationListTokens)[OrganisationIter->first].size() > 0){
1541                 
1542                         ProcessData.Append(";");
1543                         ProcessData.Append((*OrganisationListTokens)[OrganisationIter->first]);
1544                         
1545                 }
1546                         
1547                 ProcessData.Append(":");
1548                 ProcessData.Append(OrganisationIter->second);
1549                 ProcessData.Append("\n");
1551                 ProcessData = OutputText(&ProcessData);
1552                 
1553                 SaveData->Append(ProcessData);
1554                 ProcessData.clear();
1555                         
1556         }
1557                 
1560 void ContactDataObject::SaveNote(map<int, wxString> *NoteList, map<int, wxString> *NoteListLanguage,
1561         map<int, wxString> *NoteListAltID, map<int, wxString> *NoteListPID,
1562         map<int, wxString> *NoteListType, map<int, int> *NoteListPref,
1563         map<int, wxString> *NoteListTokens, wxString *SaveData, wxString DataType){
1565         wxString ProcessData = "";
1566                 
1567         for (std::map<int, wxString>::iterator NoteIter = NoteList->begin();
1568                 NoteIter != NoteList->end(); NoteIter++){
1570                 ProcessData.Append("NOTE");
1571                         
1572                 // Check if there is a value for TYPE.
1573                 
1574                 if (DataType.size() > 0){
1575                 
1576                         ProcessData.Append(";TYPE=");
1577                         ProcessData.Append(DataType);
1578                         
1579                 }
1580                 
1581                 // Check if there is a value for ALTID.
1582                 
1583                 if ((*NoteListAltID)[NoteIter->first].size() > 0){
1584                 
1585                         ProcessData.Append(";ALTID=");
1586                         ProcessData.Append((*NoteListAltID)[NoteIter->first]);
1587                         
1588                 }
1590                 // Check if there is a value for LANGUAGE.
1591                 
1592                 if ((*NoteListLanguage)[NoteIter->first].size() > 0){
1593                 
1594                         ProcessData.Append(";LANGUAGE=");
1595                         ProcessData.Append((*NoteListLanguage)[NoteIter->first]);
1596                         
1597                 }
1598                 
1599                 // Check if there is a value for PID.
1601                 if ((*NoteListPID)[NoteIter->first].size() > 0){
1602                 
1603                         ProcessData.Append(";PID=");
1604                         ProcessData.Append((*NoteListPID)[NoteIter->first]);
1605                         
1606                 }
1608                 // Check if there is a value for PREF.
1610                 if ((*NoteListPref)[NoteIter->first] > 0){
1611                 
1612                         ProcessData.Append(";PREF=");
1613                         ProcessData.Append(wxString::Format("%i", (*NoteListPref)[NoteIter->first]));
1614                         
1615                 }
1617                 // Check if there is a value for tokens.
1619                 if ((*NoteListTokens)[NoteIter->first].size() > 0){
1620                 
1621                         ProcessData.Append(";");
1622                         ProcessData.Append((*NoteListTokens)[NoteIter->first]);
1623                         
1624                 }
1625                         
1626                 ProcessData.Append(":");
1627                 ProcessData.Append(NoteIter->second);
1628                 ProcessData.Replace("\n", "\\n", true);
1629                 ProcessData.Append("\n");
1631                 ProcessData = OutputText(&ProcessData);
1632                 
1633                 SaveData->Append(ProcessData);
1634                 ProcessData.clear();
1635                         
1636         }
1637                 
1640 void ContactDataObject::SaveCategory(map<int, wxString> *CategoryList, map<int, wxString> *CategoryListLanguage,
1641         map<int, wxString> *CategoryListAltID, map<int, wxString> *CategoryListPID,
1642         map<int, wxString> *CategoryListType, map<int, int> *CategoryListPref,
1643         map<int, wxString> *CategoryListTokens, wxString *SaveData){
1645         wxString ProcessData = "";
1646                 
1647         for (std::map<int, wxString>::iterator CategoryIter = CategoryList->begin();
1648                 CategoryIter != CategoryList->end(); CategoryIter++){
1650                 ProcessData.Append("CATEGORIES");
1651                         
1652                 // Check if there is a value for TYPE.
1653                 
1654                 if ((*CategoryListType)[CategoryIter->first].size() > 0){
1655                 
1656                         ProcessData.Append(";TYPE=");
1657                         ProcessData.Append((*CategoryListType)[CategoryIter->first]);
1658                         
1659                 }
1660                 
1661                 // Check if there is a value for ALTID.
1662                 
1663                 if ((*CategoryListAltID)[CategoryIter->first].size() > 0){
1664                 
1665                         ProcessData.Append(";ALTID=");
1666                         ProcessData.Append((*CategoryListAltID)[CategoryIter->first]);
1667                         
1668                 }
1670                 // Check if there is a value for LANGUAGE.
1671                 
1672                 if ((*CategoryListLanguage)[CategoryIter->first].size() > 0){
1673                 
1674                         ProcessData.Append(";LANGUAGE=");
1675                         ProcessData.Append((*CategoryListLanguage)[CategoryIter->first]);
1676                         
1677                 }
1678                 
1679                 // Check if there is a value for PID.
1681                 if ((*CategoryListPID)[CategoryIter->first].size() > 0){
1682                 
1683                         ProcessData.Append(";PID=");
1684                         ProcessData.Append((*CategoryListPID)[CategoryIter->first]);
1685                         
1686                 }
1688                 // Check if there is a value for PREF.
1690                 if ((*CategoryListPref)[CategoryIter->first] > 0){
1691                 
1692                         ProcessData.Append(";PREF=");
1693                         ProcessData.Append(wxString::Format("%i", (*CategoryListPref)[CategoryIter->first]));
1694                         
1695                 }
1697                 // Check if there is a value for tokens.
1699                 if ((*CategoryListTokens)[CategoryIter->first].size() > 0){
1700                 
1701                         ProcessData.Append(";");
1702                         ProcessData.Append((*CategoryListTokens)[CategoryIter->first]);
1703                         
1704                 }
1705                         
1706                 ProcessData.Append(":");
1707                 ProcessData.Append(CategoryIter->second);
1708                 ProcessData.Append("\n");
1710                 ProcessData = OutputText(&ProcessData);
1711                 
1712                 SaveData->Append(ProcessData);
1713                 ProcessData.clear();
1714                         
1715         }
1716                 
1719 void ContactDataObject::SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID, 
1720                 map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
1721                 map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
1722                 map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
1723                 map<int, wxString> *PicturesListTokens, wxString *SaveData){
1725         wxString ProcessData = "";
1726                 
1727         for (std::map<int, string>::iterator PicturesIter = PicturesList->begin();
1728                 PicturesIter != PicturesList->end(); PicturesIter++){
1730                 ProcessData.Append("PHOTO");
1731                         
1732                 // Check if there is a value for TYPE.
1733                 
1734                 if ((*PicturesListType)[PicturesIter->first].size() > 0){
1735                 
1736                         ProcessData.Append(";TYPE=");
1737                         ProcessData.Append((*PicturesListType)[PicturesIter->first]);
1738                         
1739                 }
1740                 
1741                 // Check if there is a value for ALTID.
1742                 
1743                 if ((*PicturesListAltID)[PicturesIter->first].size() > 0){
1744                 
1745                         ProcessData.Append(";ALTID=");
1746                         ProcessData.Append((*PicturesListAltID)[PicturesIter->first]);
1747                         
1748                 }
1750                 // Check if there is a value for MEDIATYPE..
1751                 
1752                 if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){
1753                 
1754                         ProcessData.Append(";MEDIATYPE=");
1755                         ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]);
1756                         
1757                 }
1758                 
1759                 // Check if there is a value for PID.
1761                 if ((*PicturesListPID)[PicturesIter->first].size() > 0){
1762                 
1763                         ProcessData.Append(";PID=");
1764                         ProcessData.Append((*PicturesListPID)[PicturesIter->first]);
1765                         
1766                 }
1768                 // Check if there is a value for PREF.
1770                 if ((*PicturesListPref)[PicturesIter->first] > 0){
1771                 
1772                         ProcessData.Append(";PREF=");
1773                         ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first]));
1774                         
1775                 }
1777                 // Check if there is a value for tokens.
1779                 if ((*PicturesListTokens)[PicturesIter->first].size() > 0){
1780                 
1781                         ProcessData.Append(";");
1782                         ProcessData.Append((*PicturesListTokens)[PicturesIter->first]);
1783                         
1784                 }
1785                 
1786                 ProcessData.Append(":data:");
1787                 ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]);
1788                 ProcessData.Append(";");
1789                 ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]);
1790                 ProcessData.Append(",");
1791                 ProcessData.Append(PicturesIter->second);
1792                 ProcessData.Append("\n");
1794                 ProcessData = OutputText(&ProcessData);
1795                 
1796                 SaveData->Append(ProcessData);
1797                 ProcessData.clear();
1798                         
1799         }
1800                         
1803 void ContactDataObject::SaveLogo(map<int, string> *LogosList, map<int, wxString> *LogosListAltID, 
1804         map<int, wxString> *LogosListPID, map<int, wxString> *LogosListType,
1805         map<int, wxString> *LogosListPicEncType, map<int, wxString> *LogosListPictureType,
1806         map<int, wxString> *LogosListMediatype, map<int, int> *LogosListPref,
1807         map<int, wxString> *LogosListTokens, wxString *SaveData){
1809         wxString ProcessData = "";
1810                 
1811         for (std::map<int, string>::iterator LogosIter = LogosList->begin();
1812                 LogosIter != LogosList->end(); LogosIter++){
1814                 ProcessData.Append("LOGO");
1815                         
1816                 // Check if there is a value for TYPE.
1817                 
1818                 if ((*LogosListType)[LogosIter->first].size() > 0){
1819                 
1820                         ProcessData.Append(";TYPE=");
1821                         ProcessData.Append((*LogosListType)[LogosIter->first]);
1822                         
1823                 }
1824                 
1825                 // Check if there is a value for ALTID.
1826                 
1827                 if ((*LogosListAltID)[LogosIter->first].size() > 0){
1828                 
1829                         ProcessData.Append(";ALTID=");
1830                         ProcessData.Append((*LogosListAltID)[LogosIter->first]);
1831                         
1832                 }
1834                 // Check if there is a value for MEDIATYPE..
1835                 
1836                 if ((*LogosListMediatype)[LogosIter->first].size() > 0){
1837                 
1838                         ProcessData.Append(";MEDIATYPE=");
1839                         ProcessData.Append((*LogosListMediatype)[LogosIter->first]);
1840                         
1841                 }
1842                 
1843                 // Check if there is a value for PID.
1845                 if ((*LogosListPID)[LogosIter->first].size() > 0){
1846                 
1847                         ProcessData.Append(";PID=");
1848                         ProcessData.Append((*LogosListPID)[LogosIter->first]);
1849                         
1850                 }
1852                 // Check if there is a value for PREF.
1854                 if ((*LogosListPref)[LogosIter->first] > 0){
1855                 
1856                         ProcessData.Append(";PREF=");
1857                         ProcessData.Append(wxString::Format("%i", (*LogosListPref)[LogosIter->first]));
1858                         
1859                 }
1861                 // Check if there is a value for tokens.
1863                 if ((*LogosListTokens)[LogosIter->first].size() > 0){
1864                 
1865                         ProcessData.Append(";");
1866                         ProcessData.Append((*LogosListTokens)[LogosIter->first]);
1867                         
1868                 }
1869                 
1870                 ProcessData.Append(":data:");
1871                 ProcessData.Append((*LogosListPictureType)[LogosIter->first]);
1872                 ProcessData.Append(";");
1873                 ProcessData.Append((*LogosListPicEncType)[LogosIter->first]);
1874                 ProcessData.Append(",");
1875                 ProcessData.Append(LogosIter->second);
1876                 ProcessData.Append("\n");
1878                 ProcessData = OutputText(&ProcessData);
1879                 
1880                 SaveData->Append(ProcessData);
1881                 ProcessData.clear();
1882                         
1883         }
1884                 
1887 void ContactDataObject::SaveSound(map<int, string> *SoundsList, map<int, wxString> *SoundsListAltID, 
1888         map<int, wxString> *SoundsListPID, map<int, wxString> *SoundsListType,
1889         map<int, wxString> *SoundsListAudioEncType, map<int, wxString> *SoundsListAudioType,
1890         map<int, wxString> *SoundsListMediatype, map<int, wxString> *SoundsListLanguage, 
1891         map<int, int> *SoundsListPref, map<int, wxString> *SoundsListTokens, 
1892         wxString *SaveData){
1894         wxString ProcessData = "";
1895                 
1896         for (std::map<int, string>::iterator SoundsIter = SoundsList->begin();
1897                 SoundsIter != SoundsList->end(); SoundsIter++){
1899                 ProcessData.Append("SOUND");
1900                         
1901                 // Check if there is a value for TYPE.
1902                 
1903                 if ((*SoundsListType)[SoundsIter->first].size() > 0){
1904                 
1905                         ProcessData.Append(";TYPE=");
1906                         ProcessData.Append((*SoundsListType)[SoundsIter->first]);
1907                         
1908                 }
1909                 
1910                 // Check if there is a value for ALTID.
1911                 
1912                 if ((*SoundsListAltID)[SoundsIter->first].size() > 0){
1913                 
1914                         ProcessData.Append(";ALTID=");
1915                         ProcessData.Append((*SoundsListAltID)[SoundsIter->first]);
1916                         
1917                 }
1919                 // Check if there is a value for LANGUAGE.
1920                 
1921                 if ((*SoundsListLanguage)[SoundsIter->first].size() > 0){
1922                 
1923                         ProcessData.Append(";LANGUAGE=");
1924                         ProcessData.Append((*SoundsListLanguage)[SoundsIter->first]);
1925                         
1926                 }
1927                 
1928                 // Check if there is a value for MEDIATYPE.
1929                 
1930                 if ((*SoundsListMediatype)[SoundsIter->first].size() > 0){
1931                 
1932                         ProcessData.Append(";MEDIATYPE=");
1933                         ProcessData.Append((*SoundsListMediatype)[SoundsIter->first]);
1934                         
1935                 }
1936                 
1937                 // Check if there is a value for PID.
1939                 if ((*SoundsListPID)[SoundsIter->first].size() > 0){
1940                 
1941                         ProcessData.Append(";PID=");
1942                         ProcessData.Append((*SoundsListPID)[SoundsIter->first]);
1943                         
1944                 }
1946                 // Check if there is a value for PREF.
1948                 if ((*SoundsListPref)[SoundsIter->first] > 0){
1949                 
1950                         ProcessData.Append(";PREF=");
1951                         ProcessData.Append(wxString::Format("%i", (*SoundsListPref)[SoundsIter->first]));
1952                         
1953                 }
1955                 // Check if there is a value for tokens.
1957                 if ((*SoundsListTokens)[SoundsIter->first].size() > 0){
1958                 
1959                         ProcessData.Append(";");
1960                         ProcessData.Append((*SoundsListTokens)[SoundsIter->first]);
1961                         
1962                 }
1963                 
1964                 ProcessData.Append(":data:");
1965                 ProcessData.Append((*SoundsListAudioType)[SoundsIter->first]);
1966                 ProcessData.Append(";");
1967                 ProcessData.Append((*SoundsListAudioEncType)[SoundsIter->first]);
1968                 ProcessData.Append(",");
1969                 ProcessData.Append(SoundsIter->second);
1970                 ProcessData.Append("\n");
1972                 ProcessData = OutputText(&ProcessData);
1973                 
1974                 SaveData->Append(ProcessData);
1975                 ProcessData.clear();
1976                         
1977         }
1978                 
1981 void ContactDataObject::SaveCalendarURI(map<int, wxString> *CalendarList, map<int, wxString> *CalendarListMediatype,
1982         map<int, wxString> *CalendarListAltID, map<int, wxString> *CalendarListPID,
1983         map<int, wxString> *CalendarListType, map<int, int> *CalendarListPref,
1984         map<int, wxString> *CalendarListTokens, wxString *SaveData){
1986         wxString ProcessData = "";
1987                 
1988         for (std::map<int, wxString>::iterator CalendarIter = CalendarList->begin();
1989                 CalendarIter != CalendarList->end(); CalendarIter++){
1991                 ProcessData.Append("CALURI");
1992                         
1993                 // Check if there is a value for TYPE.
1994                 
1995                 if ((*CalendarListType)[CalendarIter->first].size() > 0){
1996                 
1997                         ProcessData.Append(";TYPE=");
1998                         ProcessData.Append((*CalendarListType)[CalendarIter->first]);
1999                         
2000                 }
2001                 
2002                 // Check if there is a value for ALTID.
2003                 
2004                 if ((*CalendarListAltID)[CalendarIter->first].size() > 0){
2005                 
2006                         ProcessData.Append(";ALTID=");
2007                         ProcessData.Append((*CalendarListAltID)[CalendarIter->first]);
2008                         
2009                 }
2011                 // Check if there is a value for MEDIATYPE.
2012                 
2013                 if ((*CalendarListMediatype)[CalendarIter->first].size() > 0){
2014                 
2015                         ProcessData.Append(";MEDIATYPE=");
2016                         ProcessData.Append((*CalendarListMediatype)[CalendarIter->first]);
2017                         
2018                 }
2019                 
2020                 // Check if there is a value for PID.
2022                 if ((*CalendarListPID)[CalendarIter->first].size() > 0){
2023                 
2024                         ProcessData.Append(";PID=");
2025                         ProcessData.Append((*CalendarListPID)[CalendarIter->first]);
2026                         
2027                 }
2029                 // Check if there is a value for PREF.
2031                 if ((*CalendarListPref)[CalendarIter->first] > 0){
2032                 
2033                         ProcessData.Append(";PREF=");
2034                         ProcessData.Append(wxString::Format("%i", (*CalendarListPref)[CalendarIter->first]));
2035                         
2036                 }
2038                 // Check if there is a value for tokens.
2040                 if ((*CalendarListTokens)[CalendarIter->first].size() > 0){
2041                 
2042                         ProcessData.Append(";");
2043                         ProcessData.Append((*CalendarListTokens)[CalendarIter->first]);
2044                         
2045                 }
2046                         
2047                 ProcessData.Append(":");
2048                 ProcessData.Append(CalendarIter->second);
2049                 ProcessData.Append("\n");
2051                 ProcessData = OutputText(&ProcessData);
2052                 
2053                 SaveData->Append(ProcessData);
2054                 ProcessData.clear();
2055                         
2056         }
2057                 
2060 void ContactDataObject::SaveCalendarRequestURI(map<int, wxString> *CalendarRequestList, map<int, wxString> *CalendarRequestListMediatype,
2061         map<int, wxString> *CalendarRequestListAltID, map<int, wxString> *CalendarRequestListPID,
2062         map<int, wxString> *CalendarRequestListType, map<int, int> *CalendarRequestListPref,
2063         map<int, wxString> *CalendarRequestListTokens, wxString *SaveData){
2065         wxString ProcessData = "";
2066                 
2067         for (std::map<int, wxString>::iterator CalendarRequestIter = CalendarRequestList->begin();
2068                 CalendarRequestIter != CalendarRequestList->end(); CalendarRequestIter++){
2070                 ProcessData.Append("CALADRURI");
2071                         
2072                 // Check if there is a value for TYPE.
2073                 
2074                 if ((*CalendarRequestListType)[CalendarRequestIter->first].size() > 0){
2075                 
2076                         ProcessData.Append(";TYPE=");
2077                         ProcessData.Append((*CalendarRequestListType)[CalendarRequestIter->first]);
2078                         
2079                 }
2080                 
2081                 // Check if there is a value for ALTID.
2082                 
2083                 if ((*CalendarRequestListAltID)[CalendarRequestIter->first].size() > 0){
2084                 
2085                         ProcessData.Append(";ALTID=");
2086                         ProcessData.Append((*CalendarRequestListAltID)[CalendarRequestIter->first]);
2087                         
2088                 }
2090                 // Check if there is a value for MEDIATYPE.
2091                 
2092                 if ((*CalendarRequestListMediatype)[CalendarRequestIter->first].size() > 0){
2093                 
2094                         ProcessData.Append(";MEDIATYPE=");
2095                         ProcessData.Append((*CalendarRequestListMediatype)[CalendarRequestIter->first]);
2096                         
2097                 }
2098                 
2099                 // Check if there is a value for PID.
2101                 if ((*CalendarRequestListPID)[CalendarRequestIter->first].size() > 0){
2102                 
2103                         ProcessData.Append(";PID=");
2104                         ProcessData.Append((*CalendarRequestListPID)[CalendarRequestIter->first]);
2105                         
2106                 }
2108                 // Check if there is a value for PREF.
2110                 if ((*CalendarRequestListPref)[CalendarRequestIter->first] > 0){
2111                 
2112                         ProcessData.Append(";PREF=");
2113                         ProcessData.Append(wxString::Format("%i", (*CalendarRequestListPref)[CalendarRequestIter->first]));
2114                         
2115                 }
2117                 // Check if there is a value for tokens.
2119                 if ((*CalendarRequestListTokens)[CalendarRequestIter->first].size() > 0){
2120                 
2121                         ProcessData.Append(";");
2122                         ProcessData.Append((*CalendarRequestListTokens)[CalendarRequestIter->first]);
2123                         
2124                 }
2125                         
2126                 ProcessData.Append(":");
2127                 ProcessData.Append(CalendarRequestIter->second);
2128                 ProcessData.Append("\n");
2130                 ProcessData = OutputText(&ProcessData);
2131                 
2132                 SaveData->Append(ProcessData);
2133                 ProcessData.clear();
2134                         
2135         }
2136                 
2139 void ContactDataObject::SaveFreeBusyURI(std::map<int, wxString> *FreeBusyList, std::map<int, wxString> *FreeBusyListAltID, 
2140         std::map<int, wxString> *FreeBusyListPID, std::map<int, wxString> *FreeBusyListType,
2141         std::map<int, wxString> *FreeBusyListMediatype, std::map<int, int> *FreeBusyListPref, 
2142         std::map<int, wxString> *FreeBusyListTokens, wxString *SaveData){
2144         wxString ProcessData = "";
2145                 
2146         for (std::map<int, wxString>::iterator FreeBusyIter = FreeBusyList->begin();
2147                 FreeBusyIter != FreeBusyList->end(); FreeBusyIter++){
2149                 ProcessData.Append("FBURL");
2150                         
2151                 // Check if there is a value for TYPE.
2152                 
2153                 if ((*FreeBusyListType)[FreeBusyIter->first].size() > 0){
2154                 
2155                         ProcessData.Append(";TYPE=");
2156                         ProcessData.Append((*FreeBusyListType)[FreeBusyIter->first]);
2157                         
2158                 }
2159                 
2160                 // Check if there is a value for ALTID.
2161                 
2162                 if ((*FreeBusyListAltID)[FreeBusyIter->first].size() > 0){
2163                 
2164                         ProcessData.Append(";ALTID=");
2165                         ProcessData.Append((*FreeBusyListAltID)[FreeBusyIter->first]);
2166                         
2167                 }
2169                 // Check if there is a value for MEDIATYPE.
2170                 
2171                 if ((*FreeBusyListMediatype)[FreeBusyIter->first].size() > 0){
2172                 
2173                         ProcessData.Append(";MEDIATYPE=");
2174                         ProcessData.Append((*FreeBusyListMediatype)[FreeBusyIter->first]);
2175                         
2176                 }
2177                 
2178                 // Check if there is a value for PID.
2180                 if ((*FreeBusyListPID)[FreeBusyIter->first].size() > 0){
2181                 
2182                         ProcessData.Append(";PID=");
2183                         ProcessData.Append((*FreeBusyListPID)[FreeBusyIter->first]);
2184                         
2185                 }
2187                 // Check if there is a value for PREF.
2189                 if ((*FreeBusyListPref)[FreeBusyIter->first] > 0){
2190                 
2191                         ProcessData.Append(";PREF=");
2192                         ProcessData.Append(wxString::Format("%i", (*FreeBusyListPref)[FreeBusyIter->first]));
2193                         
2194                 }
2196                 // Check if there is a value for tokens.
2198                 if ((*FreeBusyListTokens)[FreeBusyIter->first].size() > 0){
2199                 
2200                         ProcessData.Append(";");
2201                         ProcessData.Append((*FreeBusyListTokens)[FreeBusyIter->first]);
2202                         
2203                 }
2204                         
2205                 ProcessData.Append(":");
2206                 ProcessData.Append(FreeBusyIter->second);
2207                 ProcessData.Append("\n");
2209                 ProcessData = OutputText(&ProcessData);
2210                 
2211                 SaveData->Append(ProcessData);
2212                 ProcessData.clear();
2213                         
2214         }
2215                 
2218 void ContactDataObject::SaveKey(map<int, wxString> *KeyList, map<int, wxString> *KeyListAltID, 
2219         map<int, wxString> *KeyListPID, map<int, wxString> *KeyListType,
2220         map<int, bool> *KeyListKeyType, map<int, wxString> *KeyListDataEncType, 
2221         map<int, wxString> *KeyListDataType, map<int, int> *KeyListPref, 
2222         map<int, wxString> *KeyListTokens, wxString *SaveData){
2224         wxString ProcessData = "";
2225                 
2226         for (std::map<int, wxString>::iterator KeyIter = KeyList->begin();
2227                 KeyIter != KeyList->end(); KeyIter++){
2229                 ProcessData.Append("KEY");
2230                         
2231                 // Check if there is a value for TYPE.
2232                 
2233                 if ((*KeyListType)[KeyIter->first].size() > 0){
2234                 
2235                         ProcessData.Append(";TYPE=");
2236                         ProcessData.Append((*KeyListType)[KeyIter->first]);
2237                         
2238                 }
2239                 
2240                 // Check if there is a value for ALTID.
2241                 
2242                 if ((*KeyListAltID)[KeyIter->first].size() > 0){
2243                 
2244                         ProcessData.Append(";ALTID=");
2245                         ProcessData.Append((*KeyListAltID)[KeyIter->first]);
2246                         
2247                 }
2248                 
2249                 // Check if there is a value for PID.
2251                 if ((*KeyListPID)[KeyIter->first].size() > 0){
2252                 
2253                         ProcessData.Append(";PID=");
2254                         ProcessData.Append((*KeyListPID)[KeyIter->first]);
2255                         
2256                 }
2258                 // Check if there is a value for PREF.
2260                 if ((*KeyListPref)[KeyIter->first] > 0){
2261                 
2262                         ProcessData.Append(";PREF=");
2263                         ProcessData.Append(wxString::Format("%i", (*KeyListPref)[KeyIter->first]));
2264                         
2265                 }
2267                 // Check if there is a value for tokens.
2269                 if ((*KeyListTokens)[KeyIter->first].size() > 0){
2270                 
2271                         ProcessData.Append(";");
2272                         ProcessData.Append((*KeyListTokens)[KeyIter->first]);
2273                         
2274                 }
2275                         
2276                 ProcessData.Append(":data:");
2277                 ProcessData.Append((*KeyListDataType)[KeyIter->first]);
2278                 ProcessData.Append(";");
2279                 ProcessData.Append((*KeyListDataEncType)[KeyIter->first]);
2280                 ProcessData.Append(",");
2281                 ProcessData.Append(KeyIter->second);
2282                 ProcessData.Append("\n");
2284                 ProcessData = OutputText(&ProcessData);
2285                 
2286                 SaveData->Append(ProcessData);
2287                 ProcessData.clear();
2288                         
2289         }
2290                 
2293 void ContactDataObject::SaveVendor(map<int, wxString> *VendorList, map<int, wxString> *VendorListPEN, 
2294         map<int, wxString> *VendorListElement, wxString *SaveData){
2296         wxString ProcessData = "";
2297                 
2298         for (std::map<int, wxString>::iterator VendorIter = VendorList->begin();
2299                 VendorIter != VendorList->end(); VendorIter++){
2301                 ProcessData.Append("VND-");
2302                 ProcessData.Append((*VendorListPEN)[VendorIter->first]);
2303                 ProcessData.Append("-");
2304                 ProcessData.Append((*VendorListElement)[VendorIter->first]);
2305                 ProcessData.Append(":");
2306                 ProcessData.Append(VendorIter->second);
2307                 ProcessData.Append("\n");
2309                 ProcessData = OutputText(&ProcessData);
2310                 
2311                 SaveData->Append(ProcessData);
2312                 ProcessData.clear();
2313                         
2314         }
2315                 
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