Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added CALADRURI 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         // Write the end part of the vCard data file.
610         
611         SaveData->Append("END:VCARD");
612         
613         SaveDataStatus = CONTACTSAVE_OK;
614         
615         return SaveDataStatus;
616         
619 void ContactDataObject::SaveTitle(map<int, wxString> *TitleList, map<int, wxString> *TitleListLanguage,
620         map<int, wxString> *TitleListAltID, map<int, wxString> *TitleListPID,
621         map<int, wxString> *TitleListType, map<int, int> *TitleListPref,
622         map<int, wxString> *TitleListTokens, wxString *SaveData, wxString DataType){
624         wxString ProcessData = "";
625                 
626         for (std::map<int, wxString>::iterator TitleIter = TitleList->begin();
627                 TitleIter != TitleList->end(); TitleIter++){
629                 ProcessData.Append("TITLE");
630                         
631                 // Check if there is a value for TYPE.
632                 
633                 if (DataType.size() > 0){
634                 
635                         ProcessData.Append(";TYPE=");
636                         ProcessData.Append(DataType);
637                         
638                 }
639                 
640                 // Check if there is a value for ALTID.
641                 
642                 if ((*TitleListAltID)[TitleIter->first].size() > 0){
643                 
644                         ProcessData.Append(";ALTID=");
645                         ProcessData.Append((*TitleListAltID)[TitleIter->first]);
646                         
647                 }
649                 // Check if there is a value for LANGUAGE.
650                 
651                 if ((*TitleListLanguage)[TitleIter->first].size() > 0){
652                 
653                         ProcessData.Append(";LANGUAGE=");
654                         ProcessData.Append((*TitleListLanguage)[TitleIter->first]);
655                         
656                 }
657                 
658                 // Check if there is a value for PID.
660                 if ((*TitleListPID)[TitleIter->first].size() > 0){
661                 
662                         ProcessData.Append(";PID=");
663                         ProcessData.Append((*TitleListPID)[TitleIter->first]);
664                         
665                 }
667                 // Check if there is a value for PREF.
669                 if ((*TitleListPref)[TitleIter->first] > 0){
670                 
671                         ProcessData.Append(";PREF=");
672                         ProcessData.Append(wxString::Format("%i", (*TitleListPref)[TitleIter->first]));
673                         
674                 }
676                 // Check if there is a value for tokens.
678                 if ((*TitleListTokens)[TitleIter->first].size() > 0){
679                 
680                         ProcessData.Append(";");
681                         ProcessData.Append((*TitleListTokens)[TitleIter->first]);
682                         
683                 }
684                         
685                 ProcessData.Append(":");
686                 ProcessData.Append(TitleIter->second);
687                 ProcessData.Append("\n");
689                 ProcessData = OutputText(&ProcessData);
690                         
691                 SaveData->Append(ProcessData);
692                 ProcessData.clear();
693                         
694         }
695                 
698 void ContactDataObject::SaveSource(map<int, wxString> *SourceList, map<int, wxString> *SourceListAltID, 
699         map<int, wxString> *SourceListPID, map<int, wxString> *SourceListType,
700         map<int, wxString> *SourceListMediatype, map<int, int> *SourceListPref, 
701         map<int, wxString> *SourceListTokens, wxString *SaveData){
703         wxString ProcessData = "";
704         
705         for (std::map<int, wxString>::iterator SourceIter = SourceList->begin();
706                 SourceIter != SourceList->end(); SourceIter++){
708                 ProcessData.Append("SOURCE");
709                         
710                 // Check if there is a value for TYPE.
711                 
712                 if ((*SourceListType)[SourceIter->first].size() > 0){
713                 
714                         ProcessData.Append(";TYPE=");
715                         ProcessData.Append((*SourceListType)[SourceIter->first]);
716                         
717                 }
718                 
719                 // Check if there is a value for ALTID.
720                 
721                 if ((*SourceListAltID)[SourceIter->first].size() > 0){
722                 
723                         ProcessData.Append(";ALTID=");
724                         ProcessData.Append((*SourceListAltID)[SourceIter->first]);
725                         
726                 }
728                 // Check if there is a value for MEDIATYPE.
729                 
730                 if ((*SourceListMediatype)[SourceIter->first].size() > 0){
731                 
732                         ProcessData.Append(";MEDIATYPE=");
733                         ProcessData.Append((*SourceListMediatype)[SourceIter->first]);
734                         
735                 }
736                 
737                 // Check if there is a value for PID.
739                 if ((*SourceListPID)[SourceIter->first].size() > 0){
740                 
741                         ProcessData.Append(";PID=");
742                         ProcessData.Append((*SourceListPID)[SourceIter->first]);
743                         
744                 }
746                 // Check if there is a value for PREF.
748                 if ((*SourceListPref)[SourceIter->first] > 0){
749                 
750                         ProcessData.Append(";PREF=");
751                         ProcessData.Append(wxString::Format("%i", (*SourceListPref)[SourceIter->first]));
752                         
753                 }
755                 // Check if there is a value for tokens.
757                 if ((*SourceListTokens)[SourceIter->first].size() > 0){
758                 
759                         ProcessData.Append(";");
760                         ProcessData.Append((*SourceListTokens)[SourceIter->first]);
761                         
762                 }
763                         
764                 ProcessData.Append(":");
765                 ProcessData.Append(SourceIter->second);
766                 ProcessData.Append("\n");
768                 ProcessData = OutputText(&ProcessData);
769                         
770                 SaveData->Append(ProcessData);
771                 ProcessData.clear();
772                         
773         }
774                 
777 void ContactDataObject::SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID, 
778         map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
779         map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref, 
780         map<int, wxString> *NicknameListTokens, wxString *SaveData, wxString DataType){
782         wxString ProcessData = "";
783         
784         for (std::map<int, wxString>::iterator NicknameIter = NicknameList->begin();
785                 NicknameIter != NicknameList->end(); NicknameIter++){
787                 ProcessData.Append("NICKNAME");
788                         
789                 // Check if there is a value for TYPE.
790                 
791                 if (DataType.size() > 0){
792                 
793                         ProcessData.Append(";TYPE=");
794                         ProcessData.Append(DataType);
795                         
796                 }
797                 
798                 // Check if there is a value for ALTID.
799                 
800                 if ((*NicknameListAltID)[NicknameIter->first].size() > 0){
801                 
802                         ProcessData.Append(";ALTID=");
803                         ProcessData.Append((*NicknameListAltID)[NicknameIter->first]);
804                         
805                 }
807                 // Check if there is a value for MEDIATYPE.
808                 
809                 if ((*NicknameListLanguage)[NicknameIter->first].size() > 0){
810                 
811                         ProcessData.Append(";LANGUAGE=");
812                         ProcessData.Append((*NicknameListLanguage)[NicknameIter->first]);
813                         
814                 }
815                 
816                 // Check if there is a value for PID.
818                 if ((*NicknameListPID)[NicknameIter->first].size() > 0){
819                 
820                         ProcessData.Append(";PID=");
821                         ProcessData.Append((*NicknameListPID)[NicknameIter->first]);
822                         
823                 }
825                 // Check if there is a value for PREF.
827                 if ((*NicknameListPref)[NicknameIter->first] > 0){
828                 
829                         ProcessData.Append(";PREF=");
830                         ProcessData.Append(wxString::Format("%i", (*NicknameListPref)[NicknameIter->first]));
831                         
832                 }
834                 // Check if there is a value for tokens.
836                 if ((*NicknameListTokens)[NicknameIter->first].size() > 0){
837                 
838                         ProcessData.Append(";");
839                         ProcessData.Append((*NicknameListTokens)[NicknameIter->first]);
840                         
841                 }
842                         
843                 ProcessData.Append(":");
844                 ProcessData.Append(NicknameIter->second);
845                 ProcessData.Append("\n");
847                 ProcessData = OutputText(&ProcessData);
848                         
849                 SaveData->Append(ProcessData);
850                 ProcessData.clear();
851                         
852         }
853                 
856 void ContactDataObject::SaveTimezone(map<int, wxString> *TZList, map<int, wxString> *TZListAltID, 
857         map<int, wxString> *TZListPID, map<int, wxString> *TZListType,
858         map<int, wxString> *TZListMediatype, map<int, int> *TZListPref, 
859         map<int, wxString> *TZListTokens, wxString *SaveData, wxString DataType){
861         wxString ProcessData = "";
862         
863         for (std::map<int, wxString>::iterator TZIter = TZList->begin();
864                 TZIter != TZList->end(); TZIter++){
866                 ProcessData.Append("TZ");
867                         
868                 // Check if there is a value for TYPE.
869                 
870                 if (DataType.size() > 0){
871                 
872                         ProcessData.Append(";TYPE=");
873                         ProcessData.Append(DataType);
874                         
875                 }
876                 
877                 // Check if there is a value for ALTID.
878                 
879                 if ((*TZListAltID)[TZIter->first].size() > 0){
880                 
881                         ProcessData.Append(";ALTID=");
882                         ProcessData.Append((*TZListAltID)[TZIter->first]);
883                         
884                 }
886                 // Check if there is a value for MEDIATYPE.
887                 
888                 if ((*TZListMediatype)[TZIter->first].size() > 0){
889                 
890                         ProcessData.Append(";MEDIATYPE=");
891                         ProcessData.Append((*TZListMediatype)[TZIter->first]);
892                         
893                 }
894                 
895                 // Check if there is a value for PID.
897                 if ((*TZListPID)[TZIter->first].size() > 0){
898                 
899                         ProcessData.Append(";PID=");
900                         ProcessData.Append((*TZListPID)[TZIter->first]);
901                         
902                 }
904                 // Check if there is a value for PREF.
906                 if ((*TZListPref)[TZIter->first] > 0){
907                 
908                         ProcessData.Append(";PREF=");
909                         ProcessData.Append(wxString::Format("%i", (*TZListPref)[TZIter->first]));
910                         
911                 }
913                 // Check if there is a value for tokens.
915                 if ((*TZListTokens)[TZIter->first].size() > 0){
916                 
917                         ProcessData.Append(";");
918                         ProcessData.Append((*TZListTokens)[TZIter->first]);
919                         
920                 }
921                         
922                 ProcessData.Append(":");
923                 ProcessData.Append(TZIter->second);
924                 ProcessData.Append("\n");
926                 ProcessData = OutputText(&ProcessData);
927                         
928                 SaveData->Append(ProcessData);
929                 ProcessData.clear();
930                         
931         }
932                 
935 void ContactDataObject::SaveAddress(map<int, wxString> *AddressList, map<int, wxString> *AddressListTown,
936                 map<int, wxString> *AddressListCounty, map<int, wxString> *AddressListPostCode,
937                 map<int, wxString> *AddressListCountry, map<int, wxString> *AddressListLabel,
938                 map<int, wxString> *AddressListLang, map<int, wxString> *AddressListAltID,
939                 map<int, wxString> *AddressListPID, map<int, wxString> *AddressListGeo, 
940                 map<int, wxString> *AddressListTimezone, map<int, wxString> *AddressListType, 
941                 map<int, wxString> *AddressListMediatype, map<int, int> *AddressListPref, 
942                 map<int, wxString> *AddressListTokens, wxString *SaveData, wxString DataType){
944         wxString ProcessData = "";
945                         
946         for (std::map<int, wxString>::iterator AddressIter = AddressList->begin();
947                 AddressIter != AddressList->end(); AddressIter++){
948                         
949                 ProcessData.Append("ADR");
950                         
951                 // Check if there is a value for TYPE.
952                 
953                 if (DataType.size() > 0){
954                 
955                         ProcessData.Append(";TYPE=");
956                         ProcessData.Append(DataType);
957                         
958                 }
959                 
960                 // Check if there is a value for ALTID.
961                 
962                 if ((*AddressListAltID)[AddressIter->first].size() > 0){
963                 
964                         ProcessData.Append(";ALTID=");
965                         ProcessData.Append((*AddressListAltID)[AddressIter->first]);
966                         
967                 }
969                 // Check if there is a value for GEO.
970                 
971                 if ((*AddressListGeo)[AddressIter->first].size() > 0){
972                 
973                         ProcessData.Append(";GEO=\"");
974                         ProcessData.Append((*AddressListGeo)[AddressIter->first]);
975                         ProcessData.Append("\"");
976                         
977                 }
979                 // Check if there is a value for LABEL.
981                 if ((*AddressListLabel)[AddressIter->first].size() > 0){
982                 
983                         wxString AddressProcessed = "";
984                         AddressProcessed = (*AddressListLabel)[AddressIter->first];
985                         
986                         AddressProcessed.Replace("\n", "\\n", true);
987                         
988                         ProcessData.Append(";LABEL=");
989                         ProcessData.Append(AddressProcessed);
990                         
991                 }
992                 
993                 // Check if there is a value for LANGUAGE.
994                 
995                 if ((*AddressListLang)[AddressIter->first].size() > 0){
996                 
997                         ProcessData.Append(";LANGUAGE=");
998                         ProcessData.Append((*AddressListLang)[AddressIter->first]);
999                         
1000                 }
1001                 
1002                 // Check if there is a value for MEDIATYPE.
1003                 
1004                 if ((*AddressListMediatype)[AddressIter->first].size() > 0){
1005                 
1006                         ProcessData.Append(";MEDIATYPE=");
1007                         ProcessData.Append((*AddressListMediatype)[AddressIter->first]);
1008                         
1009                 }
1010                 
1011                 // Check if there is a value for PID.
1013                 if ((*AddressListPID)[AddressIter->first].size() > 0){
1014                 
1015                         ProcessData.Append(";PID=");
1016                         ProcessData.Append((*AddressListPID)[AddressIter->first]);
1017                         
1018                 }
1020                 // Check if there is a value for PREF.
1022                 if ((*AddressListPref)[AddressIter->first] > 0){
1023                 
1024                         ProcessData.Append(";PREF=");
1025                         ProcessData.Append(wxString::Format("%i", (*AddressListPref)[AddressIter->first]));
1026                         
1027                 }
1029                 // Check if there is a value for TZ.
1031                 if ((*AddressListTimezone)[AddressIter->first].size() > 0){
1032                 
1033                         ProcessData.Append(";TZ=");
1034                         ProcessData.Append((*AddressListTimezone)[AddressIter->first]);
1035                         
1036                 }
1037                 
1038                 // Check if there is a value for tokens.
1040                 if ((*AddressListTokens)[AddressIter->first].size() > 0){
1041                 
1042                         ProcessData.Append(";");
1043                         ProcessData.Append((*AddressListTokens)[AddressIter->first]);
1044                         
1045                 }
1046                 
1047                 // Build the address.
1048                 
1049                 ProcessData.Append(":;;");
1050                 ProcessData.Append((*AddressList)[AddressIter->first]);
1051                 ProcessData.Append(";");
1052                 ProcessData.Append((*AddressListTown)[AddressIter->first]);
1053                 ProcessData.Append(";");
1054                 ProcessData.Append((*AddressListCounty)[AddressIter->first]);
1055                 ProcessData.Append(";");
1056                 ProcessData.Append((*AddressListPostCode)[AddressIter->first]);
1057                 ProcessData.Append(";");
1058                 ProcessData.Append((*AddressListCountry)[AddressIter->first]);
1059                 ProcessData.Append("\n");
1060                 
1061                 ProcessData = OutputText(&ProcessData);
1062                         
1063                 SaveData->Append(ProcessData);
1064                 ProcessData.clear();
1065                         
1066         }
1067                         
1070 void ContactDataObject::SaveEmail(map<int, wxString> *EmailList, map<int, wxString> *EmailListAltID, 
1071         map<int, wxString> *EmailListPID, map<int, wxString> *EmailListType,
1072         map<int, int> *EmailListPref, map<int, wxString> *EmailListTokens, 
1073         wxString *SaveData, wxString DataType){
1075         wxString ProcessData = "";
1076         
1077         for (std::map<int, wxString>::iterator EmailIter = EmailList->begin();
1078                 EmailIter != EmailList->end(); EmailIter++){
1080                 ProcessData.Append("EMAIL");
1081                         
1082                 // Check if there is a value for TYPE.
1083                 
1084                 if (DataType.size() > 0){
1085                 
1086                         ProcessData.Append(";TYPE=");
1087                         ProcessData.Append(DataType);
1088                         
1089                 }
1090                 
1091                 // Check if there is a value for ALTID.
1092                 
1093                 if ((*EmailListAltID)[EmailIter->first].size() > 0){
1094                 
1095                         ProcessData.Append(";ALTID=");
1096                         ProcessData.Append((*EmailListAltID)[EmailIter->first]);
1097                         
1098                 }
1099                 
1100                 // Check if there is a value for PID.
1102                 if ((*EmailListPID)[EmailIter->first].size() > 0){
1103                 
1104                         ProcessData.Append(";PID=");
1105                         ProcessData.Append((*EmailListPID)[EmailIter->first]);
1106                         
1107                 }
1109                 // Check if there is a value for PREF.
1111                 if ((*EmailListPref)[EmailIter->first] > 0){
1112                 
1113                         ProcessData.Append(";PREF=");
1114                         ProcessData.Append(wxString::Format("%i", (*EmailListPref)[EmailIter->first]));
1115                         
1116                 }
1118                 // Check if there is a value for tokens.
1120                 if ((*EmailListTokens)[EmailIter->first].size() > 0){
1121                 
1122                         ProcessData.Append(";");
1123                         ProcessData.Append((*EmailListTokens)[EmailIter->first]);
1124                         
1125                 }
1126                         
1127                 ProcessData.Append(":");
1128                 ProcessData.Append(EmailIter->second);
1129                 ProcessData.Append("\n");
1131                 ProcessData = OutputText(&ProcessData);
1132                         
1133                 SaveData->Append(ProcessData);
1134                 ProcessData.clear();
1135                         
1136         }
1137                 
1140 void ContactDataObject::SaveLanguage(map<int, wxString> *LanguageList, map<int, wxString> *LanguageListAltID, 
1141         map<int, wxString> *LanguageListPID, map<int, wxString> *LanguageListType,
1142         map<int, int> *LangaugeListPref, map<int, wxString> *LanguageListTokens, 
1143         wxString *SaveData, wxString DataType){
1145         wxString ProcessData = "";
1146         
1147         for (std::map<int, wxString>::iterator LanguageIter = LanguageList->begin();
1148                 LanguageIter != LanguageList->end(); LanguageIter++){
1150                 ProcessData.Append("LANG");
1151                         
1152                 // Check if there is a value for TYPE.
1153                 
1154                 if (DataType.size() > 0){
1155                 
1156                         ProcessData.Append(";TYPE=");
1157                         ProcessData.Append(DataType);
1158                         
1159                 }
1160                 
1161                 // Check if there is a value for ALTID.
1162                 
1163                 if ((*LanguageListAltID)[LanguageIter->first].size() > 0){
1164                 
1165                         ProcessData.Append(";ALTID=");
1166                         ProcessData.Append((*LanguageListAltID)[LanguageIter->first]);
1167                         
1168                 }
1169                 
1170                 // Check if there is a value for PID.
1172                 if ((*LanguageListPID)[LanguageIter->first].size() > 0){
1173                 
1174                         ProcessData.Append(";PID=");
1175                         ProcessData.Append((*LanguageListPID)[LanguageIter->first]);
1176                         
1177                 }
1179                 // Check if there is a value for PREF.
1181                 if ((*LangaugeListPref)[LanguageIter->first] > 0){
1182                 
1183                         ProcessData.Append(";PREF=");
1184                         ProcessData.Append(wxString::Format("%i", (*LangaugeListPref)[LanguageIter->first]));
1185                         
1186                 }
1188                 // Check if there is a value for tokens.
1190                 if ((*LanguageListTokens)[LanguageIter->first].size() > 0){
1191                 
1192                         ProcessData.Append(";");
1193                         ProcessData.Append((*LanguageListTokens)[LanguageIter->first]);
1194                         
1195                 }
1196                         
1197                 ProcessData.Append(":");
1198                 ProcessData.Append(LanguageIter->second);
1199                 ProcessData.Append("\n");
1201                 ProcessData = OutputText(&ProcessData);
1202                         
1203                 SaveData->Append(ProcessData);
1204                 ProcessData.clear();
1205                         
1206         }
1207                 
1210 void ContactDataObject::SaveGeoposition(map<int, wxString> *GeographyList, map<int, wxString> *GeographyListAltID, 
1211         map<int, wxString> *GeographyListPID, map<int, wxString> *GeographyListType,
1212         map<int, wxString> *GeographyListMediatype, map<int, wxString> *GeographyListDataType,
1213         map<int, int> *GeographyListPref, map<int, wxString> *GeographyListTokens, 
1214         wxString *SaveData, wxString DataType){
1216         wxString ProcessData = "";
1217         
1218         for (std::map<int, wxString>::iterator GeographyIter = GeographyList->begin();
1219                 GeographyIter != GeographyList->end(); GeographyIter++){
1221                 ProcessData.Append("GEO");
1222                         
1223                 // Check if there is a value for TYPE.
1224                 
1225                 if (DataType.size() > 0){
1226                 
1227                         ProcessData.Append(";TYPE=");
1228                         ProcessData.Append(DataType);
1229                         
1230                 }
1231                 
1232                 // Check if there is a value for ALTID.
1233                 
1234                 if ((*GeographyListAltID)[GeographyIter->first].size() > 0){
1235                 
1236                         ProcessData.Append(";ALTID=");
1237                         ProcessData.Append((*GeographyListAltID)[GeographyIter->first]);
1238                         
1239                 }
1240                 
1241                 // Check if there is a value for MEDIATYPE.
1242                 
1243                 if ((*GeographyListMediatype)[GeographyIter->first].size() > 0){
1244                 
1245                         ProcessData.Append(";MEDIATYPE=");
1246                         ProcessData.Append((*GeographyListMediatype)[GeographyIter->first]);
1247                         
1248                 }
1249                 
1250                 // Check if there is a value for PID.
1252                 if ((*GeographyListPID)[GeographyIter->first].size() > 0){
1253                 
1254                         ProcessData.Append(";PID=");
1255                         ProcessData.Append((*GeographyListPID)[GeographyIter->first]);
1256                         
1257                 }
1259                 // Check if there is a value for PREF.
1261                 if ((*GeographyListPref)[GeographyIter->first] > 0){
1262                 
1263                         ProcessData.Append(";PREF=");
1264                         ProcessData.Append(wxString::Format("%i", (*GeographyListPref)[GeographyIter->first]));
1265                         
1266                 }
1268                 // Check if there is a value for tokens.
1270                 if ((*GeographyListTokens)[GeographyIter->first].size() > 0){
1271                 
1272                         ProcessData.Append(";");
1273                         ProcessData.Append((*GeographyListTokens)[GeographyIter->first]);
1274                         
1275                 }
1276                         
1277                 ProcessData.Append(":");
1278                 ProcessData.Append((*GeographyListDataType)[GeographyIter->first]);
1279                 ProcessData.Append(":");
1280                 ProcessData.Append(GeographyIter->second);
1281                 ProcessData.Append("\n");
1283                 ProcessData = OutputText(&ProcessData);
1284                         
1285                 SaveData->Append(ProcessData);
1286                 ProcessData.clear();
1287                         
1288         }
1289                 
1292 void ContactDataObject::SaveURL(map<int, wxString> *WebsiteList, map<int, wxString> *WebsiteListAltID, 
1293                 map<int, wxString> *WebsiteListPID, map<int, wxString> *WebsiteListType,
1294                 map<int, wxString> *WebsiteListMediatype, map<int, int> *WebsiteListPref, 
1295                 map<int, wxString> *WebsiteListTokens, wxString *SaveData, wxString DataType){
1297         wxString ProcessData = "";
1298         
1299         for (std::map<int, wxString>::iterator WebsiteIter = WebsiteList->begin();
1300                 WebsiteIter != WebsiteList->end(); WebsiteIter++){
1302                 ProcessData.Append("URL");
1303                         
1304                 // Check if there is a value for TYPE.
1305                 
1306                 if (DataType.size() > 0){
1307                 
1308                         ProcessData.Append(";TYPE=");
1309                         ProcessData.Append(DataType);
1310                         
1311                 }
1312                 
1313                 // Check if there is a value for ALTID.
1314                 
1315                 if ((*WebsiteListAltID)[WebsiteIter->first].size() > 0){
1316                 
1317                         ProcessData.Append(";ALTID=");
1318                         ProcessData.Append((*WebsiteListAltID)[WebsiteIter->first]);
1319                         
1320                 }
1321                 
1322                 // Check if there is a value for MEDIATYPE.
1323                 
1324                 if ((*WebsiteListMediatype)[WebsiteIter->first].size() > 0){
1325                 
1326                         ProcessData.Append(";MEDIATYPE=");
1327                         ProcessData.Append((*WebsiteListMediatype)[WebsiteIter->first]);
1328                         
1329                 }
1330                 
1331                 // Check if there is a value for PID.
1333                 if ((*WebsiteListPID)[WebsiteIter->first].size() > 0){
1334                 
1335                         ProcessData.Append(";PID=");
1336                         ProcessData.Append((*WebsiteListPID)[WebsiteIter->first]);
1337                         
1338                 }
1340                 // Check if there is a value for PREF.
1342                 if ((*WebsiteListPref)[WebsiteIter->first] > 0){
1343                 
1344                         ProcessData.Append(";PREF=");
1345                         ProcessData.Append(wxString::Format("%i", (*WebsiteListPref)[WebsiteIter->first]));
1346                         
1347                 }
1349                 // Check if there is a value for tokens.
1351                 if ((*WebsiteListTokens)[WebsiteIter->first].size() > 0){
1352                 
1353                         ProcessData.Append(";");
1354                         ProcessData.Append((*WebsiteListTokens)[WebsiteIter->first]);
1355                         
1356                 }
1357                         
1358                 ProcessData.Append(":");
1359                 ProcessData.Append(WebsiteIter->second);
1360                 ProcessData.Append("\n");
1362                 ProcessData = OutputText(&ProcessData);
1363                         
1364                 SaveData->Append(ProcessData);
1365                 ProcessData.clear();
1366                         
1367         }
1368                         
1371 void ContactDataObject::SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
1372         map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
1373         map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
1374         map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType){
1376         wxString ProcessData = "";
1377                 
1378         for (std::map<int, wxString>::iterator RoleIter = RoleList->begin();
1379                 RoleIter != RoleList->end(); RoleIter++){
1381                 ProcessData.Append("ROLE");
1382                         
1383                 // Check if there is a value for TYPE.
1384                 
1385                 if (DataType.size() > 0){
1386                 
1387                         ProcessData.Append(";TYPE=");
1388                         ProcessData.Append(DataType);
1389                         
1390                 }
1391                 
1392                 // Check if there is a value for ALTID.
1393                 
1394                 if ((*RoleListAltID)[RoleIter->first].size() > 0){
1395                 
1396                         ProcessData.Append(";ALTID=");
1397                         ProcessData.Append((*RoleListAltID)[RoleIter->first]);
1398                         
1399                 }
1401                 // Check if there is a value for LANGUAGE.
1402                 
1403                 if ((*RoleListLanguage)[RoleIter->first].size() > 0){
1404                 
1405                         ProcessData.Append(";LANGUAGE=");
1406                         ProcessData.Append((*RoleListLanguage)[RoleIter->first]);
1407                         
1408                 }
1409                 
1410                 // Check if there is a value for PID.
1412                 if ((*RoleListPID)[RoleIter->first].size() > 0){
1413                 
1414                         ProcessData.Append(";PID=");
1415                         ProcessData.Append((*RoleListPID)[RoleIter->first]);
1416                         
1417                 }
1419                 // Check if there is a value for PREF.
1421                 if ((*RoleListPref)[RoleIter->first] > 0){
1422                 
1423                         ProcessData.Append(";PREF=");
1424                         ProcessData.Append(wxString::Format("%i", (*RoleListPref)[RoleIter->first]));
1425                         
1426                 }
1428                 // Check if there is a value for tokens.
1430                 if ((*RoleListTokens)[RoleIter->first].size() > 0){
1431                 
1432                         ProcessData.Append(";");
1433                         ProcessData.Append((*RoleListTokens)[RoleIter->first]);
1434                         
1435                 }
1436                         
1437                 ProcessData.Append(":");
1438                 ProcessData.Append(RoleIter->second);
1439                 ProcessData.Append("\n");
1441                 ProcessData = OutputText(&ProcessData);
1442                 
1443                 SaveData->Append(ProcessData);
1444                 ProcessData.clear();
1445                         
1446         }
1447                 
1450 void ContactDataObject::SaveOrganisation(map<int, wxString> *OrganisationList, map<int, wxString> *OrganisationListAltID,
1451         map<int, wxString> *OrganisationListPID, map<int, wxString> *OrganisationListLanguage, 
1452         map<int, wxString> *OrganisationListSortAs, map<int, wxString> *OrganisationListType, 
1453         map<int, int> *OrganisationListPref, map<int, wxString> *OrganisationListTokens, 
1454         wxString *SaveData, wxString DataType){
1456         wxString ProcessData = "";
1457                 
1458         for (std::map<int, wxString>::iterator OrganisationIter = OrganisationList->begin();
1459                 OrganisationIter != OrganisationList->end(); OrganisationIter++){
1461                 ProcessData.Append("ORG");
1462                         
1463                 // Check if there is a value for TYPE.
1464                 
1465                 if (DataType.size() > 0){
1466                 
1467                         ProcessData.Append(";TYPE=");
1468                         ProcessData.Append(DataType);
1469                         
1470                 }
1471                 
1472                 // Check if there is a value for ALTID.
1473                 
1474                 if ((*OrganisationListAltID)[OrganisationIter->first].size() > 0){
1475                 
1476                         ProcessData.Append(";ALTID=");
1477                         ProcessData.Append((*OrganisationListAltID)[OrganisationIter->first]);
1478                         
1479                 }
1481                 // Check if there is a value for LANGUAGE.
1482                 
1483                 if ((*OrganisationListLanguage)[OrganisationIter->first].size() > 0){
1484                 
1485                         ProcessData.Append(";LANGUAGE=");
1486                         ProcessData.Append((*OrganisationListLanguage)[OrganisationIter->first]);
1487                         
1488                 }
1489                 
1490                 // Check if there is a value for PID.
1492                 if ((*OrganisationListPID)[OrganisationIter->first].size() > 0){
1493                 
1494                         ProcessData.Append(";PID=");
1495                         ProcessData.Append((*OrganisationListPID)[OrganisationIter->first]);
1496                         
1497                 }
1499                 // Check if there is a value for PREF.
1501                 if ((*OrganisationListPref)[OrganisationIter->first] > 0){
1502                 
1503                         ProcessData.Append(";PREF=");
1504                         ProcessData.Append(wxString::Format("%i", (*OrganisationListPref)[OrganisationIter->first]));
1505                         
1506                 }
1507                 
1508                 // Check if there is a value for SORT-AS.
1509                 
1510                 if ((*OrganisationListSortAs)[OrganisationIter->first].size() > 0){
1511                 
1512                         ProcessData.Append(";SORT-AS=\"");
1513                         ProcessData.Append((*OrganisationListSortAs)[OrganisationIter->first]);
1514                         ProcessData.Append("\"");
1515                         
1516                 }
1518                 // Check if there is a value for tokens.
1520                 if ((*OrganisationListTokens)[OrganisationIter->first].size() > 0){
1521                 
1522                         ProcessData.Append(";");
1523                         ProcessData.Append((*OrganisationListTokens)[OrganisationIter->first]);
1524                         
1525                 }
1526                         
1527                 ProcessData.Append(":");
1528                 ProcessData.Append(OrganisationIter->second);
1529                 ProcessData.Append("\n");
1531                 ProcessData = OutputText(&ProcessData);
1532                 
1533                 SaveData->Append(ProcessData);
1534                 ProcessData.clear();
1535                         
1536         }
1537                 
1540 void ContactDataObject::SaveNote(map<int, wxString> *NoteList, map<int, wxString> *NoteListLanguage,
1541         map<int, wxString> *NoteListAltID, map<int, wxString> *NoteListPID,
1542         map<int, wxString> *NoteListType, map<int, int> *NoteListPref,
1543         map<int, wxString> *NoteListTokens, wxString *SaveData, wxString DataType){
1545         wxString ProcessData = "";
1546                 
1547         for (std::map<int, wxString>::iterator NoteIter = NoteList->begin();
1548                 NoteIter != NoteList->end(); NoteIter++){
1550                 ProcessData.Append("NOTE");
1551                         
1552                 // Check if there is a value for TYPE.
1553                 
1554                 if (DataType.size() > 0){
1555                 
1556                         ProcessData.Append(";TYPE=");
1557                         ProcessData.Append(DataType);
1558                         
1559                 }
1560                 
1561                 // Check if there is a value for ALTID.
1562                 
1563                 if ((*NoteListAltID)[NoteIter->first].size() > 0){
1564                 
1565                         ProcessData.Append(";ALTID=");
1566                         ProcessData.Append((*NoteListAltID)[NoteIter->first]);
1567                         
1568                 }
1570                 // Check if there is a value for LANGUAGE.
1571                 
1572                 if ((*NoteListLanguage)[NoteIter->first].size() > 0){
1573                 
1574                         ProcessData.Append(";LANGUAGE=");
1575                         ProcessData.Append((*NoteListLanguage)[NoteIter->first]);
1576                         
1577                 }
1578                 
1579                 // Check if there is a value for PID.
1581                 if ((*NoteListPID)[NoteIter->first].size() > 0){
1582                 
1583                         ProcessData.Append(";PID=");
1584                         ProcessData.Append((*NoteListPID)[NoteIter->first]);
1585                         
1586                 }
1588                 // Check if there is a value for PREF.
1590                 if ((*NoteListPref)[NoteIter->first] > 0){
1591                 
1592                         ProcessData.Append(";PREF=");
1593                         ProcessData.Append(wxString::Format("%i", (*NoteListPref)[NoteIter->first]));
1594                         
1595                 }
1597                 // Check if there is a value for tokens.
1599                 if ((*NoteListTokens)[NoteIter->first].size() > 0){
1600                 
1601                         ProcessData.Append(";");
1602                         ProcessData.Append((*NoteListTokens)[NoteIter->first]);
1603                         
1604                 }
1605                         
1606                 ProcessData.Append(":");
1607                 ProcessData.Append(NoteIter->second);
1608                 ProcessData.Replace("\n", "\\n", true);
1609                 ProcessData.Append("\n");
1611                 ProcessData = OutputText(&ProcessData);
1612                 
1613                 SaveData->Append(ProcessData);
1614                 ProcessData.clear();
1615                         
1616         }
1617                 
1620 void ContactDataObject::SaveCategory(map<int, wxString> *CategoryList, map<int, wxString> *CategoryListLanguage,
1621         map<int, wxString> *CategoryListAltID, map<int, wxString> *CategoryListPID,
1622         map<int, wxString> *CategoryListType, map<int, int> *CategoryListPref,
1623         map<int, wxString> *CategoryListTokens, wxString *SaveData){
1625         wxString ProcessData = "";
1626                 
1627         for (std::map<int, wxString>::iterator CategoryIter = CategoryList->begin();
1628                 CategoryIter != CategoryList->end(); CategoryIter++){
1630                 ProcessData.Append("CATEGORIES");
1631                         
1632                 // Check if there is a value for TYPE.
1633                 
1634                 if ((*CategoryListType)[CategoryIter->first].size() > 0){
1635                 
1636                         ProcessData.Append(";TYPE=");
1637                         ProcessData.Append((*CategoryListType)[CategoryIter->first]);
1638                         
1639                 }
1640                 
1641                 // Check if there is a value for ALTID.
1642                 
1643                 if ((*CategoryListAltID)[CategoryIter->first].size() > 0){
1644                 
1645                         ProcessData.Append(";ALTID=");
1646                         ProcessData.Append((*CategoryListAltID)[CategoryIter->first]);
1647                         
1648                 }
1650                 // Check if there is a value for LANGUAGE.
1651                 
1652                 if ((*CategoryListLanguage)[CategoryIter->first].size() > 0){
1653                 
1654                         ProcessData.Append(";LANGUAGE=");
1655                         ProcessData.Append((*CategoryListLanguage)[CategoryIter->first]);
1656                         
1657                 }
1658                 
1659                 // Check if there is a value for PID.
1661                 if ((*CategoryListPID)[CategoryIter->first].size() > 0){
1662                 
1663                         ProcessData.Append(";PID=");
1664                         ProcessData.Append((*CategoryListPID)[CategoryIter->first]);
1665                         
1666                 }
1668                 // Check if there is a value for PREF.
1670                 if ((*CategoryListPref)[CategoryIter->first] > 0){
1671                 
1672                         ProcessData.Append(";PREF=");
1673                         ProcessData.Append(wxString::Format("%i", (*CategoryListPref)[CategoryIter->first]));
1674                         
1675                 }
1677                 // Check if there is a value for tokens.
1679                 if ((*CategoryListTokens)[CategoryIter->first].size() > 0){
1680                 
1681                         ProcessData.Append(";");
1682                         ProcessData.Append((*CategoryListTokens)[CategoryIter->first]);
1683                         
1684                 }
1685                         
1686                 ProcessData.Append(":");
1687                 ProcessData.Append(CategoryIter->second);
1688                 ProcessData.Append("\n");
1690                 ProcessData = OutputText(&ProcessData);
1691                 
1692                 SaveData->Append(ProcessData);
1693                 ProcessData.clear();
1694                         
1695         }
1696                 
1699 void ContactDataObject::SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID, 
1700                 map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
1701                 map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
1702                 map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
1703                 map<int, wxString> *PicturesListTokens, wxString *SaveData){
1705         wxString ProcessData = "";
1706                 
1707         for (std::map<int, string>::iterator PicturesIter = PicturesList->begin();
1708                 PicturesIter != PicturesList->end(); PicturesIter++){
1710                 ProcessData.Append("PHOTO");
1711                         
1712                 // Check if there is a value for TYPE.
1713                 
1714                 if ((*PicturesListType)[PicturesIter->first].size() > 0){
1715                 
1716                         ProcessData.Append(";TYPE=");
1717                         ProcessData.Append((*PicturesListType)[PicturesIter->first]);
1718                         
1719                 }
1720                 
1721                 // Check if there is a value for ALTID.
1722                 
1723                 if ((*PicturesListAltID)[PicturesIter->first].size() > 0){
1724                 
1725                         ProcessData.Append(";ALTID=");
1726                         ProcessData.Append((*PicturesListAltID)[PicturesIter->first]);
1727                         
1728                 }
1730                 // Check if there is a value for MEDIATYPE..
1731                 
1732                 if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){
1733                 
1734                         ProcessData.Append(";MEDIATYPE=");
1735                         ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]);
1736                         
1737                 }
1738                 
1739                 // Check if there is a value for PID.
1741                 if ((*PicturesListPID)[PicturesIter->first].size() > 0){
1742                 
1743                         ProcessData.Append(";PID=");
1744                         ProcessData.Append((*PicturesListPID)[PicturesIter->first]);
1745                         
1746                 }
1748                 // Check if there is a value for PREF.
1750                 if ((*PicturesListPref)[PicturesIter->first] > 0){
1751                 
1752                         ProcessData.Append(";PREF=");
1753                         ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first]));
1754                         
1755                 }
1757                 // Check if there is a value for tokens.
1759                 if ((*PicturesListTokens)[PicturesIter->first].size() > 0){
1760                 
1761                         ProcessData.Append(";");
1762                         ProcessData.Append((*PicturesListTokens)[PicturesIter->first]);
1763                         
1764                 }
1765                 
1766                 ProcessData.Append(":data:");
1767                 ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]);
1768                 ProcessData.Append(";");
1769                 ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]);
1770                 ProcessData.Append(",");
1771                 ProcessData.Append(PicturesIter->second);
1772                 ProcessData.Append("\n");
1774                 ProcessData = OutputText(&ProcessData);
1775                 
1776                 SaveData->Append(ProcessData);
1777                 ProcessData.clear();
1778                         
1779         }
1780                         
1783 void ContactDataObject::SaveLogo(map<int, string> *LogosList, map<int, wxString> *LogosListAltID, 
1784         map<int, wxString> *LogosListPID, map<int, wxString> *LogosListType,
1785         map<int, wxString> *LogosListPicEncType, map<int, wxString> *LogosListPictureType,
1786         map<int, wxString> *LogosListMediatype, map<int, int> *LogosListPref,
1787         map<int, wxString> *LogosListTokens, wxString *SaveData){
1789         wxString ProcessData = "";
1790                 
1791         for (std::map<int, string>::iterator LogosIter = LogosList->begin();
1792                 LogosIter != LogosList->end(); LogosIter++){
1794                 ProcessData.Append("LOGO");
1795                         
1796                 // Check if there is a value for TYPE.
1797                 
1798                 if ((*LogosListType)[LogosIter->first].size() > 0){
1799                 
1800                         ProcessData.Append(";TYPE=");
1801                         ProcessData.Append((*LogosListType)[LogosIter->first]);
1802                         
1803                 }
1804                 
1805                 // Check if there is a value for ALTID.
1806                 
1807                 if ((*LogosListAltID)[LogosIter->first].size() > 0){
1808                 
1809                         ProcessData.Append(";ALTID=");
1810                         ProcessData.Append((*LogosListAltID)[LogosIter->first]);
1811                         
1812                 }
1814                 // Check if there is a value for MEDIATYPE..
1815                 
1816                 if ((*LogosListMediatype)[LogosIter->first].size() > 0){
1817                 
1818                         ProcessData.Append(";MEDIATYPE=");
1819                         ProcessData.Append((*LogosListMediatype)[LogosIter->first]);
1820                         
1821                 }
1822                 
1823                 // Check if there is a value for PID.
1825                 if ((*LogosListPID)[LogosIter->first].size() > 0){
1826                 
1827                         ProcessData.Append(";PID=");
1828                         ProcessData.Append((*LogosListPID)[LogosIter->first]);
1829                         
1830                 }
1832                 // Check if there is a value for PREF.
1834                 if ((*LogosListPref)[LogosIter->first] > 0){
1835                 
1836                         ProcessData.Append(";PREF=");
1837                         ProcessData.Append(wxString::Format("%i", (*LogosListPref)[LogosIter->first]));
1838                         
1839                 }
1841                 // Check if there is a value for tokens.
1843                 if ((*LogosListTokens)[LogosIter->first].size() > 0){
1844                 
1845                         ProcessData.Append(";");
1846                         ProcessData.Append((*LogosListTokens)[LogosIter->first]);
1847                         
1848                 }
1849                 
1850                 ProcessData.Append(":data:");
1851                 ProcessData.Append((*LogosListPictureType)[LogosIter->first]);
1852                 ProcessData.Append(";");
1853                 ProcessData.Append((*LogosListPicEncType)[LogosIter->first]);
1854                 ProcessData.Append(",");
1855                 ProcessData.Append(LogosIter->second);
1856                 ProcessData.Append("\n");
1858                 ProcessData = OutputText(&ProcessData);
1859                 
1860                 SaveData->Append(ProcessData);
1861                 ProcessData.clear();
1862                         
1863         }
1864                 
1867 void ContactDataObject::SaveSound(map<int, string> *SoundsList, map<int, wxString> *SoundsListAltID, 
1868         map<int, wxString> *SoundsListPID, map<int, wxString> *SoundsListType,
1869         map<int, wxString> *SoundsListAudioEncType, map<int, wxString> *SoundsListAudioType,
1870         map<int, wxString> *SoundsListMediatype, map<int, wxString> *SoundsListLanguage, 
1871         map<int, int> *SoundsListPref, map<int, wxString> *SoundsListTokens, 
1872         wxString *SaveData){
1874         wxString ProcessData = "";
1875                 
1876         for (std::map<int, string>::iterator SoundsIter = SoundsList->begin();
1877                 SoundsIter != SoundsList->end(); SoundsIter++){
1879                 ProcessData.Append("SOUND");
1880                         
1881                 // Check if there is a value for TYPE.
1882                 
1883                 if ((*SoundsListType)[SoundsIter->first].size() > 0){
1884                 
1885                         ProcessData.Append(";TYPE=");
1886                         ProcessData.Append((*SoundsListType)[SoundsIter->first]);
1887                         
1888                 }
1889                 
1890                 // Check if there is a value for ALTID.
1891                 
1892                 if ((*SoundsListAltID)[SoundsIter->first].size() > 0){
1893                 
1894                         ProcessData.Append(";ALTID=");
1895                         ProcessData.Append((*SoundsListAltID)[SoundsIter->first]);
1896                         
1897                 }
1899                 // Check if there is a value for LANGUAGE.
1900                 
1901                 if ((*SoundsListLanguage)[SoundsIter->first].size() > 0){
1902                 
1903                         ProcessData.Append(";LANGUAGE=");
1904                         ProcessData.Append((*SoundsListLanguage)[SoundsIter->first]);
1905                         
1906                 }
1907                 
1908                 // Check if there is a value for MEDIATYPE.
1909                 
1910                 if ((*SoundsListMediatype)[SoundsIter->first].size() > 0){
1911                 
1912                         ProcessData.Append(";MEDIATYPE=");
1913                         ProcessData.Append((*SoundsListMediatype)[SoundsIter->first]);
1914                         
1915                 }
1916                 
1917                 // Check if there is a value for PID.
1919                 if ((*SoundsListPID)[SoundsIter->first].size() > 0){
1920                 
1921                         ProcessData.Append(";PID=");
1922                         ProcessData.Append((*SoundsListPID)[SoundsIter->first]);
1923                         
1924                 }
1926                 // Check if there is a value for PREF.
1928                 if ((*SoundsListPref)[SoundsIter->first] > 0){
1929                 
1930                         ProcessData.Append(";PREF=");
1931                         ProcessData.Append(wxString::Format("%i", (*SoundsListPref)[SoundsIter->first]));
1932                         
1933                 }
1935                 // Check if there is a value for tokens.
1937                 if ((*SoundsListTokens)[SoundsIter->first].size() > 0){
1938                 
1939                         ProcessData.Append(";");
1940                         ProcessData.Append((*SoundsListTokens)[SoundsIter->first]);
1941                         
1942                 }
1943                 
1944                 ProcessData.Append(":data:");
1945                 ProcessData.Append((*SoundsListAudioType)[SoundsIter->first]);
1946                 ProcessData.Append(";");
1947                 ProcessData.Append((*SoundsListAudioEncType)[SoundsIter->first]);
1948                 ProcessData.Append(",");
1949                 ProcessData.Append(SoundsIter->second);
1950                 ProcessData.Append("\n");
1952                 ProcessData = OutputText(&ProcessData);
1953                 
1954                 SaveData->Append(ProcessData);
1955                 ProcessData.clear();
1956                         
1957         }
1958                 
1961 void ContactDataObject::SaveCalendarURI(map<int, wxString> *CalendarList, map<int, wxString> *CalendarListMediatype,
1962         map<int, wxString> *CalendarListAltID, map<int, wxString> *CalendarListPID,
1963         map<int, wxString> *CalendarListType, map<int, int> *CalendarListPref,
1964         map<int, wxString> *CalendarListTokens, wxString *SaveData){
1966         wxString ProcessData = "";
1967                 
1968         for (std::map<int, wxString>::iterator CalendarIter = CalendarList->begin();
1969                 CalendarIter != CalendarList->end(); CalendarIter++){
1971                 ProcessData.Append("CALURI");
1972                         
1973                 // Check if there is a value for TYPE.
1974                 
1975                 if ((*CalendarListType)[CalendarIter->first].size() > 0){
1976                 
1977                         ProcessData.Append(";TYPE=");
1978                         ProcessData.Append((*CalendarListType)[CalendarIter->first]);
1979                         
1980                 }
1981                 
1982                 // Check if there is a value for ALTID.
1983                 
1984                 if ((*CalendarListAltID)[CalendarIter->first].size() > 0){
1985                 
1986                         ProcessData.Append(";ALTID=");
1987                         ProcessData.Append((*CalendarListAltID)[CalendarIter->first]);
1988                         
1989                 }
1991                 // Check if there is a value for MEDIATYPE.
1992                 
1993                 if ((*CalendarListMediatype)[CalendarIter->first].size() > 0){
1994                 
1995                         ProcessData.Append(";MEDIATYPE=");
1996                         ProcessData.Append((*CalendarListMediatype)[CalendarIter->first]);
1997                         
1998                 }
1999                 
2000                 // Check if there is a value for PID.
2002                 if ((*CalendarListPID)[CalendarIter->first].size() > 0){
2003                 
2004                         ProcessData.Append(";PID=");
2005                         ProcessData.Append((*CalendarListPID)[CalendarIter->first]);
2006                         
2007                 }
2009                 // Check if there is a value for PREF.
2011                 if ((*CalendarListPref)[CalendarIter->first] > 0){
2012                 
2013                         ProcessData.Append(";PREF=");
2014                         ProcessData.Append(wxString::Format("%i", (*CalendarListPref)[CalendarIter->first]));
2015                         
2016                 }
2018                 // Check if there is a value for tokens.
2020                 if ((*CalendarListTokens)[CalendarIter->first].size() > 0){
2021                 
2022                         ProcessData.Append(";");
2023                         ProcessData.Append((*CalendarListTokens)[CalendarIter->first]);
2024                         
2025                 }
2026                         
2027                 ProcessData.Append(":");
2028                 ProcessData.Append(CalendarIter->second);
2029                 ProcessData.Append("\n");
2031                 ProcessData = OutputText(&ProcessData);
2032                 
2033                 SaveData->Append(ProcessData);
2034                 ProcessData.clear();
2035                         
2036         }
2037                 
2040 void ContactDataObject::SaveCalendarRequestURI(map<int, wxString> *CalendarRequestList, map<int, wxString> *CalendarRequestListMediatype,
2041         map<int, wxString> *CalendarRequestListAltID, map<int, wxString> *CalendarRequestListPID,
2042         map<int, wxString> *CalendarRequestListType, map<int, int> *CalendarRequestListPref,
2043         map<int, wxString> *CalendarRequestListTokens, wxString *SaveData){
2045         wxString ProcessData = "";
2046                 
2047         for (std::map<int, wxString>::iterator CalendarRequestIter = CalendarRequestList->begin();
2048                 CalendarRequestIter != CalendarRequestList->end(); CalendarRequestIter++){
2050                 ProcessData.Append("CALADRURI");
2051                         
2052                 // Check if there is a value for TYPE.
2053                 
2054                 if ((*CalendarRequestListType)[CalendarRequestIter->first].size() > 0){
2055                 
2056                         ProcessData.Append(";TYPE=");
2057                         ProcessData.Append((*CalendarRequestListType)[CalendarRequestIter->first]);
2058                         
2059                 }
2060                 
2061                 // Check if there is a value for ALTID.
2062                 
2063                 if ((*CalendarRequestListAltID)[CalendarRequestIter->first].size() > 0){
2064                 
2065                         ProcessData.Append(";ALTID=");
2066                         ProcessData.Append((*CalendarRequestListAltID)[CalendarRequestIter->first]);
2067                         
2068                 }
2070                 // Check if there is a value for MEDIATYPE.
2071                 
2072                 if ((*CalendarRequestListMediatype)[CalendarRequestIter->first].size() > 0){
2073                 
2074                         ProcessData.Append(";MEDIATYPE=");
2075                         ProcessData.Append((*CalendarRequestListMediatype)[CalendarRequestIter->first]);
2076                         
2077                 }
2078                 
2079                 // Check if there is a value for PID.
2081                 if ((*CalendarRequestListPID)[CalendarRequestIter->first].size() > 0){
2082                 
2083                         ProcessData.Append(";PID=");
2084                         ProcessData.Append((*CalendarRequestListPID)[CalendarRequestIter->first]);
2085                         
2086                 }
2088                 // Check if there is a value for PREF.
2090                 if ((*CalendarRequestListPref)[CalendarRequestIter->first] > 0){
2091                 
2092                         ProcessData.Append(";PREF=");
2093                         ProcessData.Append(wxString::Format("%i", (*CalendarRequestListPref)[CalendarRequestIter->first]));
2094                         
2095                 }
2097                 // Check if there is a value for tokens.
2099                 if ((*CalendarRequestListTokens)[CalendarRequestIter->first].size() > 0){
2100                 
2101                         ProcessData.Append(";");
2102                         ProcessData.Append((*CalendarRequestListTokens)[CalendarRequestIter->first]);
2103                         
2104                 }
2105                         
2106                 ProcessData.Append(":");
2107                 ProcessData.Append(CalendarRequestIter->second);
2108                 ProcessData.Append("\n");
2110                 ProcessData = OutputText(&ProcessData);
2111                 
2112                 SaveData->Append(ProcessData);
2113                 ProcessData.clear();
2114                         
2115         }
2116                 
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