Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added FBURL 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         // Write the end part of the vCard data file.
617         
618         SaveData->Append("END:VCARD");
619         
620         SaveDataStatus = CONTACTSAVE_OK;
621         
622         return SaveDataStatus;
623         
626 void ContactDataObject::SaveTitle(map<int, wxString> *TitleList, map<int, wxString> *TitleListLanguage,
627         map<int, wxString> *TitleListAltID, map<int, wxString> *TitleListPID,
628         map<int, wxString> *TitleListType, map<int, int> *TitleListPref,
629         map<int, wxString> *TitleListTokens, wxString *SaveData, wxString DataType){
631         wxString ProcessData = "";
632                 
633         for (std::map<int, wxString>::iterator TitleIter = TitleList->begin();
634                 TitleIter != TitleList->end(); TitleIter++){
636                 ProcessData.Append("TITLE");
637                         
638                 // Check if there is a value for TYPE.
639                 
640                 if (DataType.size() > 0){
641                 
642                         ProcessData.Append(";TYPE=");
643                         ProcessData.Append(DataType);
644                         
645                 }
646                 
647                 // Check if there is a value for ALTID.
648                 
649                 if ((*TitleListAltID)[TitleIter->first].size() > 0){
650                 
651                         ProcessData.Append(";ALTID=");
652                         ProcessData.Append((*TitleListAltID)[TitleIter->first]);
653                         
654                 }
656                 // Check if there is a value for LANGUAGE.
657                 
658                 if ((*TitleListLanguage)[TitleIter->first].size() > 0){
659                 
660                         ProcessData.Append(";LANGUAGE=");
661                         ProcessData.Append((*TitleListLanguage)[TitleIter->first]);
662                         
663                 }
664                 
665                 // Check if there is a value for PID.
667                 if ((*TitleListPID)[TitleIter->first].size() > 0){
668                 
669                         ProcessData.Append(";PID=");
670                         ProcessData.Append((*TitleListPID)[TitleIter->first]);
671                         
672                 }
674                 // Check if there is a value for PREF.
676                 if ((*TitleListPref)[TitleIter->first] > 0){
677                 
678                         ProcessData.Append(";PREF=");
679                         ProcessData.Append(wxString::Format("%i", (*TitleListPref)[TitleIter->first]));
680                         
681                 }
683                 // Check if there is a value for tokens.
685                 if ((*TitleListTokens)[TitleIter->first].size() > 0){
686                 
687                         ProcessData.Append(";");
688                         ProcessData.Append((*TitleListTokens)[TitleIter->first]);
689                         
690                 }
691                         
692                 ProcessData.Append(":");
693                 ProcessData.Append(TitleIter->second);
694                 ProcessData.Append("\n");
696                 ProcessData = OutputText(&ProcessData);
697                         
698                 SaveData->Append(ProcessData);
699                 ProcessData.clear();
700                         
701         }
702                 
705 void ContactDataObject::SaveSource(map<int, wxString> *SourceList, map<int, wxString> *SourceListAltID, 
706         map<int, wxString> *SourceListPID, map<int, wxString> *SourceListType,
707         map<int, wxString> *SourceListMediatype, map<int, int> *SourceListPref, 
708         map<int, wxString> *SourceListTokens, wxString *SaveData){
710         wxString ProcessData = "";
711         
712         for (std::map<int, wxString>::iterator SourceIter = SourceList->begin();
713                 SourceIter != SourceList->end(); SourceIter++){
715                 ProcessData.Append("SOURCE");
716                         
717                 // Check if there is a value for TYPE.
718                 
719                 if ((*SourceListType)[SourceIter->first].size() > 0){
720                 
721                         ProcessData.Append(";TYPE=");
722                         ProcessData.Append((*SourceListType)[SourceIter->first]);
723                         
724                 }
725                 
726                 // Check if there is a value for ALTID.
727                 
728                 if ((*SourceListAltID)[SourceIter->first].size() > 0){
729                 
730                         ProcessData.Append(";ALTID=");
731                         ProcessData.Append((*SourceListAltID)[SourceIter->first]);
732                         
733                 }
735                 // Check if there is a value for MEDIATYPE.
736                 
737                 if ((*SourceListMediatype)[SourceIter->first].size() > 0){
738                 
739                         ProcessData.Append(";MEDIATYPE=");
740                         ProcessData.Append((*SourceListMediatype)[SourceIter->first]);
741                         
742                 }
743                 
744                 // Check if there is a value for PID.
746                 if ((*SourceListPID)[SourceIter->first].size() > 0){
747                 
748                         ProcessData.Append(";PID=");
749                         ProcessData.Append((*SourceListPID)[SourceIter->first]);
750                         
751                 }
753                 // Check if there is a value for PREF.
755                 if ((*SourceListPref)[SourceIter->first] > 0){
756                 
757                         ProcessData.Append(";PREF=");
758                         ProcessData.Append(wxString::Format("%i", (*SourceListPref)[SourceIter->first]));
759                         
760                 }
762                 // Check if there is a value for tokens.
764                 if ((*SourceListTokens)[SourceIter->first].size() > 0){
765                 
766                         ProcessData.Append(";");
767                         ProcessData.Append((*SourceListTokens)[SourceIter->first]);
768                         
769                 }
770                         
771                 ProcessData.Append(":");
772                 ProcessData.Append(SourceIter->second);
773                 ProcessData.Append("\n");
775                 ProcessData = OutputText(&ProcessData);
776                         
777                 SaveData->Append(ProcessData);
778                 ProcessData.clear();
779                         
780         }
781                 
784 void ContactDataObject::SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID, 
785         map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
786         map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref, 
787         map<int, wxString> *NicknameListTokens, wxString *SaveData, wxString DataType){
789         wxString ProcessData = "";
790         
791         for (std::map<int, wxString>::iterator NicknameIter = NicknameList->begin();
792                 NicknameIter != NicknameList->end(); NicknameIter++){
794                 ProcessData.Append("NICKNAME");
795                         
796                 // Check if there is a value for TYPE.
797                 
798                 if (DataType.size() > 0){
799                 
800                         ProcessData.Append(";TYPE=");
801                         ProcessData.Append(DataType);
802                         
803                 }
804                 
805                 // Check if there is a value for ALTID.
806                 
807                 if ((*NicknameListAltID)[NicknameIter->first].size() > 0){
808                 
809                         ProcessData.Append(";ALTID=");
810                         ProcessData.Append((*NicknameListAltID)[NicknameIter->first]);
811                         
812                 }
814                 // Check if there is a value for MEDIATYPE.
815                 
816                 if ((*NicknameListLanguage)[NicknameIter->first].size() > 0){
817                 
818                         ProcessData.Append(";LANGUAGE=");
819                         ProcessData.Append((*NicknameListLanguage)[NicknameIter->first]);
820                         
821                 }
822                 
823                 // Check if there is a value for PID.
825                 if ((*NicknameListPID)[NicknameIter->first].size() > 0){
826                 
827                         ProcessData.Append(";PID=");
828                         ProcessData.Append((*NicknameListPID)[NicknameIter->first]);
829                         
830                 }
832                 // Check if there is a value for PREF.
834                 if ((*NicknameListPref)[NicknameIter->first] > 0){
835                 
836                         ProcessData.Append(";PREF=");
837                         ProcessData.Append(wxString::Format("%i", (*NicknameListPref)[NicknameIter->first]));
838                         
839                 }
841                 // Check if there is a value for tokens.
843                 if ((*NicknameListTokens)[NicknameIter->first].size() > 0){
844                 
845                         ProcessData.Append(";");
846                         ProcessData.Append((*NicknameListTokens)[NicknameIter->first]);
847                         
848                 }
849                         
850                 ProcessData.Append(":");
851                 ProcessData.Append(NicknameIter->second);
852                 ProcessData.Append("\n");
854                 ProcessData = OutputText(&ProcessData);
855                         
856                 SaveData->Append(ProcessData);
857                 ProcessData.clear();
858                         
859         }
860                 
863 void ContactDataObject::SaveTimezone(map<int, wxString> *TZList, map<int, wxString> *TZListAltID, 
864         map<int, wxString> *TZListPID, map<int, wxString> *TZListType,
865         map<int, wxString> *TZListMediatype, map<int, int> *TZListPref, 
866         map<int, wxString> *TZListTokens, wxString *SaveData, wxString DataType){
868         wxString ProcessData = "";
869         
870         for (std::map<int, wxString>::iterator TZIter = TZList->begin();
871                 TZIter != TZList->end(); TZIter++){
873                 ProcessData.Append("TZ");
874                         
875                 // Check if there is a value for TYPE.
876                 
877                 if (DataType.size() > 0){
878                 
879                         ProcessData.Append(";TYPE=");
880                         ProcessData.Append(DataType);
881                         
882                 }
883                 
884                 // Check if there is a value for ALTID.
885                 
886                 if ((*TZListAltID)[TZIter->first].size() > 0){
887                 
888                         ProcessData.Append(";ALTID=");
889                         ProcessData.Append((*TZListAltID)[TZIter->first]);
890                         
891                 }
893                 // Check if there is a value for MEDIATYPE.
894                 
895                 if ((*TZListMediatype)[TZIter->first].size() > 0){
896                 
897                         ProcessData.Append(";MEDIATYPE=");
898                         ProcessData.Append((*TZListMediatype)[TZIter->first]);
899                         
900                 }
901                 
902                 // Check if there is a value for PID.
904                 if ((*TZListPID)[TZIter->first].size() > 0){
905                 
906                         ProcessData.Append(";PID=");
907                         ProcessData.Append((*TZListPID)[TZIter->first]);
908                         
909                 }
911                 // Check if there is a value for PREF.
913                 if ((*TZListPref)[TZIter->first] > 0){
914                 
915                         ProcessData.Append(";PREF=");
916                         ProcessData.Append(wxString::Format("%i", (*TZListPref)[TZIter->first]));
917                         
918                 }
920                 // Check if there is a value for tokens.
922                 if ((*TZListTokens)[TZIter->first].size() > 0){
923                 
924                         ProcessData.Append(";");
925                         ProcessData.Append((*TZListTokens)[TZIter->first]);
926                         
927                 }
928                         
929                 ProcessData.Append(":");
930                 ProcessData.Append(TZIter->second);
931                 ProcessData.Append("\n");
933                 ProcessData = OutputText(&ProcessData);
934                         
935                 SaveData->Append(ProcessData);
936                 ProcessData.clear();
937                         
938         }
939                 
942 void ContactDataObject::SaveAddress(map<int, wxString> *AddressList, map<int, wxString> *AddressListTown,
943                 map<int, wxString> *AddressListCounty, map<int, wxString> *AddressListPostCode,
944                 map<int, wxString> *AddressListCountry, map<int, wxString> *AddressListLabel,
945                 map<int, wxString> *AddressListLang, map<int, wxString> *AddressListAltID,
946                 map<int, wxString> *AddressListPID, map<int, wxString> *AddressListGeo, 
947                 map<int, wxString> *AddressListTimezone, map<int, wxString> *AddressListType, 
948                 map<int, wxString> *AddressListMediatype, map<int, int> *AddressListPref, 
949                 map<int, wxString> *AddressListTokens, wxString *SaveData, wxString DataType){
951         wxString ProcessData = "";
952                         
953         for (std::map<int, wxString>::iterator AddressIter = AddressList->begin();
954                 AddressIter != AddressList->end(); AddressIter++){
955                         
956                 ProcessData.Append("ADR");
957                         
958                 // Check if there is a value for TYPE.
959                 
960                 if (DataType.size() > 0){
961                 
962                         ProcessData.Append(";TYPE=");
963                         ProcessData.Append(DataType);
964                         
965                 }
966                 
967                 // Check if there is a value for ALTID.
968                 
969                 if ((*AddressListAltID)[AddressIter->first].size() > 0){
970                 
971                         ProcessData.Append(";ALTID=");
972                         ProcessData.Append((*AddressListAltID)[AddressIter->first]);
973                         
974                 }
976                 // Check if there is a value for GEO.
977                 
978                 if ((*AddressListGeo)[AddressIter->first].size() > 0){
979                 
980                         ProcessData.Append(";GEO=\"");
981                         ProcessData.Append((*AddressListGeo)[AddressIter->first]);
982                         ProcessData.Append("\"");
983                         
984                 }
986                 // Check if there is a value for LABEL.
988                 if ((*AddressListLabel)[AddressIter->first].size() > 0){
989                 
990                         wxString AddressProcessed = "";
991                         AddressProcessed = (*AddressListLabel)[AddressIter->first];
992                         
993                         AddressProcessed.Replace("\n", "\\n", true);
994                         
995                         ProcessData.Append(";LABEL=");
996                         ProcessData.Append(AddressProcessed);
997                         
998                 }
999                 
1000                 // Check if there is a value for LANGUAGE.
1001                 
1002                 if ((*AddressListLang)[AddressIter->first].size() > 0){
1003                 
1004                         ProcessData.Append(";LANGUAGE=");
1005                         ProcessData.Append((*AddressListLang)[AddressIter->first]);
1006                         
1007                 }
1008                 
1009                 // Check if there is a value for MEDIATYPE.
1010                 
1011                 if ((*AddressListMediatype)[AddressIter->first].size() > 0){
1012                 
1013                         ProcessData.Append(";MEDIATYPE=");
1014                         ProcessData.Append((*AddressListMediatype)[AddressIter->first]);
1015                         
1016                 }
1017                 
1018                 // Check if there is a value for PID.
1020                 if ((*AddressListPID)[AddressIter->first].size() > 0){
1021                 
1022                         ProcessData.Append(";PID=");
1023                         ProcessData.Append((*AddressListPID)[AddressIter->first]);
1024                         
1025                 }
1027                 // Check if there is a value for PREF.
1029                 if ((*AddressListPref)[AddressIter->first] > 0){
1030                 
1031                         ProcessData.Append(";PREF=");
1032                         ProcessData.Append(wxString::Format("%i", (*AddressListPref)[AddressIter->first]));
1033                         
1034                 }
1036                 // Check if there is a value for TZ.
1038                 if ((*AddressListTimezone)[AddressIter->first].size() > 0){
1039                 
1040                         ProcessData.Append(";TZ=");
1041                         ProcessData.Append((*AddressListTimezone)[AddressIter->first]);
1042                         
1043                 }
1044                 
1045                 // Check if there is a value for tokens.
1047                 if ((*AddressListTokens)[AddressIter->first].size() > 0){
1048                 
1049                         ProcessData.Append(";");
1050                         ProcessData.Append((*AddressListTokens)[AddressIter->first]);
1051                         
1052                 }
1053                 
1054                 // Build the address.
1055                 
1056                 ProcessData.Append(":;;");
1057                 ProcessData.Append((*AddressList)[AddressIter->first]);
1058                 ProcessData.Append(";");
1059                 ProcessData.Append((*AddressListTown)[AddressIter->first]);
1060                 ProcessData.Append(";");
1061                 ProcessData.Append((*AddressListCounty)[AddressIter->first]);
1062                 ProcessData.Append(";");
1063                 ProcessData.Append((*AddressListPostCode)[AddressIter->first]);
1064                 ProcessData.Append(";");
1065                 ProcessData.Append((*AddressListCountry)[AddressIter->first]);
1066                 ProcessData.Append("\n");
1067                 
1068                 ProcessData = OutputText(&ProcessData);
1069                         
1070                 SaveData->Append(ProcessData);
1071                 ProcessData.clear();
1072                         
1073         }
1074                         
1077 void ContactDataObject::SaveEmail(map<int, wxString> *EmailList, map<int, wxString> *EmailListAltID, 
1078         map<int, wxString> *EmailListPID, map<int, wxString> *EmailListType,
1079         map<int, int> *EmailListPref, map<int, wxString> *EmailListTokens, 
1080         wxString *SaveData, wxString DataType){
1082         wxString ProcessData = "";
1083         
1084         for (std::map<int, wxString>::iterator EmailIter = EmailList->begin();
1085                 EmailIter != EmailList->end(); EmailIter++){
1087                 ProcessData.Append("EMAIL");
1088                         
1089                 // Check if there is a value for TYPE.
1090                 
1091                 if (DataType.size() > 0){
1092                 
1093                         ProcessData.Append(";TYPE=");
1094                         ProcessData.Append(DataType);
1095                         
1096                 }
1097                 
1098                 // Check if there is a value for ALTID.
1099                 
1100                 if ((*EmailListAltID)[EmailIter->first].size() > 0){
1101                 
1102                         ProcessData.Append(";ALTID=");
1103                         ProcessData.Append((*EmailListAltID)[EmailIter->first]);
1104                         
1105                 }
1106                 
1107                 // Check if there is a value for PID.
1109                 if ((*EmailListPID)[EmailIter->first].size() > 0){
1110                 
1111                         ProcessData.Append(";PID=");
1112                         ProcessData.Append((*EmailListPID)[EmailIter->first]);
1113                         
1114                 }
1116                 // Check if there is a value for PREF.
1118                 if ((*EmailListPref)[EmailIter->first] > 0){
1119                 
1120                         ProcessData.Append(";PREF=");
1121                         ProcessData.Append(wxString::Format("%i", (*EmailListPref)[EmailIter->first]));
1122                         
1123                 }
1125                 // Check if there is a value for tokens.
1127                 if ((*EmailListTokens)[EmailIter->first].size() > 0){
1128                 
1129                         ProcessData.Append(";");
1130                         ProcessData.Append((*EmailListTokens)[EmailIter->first]);
1131                         
1132                 }
1133                         
1134                 ProcessData.Append(":");
1135                 ProcessData.Append(EmailIter->second);
1136                 ProcessData.Append("\n");
1138                 ProcessData = OutputText(&ProcessData);
1139                         
1140                 SaveData->Append(ProcessData);
1141                 ProcessData.clear();
1142                         
1143         }
1144                 
1147 void ContactDataObject::SaveLanguage(map<int, wxString> *LanguageList, map<int, wxString> *LanguageListAltID, 
1148         map<int, wxString> *LanguageListPID, map<int, wxString> *LanguageListType,
1149         map<int, int> *LangaugeListPref, map<int, wxString> *LanguageListTokens, 
1150         wxString *SaveData, wxString DataType){
1152         wxString ProcessData = "";
1153         
1154         for (std::map<int, wxString>::iterator LanguageIter = LanguageList->begin();
1155                 LanguageIter != LanguageList->end(); LanguageIter++){
1157                 ProcessData.Append("LANG");
1158                         
1159                 // Check if there is a value for TYPE.
1160                 
1161                 if (DataType.size() > 0){
1162                 
1163                         ProcessData.Append(";TYPE=");
1164                         ProcessData.Append(DataType);
1165                         
1166                 }
1167                 
1168                 // Check if there is a value for ALTID.
1169                 
1170                 if ((*LanguageListAltID)[LanguageIter->first].size() > 0){
1171                 
1172                         ProcessData.Append(";ALTID=");
1173                         ProcessData.Append((*LanguageListAltID)[LanguageIter->first]);
1174                         
1175                 }
1176                 
1177                 // Check if there is a value for PID.
1179                 if ((*LanguageListPID)[LanguageIter->first].size() > 0){
1180                 
1181                         ProcessData.Append(";PID=");
1182                         ProcessData.Append((*LanguageListPID)[LanguageIter->first]);
1183                         
1184                 }
1186                 // Check if there is a value for PREF.
1188                 if ((*LangaugeListPref)[LanguageIter->first] > 0){
1189                 
1190                         ProcessData.Append(";PREF=");
1191                         ProcessData.Append(wxString::Format("%i", (*LangaugeListPref)[LanguageIter->first]));
1192                         
1193                 }
1195                 // Check if there is a value for tokens.
1197                 if ((*LanguageListTokens)[LanguageIter->first].size() > 0){
1198                 
1199                         ProcessData.Append(";");
1200                         ProcessData.Append((*LanguageListTokens)[LanguageIter->first]);
1201                         
1202                 }
1203                         
1204                 ProcessData.Append(":");
1205                 ProcessData.Append(LanguageIter->second);
1206                 ProcessData.Append("\n");
1208                 ProcessData = OutputText(&ProcessData);
1209                         
1210                 SaveData->Append(ProcessData);
1211                 ProcessData.clear();
1212                         
1213         }
1214                 
1217 void ContactDataObject::SaveGeoposition(map<int, wxString> *GeographyList, map<int, wxString> *GeographyListAltID, 
1218         map<int, wxString> *GeographyListPID, map<int, wxString> *GeographyListType,
1219         map<int, wxString> *GeographyListMediatype, map<int, wxString> *GeographyListDataType,
1220         map<int, int> *GeographyListPref, map<int, wxString> *GeographyListTokens, 
1221         wxString *SaveData, wxString DataType){
1223         wxString ProcessData = "";
1224         
1225         for (std::map<int, wxString>::iterator GeographyIter = GeographyList->begin();
1226                 GeographyIter != GeographyList->end(); GeographyIter++){
1228                 ProcessData.Append("GEO");
1229                         
1230                 // Check if there is a value for TYPE.
1231                 
1232                 if (DataType.size() > 0){
1233                 
1234                         ProcessData.Append(";TYPE=");
1235                         ProcessData.Append(DataType);
1236                         
1237                 }
1238                 
1239                 // Check if there is a value for ALTID.
1240                 
1241                 if ((*GeographyListAltID)[GeographyIter->first].size() > 0){
1242                 
1243                         ProcessData.Append(";ALTID=");
1244                         ProcessData.Append((*GeographyListAltID)[GeographyIter->first]);
1245                         
1246                 }
1247                 
1248                 // Check if there is a value for MEDIATYPE.
1249                 
1250                 if ((*GeographyListMediatype)[GeographyIter->first].size() > 0){
1251                 
1252                         ProcessData.Append(";MEDIATYPE=");
1253                         ProcessData.Append((*GeographyListMediatype)[GeographyIter->first]);
1254                         
1255                 }
1256                 
1257                 // Check if there is a value for PID.
1259                 if ((*GeographyListPID)[GeographyIter->first].size() > 0){
1260                 
1261                         ProcessData.Append(";PID=");
1262                         ProcessData.Append((*GeographyListPID)[GeographyIter->first]);
1263                         
1264                 }
1266                 // Check if there is a value for PREF.
1268                 if ((*GeographyListPref)[GeographyIter->first] > 0){
1269                 
1270                         ProcessData.Append(";PREF=");
1271                         ProcessData.Append(wxString::Format("%i", (*GeographyListPref)[GeographyIter->first]));
1272                         
1273                 }
1275                 // Check if there is a value for tokens.
1277                 if ((*GeographyListTokens)[GeographyIter->first].size() > 0){
1278                 
1279                         ProcessData.Append(";");
1280                         ProcessData.Append((*GeographyListTokens)[GeographyIter->first]);
1281                         
1282                 }
1283                         
1284                 ProcessData.Append(":");
1285                 ProcessData.Append((*GeographyListDataType)[GeographyIter->first]);
1286                 ProcessData.Append(":");
1287                 ProcessData.Append(GeographyIter->second);
1288                 ProcessData.Append("\n");
1290                 ProcessData = OutputText(&ProcessData);
1291                         
1292                 SaveData->Append(ProcessData);
1293                 ProcessData.clear();
1294                         
1295         }
1296                 
1299 void ContactDataObject::SaveURL(map<int, wxString> *WebsiteList, map<int, wxString> *WebsiteListAltID, 
1300                 map<int, wxString> *WebsiteListPID, map<int, wxString> *WebsiteListType,
1301                 map<int, wxString> *WebsiteListMediatype, map<int, int> *WebsiteListPref, 
1302                 map<int, wxString> *WebsiteListTokens, wxString *SaveData, wxString DataType){
1304         wxString ProcessData = "";
1305         
1306         for (std::map<int, wxString>::iterator WebsiteIter = WebsiteList->begin();
1307                 WebsiteIter != WebsiteList->end(); WebsiteIter++){
1309                 ProcessData.Append("URL");
1310                         
1311                 // Check if there is a value for TYPE.
1312                 
1313                 if (DataType.size() > 0){
1314                 
1315                         ProcessData.Append(";TYPE=");
1316                         ProcessData.Append(DataType);
1317                         
1318                 }
1319                 
1320                 // Check if there is a value for ALTID.
1321                 
1322                 if ((*WebsiteListAltID)[WebsiteIter->first].size() > 0){
1323                 
1324                         ProcessData.Append(";ALTID=");
1325                         ProcessData.Append((*WebsiteListAltID)[WebsiteIter->first]);
1326                         
1327                 }
1328                 
1329                 // Check if there is a value for MEDIATYPE.
1330                 
1331                 if ((*WebsiteListMediatype)[WebsiteIter->first].size() > 0){
1332                 
1333                         ProcessData.Append(";MEDIATYPE=");
1334                         ProcessData.Append((*WebsiteListMediatype)[WebsiteIter->first]);
1335                         
1336                 }
1337                 
1338                 // Check if there is a value for PID.
1340                 if ((*WebsiteListPID)[WebsiteIter->first].size() > 0){
1341                 
1342                         ProcessData.Append(";PID=");
1343                         ProcessData.Append((*WebsiteListPID)[WebsiteIter->first]);
1344                         
1345                 }
1347                 // Check if there is a value for PREF.
1349                 if ((*WebsiteListPref)[WebsiteIter->first] > 0){
1350                 
1351                         ProcessData.Append(";PREF=");
1352                         ProcessData.Append(wxString::Format("%i", (*WebsiteListPref)[WebsiteIter->first]));
1353                         
1354                 }
1356                 // Check if there is a value for tokens.
1358                 if ((*WebsiteListTokens)[WebsiteIter->first].size() > 0){
1359                 
1360                         ProcessData.Append(";");
1361                         ProcessData.Append((*WebsiteListTokens)[WebsiteIter->first]);
1362                         
1363                 }
1364                         
1365                 ProcessData.Append(":");
1366                 ProcessData.Append(WebsiteIter->second);
1367                 ProcessData.Append("\n");
1369                 ProcessData = OutputText(&ProcessData);
1370                         
1371                 SaveData->Append(ProcessData);
1372                 ProcessData.clear();
1373                         
1374         }
1375                         
1378 void ContactDataObject::SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
1379         map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
1380         map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
1381         map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType){
1383         wxString ProcessData = "";
1384                 
1385         for (std::map<int, wxString>::iterator RoleIter = RoleList->begin();
1386                 RoleIter != RoleList->end(); RoleIter++){
1388                 ProcessData.Append("ROLE");
1389                         
1390                 // Check if there is a value for TYPE.
1391                 
1392                 if (DataType.size() > 0){
1393                 
1394                         ProcessData.Append(";TYPE=");
1395                         ProcessData.Append(DataType);
1396                         
1397                 }
1398                 
1399                 // Check if there is a value for ALTID.
1400                 
1401                 if ((*RoleListAltID)[RoleIter->first].size() > 0){
1402                 
1403                         ProcessData.Append(";ALTID=");
1404                         ProcessData.Append((*RoleListAltID)[RoleIter->first]);
1405                         
1406                 }
1408                 // Check if there is a value for LANGUAGE.
1409                 
1410                 if ((*RoleListLanguage)[RoleIter->first].size() > 0){
1411                 
1412                         ProcessData.Append(";LANGUAGE=");
1413                         ProcessData.Append((*RoleListLanguage)[RoleIter->first]);
1414                         
1415                 }
1416                 
1417                 // Check if there is a value for PID.
1419                 if ((*RoleListPID)[RoleIter->first].size() > 0){
1420                 
1421                         ProcessData.Append(";PID=");
1422                         ProcessData.Append((*RoleListPID)[RoleIter->first]);
1423                         
1424                 }
1426                 // Check if there is a value for PREF.
1428                 if ((*RoleListPref)[RoleIter->first] > 0){
1429                 
1430                         ProcessData.Append(";PREF=");
1431                         ProcessData.Append(wxString::Format("%i", (*RoleListPref)[RoleIter->first]));
1432                         
1433                 }
1435                 // Check if there is a value for tokens.
1437                 if ((*RoleListTokens)[RoleIter->first].size() > 0){
1438                 
1439                         ProcessData.Append(";");
1440                         ProcessData.Append((*RoleListTokens)[RoleIter->first]);
1441                         
1442                 }
1443                         
1444                 ProcessData.Append(":");
1445                 ProcessData.Append(RoleIter->second);
1446                 ProcessData.Append("\n");
1448                 ProcessData = OutputText(&ProcessData);
1449                 
1450                 SaveData->Append(ProcessData);
1451                 ProcessData.clear();
1452                         
1453         }
1454                 
1457 void ContactDataObject::SaveOrganisation(map<int, wxString> *OrganisationList, map<int, wxString> *OrganisationListAltID,
1458         map<int, wxString> *OrganisationListPID, map<int, wxString> *OrganisationListLanguage, 
1459         map<int, wxString> *OrganisationListSortAs, map<int, wxString> *OrganisationListType, 
1460         map<int, int> *OrganisationListPref, map<int, wxString> *OrganisationListTokens, 
1461         wxString *SaveData, wxString DataType){
1463         wxString ProcessData = "";
1464                 
1465         for (std::map<int, wxString>::iterator OrganisationIter = OrganisationList->begin();
1466                 OrganisationIter != OrganisationList->end(); OrganisationIter++){
1468                 ProcessData.Append("ORG");
1469                         
1470                 // Check if there is a value for TYPE.
1471                 
1472                 if (DataType.size() > 0){
1473                 
1474                         ProcessData.Append(";TYPE=");
1475                         ProcessData.Append(DataType);
1476                         
1477                 }
1478                 
1479                 // Check if there is a value for ALTID.
1480                 
1481                 if ((*OrganisationListAltID)[OrganisationIter->first].size() > 0){
1482                 
1483                         ProcessData.Append(";ALTID=");
1484                         ProcessData.Append((*OrganisationListAltID)[OrganisationIter->first]);
1485                         
1486                 }
1488                 // Check if there is a value for LANGUAGE.
1489                 
1490                 if ((*OrganisationListLanguage)[OrganisationIter->first].size() > 0){
1491                 
1492                         ProcessData.Append(";LANGUAGE=");
1493                         ProcessData.Append((*OrganisationListLanguage)[OrganisationIter->first]);
1494                         
1495                 }
1496                 
1497                 // Check if there is a value for PID.
1499                 if ((*OrganisationListPID)[OrganisationIter->first].size() > 0){
1500                 
1501                         ProcessData.Append(";PID=");
1502                         ProcessData.Append((*OrganisationListPID)[OrganisationIter->first]);
1503                         
1504                 }
1506                 // Check if there is a value for PREF.
1508                 if ((*OrganisationListPref)[OrganisationIter->first] > 0){
1509                 
1510                         ProcessData.Append(";PREF=");
1511                         ProcessData.Append(wxString::Format("%i", (*OrganisationListPref)[OrganisationIter->first]));
1512                         
1513                 }
1514                 
1515                 // Check if there is a value for SORT-AS.
1516                 
1517                 if ((*OrganisationListSortAs)[OrganisationIter->first].size() > 0){
1518                 
1519                         ProcessData.Append(";SORT-AS=\"");
1520                         ProcessData.Append((*OrganisationListSortAs)[OrganisationIter->first]);
1521                         ProcessData.Append("\"");
1522                         
1523                 }
1525                 // Check if there is a value for tokens.
1527                 if ((*OrganisationListTokens)[OrganisationIter->first].size() > 0){
1528                 
1529                         ProcessData.Append(";");
1530                         ProcessData.Append((*OrganisationListTokens)[OrganisationIter->first]);
1531                         
1532                 }
1533                         
1534                 ProcessData.Append(":");
1535                 ProcessData.Append(OrganisationIter->second);
1536                 ProcessData.Append("\n");
1538                 ProcessData = OutputText(&ProcessData);
1539                 
1540                 SaveData->Append(ProcessData);
1541                 ProcessData.clear();
1542                         
1543         }
1544                 
1547 void ContactDataObject::SaveNote(map<int, wxString> *NoteList, map<int, wxString> *NoteListLanguage,
1548         map<int, wxString> *NoteListAltID, map<int, wxString> *NoteListPID,
1549         map<int, wxString> *NoteListType, map<int, int> *NoteListPref,
1550         map<int, wxString> *NoteListTokens, wxString *SaveData, wxString DataType){
1552         wxString ProcessData = "";
1553                 
1554         for (std::map<int, wxString>::iterator NoteIter = NoteList->begin();
1555                 NoteIter != NoteList->end(); NoteIter++){
1557                 ProcessData.Append("NOTE");
1558                         
1559                 // Check if there is a value for TYPE.
1560                 
1561                 if (DataType.size() > 0){
1562                 
1563                         ProcessData.Append(";TYPE=");
1564                         ProcessData.Append(DataType);
1565                         
1566                 }
1567                 
1568                 // Check if there is a value for ALTID.
1569                 
1570                 if ((*NoteListAltID)[NoteIter->first].size() > 0){
1571                 
1572                         ProcessData.Append(";ALTID=");
1573                         ProcessData.Append((*NoteListAltID)[NoteIter->first]);
1574                         
1575                 }
1577                 // Check if there is a value for LANGUAGE.
1578                 
1579                 if ((*NoteListLanguage)[NoteIter->first].size() > 0){
1580                 
1581                         ProcessData.Append(";LANGUAGE=");
1582                         ProcessData.Append((*NoteListLanguage)[NoteIter->first]);
1583                         
1584                 }
1585                 
1586                 // Check if there is a value for PID.
1588                 if ((*NoteListPID)[NoteIter->first].size() > 0){
1589                 
1590                         ProcessData.Append(";PID=");
1591                         ProcessData.Append((*NoteListPID)[NoteIter->first]);
1592                         
1593                 }
1595                 // Check if there is a value for PREF.
1597                 if ((*NoteListPref)[NoteIter->first] > 0){
1598                 
1599                         ProcessData.Append(";PREF=");
1600                         ProcessData.Append(wxString::Format("%i", (*NoteListPref)[NoteIter->first]));
1601                         
1602                 }
1604                 // Check if there is a value for tokens.
1606                 if ((*NoteListTokens)[NoteIter->first].size() > 0){
1607                 
1608                         ProcessData.Append(";");
1609                         ProcessData.Append((*NoteListTokens)[NoteIter->first]);
1610                         
1611                 }
1612                         
1613                 ProcessData.Append(":");
1614                 ProcessData.Append(NoteIter->second);
1615                 ProcessData.Replace("\n", "\\n", true);
1616                 ProcessData.Append("\n");
1618                 ProcessData = OutputText(&ProcessData);
1619                 
1620                 SaveData->Append(ProcessData);
1621                 ProcessData.clear();
1622                         
1623         }
1624                 
1627 void ContactDataObject::SaveCategory(map<int, wxString> *CategoryList, map<int, wxString> *CategoryListLanguage,
1628         map<int, wxString> *CategoryListAltID, map<int, wxString> *CategoryListPID,
1629         map<int, wxString> *CategoryListType, map<int, int> *CategoryListPref,
1630         map<int, wxString> *CategoryListTokens, wxString *SaveData){
1632         wxString ProcessData = "";
1633                 
1634         for (std::map<int, wxString>::iterator CategoryIter = CategoryList->begin();
1635                 CategoryIter != CategoryList->end(); CategoryIter++){
1637                 ProcessData.Append("CATEGORIES");
1638                         
1639                 // Check if there is a value for TYPE.
1640                 
1641                 if ((*CategoryListType)[CategoryIter->first].size() > 0){
1642                 
1643                         ProcessData.Append(";TYPE=");
1644                         ProcessData.Append((*CategoryListType)[CategoryIter->first]);
1645                         
1646                 }
1647                 
1648                 // Check if there is a value for ALTID.
1649                 
1650                 if ((*CategoryListAltID)[CategoryIter->first].size() > 0){
1651                 
1652                         ProcessData.Append(";ALTID=");
1653                         ProcessData.Append((*CategoryListAltID)[CategoryIter->first]);
1654                         
1655                 }
1657                 // Check if there is a value for LANGUAGE.
1658                 
1659                 if ((*CategoryListLanguage)[CategoryIter->first].size() > 0){
1660                 
1661                         ProcessData.Append(";LANGUAGE=");
1662                         ProcessData.Append((*CategoryListLanguage)[CategoryIter->first]);
1663                         
1664                 }
1665                 
1666                 // Check if there is a value for PID.
1668                 if ((*CategoryListPID)[CategoryIter->first].size() > 0){
1669                 
1670                         ProcessData.Append(";PID=");
1671                         ProcessData.Append((*CategoryListPID)[CategoryIter->first]);
1672                         
1673                 }
1675                 // Check if there is a value for PREF.
1677                 if ((*CategoryListPref)[CategoryIter->first] > 0){
1678                 
1679                         ProcessData.Append(";PREF=");
1680                         ProcessData.Append(wxString::Format("%i", (*CategoryListPref)[CategoryIter->first]));
1681                         
1682                 }
1684                 // Check if there is a value for tokens.
1686                 if ((*CategoryListTokens)[CategoryIter->first].size() > 0){
1687                 
1688                         ProcessData.Append(";");
1689                         ProcessData.Append((*CategoryListTokens)[CategoryIter->first]);
1690                         
1691                 }
1692                         
1693                 ProcessData.Append(":");
1694                 ProcessData.Append(CategoryIter->second);
1695                 ProcessData.Append("\n");
1697                 ProcessData = OutputText(&ProcessData);
1698                 
1699                 SaveData->Append(ProcessData);
1700                 ProcessData.clear();
1701                         
1702         }
1703                 
1706 void ContactDataObject::SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID, 
1707                 map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
1708                 map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
1709                 map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
1710                 map<int, wxString> *PicturesListTokens, wxString *SaveData){
1712         wxString ProcessData = "";
1713                 
1714         for (std::map<int, string>::iterator PicturesIter = PicturesList->begin();
1715                 PicturesIter != PicturesList->end(); PicturesIter++){
1717                 ProcessData.Append("PHOTO");
1718                         
1719                 // Check if there is a value for TYPE.
1720                 
1721                 if ((*PicturesListType)[PicturesIter->first].size() > 0){
1722                 
1723                         ProcessData.Append(";TYPE=");
1724                         ProcessData.Append((*PicturesListType)[PicturesIter->first]);
1725                         
1726                 }
1727                 
1728                 // Check if there is a value for ALTID.
1729                 
1730                 if ((*PicturesListAltID)[PicturesIter->first].size() > 0){
1731                 
1732                         ProcessData.Append(";ALTID=");
1733                         ProcessData.Append((*PicturesListAltID)[PicturesIter->first]);
1734                         
1735                 }
1737                 // Check if there is a value for MEDIATYPE..
1738                 
1739                 if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){
1740                 
1741                         ProcessData.Append(";MEDIATYPE=");
1742                         ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]);
1743                         
1744                 }
1745                 
1746                 // Check if there is a value for PID.
1748                 if ((*PicturesListPID)[PicturesIter->first].size() > 0){
1749                 
1750                         ProcessData.Append(";PID=");
1751                         ProcessData.Append((*PicturesListPID)[PicturesIter->first]);
1752                         
1753                 }
1755                 // Check if there is a value for PREF.
1757                 if ((*PicturesListPref)[PicturesIter->first] > 0){
1758                 
1759                         ProcessData.Append(";PREF=");
1760                         ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first]));
1761                         
1762                 }
1764                 // Check if there is a value for tokens.
1766                 if ((*PicturesListTokens)[PicturesIter->first].size() > 0){
1767                 
1768                         ProcessData.Append(";");
1769                         ProcessData.Append((*PicturesListTokens)[PicturesIter->first]);
1770                         
1771                 }
1772                 
1773                 ProcessData.Append(":data:");
1774                 ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]);
1775                 ProcessData.Append(";");
1776                 ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]);
1777                 ProcessData.Append(",");
1778                 ProcessData.Append(PicturesIter->second);
1779                 ProcessData.Append("\n");
1781                 ProcessData = OutputText(&ProcessData);
1782                 
1783                 SaveData->Append(ProcessData);
1784                 ProcessData.clear();
1785                         
1786         }
1787                         
1790 void ContactDataObject::SaveLogo(map<int, string> *LogosList, map<int, wxString> *LogosListAltID, 
1791         map<int, wxString> *LogosListPID, map<int, wxString> *LogosListType,
1792         map<int, wxString> *LogosListPicEncType, map<int, wxString> *LogosListPictureType,
1793         map<int, wxString> *LogosListMediatype, map<int, int> *LogosListPref,
1794         map<int, wxString> *LogosListTokens, wxString *SaveData){
1796         wxString ProcessData = "";
1797                 
1798         for (std::map<int, string>::iterator LogosIter = LogosList->begin();
1799                 LogosIter != LogosList->end(); LogosIter++){
1801                 ProcessData.Append("LOGO");
1802                         
1803                 // Check if there is a value for TYPE.
1804                 
1805                 if ((*LogosListType)[LogosIter->first].size() > 0){
1806                 
1807                         ProcessData.Append(";TYPE=");
1808                         ProcessData.Append((*LogosListType)[LogosIter->first]);
1809                         
1810                 }
1811                 
1812                 // Check if there is a value for ALTID.
1813                 
1814                 if ((*LogosListAltID)[LogosIter->first].size() > 0){
1815                 
1816                         ProcessData.Append(";ALTID=");
1817                         ProcessData.Append((*LogosListAltID)[LogosIter->first]);
1818                         
1819                 }
1821                 // Check if there is a value for MEDIATYPE..
1822                 
1823                 if ((*LogosListMediatype)[LogosIter->first].size() > 0){
1824                 
1825                         ProcessData.Append(";MEDIATYPE=");
1826                         ProcessData.Append((*LogosListMediatype)[LogosIter->first]);
1827                         
1828                 }
1829                 
1830                 // Check if there is a value for PID.
1832                 if ((*LogosListPID)[LogosIter->first].size() > 0){
1833                 
1834                         ProcessData.Append(";PID=");
1835                         ProcessData.Append((*LogosListPID)[LogosIter->first]);
1836                         
1837                 }
1839                 // Check if there is a value for PREF.
1841                 if ((*LogosListPref)[LogosIter->first] > 0){
1842                 
1843                         ProcessData.Append(";PREF=");
1844                         ProcessData.Append(wxString::Format("%i", (*LogosListPref)[LogosIter->first]));
1845                         
1846                 }
1848                 // Check if there is a value for tokens.
1850                 if ((*LogosListTokens)[LogosIter->first].size() > 0){
1851                 
1852                         ProcessData.Append(";");
1853                         ProcessData.Append((*LogosListTokens)[LogosIter->first]);
1854                         
1855                 }
1856                 
1857                 ProcessData.Append(":data:");
1858                 ProcessData.Append((*LogosListPictureType)[LogosIter->first]);
1859                 ProcessData.Append(";");
1860                 ProcessData.Append((*LogosListPicEncType)[LogosIter->first]);
1861                 ProcessData.Append(",");
1862                 ProcessData.Append(LogosIter->second);
1863                 ProcessData.Append("\n");
1865                 ProcessData = OutputText(&ProcessData);
1866                 
1867                 SaveData->Append(ProcessData);
1868                 ProcessData.clear();
1869                         
1870         }
1871                 
1874 void ContactDataObject::SaveSound(map<int, string> *SoundsList, map<int, wxString> *SoundsListAltID, 
1875         map<int, wxString> *SoundsListPID, map<int, wxString> *SoundsListType,
1876         map<int, wxString> *SoundsListAudioEncType, map<int, wxString> *SoundsListAudioType,
1877         map<int, wxString> *SoundsListMediatype, map<int, wxString> *SoundsListLanguage, 
1878         map<int, int> *SoundsListPref, map<int, wxString> *SoundsListTokens, 
1879         wxString *SaveData){
1881         wxString ProcessData = "";
1882                 
1883         for (std::map<int, string>::iterator SoundsIter = SoundsList->begin();
1884                 SoundsIter != SoundsList->end(); SoundsIter++){
1886                 ProcessData.Append("SOUND");
1887                         
1888                 // Check if there is a value for TYPE.
1889                 
1890                 if ((*SoundsListType)[SoundsIter->first].size() > 0){
1891                 
1892                         ProcessData.Append(";TYPE=");
1893                         ProcessData.Append((*SoundsListType)[SoundsIter->first]);
1894                         
1895                 }
1896                 
1897                 // Check if there is a value for ALTID.
1898                 
1899                 if ((*SoundsListAltID)[SoundsIter->first].size() > 0){
1900                 
1901                         ProcessData.Append(";ALTID=");
1902                         ProcessData.Append((*SoundsListAltID)[SoundsIter->first]);
1903                         
1904                 }
1906                 // Check if there is a value for LANGUAGE.
1907                 
1908                 if ((*SoundsListLanguage)[SoundsIter->first].size() > 0){
1909                 
1910                         ProcessData.Append(";LANGUAGE=");
1911                         ProcessData.Append((*SoundsListLanguage)[SoundsIter->first]);
1912                         
1913                 }
1914                 
1915                 // Check if there is a value for MEDIATYPE.
1916                 
1917                 if ((*SoundsListMediatype)[SoundsIter->first].size() > 0){
1918                 
1919                         ProcessData.Append(";MEDIATYPE=");
1920                         ProcessData.Append((*SoundsListMediatype)[SoundsIter->first]);
1921                         
1922                 }
1923                 
1924                 // Check if there is a value for PID.
1926                 if ((*SoundsListPID)[SoundsIter->first].size() > 0){
1927                 
1928                         ProcessData.Append(";PID=");
1929                         ProcessData.Append((*SoundsListPID)[SoundsIter->first]);
1930                         
1931                 }
1933                 // Check if there is a value for PREF.
1935                 if ((*SoundsListPref)[SoundsIter->first] > 0){
1936                 
1937                         ProcessData.Append(";PREF=");
1938                         ProcessData.Append(wxString::Format("%i", (*SoundsListPref)[SoundsIter->first]));
1939                         
1940                 }
1942                 // Check if there is a value for tokens.
1944                 if ((*SoundsListTokens)[SoundsIter->first].size() > 0){
1945                 
1946                         ProcessData.Append(";");
1947                         ProcessData.Append((*SoundsListTokens)[SoundsIter->first]);
1948                         
1949                 }
1950                 
1951                 ProcessData.Append(":data:");
1952                 ProcessData.Append((*SoundsListAudioType)[SoundsIter->first]);
1953                 ProcessData.Append(";");
1954                 ProcessData.Append((*SoundsListAudioEncType)[SoundsIter->first]);
1955                 ProcessData.Append(",");
1956                 ProcessData.Append(SoundsIter->second);
1957                 ProcessData.Append("\n");
1959                 ProcessData = OutputText(&ProcessData);
1960                 
1961                 SaveData->Append(ProcessData);
1962                 ProcessData.clear();
1963                         
1964         }
1965                 
1968 void ContactDataObject::SaveCalendarURI(map<int, wxString> *CalendarList, map<int, wxString> *CalendarListMediatype,
1969         map<int, wxString> *CalendarListAltID, map<int, wxString> *CalendarListPID,
1970         map<int, wxString> *CalendarListType, map<int, int> *CalendarListPref,
1971         map<int, wxString> *CalendarListTokens, wxString *SaveData){
1973         wxString ProcessData = "";
1974                 
1975         for (std::map<int, wxString>::iterator CalendarIter = CalendarList->begin();
1976                 CalendarIter != CalendarList->end(); CalendarIter++){
1978                 ProcessData.Append("CALURI");
1979                         
1980                 // Check if there is a value for TYPE.
1981                 
1982                 if ((*CalendarListType)[CalendarIter->first].size() > 0){
1983                 
1984                         ProcessData.Append(";TYPE=");
1985                         ProcessData.Append((*CalendarListType)[CalendarIter->first]);
1986                         
1987                 }
1988                 
1989                 // Check if there is a value for ALTID.
1990                 
1991                 if ((*CalendarListAltID)[CalendarIter->first].size() > 0){
1992                 
1993                         ProcessData.Append(";ALTID=");
1994                         ProcessData.Append((*CalendarListAltID)[CalendarIter->first]);
1995                         
1996                 }
1998                 // Check if there is a value for MEDIATYPE.
1999                 
2000                 if ((*CalendarListMediatype)[CalendarIter->first].size() > 0){
2001                 
2002                         ProcessData.Append(";MEDIATYPE=");
2003                         ProcessData.Append((*CalendarListMediatype)[CalendarIter->first]);
2004                         
2005                 }
2006                 
2007                 // Check if there is a value for PID.
2009                 if ((*CalendarListPID)[CalendarIter->first].size() > 0){
2010                 
2011                         ProcessData.Append(";PID=");
2012                         ProcessData.Append((*CalendarListPID)[CalendarIter->first]);
2013                         
2014                 }
2016                 // Check if there is a value for PREF.
2018                 if ((*CalendarListPref)[CalendarIter->first] > 0){
2019                 
2020                         ProcessData.Append(";PREF=");
2021                         ProcessData.Append(wxString::Format("%i", (*CalendarListPref)[CalendarIter->first]));
2022                         
2023                 }
2025                 // Check if there is a value for tokens.
2027                 if ((*CalendarListTokens)[CalendarIter->first].size() > 0){
2028                 
2029                         ProcessData.Append(";");
2030                         ProcessData.Append((*CalendarListTokens)[CalendarIter->first]);
2031                         
2032                 }
2033                         
2034                 ProcessData.Append(":");
2035                 ProcessData.Append(CalendarIter->second);
2036                 ProcessData.Append("\n");
2038                 ProcessData = OutputText(&ProcessData);
2039                 
2040                 SaveData->Append(ProcessData);
2041                 ProcessData.clear();
2042                         
2043         }
2044                 
2047 void ContactDataObject::SaveCalendarRequestURI(map<int, wxString> *CalendarRequestList, map<int, wxString> *CalendarRequestListMediatype,
2048         map<int, wxString> *CalendarRequestListAltID, map<int, wxString> *CalendarRequestListPID,
2049         map<int, wxString> *CalendarRequestListType, map<int, int> *CalendarRequestListPref,
2050         map<int, wxString> *CalendarRequestListTokens, wxString *SaveData){
2052         wxString ProcessData = "";
2053                 
2054         for (std::map<int, wxString>::iterator CalendarRequestIter = CalendarRequestList->begin();
2055                 CalendarRequestIter != CalendarRequestList->end(); CalendarRequestIter++){
2057                 ProcessData.Append("CALADRURI");
2058                         
2059                 // Check if there is a value for TYPE.
2060                 
2061                 if ((*CalendarRequestListType)[CalendarRequestIter->first].size() > 0){
2062                 
2063                         ProcessData.Append(";TYPE=");
2064                         ProcessData.Append((*CalendarRequestListType)[CalendarRequestIter->first]);
2065                         
2066                 }
2067                 
2068                 // Check if there is a value for ALTID.
2069                 
2070                 if ((*CalendarRequestListAltID)[CalendarRequestIter->first].size() > 0){
2071                 
2072                         ProcessData.Append(";ALTID=");
2073                         ProcessData.Append((*CalendarRequestListAltID)[CalendarRequestIter->first]);
2074                         
2075                 }
2077                 // Check if there is a value for MEDIATYPE.
2078                 
2079                 if ((*CalendarRequestListMediatype)[CalendarRequestIter->first].size() > 0){
2080                 
2081                         ProcessData.Append(";MEDIATYPE=");
2082                         ProcessData.Append((*CalendarRequestListMediatype)[CalendarRequestIter->first]);
2083                         
2084                 }
2085                 
2086                 // Check if there is a value for PID.
2088                 if ((*CalendarRequestListPID)[CalendarRequestIter->first].size() > 0){
2089                 
2090                         ProcessData.Append(";PID=");
2091                         ProcessData.Append((*CalendarRequestListPID)[CalendarRequestIter->first]);
2092                         
2093                 }
2095                 // Check if there is a value for PREF.
2097                 if ((*CalendarRequestListPref)[CalendarRequestIter->first] > 0){
2098                 
2099                         ProcessData.Append(";PREF=");
2100                         ProcessData.Append(wxString::Format("%i", (*CalendarRequestListPref)[CalendarRequestIter->first]));
2101                         
2102                 }
2104                 // Check if there is a value for tokens.
2106                 if ((*CalendarRequestListTokens)[CalendarRequestIter->first].size() > 0){
2107                 
2108                         ProcessData.Append(";");
2109                         ProcessData.Append((*CalendarRequestListTokens)[CalendarRequestIter->first]);
2110                         
2111                 }
2112                         
2113                 ProcessData.Append(":");
2114                 ProcessData.Append(CalendarRequestIter->second);
2115                 ProcessData.Append("\n");
2117                 ProcessData = OutputText(&ProcessData);
2118                 
2119                 SaveData->Append(ProcessData);
2120                 ProcessData.clear();
2121                         
2122         }
2123                 
2126 void ContactDataObject::SaveFreeBusyURI(std::map<int, wxString> *FreeBusyList, std::map<int, wxString> *FreeBusyListAltID, 
2127         std::map<int, wxString> *FreeBusyListPID, std::map<int, wxString> *FreeBusyListType,
2128         std::map<int, wxString> *FreeBusyListMediatype, std::map<int, int> *FreeBusyListPref, 
2129         std::map<int, wxString> *FreeBusyListTokens, wxString *SaveData){
2131         wxString ProcessData = "";
2132                 
2133         for (std::map<int, wxString>::iterator FreeBusyIter = FreeBusyList->begin();
2134                 FreeBusyIter != FreeBusyList->end(); FreeBusyIter++){
2136                 ProcessData.Append("FBURL");
2137                         
2138                 // Check if there is a value for TYPE.
2139                 
2140                 if ((*FreeBusyListType)[FreeBusyIter->first].size() > 0){
2141                 
2142                         ProcessData.Append(";TYPE=");
2143                         ProcessData.Append((*FreeBusyListType)[FreeBusyIter->first]);
2144                         
2145                 }
2146                 
2147                 // Check if there is a value for ALTID.
2148                 
2149                 if ((*FreeBusyListAltID)[FreeBusyIter->first].size() > 0){
2150                 
2151                         ProcessData.Append(";ALTID=");
2152                         ProcessData.Append((*FreeBusyListAltID)[FreeBusyIter->first]);
2153                         
2154                 }
2156                 // Check if there is a value for MEDIATYPE.
2157                 
2158                 if ((*FreeBusyListMediatype)[FreeBusyIter->first].size() > 0){
2159                 
2160                         ProcessData.Append(";MEDIATYPE=");
2161                         ProcessData.Append((*FreeBusyListMediatype)[FreeBusyIter->first]);
2162                         
2163                 }
2164                 
2165                 // Check if there is a value for PID.
2167                 if ((*FreeBusyListPID)[FreeBusyIter->first].size() > 0){
2168                 
2169                         ProcessData.Append(";PID=");
2170                         ProcessData.Append((*FreeBusyListPID)[FreeBusyIter->first]);
2171                         
2172                 }
2174                 // Check if there is a value for PREF.
2176                 if ((*FreeBusyListPref)[FreeBusyIter->first] > 0){
2177                 
2178                         ProcessData.Append(";PREF=");
2179                         ProcessData.Append(wxString::Format("%i", (*FreeBusyListPref)[FreeBusyIter->first]));
2180                         
2181                 }
2183                 // Check if there is a value for tokens.
2185                 if ((*FreeBusyListTokens)[FreeBusyIter->first].size() > 0){
2186                 
2187                         ProcessData.Append(";");
2188                         ProcessData.Append((*FreeBusyListTokens)[FreeBusyIter->first]);
2189                         
2190                 }
2191                         
2192                 ProcessData.Append(":");
2193                 ProcessData.Append(FreeBusyIter->second);
2194                 ProcessData.Append("\n");
2196                 ProcessData = OutputText(&ProcessData);
2197                 
2198                 SaveData->Append(ProcessData);
2199                 ProcessData.clear();
2200                         
2201         }
2202                 
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