Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Set tab on opening of the Contact Editor to be the first tab.
[xestiaab/.git] / source / contacteditor / frmContactEditor.cpp
1 #include <map>
2 #include <string>
3 #include <thread>
4 #include <vector>
5 #include <stdlib.h>
7 #include <wx/wx.h>
8 #include <wx/ffile.h>
9 #include <wx/tokenzr.h>
10 #include <wx/mstream.h>
11 #include <wx/fs_mem.h>
12 #include <wx/datetime.h>
14 #include <SFML/Audio.hpp>
16 #include "frmContactEditor.h"
17 #include "frmContactEditorNickname.h"
18 #include "frmContactEditorAddress.h"
19 #include "frmContactEditorEmail.h"
20 #include "frmContactEditorIM.h"
21 #include "frmContactEditorTelephone.h"
22 #include "frmContactEditorLanguages.h"
23 #include "frmContactEditorTimezones.h"
24 #include "frmContactEditorRelated.h"
25 #include "frmContactEditorWebsites.h"
26 #include "frmContactEditorTitles.h"
27 #include "frmContactEditorRoles.h"
28 #include "frmContactEditorGeoposition.h"
29 #include "frmContactEditorGroups.h"
31 #include "frmContactEditorOrganisations.h"
32 #include "frmContactEditorNotes.h"
33 #include "frmContactEditorCategory.h"
34 #include "frmContactEditorSound.h"
35 #include "frmContactEditorPicture.h"
36 #include "frmContactEditorCalAdr.h"
37 #include "frmContactEditorKey.h"
38 #include "frmContactEditorVendor.h"
39 #include "frmContactEditorXToken.h"
40 #include "../frmMain.h"
42 #include "../enums.h"
43 #include "../version.h"
44 #include "../vcard/vcard.h"
45 #include "../vcard/vcard34conv.h"
46 #include "../bitmaps.h"
47 #include "../common/base64.h"
48 #include "../common/textprocessing.h"
49 #include "../common/preferences.h"
50 #include "../common/uuid.h"
51 #include "../common/dirs.h"
53 #define CE_NICKNAME wxT("Nickname")
54 #define CE_ADDRESS wxT("Address")
55 #define CE_EMAIL wxT("Email")
56 #define CE_IM wxT("IM")
57 #define CE_TELEPHONE wxT("Telephone")
58 #define CE_LANG wxT("Languages")
59 #define CE_TZ wxT("Timezone")
60 #define CE_RELATED wxT("Related")
61 #define CE_WEBSITE wxT("Websites")
62 #define CE_TITLE wxT("Titles")
63 #define CE_GEOPOSITION wxT("Geoposition")
64 #define CE_ROLE wxT("Roles")
65 #define CE_ORG wxT("Organisations")
66 #define CE_NOTE wxT("Notes")
67 #define CE_CATEGORIES wxT("Categories")
68 #define CE_GROUPS wxT("Groups")
69 #define CE_PICTURES wxT("Pictures")
70 #define CE_SOUNDS wxT("Sounds")
71 #define CE_CALENDAR wxT("Calendar")
72 #define CE_KEY wxT("Key")
73 #define CE_TOKEN wxT("Token")
75 // TODO: Investigate problems with SFML & PulseAudio - CPU usage problems when
76 // not being used.
78 // Replace intResult with intValueSeek.
80 BEGIN_EVENT_TABLE(frmContactEditor, wxFrame)
81 EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, frmContactEditor::ContactFileChanged)
82 END_EVENT_TABLE()
84 frmContactEditor::frmContactEditor( wxWindow* parent )
85 :
86 frmContactEditorADT( parent )
87 {
88     boolContactModified = FALSE;
89     wxDateTime NoDate;
90     dapAnniversary->SetValue(NoDate);
91     dapBirthday->SetValue(NoDate);
92     tabMembers->Hide();
93     
94     // Setup the buttons.
95     
96     wxMemoryInputStream istream(buttons_play_png, sizeof(buttons_play_png));
97     wxImage button_play_pngi(istream, wxBITMAP_TYPE_PNG);
98     wxBitmap playiconbmp(button_play_pngi, -1);
99     btnPlay->SetBitmapLabel(playiconbmp);
100     
101     wxMemoryInputStream istream2(buttons_stop_png, sizeof(buttons_stop_png));
102     wxImage button_stop_pngi(istream2, wxBITMAP_TYPE_PNG);
103     wxBitmap stopiconbmp(button_stop_pngi, -1);
104     btnStop->SetBitmapLabel(stopiconbmp);
105     btnStop->Disable();
106     FMTimer.SetupPointers(this);
107     //wxIcon contacticon;
108     //contacticon.CopyFromBitmap(contacticonbmp);
109     
110     nbkContact->SetSelection(0);
111     
114 void frmContactEditor::AddGeneralNickname( wxCommandEvent& event )
116     int intResult = 0;
117     
118     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
119     frameCENickname->SetEditorMode(FALSE, CE_GENERAL);
120     intResult = GetLastInt(&GeneralNicknamesList);
121     frameCENickname->SetupPointers(&GeneralNicknamesList,
122                                    &GeneralNicknamesListAltID,
123                                    &GeneralNicknamesListPID,
124                                    &GeneralNicknamesListType,
125                                    &GeneralNicknamesListLanguage,
126                                    &GeneralNicknamesListTokens,
127                                    &GeneralNicknamesListPref,
128                                    lboNicknames,
129                                    (intValueSeek));
130     frameCENickname->ShowModal();
131     delete frameCENickname;
132     frameCENickname = NULL;
135 void frmContactEditor::ModifyGeneralNickname( wxCommandEvent& event )
137     
138     long longSelected = -1;
139     int intSelectedData = 0;
140     
141     if (!GetSelectedItem(lboNicknames,
142                          &longSelected,
143                          &intSelectedData)){
144         return;
145     }
146     
147     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
148     frameCENickname->SetupPointers(&GeneralNicknamesList,
149                                    &GeneralNicknamesListAltID,
150                                    &GeneralNicknamesListPID,
151                                    &GeneralNicknamesListType,
152                                    &GeneralNicknamesListLanguage,
153                                    &GeneralNicknamesListTokens,
154                                    &GeneralNicknamesListPref,
155                                    lboNicknames,
156                                    intSelectedData);
157     frameCENickname->SetEditorMode(TRUE, CE_GENERAL);
158     frameCENickname->ShowModal();
159     delete frameCENickname;
160     frameCENickname = NULL;
161     
164 void frmContactEditor::DeleteGeneralNickname( wxCommandEvent& event )
166     
167     long longSelected = -1;
168     int intSelectedData = 0;
169     
170     if (!GetSelectedItem(lboNicknames,
171                          &longSelected,
172                          &intSelectedData)){
173         return;
174     }
175     
176     lboNicknames->DeleteItem(longSelected);
177     
178     DeleteMapData(intSelectedData,
179                   &GeneralNicknamesList,
180                   &GeneralNicknamesListLanguage,
181                   &GeneralNicknamesListAltID,
182                   &GeneralNicknamesListPID,
183                   &GeneralNicknamesListTokens,
184                   &GeneralNicknamesListType,
185                   &GeneralNicknamesListPref);
186     
189 void frmContactEditor::AddGeneralAddress( wxCommandEvent& event )
191     
192     int intResult = 0;
193     
194     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
195     frameCEAddress->SetEditorMode(FALSE, CE_GENERAL);
196     intResult = GetLastInt(&GeneralAddressList);
197     frameCEAddress->SetupPointers(&GeneralAddressList,
198                                   &GeneralAddressListTown,
199                                   &GeneralAddressListCounty,
200                                   &GeneralAddressListPostCode,
201                                   &GeneralAddressListCountry,
202                                   &GeneralAddressListLabel,
203                                   &GeneralAddressListLang,
204                                   &GeneralAddressListAltID,
205                                   &GeneralAddressListPID,
206                                   &GeneralAddressListTokens,
207                                   &GeneralAddressListGeo,
208                                   &GeneralAddressListTimezone,
209                                   &GeneralAddressListType,
210                                   &GeneralAddressListMediatype,
211                                   &GeneralAddressListPref,
212                                   lboAddresses,
213                                   (intValueSeek));
214     frameCEAddress->ShowModal();
215     delete frameCEAddress;
216     frameCEAddress = NULL;
219 void frmContactEditor::ModifyGeneralAddress( wxCommandEvent& event )
221     
222     long longSelected = -1;
223     int intSelectedData = 0;
224     
225     if (!GetSelectedItem(lboAddresses,
226                          &longSelected,
227                          &intSelectedData)){
228         return;
229     }
230     
231     if (longSelected == -1){
232         return;
233     }
234     
235     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
236     frameCEAddress->SetupPointers(&GeneralAddressList,
237                                   &GeneralAddressListTown,
238                                   &GeneralAddressListCounty,
239                                   &GeneralAddressListPostCode,
240                                   &GeneralAddressListCountry,
241                                   &GeneralAddressListLabel,
242                                   &GeneralAddressListLang,
243                                   &GeneralAddressListAltID,
244                                   &GeneralAddressListPID,
245                                   &GeneralAddressListTokens,
246                                   &GeneralAddressListGeo,
247                                   &GeneralAddressListTimezone,
248                                   &GeneralAddressListType,
249                                   &GeneralAddressListMediatype,
250                                   &GeneralAddressListPref,
251                                   lboAddresses,
252                                   intSelectedData);
253     frameCEAddress->SetEditorMode(TRUE, CE_GENERAL);
254     frameCEAddress->ShowModal();
255     delete frameCEAddress;
256     frameCEAddress = NULL;
257     
260 void frmContactEditor::DeleteGeneralAddress( wxCommandEvent& event )
262     
263     long longSelected = -1;
264     int intSelectedData = 0;
265     
266     if (!GetSelectedItem(lboAddresses,
267                          &longSelected,
268                          &intSelectedData)){
269         return;
270     }
271     
272     lboAddresses->DeleteItem(longSelected);
273     
274     DeleteMapData(intSelectedData, &GeneralAddressList,
275                   &GeneralAddressListTown, &GeneralAddressListCounty,
276                   &GeneralAddressListPostCode, &GeneralAddressListCountry,
277                   &GeneralAddressList, &GeneralAddressListLabel,
278                   &GeneralAddressListLang, &GeneralAddressListAltID,
279                   &GeneralAddressListPID, &GeneralAddressListTokens,
280                   &GeneralAddressListGeo, &GeneralAddressListTimezone,
281                   &GeneralAddressListType, &GeneralAddressListMediatype,
282                   &GeneralAddressListPref);
283     
286 void frmContactEditor::AddGeneralEmail( wxCommandEvent& event )
288     int intResult = 0;
289     
290     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
291     frameCEEmail->SetEditorMode(FALSE, CE_GENERAL);
292     intResult = GetLastInt(&GeneralAddressList);
293     frameCEEmail->SetupPointers(&GeneralEmailList,
294                                 &GeneralEmailListAltID,
295                                 &GeneralEmailListPID,
296                                 &GeneralEmailListType,
297                                 &GeneralEmailListTokens,
298                                 &GeneralEmailListPref,
299                                 lboEmails,
300                                 (intValueSeek));
301     frameCEEmail->ShowModal();
302     delete frameCEEmail;
303     frameCEEmail = NULL;
306 void frmContactEditor::ModifyGeneralEmail( wxCommandEvent& event )
308     long longSelected = -1;
309     int intSelectedData = 0;
310     
311     if (!GetSelectedItem(lboEmails,
312                          &longSelected,
313                          &intSelectedData)){
314         return;
315     }
316     
317     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
318     frameCEEmail->SetupPointers(&GeneralEmailList,
319                                 &GeneralEmailListAltID,
320                                 &GeneralEmailListPID,
321                                 &GeneralEmailListType,
322                                 &GeneralEmailListTokens,
323                                 &GeneralEmailListPref,
324                                 lboEmails,
325                                 intSelectedData);
326     frameCEEmail->SetEditorMode(TRUE, CE_GENERAL);
327     frameCEEmail->ShowModal();
328     delete frameCEEmail;
329     frameCEEmail = NULL;
332 void frmContactEditor::DeleteGeneralEmail( wxCommandEvent& event )
334     long longSelected = -1;
335     int intSelectedData = 0;
336     
337     if (!GetSelectedItem(lboEmails,
338                          &longSelected,
339                          &intSelectedData)){
340         return;
341     }
342     
343     lboEmails->DeleteItem(longSelected);
344     
345     DeleteMapData(intSelectedData, &GeneralEmailList,
346                   &GeneralEmailListAltID, &GeneralEmailListPID,
347                   &GeneralEmailListType, &GeneralEmailListTokens,
348                   &GeneralEmailListPref);
349     
352 void frmContactEditor::AddGeneralIM( wxCommandEvent& event )
354     int intResult = 0;
355     
356     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
357     frameCEIM->SetEditorMode(FALSE, CE_GENERAL);
358     intResult = GetLastInt(&GeneralIMList);
359     frameCEIM->SetupPointers(&GeneralIMList,
360                              &GeneralIMListAltID,
361                              &GeneralIMListPID,
362                              &GeneralIMListType,
363                              &GeneralIMListTokens,
364                              &GeneralIMListMediatype,
365                              &GeneralIMListPref,
366                              lboIM,
367                              (intValueSeek));
368     frameCEIM->ShowModal();
369     delete frameCEIM;
370     frameCEIM = NULL;
373 void frmContactEditor::ModifyGeneralIM( wxCommandEvent& event )
375     long longSelected = -1;
376     int intSelectedData = 0;
377     
378     if (!GetSelectedItem(lboIM,
379                          &longSelected,
380                          &intSelectedData)){
381         return;
382     }
383     
384     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
385     frameCEIM->SetupPointers(&GeneralIMList,
386                              &GeneralIMListAltID,
387                              &GeneralIMListPID,
388                              &GeneralIMListType,
389                              &GeneralIMListTokens,
390                              &GeneralIMListMediatype,
391                              &GeneralIMListPref,
392                              lboIM,
393                              intSelectedData);
394     frameCEIM->SetEditorMode(TRUE, CE_GENERAL);
395     frameCEIM->ShowModal();
396     delete frameCEIM;
397     frameCEIM = NULL;
400 void frmContactEditor::DeleteGeneralIM( wxCommandEvent& event )
402     long longSelected = -1;
403     int intSelectedData = 0;
404     
405     if (!GetSelectedItem(lboIM,
406                          &longSelected,
407                          &intSelectedData)){
408         return;
409     }
410     
411     lboIM->DeleteItem(longSelected);
412     
413     DeleteMapData(intSelectedData, &GeneralIMList,
414                   &GeneralIMListAltID, &GeneralIMListPID,
415                   &GeneralIMListType, &GeneralIMListTokens,
416                   &GeneralIMListMediatype, &GeneralIMListPref);
417     
420 void frmContactEditor::AddGeneralTelephone( wxCommandEvent& event )
422     int intResult = 0;
423     
424     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
425     frameCETel->SetEditorMode(FALSE, CE_GENERAL);
426     intResult = GetLastInt(&GeneralTelephoneList);
427     frameCETel->SetupPointers(&GeneralTelephoneList,
428                               &GeneralTelephoneListAltID,
429                               &GeneralTelephoneListPID,
430                               &GeneralTelephoneListType,
431                               &GeneralTelephoneListTokens,
432                               &GeneralTelephoneListPref,
433                               lboTelephone,
434                               (intValueSeek));
435     frameCETel->ShowModal();
436     delete frameCETel;
437     frameCETel = NULL;
440 void frmContactEditor::ModifyGeneralTelephone( wxCommandEvent& event )
442     long longSelected = -1;
443     int intSelectedData = 0;
444     
445     if (!GetSelectedItem(lboTelephone,
446                          &longSelected,
447                          &intSelectedData)){
448         return;
449     }
450     
451     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
452     frameCETel->SetupPointers(&GeneralTelephoneList,
453                               &GeneralTelephoneListAltID,
454                               &GeneralTelephoneListPID,
455                               &GeneralTelephoneListType,
456                               &GeneralTelephoneListTokens,
457                               &GeneralTelephoneListPref,
458                               lboTelephone,
459                               intSelectedData);
460     frameCETel->SetEditorMode(TRUE, CE_GENERAL);
461     frameCETel->ShowModal();
462     delete frameCETel;
463     frameCETel = NULL;
466 void frmContactEditor::DeleteGeneralTelephone( wxCommandEvent& event )
468     long longSelected = -1;
469     int intSelectedData = 0;
470     
471     if (!GetSelectedItem(lboTelephone,
472                          &longSelected,
473                          &intSelectedData)){
474         return;
475     }
476     
477     lboTelephone->DeleteItem(longSelected);
478     
479     DeleteMapData(intSelectedData, &GeneralTelephoneList,
480                   &GeneralTelephoneListAltID, &GeneralTelephoneListPID,
481                   &GeneralTelephoneListType, &GeneralTelephoneListTokens,
482                   &GeneralTelephoneListPref);
483     
486 void frmContactEditor::AddGeneralLanguages( wxCommandEvent& event )
488     int intResult = 0;
489     
490     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
491     frameCELang->SetEditorMode(FALSE, CE_GENERAL);
492     intResult = GetLastInt(&GeneralLanguageList);
493     frameCELang->SetupPointers(&GeneralLanguageList,
494                                &GeneralLanguageListAltID,
495                                &GeneralLanguageListPID,
496                                &GeneralLanguageListType,
497                                &GeneralLanguageListTokens,
498                                &GeneralLanguageListPref,
499                                lboLanguages,
500                                (intValueSeek));
501     frameCELang->ShowModal();
502     delete frameCELang;
503     frameCELang = NULL;
506 void frmContactEditor::ModifyGeneralLanguages( wxCommandEvent& event )
508     long longSelected = -1;
509     int intSelectedData = 0;
510     
511     if (!GetSelectedItem(lboLanguages,
512                          &longSelected,
513                          &intSelectedData)){
514         return;
515     }
516     
517     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
518     frameCELang->SetupPointers(&GeneralLanguageList,
519                                &GeneralLanguageListAltID,
520                                &GeneralLanguageListPID,
521                                &GeneralLanguageListType,
522                                &GeneralLanguageListTokens,
523                                &GeneralLanguageListPref,
524                                lboLanguages,
525                                intSelectedData);
526     frameCELang->SetEditorMode(TRUE, CE_GENERAL);
527     frameCELang->ShowModal();
528     delete frameCELang;
529     frameCELang = NULL;
532 void frmContactEditor::DeleteGeneralLanguage( wxCommandEvent& event )
534     long longSelected = -1;
535     int intSelectedData = 0;
536     
537     if (!GetSelectedItem(lboLanguages,
538                          &longSelected,
539                          &intSelectedData)){
540         return;
541     }
542     
543     lboLanguages->DeleteItem(longSelected);
544     
545     DeleteMapData(intSelectedData, &GeneralLanguageList,
546                   &GeneralLanguageListAltID, &GeneralLanguageListPID,
547                   &GeneralLanguageListType, &GeneralLanguageListTokens,
548                   &GeneralLanguageListPref);
549     
552 void frmContactEditor::AddGeneralTimezone( wxCommandEvent& event )
554     int intResult = 0;
555     
556     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
557     frameCETZ->SetEditorMode(FALSE, CE_GENERAL);
558     intResult = GetLastInt(&GeneralTZList);
559     frameCETZ->SetupPointers(&GeneralTZList,
560                              &GeneralTZListAltID,
561                              &GeneralTZListPID,
562                              &GeneralTZListType,
563                              &GeneralTZListTokens,
564                              &GeneralTZListMediatype,
565                              &GeneralTZListPref,
566                              lboTimezones,
567                              (intValueSeek));
568     frameCETZ->ShowModal();
569     delete frameCETZ;
570     frameCETZ = NULL;
573 void frmContactEditor::ModifyGeneralTimezone( wxCommandEvent& event )
575     long longSelected = -1;
576     int intSelectedData = 0;
577     
578     if (!GetSelectedItem(lboTimezones,
579                          &longSelected,
580                          &intSelectedData)){
581         return;
582     }
583     
584     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
585     frameCETZ->SetupPointers(&GeneralTZList,
586                              &GeneralTZListAltID,
587                              &GeneralTZListPID,
588                              &GeneralTZListType,
589                              &GeneralTZListTokens,
590                              &GeneralTZListMediatype,
591                              &GeneralTZListPref,
592                              lboTimezones,
593                              intSelectedData);
594     frameCETZ->SetEditorMode(TRUE, CE_GENERAL);
595     frameCETZ->ShowModal();
596     delete frameCETZ;
597     frameCETZ = NULL;
600 void frmContactEditor::DeleteGeneralTimezone( wxCommandEvent& event )
602     long longSelected = -1;
603     int intSelectedData = 0;
604     
605     if (!GetSelectedItem(lboTimezones,
606                          &longSelected,
607                          &intSelectedData)){
608         return;
609     }
610     
611     lboTimezones->DeleteItem(longSelected);
612     
613     DeleteMapData(intSelectedData, &GeneralTZList,
614                   &GeneralTZListAltID, &GeneralTZListPID,
615                   &GeneralTZListType, &GeneralTZListTokens,
616                   &GeneralTZListMediatype, &GeneralTZListPref);
617     
620 void frmContactEditor::AddGeneralGeoposition( wxCommandEvent& event )
622     int intResult = 0;
623     
624     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
625     frameCEGeo->SetEditorMode(FALSE, CE_GENERAL);
626     intResult = GetLastInt(&GeneralGeographyList);
627     frameCEGeo->SetupPointers(&GeneralGeographyList,
628                               &GeneralGeographyListAltID,
629                               &GeneralGeographyListPID,
630                               &GeneralGeographyListType,
631                               &GeneralGeographyListTokens,
632                               &GeneralGeographyListMediatype,
633                               &GeneralGeographyListPref,
634                               lboGeoposition,
635                               (intValueSeek));
636     frameCEGeo->ShowModal();
637     delete frameCEGeo;
638     frameCEGeo = NULL;
641 void frmContactEditor::ModifyGeneralGeoposition( wxCommandEvent& event )
643     long longSelected = -1;
644     int intSelectedData = 0;
645     
646     if (!GetSelectedItem(lboGeoposition,
647                          &longSelected,
648                          &intSelectedData)){
649         return;
650     }
651     
652     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
653     frameCEGeo->SetupPointers(&GeneralGeographyList,
654                               &GeneralGeographyListAltID,
655                               &GeneralGeographyListPID,
656                               &GeneralGeographyListType,
657                               &GeneralGeographyListTokens,
658                               &GeneralGeographyListMediatype,
659                               &GeneralGeographyListPref,
660                               lboGeoposition,
661                               intSelectedData);
662     frameCEGeo->SetEditorMode(TRUE, CE_GENERAL);
663     frameCEGeo->ShowModal();
664     delete frameCEGeo;
665     frameCEGeo = NULL;
668 void frmContactEditor::DeleteGeneralGeoposition( wxCommandEvent& event )
670     long longSelected = -1;
671     int intSelectedData = 0;
672     
673     if (!GetSelectedItem(lboGeoposition,
674                          &longSelected,
675                          &intSelectedData)){
676         return;
677     }
678     
679     lboGeoposition->DeleteItem(longSelected);
680     
681     DeleteMapData(intSelectedData, &GeneralGeographyList,
682                   &GeneralGeographyListAltID, &GeneralGeographyListPID,
683                   &GeneralGeographyListType, &GeneralGeographyListTokens,
684                   &GeneralGeographyListMediatype, &GeneralGeographyListPref);
685     
688 void frmContactEditor::AddGeneralRelated( wxCommandEvent& event )
690     int intResult = 0;
691     
692     frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
693     frameCERel->SetEditorMode(FALSE, CE_GENERAL);
694     intResult = GetLastInt(&GeneralRelatedList);
695     frameCERel->SetupPointers(&GeneralRelatedList,
696                               &GeneralRelatedListRelType,
697                               &GeneralRelatedListAltID,
698                               &GeneralRelatedListPID,
699                               &GeneralRelatedListType,
700                               &GeneralRelatedListTokens,
701                               &GeneralRelatedListPref,
702                               lboRelated,
703                               (intValueSeek));
704     frameCERel->ShowModal();
705     delete frameCERel;
706     frameCERel = NULL;
709 void frmContactEditor::ModifyGeneralRelated( wxCommandEvent& event )
711     long longSelected = -1;
712     int intSelectedData = 0;
713     
714     if (!GetSelectedItem(lboRelated,
715                          &longSelected,
716                          &intSelectedData)){
717         return;
718     }
719     
720     frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
721     frameCERel->SetupPointers(&GeneralRelatedList,
722                               &GeneralRelatedListRelType,
723                               &GeneralRelatedListAltID,
724                               &GeneralRelatedListPID,
725                               &GeneralRelatedListType,
726                               &GeneralRelatedListTokens,
727                               &GeneralRelatedListPref,
728                               lboRelated,
729                               intSelectedData);
730     frameCERel->SetEditorMode(TRUE, CE_GENERAL);
731     frameCERel->ShowModal();
732     delete frameCERel;
733     frameCERel = NULL;
736 void frmContactEditor::DeleteGeneralRelated( wxCommandEvent& event )
738     long longSelected = -1;
739     int intSelectedData = 0;
740     
741     if (!GetSelectedItem(lboRelated,
742                          &longSelected,
743                          &intSelectedData)){
744         return;
745     }
746     
747     lboRelated->DeleteItem(longSelected);
748     
749     GeneralRelatedList.erase(intSelectedData);
750     GeneralRelatedListRelType.erase(intSelectedData);
751     GeneralRelatedListAltID.erase(intSelectedData);
752     GeneralRelatedListPID.erase(intSelectedData);
753     GeneralRelatedListType.erase(intSelectedData);
754     GeneralRelatedListTokens.erase(intSelectedData);
755     GeneralRelatedListPref.erase(intSelectedData);
758 void frmContactEditor::AddGeneralWebsite( wxCommandEvent& event )
760     int intResult = 0;
761     
762     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
763     frameCEWeb->SetEditorMode(FALSE, CE_GENERAL);
764     intResult = GetLastInt(&GeneralWebsiteList);
765     frameCEWeb->SetupPointers(&GeneralWebsiteList,
766                               &GeneralWebsiteListAltID,
767                               &GeneralWebsiteListPID,
768                               &GeneralWebsiteListType,
769                               &GeneralWebsiteListTokens,
770                               &GeneralWebsiteListMediatype,
771                               &GeneralWebsiteListPref,
772                               lboWebsites,
773                               (intValueSeek));
774     frameCEWeb->ShowModal();
775     delete frameCEWeb;
776     frameCEWeb = NULL;
779 void frmContactEditor::ModifyGeneralWebsite( wxCommandEvent& event )
781     long longSelected = -1;
782     int intSelectedData = 0;
783     
784     if (!GetSelectedItem(lboWebsites,
785                          &longSelected,
786                          &intSelectedData)){
787         return;
788     }
789     
790     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
791     frameCEWeb->SetupPointers(&GeneralWebsiteList,
792                               &GeneralWebsiteListAltID,
793                               &GeneralWebsiteListPID,
794                               &GeneralWebsiteListType,
795                               &GeneralWebsiteListTokens,
796                               &GeneralWebsiteListMediatype,
797                               &GeneralWebsiteListPref,
798                               lboWebsites,
799                               intSelectedData);
800     frameCEWeb->SetEditorMode(TRUE, CE_GENERAL);
801     frameCEWeb->ShowModal();
802     delete frameCEWeb;
803     frameCEWeb = NULL;
806 void frmContactEditor::DeleteGeneralWebsite( wxCommandEvent& event )
808     long longSelected = -1;
809     int intSelectedData = 0;
810     
811     if (!GetSelectedItem(lboWebsites,
812                          &longSelected,
813                          &intSelectedData)){
814         return;
815     }
816     
817     lboWebsites->DeleteItem(longSelected);
818     
819     DeleteMapData(intSelectedData, &GeneralWebsiteList,
820                   &GeneralWebsiteListAltID, &GeneralWebsiteListPID,
821                   &GeneralWebsiteListType, &GeneralWebsiteListTokens,
822                   &GeneralWebsiteListMediatype, &GeneralWebsiteListPref);
823     
826 void frmContactEditor::AddGeneralTitle( wxCommandEvent& event )
828     int intResult = 0;
829     
830     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
831     frameCETitle->SetEditorMode(FALSE, CE_GENERAL);
832     intResult = GetLastInt(&GeneralTitleList);
833     frameCETitle->SetupPointers(&GeneralTitleList,
834                                 &GeneralTitleListLanguage,
835                                 &GeneralTitleListAltID,
836                                 &GeneralTitleListPID,
837                                 &GeneralTitleListType,
838                                 &GeneralTitleListTokens,
839                                 &GeneralTitleListPref,
840                                 lboTitles,
841                                 (intValueSeek));
842     frameCETitle->ShowModal();
843     delete frameCETitle;
844     frameCETitle = NULL;
847 void frmContactEditor::ModifyGeneralTitle( wxCommandEvent& event )
849     long longSelected = -1;
850     int intSelectedData = 0;
851     
852     if (!GetSelectedItem(lboTitles,
853                          &longSelected,
854                          &intSelectedData)){
855         return;
856     }
857     
858     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
859     frameCETitle->SetupPointers(&GeneralTitleList,
860                                 &GeneralTitleListLanguage,
861                                 &GeneralTitleListAltID,
862                                 &GeneralTitleListPID,
863                                 &GeneralTitleListType,
864                                 &GeneralTitleListTokens,
865                                 &GeneralTitleListPref,
866                                 lboTitles,
867                                 intSelectedData);
868     frameCETitle->SetEditorMode(TRUE, CE_GENERAL);
869     frameCETitle->ShowModal();
870     delete frameCETitle;
871     frameCETitle = NULL;
874 void frmContactEditor::DeleteGeneralTitle( wxCommandEvent& event )
876     long longSelected = -1;
877     int intSelectedData = 0;
878     
879     if (!GetSelectedItem(lboTitles,
880                          &longSelected,
881                          &intSelectedData)){
882         return;
883     }
884     
885     lboTitles->DeleteItem(longSelected);
886     
887     DeleteMapData(intSelectedData, &GeneralTitleList,
888                   &GeneralTitleListLanguage, &GeneralTitleListAltID,
889                   &GeneralTitleListPID, &GeneralTitleListType,
890                   &GeneralTitleListTokens, &GeneralTitleListPref);
891     
894 void frmContactEditor::AddGeneralRole( wxCommandEvent& event )
896     int intResult = 0;
897     
898     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
899     frameCERole->SetEditorMode(FALSE, CE_GENERAL);
900     intResult = GetLastInt(&GeneralRoleList);
901     frameCERole->SetupPointers(&GeneralRoleList,
902                                &GeneralRoleListLanguage,
903                                &GeneralRoleListAltID,
904                                &GeneralRoleListPID,
905                                &GeneralRoleListType,
906                                &GeneralRoleListTokens,
907                                &GeneralRoleListPref,
908                                lboRoles,
909                                (intValueSeek));
910     frameCERole->ShowModal();
911     delete frameCERole;
912     frameCERole = NULL;
915 void frmContactEditor::ModifyGeneralRole( wxCommandEvent& event )
917     long longSelected = -1;
918     int intSelectedData = 0;
919     
920     if (!GetSelectedItem(lboRoles,
921                          &longSelected,
922                          &intSelectedData)){
923         return;
924     }
925     
926     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
927     frameCERole->SetupPointers(&GeneralRoleList,
928                                &GeneralRoleListLanguage,
929                                &GeneralRoleListAltID,
930                                &GeneralRoleListPID,
931                                &GeneralRoleListType,
932                                &GeneralRoleListTokens,
933                                &GeneralRoleListPref,
934                                lboRoles,
935                                intSelectedData);
936     frameCERole->SetEditorMode(TRUE, CE_GENERAL);
937     frameCERole->ShowModal();
938     delete frameCERole;
939     frameCERole = NULL;
942 void frmContactEditor::DeleteGeneralRole( wxCommandEvent& event )
944     long longSelected = -1;
945     int intSelectedData = 0;
946     
947     if (!GetSelectedItem(lboRoles,
948                          &longSelected,
949                          &intSelectedData)){
950         return;
951     }
952     
953     lboRoles->DeleteItem(longSelected);
954     
955     DeleteMapData(intSelectedData, &GeneralRoleList,
956                   &GeneralRoleListLanguage, &GeneralRoleListAltID,
957                   &GeneralRoleListPID, &GeneralRoleListType,
958                   &GeneralRoleListTokens, &GeneralRoleListPref);
959     
962 void frmContactEditor::AddGeneralOrganisation( wxCommandEvent& event )
964     int intResult = 0;
965     
966     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
967     frameCEOrg->SetEditorMode(FALSE, CE_GENERAL);
968     intResult = GetLastInt(&GeneralOrganisationsList);
969     frameCEOrg->SetupPointers(&GeneralOrganisationsList,
970                               &GeneralOrganisationsListLanguage,
971                               &GeneralOrganisationsListSortAs,
972                               &GeneralOrganisationsListAltID,
973                               &GeneralOrganisationsListPID,
974                               &GeneralOrganisationsListType,
975                               &GeneralOrganisationsListTokens,
976                               &GeneralOrganisationsListPref,
977                               lboOrganisations,
978                               (intValueSeek));
979     frameCEOrg->ShowModal();
980     delete frameCEOrg;
981     frameCEOrg = NULL;
984 void frmContactEditor::ModifyGeneralOrganisation( wxCommandEvent& event )
986     long longSelected = -1;
987     int intSelectedData = 0;
988     
989     if (!GetSelectedItem(lboOrganisations,
990                          &longSelected,
991                          &intSelectedData)){
992         return;
993     }
994     
995     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
996     frameCEOrg->SetupPointers(&GeneralOrganisationsList,
997                               &GeneralOrganisationsListLanguage,
998                               &GeneralOrganisationsListSortAs,
999                               &GeneralOrganisationsListAltID,
1000                               &GeneralOrganisationsListPID,
1001                               &GeneralOrganisationsListType,
1002                               &GeneralOrganisationsListTokens,
1003                               &GeneralOrganisationsListPref,
1004                               lboOrganisations,
1005                               intSelectedData);
1006     frameCEOrg->SetEditorMode(TRUE, CE_GENERAL);
1007     frameCEOrg->ShowModal();
1008     delete frameCEOrg;
1009     frameCEOrg = NULL;
1012 void frmContactEditor::DeleteGeneralOrganisation( wxCommandEvent& event )
1014     long longSelected = -1;
1015     int intSelectedData = 0;
1016     
1017     if (!GetSelectedItem(lboOrganisations,
1018                          &longSelected,
1019                          &intSelectedData)){
1020         return;
1021     }
1022     
1023     lboOrganisations->DeleteItem(longSelected);
1024     
1025     DeleteMapData(intSelectedData, &GeneralOrganisationsList,
1026                   &GeneralOrganisationsListLanguage, &GeneralOrganisationsListSortAs,
1027                   &GeneralOrganisationsListAltID, &GeneralOrganisationsListPID,
1028                   &GeneralOrganisationsListType, &GeneralOrganisationsListTokens,
1029                   &GeneralOrganisationsListPref);
1030     
1033 void frmContactEditor::AddGeneralNote( wxCommandEvent& event )
1035     int intResult = 0;
1036     
1037     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1038     frameCENote->SetEditorMode(FALSE, CE_GENERAL);
1039     intResult = GetLastInt(&GeneralNoteList);
1040     frameCENote->SetupPointers(&GeneralNoteList,
1041                                &GeneralNoteListLanguage,
1042                                &GeneralNoteListAltID,
1043                                &GeneralNoteListPID,
1044                                &GeneralNoteListType,
1045                                &GeneralNoteListTokens,
1046                                &GeneralNoteListPref,
1047                                lboNotes,
1048                                (intValueSeek));
1049     frameCENote->ShowModal();
1050     delete frameCENote;
1051     frameCENote = NULL;
1054 void frmContactEditor::ModifyGeneralNote( wxCommandEvent& event )
1056     long longSelected = -1;
1057     int intSelectedData = 0;
1058     
1059     if (!GetSelectedItem(lboNotes,
1060                          &longSelected,
1061                          &intSelectedData)){
1062         return;
1063     }
1064     
1065     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1066     frameCENote->SetupPointers(&GeneralNoteList,
1067                                &GeneralNoteListLanguage,
1068                                &GeneralNoteListAltID,
1069                                &GeneralNoteListPID,
1070                                &GeneralNoteListType,
1071                                &GeneralNoteListTokens,
1072                                &GeneralNoteListPref,
1073                                lboNotes,
1074                                intSelectedData);
1075     frameCENote->SetEditorMode(TRUE, CE_GENERAL);
1076     frameCENote->ShowModal();
1077     delete frameCENote;
1078     frameCENote = NULL;
1081 void frmContactEditor::DeleteGeneralNote( wxCommandEvent& event )
1083     long longSelected = -1;
1084     int intSelectedData = 0;
1085     
1086     if (!GetSelectedItem(lboNotes,
1087                          &longSelected,
1088                          &intSelectedData)){
1089         return;
1090     }
1091     
1092     lboNotes->DeleteItem(longSelected);
1093     
1094     DeleteMapData(intSelectedData, &GeneralNoteList,
1095                   &GeneralNoteListLanguage, &GeneralNoteListAltID,
1096                   &GeneralNoteListPID, &GeneralNoteListType,
1097                   &GeneralNoteListTokens, &GeneralNoteListPref);
1098     
1101 void frmContactEditor::AddHomeNickname( wxCommandEvent& event )
1103     int intResult = 0;
1104     
1105     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
1106     frameCENickname->SetEditorMode(FALSE, CE_HOME);
1107     intResult = GetLastInt(&HomeNicknamesList);
1108     frameCENickname->SetupPointers(&HomeNicknamesList,
1109                                    &HomeNicknamesListAltID,
1110                                    &HomeNicknamesListPID,
1111                                    &HomeNicknamesListType,
1112                                    &HomeNicknamesListLanguage,
1113                                    &HomeNicknamesListTokens,
1114                                    &HomeNicknamesListPref,
1115                                    lboHomeNicknames,
1116                                    (intValueSeek));
1117     frameCENickname->ShowModal();
1118     delete frameCENickname;
1119     frameCENickname = NULL;
1122 void frmContactEditor::ModifyHomeNickname( wxCommandEvent& event )
1124     long longSelected = -1;
1125     int intSelectedData = 0;
1126     
1127     if (!GetSelectedItem(lboHomeNicknames,
1128                          &longSelected,
1129                          &intSelectedData)){
1130         return;
1131     }
1132     
1133     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
1134     frameCENickname->SetupPointers(&HomeNicknamesList,
1135                                    &HomeNicknamesListAltID,
1136                                    &HomeNicknamesListPID,
1137                                    &HomeNicknamesListType,
1138                                    &HomeNicknamesListLanguage,
1139                                    &HomeNicknamesListTokens,
1140                                    &HomeNicknamesListPref,
1141                                    lboHomeNicknames,
1142                                    intSelectedData);
1143     frameCENickname->SetEditorMode(TRUE, CE_HOME);
1144     frameCENickname->ShowModal();
1145     delete frameCENickname;
1146     frameCENickname = NULL;
1149 void frmContactEditor::DeleteHomeNickname( wxCommandEvent& event )
1151     
1152     long longSelected = -1;
1153     int intSelectedData = 0;
1154     
1155     if (!GetSelectedItem(lboHomeNicknames,
1156                          &longSelected,
1157                          &intSelectedData)){
1158         return;
1159     }
1160     
1161     lboHomeNicknames->DeleteItem(longSelected);
1162     
1163     DeleteMapData(intSelectedData,
1164                   &HomeNicknamesList,
1165                   &HomeNicknamesListLanguage,
1166                   &HomeNicknamesListAltID,
1167                   &HomeNicknamesListPID,
1168                   &HomeNicknamesListTokens,
1169                   &HomeNicknamesListType,
1170                   &HomeNicknamesListPref);
1171     
1174 void frmContactEditor::AddHomeAddress( wxCommandEvent& event )
1176     int intResult = 0;
1177     
1178     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
1179     frameCEAddress->SetEditorMode(FALSE, CE_HOME);
1180     intResult = GetLastInt(&HomeAddressList);
1181     frameCEAddress->SetupPointers(&HomeAddressList,
1182                                   &HomeAddressListTown,
1183                                   &HomeAddressListCounty,
1184                                   &HomeAddressListPostCode,
1185                                   &HomeAddressListCountry,
1186                                   &HomeAddressListLabel,
1187                                   &HomeAddressListLang,
1188                                   &HomeAddressListAltID,
1189                                   &HomeAddressListPID,
1190                                   &HomeAddressListTokens,
1191                                   &HomeAddressListGeo,
1192                                   &HomeAddressListTimezone,
1193                                   &HomeAddressListType,
1194                                   &HomeAddressListMediatype,
1195                                   &HomeAddressListPref,
1196                                   lboHomeAddresses,
1197                                   (intValueSeek));
1198     frameCEAddress->ShowModal();
1199     delete frameCEAddress;
1200     frameCEAddress = NULL;
1203 void frmContactEditor::ModifyHomeAddress( wxCommandEvent& event )
1205     long longSelected = -1;
1206     int intSelectedData = 0;
1207     
1208     if (!GetSelectedItem(lboHomeAddresses,
1209                          &longSelected,
1210                          &intSelectedData)){
1211         return;
1212     }
1213     
1214     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
1215     frameCEAddress->SetupPointers(&HomeAddressList,
1216                                   &HomeAddressListTown,
1217                                   &HomeAddressListCounty,
1218                                   &HomeAddressListPostCode,
1219                                   &HomeAddressListCountry,
1220                                   &HomeAddressListLabel,
1221                                   &HomeAddressListLang,
1222                                   &HomeAddressListAltID,
1223                                   &HomeAddressListPID,
1224                                   &HomeAddressListTokens,
1225                                   &HomeAddressListGeo,
1226                                   &HomeAddressListTimezone,
1227                                   &HomeAddressListType,
1228                                   &HomeAddressListMediatype,
1229                                   &HomeAddressListPref,
1230                                   lboHomeAddresses,
1231                                   intSelectedData);
1232     frameCEAddress->SetEditorMode(TRUE, CE_HOME);
1233     frameCEAddress->ShowModal();
1234     delete frameCEAddress;
1235     frameCEAddress = NULL;
1238 void frmContactEditor::DeleteHomeAddress( wxCommandEvent& event )
1240     
1241     long longSelected = -1;
1242     int intSelectedData = 0;
1243     
1244     if (!GetSelectedItem(lboHomeAddresses,
1245                          &longSelected,
1246                          &intSelectedData)){
1247         return;
1248     }
1249     
1250     lboHomeAddresses->DeleteItem(longSelected);
1251     
1252     DeleteMapData(intSelectedData, &HomeAddressList,
1253                   &HomeAddressListTown, &HomeAddressListCounty,
1254                   &HomeAddressListPostCode, &HomeAddressListCountry,
1255                   &HomeAddressList, &HomeAddressListLabel,
1256                   &HomeAddressListLang, &HomeAddressListAltID,
1257                   &HomeAddressListPID, &HomeAddressListTokens,
1258                   &HomeAddressListGeo, &HomeAddressListTimezone,
1259                   &HomeAddressListType, &HomeAddressListMediatype,
1260                   &HomeAddressListPref);
1261     
1264 void frmContactEditor::AddHomeEmail( wxCommandEvent& event )
1266     int intResult = 0;
1267     
1268     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
1269     frameCEEmail->SetEditorMode(FALSE, CE_HOME);
1270     intResult = GetLastInt(&HomeAddressList);
1271     frameCEEmail->SetupPointers(&HomeEmailList,
1272                                 &HomeEmailListAltID,
1273                                 &HomeEmailListPID,
1274                                 &HomeEmailListType,
1275                                 &HomeEmailListTokens,
1276                                 &HomeEmailListPref,
1277                                 lboHomeEmails,
1278                                 (intValueSeek));
1279     frameCEEmail->ShowModal();
1280     delete frameCEEmail;
1281     frameCEEmail = NULL;
1284 void frmContactEditor::ModifyHomeEmail( wxCommandEvent& event )
1286     long longSelected = -1;
1287     int intSelectedData = 0;
1288     
1289     if (!GetSelectedItem(lboHomeEmails,
1290                          &longSelected,
1291                          &intSelectedData)){
1292         return;
1293     }
1294     
1295     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
1296     frameCEEmail->SetupPointers(&HomeEmailList,
1297                                 &HomeEmailListAltID,
1298                                 &HomeEmailListPID,
1299                                 &HomeEmailListType,
1300                                 &HomeEmailListTokens,
1301                                 &HomeEmailListPref,
1302                                 lboHomeEmails,
1303                                 intSelectedData);
1304     frameCEEmail->SetEditorMode(TRUE, CE_HOME);
1305     frameCEEmail->ShowModal();
1306     delete frameCEEmail;
1307     frameCEEmail = NULL;
1311 void frmContactEditor::DeleteHomeEmail( wxCommandEvent& event )
1313     long longSelected = -1;
1314     int intSelectedData = 0;
1315     
1316     if (!GetSelectedItem(lboHomeEmails,
1317                          &longSelected,
1318                          &intSelectedData)){
1319         return;
1320     }
1321     
1322     lboHomeEmails->DeleteItem(longSelected);
1323     
1324     DeleteMapData(intSelectedData, &HomeEmailList,
1325                   &HomeEmailListAltID, &HomeEmailListPID,
1326                   &HomeEmailListType, &HomeEmailListTokens,
1327                   &HomeEmailListPref);
1331 void frmContactEditor::AddHomeIM( wxCommandEvent& event )
1333     int intResult = 0;
1334     
1335     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
1336     frameCEIM->SetEditorMode(FALSE, CE_HOME);
1337     intResult = GetLastInt(&HomeIMList);
1338     frameCEIM->SetupPointers(&HomeIMList,
1339                              &HomeIMListAltID,
1340                              &HomeIMListPID,
1341                              &HomeIMListType,
1342                              &HomeIMListTokens,
1343                              &HomeIMListMediatype,
1344                              &HomeIMListPref,
1345                              lboHomeIM,
1346                              (intValueSeek));
1347     frameCEIM->ShowModal();
1348     delete frameCEIM;
1349     frameCEIM = NULL;
1352 void frmContactEditor::ModifyHomeIM( wxCommandEvent& event )
1354     long longSelected = -1;
1355     int intSelectedData = 0;
1356     
1357     if (!GetSelectedItem(lboHomeIM,
1358                          &longSelected,
1359                          &intSelectedData)){
1360         return;
1361     }
1362     
1363     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
1364     frameCEIM->SetupPointers(&HomeIMList,
1365                              &HomeIMListAltID,
1366                              &HomeIMListPID,
1367                              &HomeIMListType,
1368                              &HomeIMListTokens,
1369                              &HomeIMListMediatype,
1370                              &HomeIMListPref,
1371                              lboHomeIM,
1372                              intSelectedData);
1373     frameCEIM->SetEditorMode(TRUE, CE_HOME);
1374     frameCEIM->ShowModal();
1375     delete frameCEIM;
1376     frameCEIM = NULL;
1379 void frmContactEditor::DeleteHomeIM( wxCommandEvent& event )
1381     long longSelected = -1;
1382     int intSelectedData = 0;
1383     
1384     if (!GetSelectedItem(lboHomeIM,
1385                          &longSelected,
1386                          &intSelectedData)){
1387         return;
1388     }
1389     
1390     lboHomeIM->DeleteItem(longSelected);
1391     
1392     DeleteMapData(intSelectedData, &HomeIMList,
1393                   &HomeIMListAltID, &HomeIMListPID,
1394                   &HomeIMListType, &HomeIMListTokens,
1395                   &HomeIMListMediatype, &HomeIMListPref);
1396     
1399 void frmContactEditor::AddHomeTelephone( wxCommandEvent& event )
1401     int intResult = 0;
1402     
1403     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
1404     frameCETel->SetEditorMode(FALSE, CE_HOME);
1405     intResult = GetLastInt(&HomeTelephoneList);
1406     frameCETel->SetupPointers(&HomeTelephoneList,
1407                               &HomeTelephoneListAltID,
1408                               &HomeTelephoneListPID,
1409                               &HomeTelephoneListType,
1410                               &HomeTelephoneListTokens,
1411                               &HomeTelephoneListPref,
1412                               lboHomeTelephone,
1413                               (intValueSeek));
1414     frameCETel->ShowModal();
1415     delete frameCETel;
1416     frameCETel = NULL;
1419 void frmContactEditor::ModifyHomeTelephone( wxCommandEvent& event )
1421     long longSelected = -1;
1422     int intSelectedData = 0;
1423     
1424     if (!GetSelectedItem(lboHomeTelephone,
1425                          &longSelected,
1426                          &intSelectedData)){
1427         return;
1428     }
1429     
1430     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
1431     frameCETel->SetupPointers(&HomeTelephoneList,
1432                               &HomeTelephoneListAltID,
1433                               &HomeTelephoneListPID,
1434                               &HomeTelephoneListType,
1435                               &HomeTelephoneListTokens,
1436                               &HomeTelephoneListPref,
1437                               lboHomeTelephone,
1438                               intSelectedData);
1439     frameCETel->SetEditorMode(TRUE, CE_HOME);
1440     frameCETel->ShowModal();
1441     delete frameCETel;
1442     frameCETel = NULL;
1445 void frmContactEditor::DeleteHomeTelephone( wxCommandEvent& event )
1447     long longSelected = -1;
1448     int intSelectedData = 0;
1449     
1450     if (!GetSelectedItem(lboHomeTelephone,
1451                          &longSelected,
1452                          &intSelectedData)){
1453         return;
1454     }
1455     
1456     lboHomeTelephone->DeleteItem(longSelected);
1457     
1458     DeleteMapData(intSelectedData, &HomeTelephoneList,
1459                   &HomeTelephoneListAltID, &HomeTelephoneListPID,
1460                   &HomeTelephoneListType, &HomeTelephoneListTokens,
1461                   &HomeTelephoneListPref);
1462     
1465 void frmContactEditor::AddHomeLanguage( wxCommandEvent& event )
1467     int intResult = 0;
1468     
1469     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
1470     frameCELang->SetEditorMode(FALSE, CE_HOME);
1471     intResult = GetLastInt(&HomeLanguageList);
1472     frameCELang->SetupPointers(&HomeLanguageList,
1473                                &HomeLanguageListAltID,
1474                                &HomeLanguageListPID,
1475                                &HomeLanguageListType,
1476                                &HomeLanguageListTokens,
1477                                &HomeLanguageListPref,
1478                                lboHomeLanguages,
1479                                (intValueSeek));
1480     frameCELang->ShowModal();
1481     delete frameCELang;
1482     frameCELang = NULL;
1485 void frmContactEditor::ModifyHomeLanguage( wxCommandEvent& event )
1487     long longSelected = -1;
1488     int intSelectedData = 0;
1489     
1490     if (!GetSelectedItem(lboHomeLanguages,
1491                          &longSelected,
1492                          &intSelectedData)){
1493         return;
1494     }
1495     
1496     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
1497     frameCELang->SetupPointers(&HomeLanguageList,
1498                                &HomeLanguageListAltID,
1499                                &HomeLanguageListPID,
1500                                &HomeLanguageListType,
1501                                &HomeLanguageListTokens,
1502                                &HomeLanguageListPref,
1503                                lboHomeLanguages,
1504                                intSelectedData);
1505     frameCELang->SetEditorMode(TRUE, CE_HOME);
1506     frameCELang->ShowModal();
1507     delete frameCELang;
1508     frameCELang = NULL;
1511 void frmContactEditor::DeleteHomeLanguage( wxCommandEvent& event )
1513     long longSelected = -1;
1514     int intSelectedData = 0;
1515     
1516     if (!GetSelectedItem(lboHomeLanguages,
1517                          &longSelected,
1518                          &intSelectedData)){
1519         return;
1520     }
1521     
1522     lboHomeLanguages->DeleteItem(longSelected);
1523     
1524     DeleteMapData(intSelectedData, &HomeLanguageList,
1525                   &HomeLanguageListAltID, &HomeLanguageListPID,
1526                   &HomeLanguageListType, &HomeLanguageListTokens,
1527                   &HomeLanguageListPref);
1528     
1531 void frmContactEditor::AddHomeTimezone( wxCommandEvent& event )
1533     int intResult = 0;
1534     
1535     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
1536     frameCETZ->SetEditorMode(FALSE, CE_HOME);
1537     intResult = GetLastInt(&HomeTZList);
1538     frameCETZ->SetupPointers(&HomeTZList,
1539                              &HomeTZListAltID,
1540                              &HomeTZListPID,
1541                              &HomeTZListType,
1542                              &HomeTZListTokens,
1543                              &HomeTZListMediatype,
1544                              &HomeTZListPref,
1545                              lboHomeTimezones,
1546                              (intValueSeek));
1547     frameCETZ->ShowModal();
1548     delete frameCETZ;
1549     frameCETZ = NULL;
1552 void frmContactEditor::ModifyHomeTimezone( wxCommandEvent& event )
1554     long longSelected = -1;
1555     int intSelectedData = 0;
1556     
1557     if (!GetSelectedItem(lboHomeTimezones,
1558                          &longSelected,
1559                          &intSelectedData)){
1560         return;
1561     }
1562     
1563     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
1564     frameCETZ->SetupPointers(&HomeTZList,
1565                              &HomeTZListAltID,
1566                              &HomeTZListPID,
1567                              &HomeTZListType,
1568                              &HomeTZListTokens,
1569                              &HomeTZListMediatype,
1570                              &HomeTZListPref,
1571                              lboHomeTimezones,
1572                              intSelectedData);
1573     frameCETZ->SetEditorMode(TRUE, CE_HOME);
1574     frameCETZ->ShowModal();
1575     delete frameCETZ;
1576     frameCETZ = NULL;
1579 void frmContactEditor::DeleteHomeTimezone( wxCommandEvent& event )
1581     long longSelected = -1;
1582     int intSelectedData = 0;
1583     
1584     if (!GetSelectedItem(lboHomeTimezones,
1585                          &longSelected,
1586                          &intSelectedData)){
1587         return;
1588     }
1589     
1590     lboHomeTimezones->DeleteItem(longSelected);
1591     
1592     DeleteMapData(intSelectedData, &HomeTZList,
1593                   &HomeTZListAltID, &HomeTZListPID,
1594                   &HomeTZListType, &HomeTZListTokens,
1595                   &HomeTZListMediatype, &HomeTZListPref);
1596     
1599 void frmContactEditor::AddHomeGeoposition( wxCommandEvent& event )
1601     int intResult = 0;
1602     
1603     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
1604     frameCEGeo->SetEditorMode(FALSE, CE_HOME);
1605     intResult = GetLastInt(&HomeGeographyList);
1606     frameCEGeo->SetupPointers(&HomeGeographyList,
1607                               &HomeGeographyListAltID,
1608                               &HomeGeographyListPID,
1609                               &HomeGeographyListType,
1610                               &HomeGeographyListTokens,
1611                               &HomeGeographyListMediatype,
1612                               &HomeGeographyListPref,
1613                               lboHomeGeoposition,
1614                               (intValueSeek));
1615     frameCEGeo->ShowModal();
1616     delete frameCEGeo;
1617     frameCEGeo = NULL;
1620 void frmContactEditor::ModifyHomeGeoposition( wxCommandEvent& event )
1622     long longSelected = -1;
1623     int intSelectedData = 0;
1624     
1625     if (!GetSelectedItem(lboHomeGeoposition,
1626                          &longSelected,
1627                          &intSelectedData)){
1628         return;
1629     }
1630     
1631     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
1632     frameCEGeo->SetupPointers(&HomeGeographyList,
1633                               &HomeGeographyListAltID,
1634                               &HomeGeographyListPID,
1635                               &HomeGeographyListType,
1636                               &HomeGeographyListTokens,
1637                               &HomeGeographyListMediatype,
1638                               &HomeGeographyListPref,
1639                               lboHomeGeoposition,
1640                               intSelectedData);
1641     frameCEGeo->SetEditorMode(TRUE, CE_HOME);
1642     frameCEGeo->ShowModal();
1643     delete frameCEGeo;
1644     frameCEGeo = NULL;
1647 void frmContactEditor::DeleteHomeGeoposition( wxCommandEvent& event )
1649     long longSelected = -1;
1650     int intSelectedData = 0;
1651     
1652     if (!GetSelectedItem(lboHomeGeoposition,
1653                          &longSelected,
1654                          &intSelectedData)){
1655         return;
1656     }
1657     
1658     lboHomeGeoposition->DeleteItem(longSelected);
1659     
1660     DeleteMapData(intSelectedData, &HomeGeographyList,
1661                   &HomeGeographyListAltID, &HomeGeographyListPID,
1662                   &HomeGeographyListType, &HomeGeographyListTokens,
1663                   &HomeGeographyListMediatype, &HomeGeographyListPref);
1664     
1667 void frmContactEditor::AddHomeWebsite( wxCommandEvent& event )
1669     int intResult = 0;
1670     
1671     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
1672     frameCEWeb->SetEditorMode(FALSE, CE_HOME);
1673     intResult = GetLastInt(&HomeWebsiteList);
1674     frameCEWeb->SetupPointers(&HomeWebsiteList,
1675                               &HomeWebsiteListAltID,
1676                               &HomeWebsiteListPID,
1677                               &HomeWebsiteListType,
1678                               &HomeWebsiteListTokens,
1679                               &HomeWebsiteListMediatype,
1680                               &HomeWebsiteListPref,
1681                               lboHomeWebsites,
1682                               (intValueSeek));
1683     frameCEWeb->ShowModal();
1684     delete frameCEWeb;
1685     frameCEWeb = NULL;
1688 void frmContactEditor::ModifyHomeWebsite( wxCommandEvent& event )
1690     long longSelected = -1;
1691     int intSelectedData = 0;
1692     
1693     if (!GetSelectedItem(lboHomeWebsites,
1694                          &longSelected,
1695                          &intSelectedData)){
1696         return;
1697     }
1698     
1699     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
1700     frameCEWeb->SetupPointers(&HomeWebsiteList,
1701                               &HomeWebsiteListAltID,
1702                               &HomeWebsiteListPID,
1703                               &HomeWebsiteListType,
1704                               &HomeWebsiteListTokens,
1705                               &HomeWebsiteListMediatype,
1706                               &HomeWebsiteListPref,
1707                               lboHomeWebsites,
1708                               intSelectedData);
1709     frameCEWeb->SetEditorMode(TRUE, CE_HOME);
1710     frameCEWeb->ShowModal();
1711     delete frameCEWeb;
1712     frameCEWeb = NULL;
1715 void frmContactEditor::DeleteHomeWebsite( wxCommandEvent& event )
1717     long longSelected = -1;
1718     int intSelectedData = 0;
1719     
1720     if (!GetSelectedItem(lboHomeWebsites,
1721                          &longSelected,
1722                          &intSelectedData)){
1723         return;
1724     }
1725     
1726     lboHomeWebsites->DeleteItem(longSelected);
1727     
1728     DeleteMapData(intSelectedData, &HomeWebsiteList,
1729                   &HomeWebsiteListAltID, &HomeWebsiteListPID,
1730                   &HomeWebsiteListType, &HomeWebsiteListTokens,
1731                   &HomeWebsiteListMediatype, &HomeWebsiteListPref);
1732     
1735 void frmContactEditor::AddHomeTitle( wxCommandEvent& event )
1737     int intResult = 0;
1738     
1739     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
1740     frameCETitle->SetEditorMode(FALSE, CE_HOME);
1741     intResult = GetLastInt(&HomeTitleList);
1742     frameCETitle->SetupPointers(&HomeTitleList,
1743                                 &HomeTitleListLanguage,
1744                                 &HomeTitleListAltID,
1745                                 &HomeTitleListPID,
1746                                 &HomeTitleListType,
1747                                 &HomeTitleListTokens,
1748                                 &HomeTitleListPref,
1749                                 lboHomeTitles,
1750                                 (intValueSeek));
1751     frameCETitle->ShowModal();
1752     delete frameCETitle;
1753     frameCETitle = NULL;
1756 void frmContactEditor::ModifyHomeTitle( wxCommandEvent& event )
1758     long longSelected = -1;
1759     int intSelectedData = 0;
1760     
1761     if (!GetSelectedItem(lboHomeTitles,
1762                          &longSelected,
1763                          &intSelectedData)){
1764         return;
1765     }
1766     
1767     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
1768     frameCETitle->SetupPointers(&HomeTitleList,
1769                                 &HomeTitleListLanguage,
1770                                 &HomeTitleListAltID,
1771                                 &HomeTitleListPID,
1772                                 &HomeTitleListType,
1773                                 &HomeTitleListTokens,
1774                                 &HomeTitleListPref,
1775                                 lboHomeTitles,
1776                                 intSelectedData);
1777     frameCETitle->SetEditorMode(TRUE, CE_HOME);
1778     frameCETitle->ShowModal();
1779     delete frameCETitle;
1780     frameCETitle = NULL;
1783 void frmContactEditor::DeleteHomeTitle( wxCommandEvent& event )
1785     long longSelected = -1;
1786     int intSelectedData = 0;
1787     
1788     if (!GetSelectedItem(lboHomeTitles,
1789                          &longSelected,
1790                          &intSelectedData)){
1791         return;
1792     }
1793     
1794     lboHomeTitles->DeleteItem(longSelected);
1795     
1796     DeleteMapData(intSelectedData, &HomeTitleList,
1797                   &HomeTitleListLanguage, &HomeTitleListAltID,
1798                   &HomeTitleListPID, &HomeTitleListType,
1799                   &HomeTitleListTokens, &HomeTitleListPref);
1800     
1803 void frmContactEditor::AddHomeRole( wxCommandEvent& event )
1805     int intResult = 0;
1806     
1807     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
1808     frameCERole->SetEditorMode(FALSE, CE_HOME);
1809     intResult = GetLastInt(&HomeRoleList);
1810     frameCERole->SetupPointers(&HomeRoleList,
1811                                &HomeRoleListLanguage,
1812                                &HomeRoleListAltID,
1813                                &HomeRoleListPID,
1814                                &HomeRoleListType,
1815                                &HomeRoleListTokens,
1816                                &HomeRoleListPref,
1817                                lboHomeRoles,
1818                                (intValueSeek));
1819     frameCERole->ShowModal();
1820     delete frameCERole;
1821     frameCERole = NULL;
1824 void frmContactEditor::ModifyHomeRole( wxCommandEvent& event )
1826     long longSelected = -1;
1827     int intSelectedData = 0;
1828     
1829     if (!GetSelectedItem(lboHomeRoles,
1830                          &longSelected,
1831                          &intSelectedData)){
1832         return;
1833     }
1834     
1835     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
1836     frameCERole->SetupPointers(&HomeRoleList,
1837                                &HomeRoleListLanguage,
1838                                &HomeRoleListAltID,
1839                                &HomeRoleListPID,
1840                                &HomeRoleListType,
1841                                &HomeRoleListTokens,
1842                                &HomeRoleListPref,
1843                                lboHomeRoles,
1844                                intSelectedData);
1845     frameCERole->SetEditorMode(TRUE, CE_HOME);
1846     frameCERole->ShowModal();
1847     delete frameCERole;
1848     frameCERole = NULL;
1851 void frmContactEditor::DeleteHomeRole( wxCommandEvent& event )
1853     long longSelected = -1;
1854     int intSelectedData = 0;
1855     
1856     if (!GetSelectedItem(lboHomeRoles,
1857                          &longSelected,
1858                          &intSelectedData)){
1859         return;
1860     }
1861     
1862     lboHomeRoles->DeleteItem(longSelected);
1863     
1864     DeleteMapData(intSelectedData, &HomeRoleList,
1865                   &HomeRoleListLanguage, &HomeRoleListAltID,
1866                   &HomeRoleListPID, &HomeRoleListType,
1867                   &HomeRoleListTokens, &HomeRoleListPref);
1868     
1871 void frmContactEditor::AddHomeOrganisation( wxCommandEvent& event )
1873     int intResult = 0;
1874     
1875     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
1876     frameCEOrg->SetEditorMode(FALSE, CE_HOME);
1877     intResult = GetLastInt(&HomeOrganisationsList);
1878     frameCEOrg->SetupPointers(&HomeOrganisationsList,
1879                               &HomeOrganisationsListLanguage,
1880                               &HomeOrganisationsListSortAs,
1881                               &HomeOrganisationsListAltID,
1882                               &HomeOrganisationsListPID,
1883                               &HomeOrganisationsListType,
1884                               &HomeOrganisationsListTokens,
1885                               &HomeOrganisationsListPref,
1886                               lboHomeOrganisations,
1887                               (intValueSeek));
1888     frameCEOrg->ShowModal();
1889     delete frameCEOrg;
1890     frameCEOrg = NULL;
1893 void frmContactEditor::ModifyHomeOrganisation( wxCommandEvent& event )
1895     long longSelected = -1;
1896     int intSelectedData = 0;
1897     
1898     if (!GetSelectedItem(lboHomeOrganisations,
1899                          &longSelected,
1900                          &intSelectedData)){
1901         return;
1902     }
1903     
1904     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
1905     frameCEOrg->SetupPointers(&HomeOrganisationsList,
1906                               &HomeOrganisationsListLanguage,
1907                               &HomeOrganisationsListSortAs,
1908                               &HomeOrganisationsListAltID,
1909                               &HomeOrganisationsListPID,
1910                               &HomeOrganisationsListType,
1911                               &HomeOrganisationsListTokens,
1912                               &HomeOrganisationsListPref,
1913                               lboHomeOrganisations,
1914                               intSelectedData);
1915     frameCEOrg->SetEditorMode(TRUE, CE_HOME);
1916     frameCEOrg->ShowModal();
1917     delete frameCEOrg;
1918     frameCEOrg = NULL;
1921 void frmContactEditor::DeleteHomeOrganisation( wxCommandEvent& event )
1923     long longSelected = -1;
1924     int intSelectedData = 0;
1925     
1926     if (!GetSelectedItem(lboHomeOrganisations,
1927                          &longSelected,
1928                          &intSelectedData)){
1929         return;
1930     }
1931     
1932     lboHomeOrganisations->DeleteItem(longSelected);
1933     
1934     DeleteMapData(intSelectedData, &HomeOrganisationsList,
1935                   &HomeOrganisationsListLanguage, &HomeOrganisationsListSortAs,
1936                   &HomeOrganisationsListAltID, &HomeOrganisationsListPID,
1937                   &HomeOrganisationsListType, &HomeOrganisationsListTokens,
1938                   &HomeOrganisationsListPref);
1939     
1942 void frmContactEditor::AddHomeNote( wxCommandEvent& event )
1944     int intResult = 0;
1945     
1946     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1947     frameCENote->SetEditorMode(FALSE, CE_HOME);
1948     intResult = GetLastInt(&HomeNoteList);
1949     frameCENote->SetupPointers(&HomeNoteList,
1950                                &HomeNoteListLanguage,
1951                                &HomeNoteListAltID,
1952                                &HomeNoteListPID,
1953                                &HomeNoteListType,
1954                                &HomeNoteListTokens,
1955                                &HomeNoteListPref,
1956                                lboHomeNotes,
1957                                (intValueSeek));
1958     frameCENote->ShowModal();
1959     delete frameCENote;
1960     frameCENote = NULL;
1963 void frmContactEditor::ModifyHomeNote( wxCommandEvent& event )
1965     long longSelected = -1;
1966     int intSelectedData = 0;
1967     
1968     if (!GetSelectedItem(lboHomeNotes,
1969                          &longSelected,
1970                          &intSelectedData)){
1971         return;
1972     }
1973     
1974     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1975     frameCENote->SetupPointers(&HomeNoteList,
1976                                &HomeNoteListLanguage,
1977                                &HomeNoteListAltID,
1978                                &HomeNoteListPID,
1979                                &HomeNoteListType,
1980                                &HomeNoteListTokens,
1981                                &HomeNoteListPref,
1982                                lboHomeNotes,
1983                                intSelectedData);
1984     frameCENote->SetEditorMode(TRUE, CE_HOME);
1985     frameCENote->ShowModal();
1986     delete frameCENote;
1987     frameCENote = NULL;
1990 void frmContactEditor::DeleteHomeNote( wxCommandEvent& event )
1992     long longSelected = -1;
1993     int intSelectedData = 0;
1994     
1995     if (!GetSelectedItem(lboHomeNotes,
1996                          &longSelected,
1997                          &intSelectedData)){
1998         return;
1999     }
2000     
2001     lboNotes->DeleteItem(longSelected);
2002     
2003     DeleteMapData(intSelectedData, &HomeNoteList,
2004                   &HomeNoteListLanguage, &HomeNoteListAltID,
2005                   &HomeNoteListPID, &HomeNoteListType,
2006                   &HomeNoteListTokens, &HomeNoteListPref);
2007     
2010 void frmContactEditor::AddBusinessNickname( wxCommandEvent& event )
2012     int intResult = 0;
2013     
2014     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
2015     frameCENickname->SetEditorMode(FALSE, CE_WORK);
2016     intResult = GetLastInt(&BusinessNicknamesList);
2017     frameCENickname->SetupPointers(&BusinessNicknamesList,
2018                                    &BusinessNicknamesListAltID,
2019                                    &BusinessNicknamesListPID,
2020                                    &BusinessNicknamesListType,
2021                                    &BusinessNicknamesListLanguage,
2022                                    &BusinessNicknamesListTokens,
2023                                    &BusinessNicknamesListPref,
2024                                    lboBusinessNicknames,
2025                                    (intValueSeek));
2026     frameCENickname->ShowModal();
2027     delete frameCENickname;
2028     frameCENickname = NULL;
2031 void frmContactEditor::ModifyBusinessNickname( wxCommandEvent& event )
2033     long longSelected = -1;
2034     int intSelectedData = 0;
2035     
2036     if (!GetSelectedItem(lboBusinessNicknames,
2037                          &longSelected,
2038                          &intSelectedData)){
2039         return;
2040     }
2041     
2042     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
2043     frameCENickname->SetupPointers(&BusinessNicknamesList,
2044                                    &BusinessNicknamesListAltID,
2045                                    &BusinessNicknamesListPID,
2046                                    &BusinessNicknamesListType,
2047                                    &BusinessNicknamesListLanguage,
2048                                    &BusinessNicknamesListTokens,
2049                                    &BusinessNicknamesListPref,
2050                                    lboBusinessNicknames,
2051                                    intSelectedData);
2052     frameCENickname->SetEditorMode(TRUE, CE_WORK);
2053     frameCENickname->ShowModal();
2054     delete frameCENickname;
2055     frameCENickname = NULL;
2058 void frmContactEditor::DeleteBusinessNickname( wxCommandEvent& event )
2060     long longSelected = -1;
2061     int intSelectedData = 0;
2062     
2063     if (!GetSelectedItem(lboBusinessNicknames,
2064                          &longSelected,
2065                          &intSelectedData)){
2066         return;
2067     }
2068     
2069     lboBusinessNicknames->DeleteItem(longSelected);
2070     
2071     DeleteMapData(intSelectedData,
2072                   &BusinessNicknamesList,
2073                   &BusinessNicknamesListLanguage,
2074                   &BusinessNicknamesListAltID,
2075                   &BusinessNicknamesListPID,
2076                   &BusinessNicknamesListTokens,
2077                   &BusinessNicknamesListType,
2078                   &BusinessNicknamesListPref);
2081 void frmContactEditor::AddBusinessAddress( wxCommandEvent& event )
2083     int intResult = 0;
2084     
2085     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
2086     frameCEAddress->SetEditorMode(FALSE, CE_WORK);
2087     intResult = GetLastInt(&BusinessAddressList);
2088     frameCEAddress->SetupPointers(&BusinessAddressList,
2089                                   &BusinessAddressListTown,
2090                                   &BusinessAddressListCounty,
2091                                   &BusinessAddressListPostCode,
2092                                   &BusinessAddressListCountry,
2093                                   &BusinessAddressListLabel,
2094                                   &BusinessAddressListLang,
2095                                   &BusinessAddressListAltID,
2096                                   &BusinessAddressListPID,
2097                                   &BusinessAddressListTokens,
2098                                   &BusinessAddressListGeo,
2099                                   &BusinessAddressListTimezone,
2100                                   &BusinessAddressListType,
2101                                   &BusinessAddressListMediatype,
2102                                   &BusinessAddressListPref,
2103                                   lboBusinessAddresses,
2104                                   (intValueSeek));
2105     frameCEAddress->ShowModal();
2106     delete frameCEAddress;
2107     frameCEAddress = NULL;
2110 void frmContactEditor::ModifyBusinessAddress( wxCommandEvent& event )
2112     long longSelected = -1;
2113     int intSelectedData = 0;
2114     
2115     if (!GetSelectedItem(lboBusinessAddresses,
2116                          &longSelected,
2117                          &intSelectedData)){
2118         return;
2119     }
2120     
2121     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
2122     frameCEAddress->SetupPointers(&BusinessAddressList,
2123                                   &BusinessAddressListTown,
2124                                   &BusinessAddressListCounty,
2125                                   &BusinessAddressListPostCode,
2126                                   &BusinessAddressListCountry,
2127                                   &BusinessAddressListLabel,
2128                                   &BusinessAddressListLang,
2129                                   &BusinessAddressListAltID,
2130                                   &BusinessAddressListPID,
2131                                   &BusinessAddressListTokens,
2132                                   &BusinessAddressListGeo,
2133                                   &BusinessAddressListTimezone,
2134                                   &BusinessAddressListType,
2135                                   &BusinessAddressListMediatype,
2136                                   &BusinessAddressListPref,
2137                                   lboBusinessAddresses,
2138                                   intSelectedData);
2139     frameCEAddress->SetEditorMode(TRUE, CE_WORK);
2140     frameCEAddress->ShowModal();
2141     delete frameCEAddress;
2142     frameCEAddress = NULL;
2145 void frmContactEditor::DeleteBusinessAddress( wxCommandEvent& event )
2147     long longSelected = -1;
2148     int intSelectedData = 0;
2149     
2150     if (!GetSelectedItem(lboBusinessAddresses,
2151                          &longSelected,
2152                          &intSelectedData)){
2153         return;
2154     }
2155     
2156     lboBusinessAddresses->DeleteItem(longSelected);
2157     DeleteMapData(intSelectedData, &BusinessAddressList,
2158                   &BusinessAddressListTown, &BusinessAddressListCounty,
2159                   &BusinessAddressListPostCode, &BusinessAddressListCountry,
2160                   &BusinessAddressList, &BusinessAddressListLabel,
2161                   &BusinessAddressListLang, &BusinessAddressListAltID,
2162                   &BusinessAddressListPID, &BusinessAddressListTokens,
2163                   &BusinessAddressListGeo, &BusinessAddressListTimezone,
2164                   &BusinessAddressListType, &BusinessAddressListMediatype,
2165                   &BusinessAddressListPref);
2166     
2169 void frmContactEditor::AddBusinessEmail( wxCommandEvent& event )
2171     int intResult = 0;
2172     
2173     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
2174     frameCEEmail->SetEditorMode(FALSE, CE_WORK);
2175     intResult = GetLastInt(&BusinessAddressList);
2176     frameCEEmail->SetupPointers(&BusinessEmailList,
2177                                 &BusinessEmailListAltID,
2178                                 &BusinessEmailListPID,
2179                                 &BusinessEmailListType,
2180                                 &BusinessEmailListTokens,
2181                                 &BusinessEmailListPref,
2182                                 lboBusinessEmail,
2183                                 (intValueSeek));
2184     frameCEEmail->ShowModal();
2185     delete frameCEEmail;
2186     frameCEEmail = NULL;
2189 void frmContactEditor::ModifyBusinessEmail( wxCommandEvent& event )
2191     long longSelected = -1;
2192     int intSelectedData = 0;
2193     
2194     if (!GetSelectedItem(lboBusinessEmail,
2195                          &longSelected,
2196                          &intSelectedData)){
2197         return;
2198     }
2199     
2200     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
2201     frameCEEmail->SetupPointers(&BusinessEmailList,
2202                                 &BusinessEmailListAltID,
2203                                 &BusinessEmailListPID,
2204                                 &BusinessEmailListType,
2205                                 &BusinessEmailListTokens,
2206                                 &BusinessEmailListPref,
2207                                 lboBusinessEmail,
2208                                 intSelectedData);
2209     frameCEEmail->SetEditorMode(TRUE, CE_WORK);
2210     frameCEEmail->ShowModal();
2211     delete frameCEEmail;
2212     frameCEEmail = NULL;
2215 void frmContactEditor::DeleteBusinessEmail( wxCommandEvent& event )
2217     long longSelected = -1;
2218     int intSelectedData = 0;
2219     
2220     if (!GetSelectedItem(lboBusinessEmail,
2221                          &longSelected,
2222                          &intSelectedData)){
2223         return;
2224     }
2225     
2226     lboBusinessEmail->DeleteItem(longSelected);
2227     
2228     DeleteMapData(intSelectedData, &BusinessEmailList,
2229                   &BusinessEmailListAltID, &BusinessEmailListPID,
2230                   &BusinessEmailListType, &BusinessEmailListTokens,
2231                   &BusinessEmailListPref);
2232     
2235 void frmContactEditor::AddBusinessIM( wxCommandEvent& event )
2237     int intResult = 0;
2238     
2239     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
2240     frameCEIM->SetEditorMode(FALSE, CE_WORK);
2241     intResult = GetLastInt(&BusinessIMList);
2242     frameCEIM->SetupPointers(&BusinessIMList,
2243                              &BusinessIMListAltID,
2244                              &BusinessIMListPID,
2245                              &BusinessIMListType,
2246                              &BusinessIMListTokens,
2247                              &BusinessIMListMediatype,
2248                              &BusinessIMListPref,
2249                              lboBusinessIM,
2250                              (intValueSeek));
2251     frameCEIM->ShowModal();
2252     delete frameCEIM;
2253     frameCEIM = NULL;
2256 void frmContactEditor::ModifyBusinessIM( wxCommandEvent& event )
2258     long longSelected = -1;
2259     int intSelectedData = 0;
2260     
2261     if (!GetSelectedItem(lboBusinessIM,
2262                          &longSelected,
2263                          &intSelectedData)){
2264         return;
2265     }
2266     
2267     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
2268     frameCEIM->SetupPointers(&BusinessIMList,
2269                              &BusinessIMListAltID,
2270                              &BusinessIMListPID,
2271                              &BusinessIMListType,
2272                              &BusinessIMListTokens,
2273                              &BusinessIMListMediatype,
2274                              &BusinessIMListPref,
2275                              lboBusinessIM,
2276                              intSelectedData);
2277     frameCEIM->SetEditorMode(TRUE, CE_WORK);
2278     frameCEIM->ShowModal();
2279     delete frameCEIM;
2280     frameCEIM = NULL;
2283 void frmContactEditor::DeleteBusinessIM( wxCommandEvent& event )
2285     long longSelected = -1;
2286     int intSelectedData = 0;
2287     
2288     if (!GetSelectedItem(lboBusinessIM,
2289                          &longSelected,
2290                          &intSelectedData)){
2291         return;
2292     }
2293     
2294     lboBusinessIM->DeleteItem(longSelected);
2295     
2296     DeleteMapData(intSelectedData, &BusinessIMList,
2297                   &BusinessIMListAltID, &BusinessIMListPID,
2298                   &BusinessIMListType, &BusinessIMListTokens,
2299                   &BusinessIMListMediatype, &BusinessIMListPref);
2300     
2303 void frmContactEditor::AddBusinessTelephone( wxCommandEvent& event )
2305     int intResult = 0;
2306     
2307     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
2308     frameCETel->SetEditorMode(FALSE, CE_WORK);
2309     intResult = GetLastInt(&BusinessTelephoneList);
2310     frameCETel->SetupPointers(&BusinessTelephoneList,
2311                               &BusinessTelephoneListAltID,
2312                               &BusinessTelephoneListPID,
2313                               &BusinessTelephoneListType,
2314                               &BusinessTelephoneListTokens,
2315                               &BusinessTelephoneListPref,
2316                               lboBusinessTelephone,
2317                               (intValueSeek));
2318     frameCETel->ShowModal();
2319     delete frameCETel;
2320     frameCETel = NULL;
2323 void frmContactEditor::ModifyBusinessTelephone( wxCommandEvent& event )
2325     long longSelected = -1;
2326     int intSelectedData = 0;
2327     
2328     if (!GetSelectedItem(lboBusinessTelephone,
2329                          &longSelected,
2330                          &intSelectedData)){
2331         return;
2332     }
2333     
2334     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
2335     frameCETel->SetupPointers(&BusinessTelephoneList,
2336                               &BusinessTelephoneListAltID,
2337                               &BusinessTelephoneListPID,
2338                               &BusinessTelephoneListType,
2339                               &BusinessTelephoneListTokens,
2340                               &BusinessTelephoneListPref,
2341                               lboBusinessTelephone,
2342                               intSelectedData);
2343     frameCETel->SetEditorMode(TRUE, CE_WORK);
2344     frameCETel->ShowModal();
2345     delete frameCETel;
2346     frameCETel = NULL;
2349 void frmContactEditor::DeleteBusinessTelephone( wxCommandEvent& event )
2351     long longSelected = -1;
2352     int intSelectedData = 0;
2353     
2354     if (!GetSelectedItem(lboBusinessTelephone,
2355                          &longSelected,
2356                          &intSelectedData)){
2357         return;
2358     }
2359     
2360     lboBusinessTelephone->DeleteItem(longSelected);
2361     
2362     DeleteMapData(intSelectedData, &BusinessTelephoneList,
2363                   &BusinessTelephoneListAltID, &BusinessTelephoneListPID,
2364                   &BusinessTelephoneListType, &BusinessTelephoneListTokens,
2365                   &BusinessTelephoneListPref);
2366     
2369 void frmContactEditor::AddBusinessLanguage( wxCommandEvent& event )
2371     int intResult = 0;
2372     
2373     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
2374     frameCELang->SetEditorMode(FALSE, CE_WORK);
2375     intResult = GetLastInt(&BusinessLanguageList);
2376     frameCELang->SetupPointers(&BusinessLanguageList,
2377                                &BusinessLanguageListAltID,
2378                                &BusinessLanguageListPID,
2379                                &BusinessLanguageListType,
2380                                &BusinessLanguageListTokens,
2381                                &BusinessLanguageListPref,
2382                                lboBusinessLanguages,
2383                                (intValueSeek));
2384     frameCELang->ShowModal();
2385     delete frameCELang;
2386     frameCELang = NULL;
2389 void frmContactEditor::ModifyBusinessLanguage( wxCommandEvent& event )
2391     long longSelected = -1;
2392     int intSelectedData = 0;
2393     
2394     if (!GetSelectedItem(lboBusinessLanguages,
2395                          &longSelected,
2396                          &intSelectedData)){
2397         return;
2398     }
2399     
2400     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
2401     frameCELang->SetupPointers(&BusinessLanguageList,
2402                                &BusinessLanguageListAltID,
2403                                &BusinessLanguageListPID,
2404                                &BusinessLanguageListType,
2405                                &BusinessLanguageListTokens,
2406                                &BusinessLanguageListPref,
2407                                lboBusinessLanguages,
2408                                intSelectedData);
2409     frameCELang->SetEditorMode(TRUE, CE_WORK);
2410     frameCELang->ShowModal();
2411     delete frameCELang;
2412     frameCELang = NULL;
2415 void frmContactEditor::DeleteBusinessLanguage( wxCommandEvent& event )
2417     long longSelected = -1;
2418     int intSelectedData = 0;
2419     
2420     if (!GetSelectedItem(lboBusinessLanguages,
2421                          &longSelected,
2422                          &intSelectedData)){
2423         return;
2424     }
2425     
2426     lboBusinessLanguages->DeleteItem(longSelected);
2427     
2428     DeleteMapData(intSelectedData, &BusinessLanguageList,
2429                   &BusinessLanguageListAltID, &BusinessLanguageListPID,
2430                   &BusinessLanguageListType, &BusinessLanguageListTokens,
2431                   &BusinessLanguageListPref);
2432     
2435 void frmContactEditor::AddBusinessTimezone( wxCommandEvent& event )
2437     int intResult = 0;
2438     
2439     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
2440     frameCETZ->SetEditorMode(FALSE, CE_WORK);
2441     intResult = GetLastInt(&BusinessTZList);
2442     frameCETZ->SetupPointers(&BusinessTZList,
2443                              &BusinessTZListAltID,
2444                              &BusinessTZListPID,
2445                              &BusinessTZListType,
2446                              &BusinessTZListTokens,
2447                              &BusinessTZListMediatype,
2448                              &BusinessTZListPref,
2449                              lboBusinessTimezones,
2450                              (intValueSeek));
2451     frameCETZ->ShowModal();
2452     delete frameCETZ;
2453     frameCETZ = NULL;
2456 void frmContactEditor::ModifyBusinessTimezone( wxCommandEvent& event )
2458     long longSelected = -1;
2459     int intSelectedData = 0;
2460     
2461     if (!GetSelectedItem(lboBusinessTimezones,
2462                          &longSelected,
2463                          &intSelectedData)){
2464         return;
2465     }
2466     
2467     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
2468     frameCETZ->SetupPointers(&BusinessTZList,
2469                              &BusinessTZListAltID,
2470                              &BusinessTZListPID,
2471                              &BusinessTZListType,
2472                              &BusinessTZListTokens,
2473                              &BusinessTZListMediatype,
2474                              &BusinessTZListPref,
2475                              lboBusinessTimezones,
2476                              intSelectedData);
2477     frameCETZ->SetEditorMode(TRUE, CE_WORK);
2478     frameCETZ->ShowModal();
2479     delete frameCETZ;
2480     frameCETZ = NULL;
2483 void frmContactEditor::DeleteBusinessTimezone( wxCommandEvent& event )
2485     long longSelected = -1;
2486     int intSelectedData = 0;
2487     
2488     if (!GetSelectedItem(lboBusinessTimezones,
2489                          &longSelected,
2490                          &intSelectedData)){
2491         return;
2492     }
2493     
2494     lboBusinessTimezones->DeleteItem(longSelected);
2495     
2496     DeleteMapData(intSelectedData, &BusinessTZList,
2497                   &BusinessTZListAltID, &BusinessTZListPID,
2498                   &BusinessTZListType, &BusinessTZListTokens,
2499                   &BusinessTZListMediatype, &BusinessTZListPref);
2500     
2503 void frmContactEditor::AddBusinessGeoposition( wxCommandEvent& event )
2505     int intResult = 0;
2506     
2507     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
2508     frameCEGeo->SetEditorMode(FALSE, CE_WORK);
2509     intResult = GetLastInt(&BusinessGeographyList);
2510     frameCEGeo->SetupPointers(&BusinessGeographyList,
2511                               &BusinessGeographyListAltID,
2512                               &BusinessGeographyListPID,
2513                               &BusinessGeographyListType,
2514                               &BusinessGeographyListTokens,
2515                               &BusinessGeographyListMediatype,
2516                               &BusinessGeographyListPref,
2517                               lboBusinessGeoposition,
2518                               (intValueSeek));
2519     frameCEGeo->ShowModal();
2520     delete frameCEGeo;
2521     frameCEGeo = NULL;
2524 void frmContactEditor::ModifyBusinessGeoposition( wxCommandEvent& event )
2526     long longSelected = -1;
2527     int intSelectedData = 0;
2528     
2529     if (!GetSelectedItem(lboBusinessGeoposition,
2530                          &longSelected,
2531                          &intSelectedData)){
2532         return;
2533     }
2534     
2535     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
2536     frameCEGeo->SetupPointers(&BusinessGeographyList,
2537                               &BusinessGeographyListAltID,
2538                               &BusinessGeographyListPID,
2539                               &BusinessGeographyListType,
2540                               &BusinessGeographyListTokens,
2541                               &BusinessGeographyListMediatype,
2542                               &BusinessGeographyListPref,
2543                               lboBusinessGeoposition,
2544                               intSelectedData);
2545     frameCEGeo->SetEditorMode(TRUE, CE_WORK);
2546     frameCEGeo->ShowModal();
2547     delete frameCEGeo;
2548     frameCEGeo = NULL;
2551 void frmContactEditor::DeleteBusinessGeoposition( wxCommandEvent& event )
2553     long longSelected = -1;
2554     int intSelectedData = 0;
2555     
2556     if (!GetSelectedItem(lboBusinessGeoposition,
2557                          &longSelected,
2558                          &intSelectedData)){
2559         return;
2560     }
2561     
2562     lboBusinessGeoposition->DeleteItem(longSelected);
2563     
2564     DeleteMapData(intSelectedData, &BusinessGeographyList,
2565                   &BusinessGeographyListAltID, &BusinessGeographyListPID,
2566                   &BusinessGeographyListType, &BusinessGeographyListTokens,
2567                   &BusinessGeographyListMediatype, &BusinessGeographyListPref);
2568     
2571 void frmContactEditor::AddBusinessWebsite( wxCommandEvent& event )
2573     int intResult = 0;
2574     
2575     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
2576     frameCEWeb->SetEditorMode(FALSE, CE_WORK);
2577     intResult = GetLastInt(&BusinessWebsiteList);
2578     frameCEWeb->SetupPointers(&BusinessWebsiteList,
2579                               &BusinessWebsiteListAltID,
2580                               &BusinessWebsiteListPID,
2581                               &BusinessWebsiteListType,
2582                               &BusinessWebsiteListTokens,
2583                               &BusinessWebsiteListMediatype,
2584                               &BusinessWebsiteListPref,
2585                               lboBusinessWebsites,
2586                               (intValueSeek));
2587     frameCEWeb->ShowModal();
2588     delete frameCEWeb;
2589     frameCEWeb = NULL;
2592 void frmContactEditor::ModifyBusinessWebsite( wxCommandEvent& event )
2594     long longSelected = -1;
2595     int intSelectedData = 0;
2596     
2597     if (!GetSelectedItem(lboBusinessWebsites,
2598                          &longSelected,
2599                          &intSelectedData)){
2600         return;
2601     }
2602     
2603     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
2604     frameCEWeb->SetupPointers(&BusinessWebsiteList,
2605                               &BusinessWebsiteListAltID,
2606                               &BusinessWebsiteListPID,
2607                               &BusinessWebsiteListType,
2608                               &BusinessWebsiteListTokens,
2609                               &BusinessWebsiteListMediatype,
2610                               &BusinessWebsiteListPref,
2611                               lboBusinessWebsites,
2612                               intSelectedData);
2613     frameCEWeb->SetEditorMode(TRUE, CE_WORK);
2614     frameCEWeb->ShowModal();
2615     delete frameCEWeb;
2616     frameCEWeb = NULL;
2619 void frmContactEditor::DeleteBusinessWebsite( wxCommandEvent& event )
2621     long longSelected = -1;
2622     int intSelectedData = 0;
2623     
2624     if (!GetSelectedItem(lboBusinessWebsites,
2625                          &longSelected,
2626                          &intSelectedData)){
2627         return;
2628     }
2629     
2630     lboBusinessWebsites->DeleteItem(longSelected);
2631     
2632     DeleteMapData(intSelectedData, &BusinessWebsiteList,
2633                   &BusinessWebsiteListAltID, &BusinessWebsiteListPID,
2634                   &BusinessWebsiteListType, &BusinessWebsiteListTokens,
2635                   &BusinessWebsiteListMediatype, &BusinessWebsiteListPref);
2636     
2639 void frmContactEditor::AddBusinessTitle( wxCommandEvent& event )
2641     int intResult = 0;
2642     
2643     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
2644     frameCETitle->SetEditorMode(FALSE, CE_WORK);
2645     intResult = GetLastInt(&BusinessTitleList);
2646     frameCETitle->SetupPointers(&BusinessTitleList,
2647                                 &BusinessTitleListLanguage,
2648                                 &BusinessTitleListAltID,
2649                                 &BusinessTitleListPID,
2650                                 &BusinessTitleListType,
2651                                 &BusinessTitleListTokens,
2652                                 &BusinessTitleListPref,
2653                                 lboBusinessTitles,
2654                                 (intValueSeek));
2655     frameCETitle->ShowModal();
2656     delete frameCETitle;
2657     frameCETitle = NULL;
2660 void frmContactEditor::ModifyBusinessTitle( wxCommandEvent& event )
2662     long longSelected = -1;
2663     int intSelectedData = 0;
2664     
2665     if (!GetSelectedItem(lboBusinessTitles,
2666                          &longSelected,
2667                          &intSelectedData)){
2668         return;
2669     }
2670     
2671     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
2672     frameCETitle->SetupPointers(&BusinessTitleList,
2673                                 &BusinessTitleListLanguage,
2674                                 &BusinessTitleListAltID,
2675                                 &BusinessTitleListPID,
2676                                 &BusinessTitleListType,
2677                                 &BusinessTitleListTokens,
2678                                 &BusinessTitleListPref,
2679                                 lboBusinessTitles,
2680                                 intSelectedData);
2681     frameCETitle->SetEditorMode(TRUE, CE_WORK);
2682     frameCETitle->ShowModal();
2683     delete frameCETitle;
2684     frameCETitle = NULL;
2687 void frmContactEditor::DeleteBusinessTitle( wxCommandEvent& event )
2689     long longSelected = -1;
2690     int intSelectedData = 0;
2691     
2692     if (!GetSelectedItem(lboBusinessTitles,
2693                          &longSelected,
2694                          &intSelectedData)){
2695         return;
2696     }
2697     
2698     lboTitles->DeleteItem(longSelected);
2699     
2700     DeleteMapData(intSelectedData, &BusinessTitleList,
2701                   &BusinessTitleListLanguage, &BusinessTitleListAltID,
2702                   &BusinessTitleListPID, &BusinessTitleListType,
2703                   &BusinessTitleListTokens, &BusinessTitleListPref);
2704     
2707 void frmContactEditor::AddBusinessRole( wxCommandEvent& event )
2709     int intResult = 0;
2710     
2711     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
2712     frameCERole->SetEditorMode(FALSE, CE_WORK);
2713     intResult = GetLastInt(&BusinessRoleList);
2714     frameCERole->SetupPointers(&BusinessRoleList,
2715                                &BusinessRoleListLanguage,
2716                                &BusinessRoleListAltID,
2717                                &BusinessRoleListPID,
2718                                &BusinessRoleListType,
2719                                &BusinessRoleListTokens,
2720                                &BusinessRoleListPref,
2721                                lboBusinessRoles,
2722                                (intValueSeek));
2723     frameCERole->ShowModal();
2724     delete frameCERole;
2725     frameCERole = NULL;
2728 void frmContactEditor::ModifyBusinessRole( wxCommandEvent& event )
2730     long longSelected = -1;
2731     int intSelectedData = 0;
2732     
2733     if (!GetSelectedItem(lboBusinessRoles,
2734                          &longSelected,
2735                          &intSelectedData)){
2736         return;
2737     }
2738     
2739     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
2740     frameCERole->SetupPointers(&BusinessRoleList,
2741                                &BusinessRoleListLanguage,
2742                                &BusinessRoleListAltID,
2743                                &BusinessRoleListPID,
2744                                &BusinessRoleListType,
2745                                &BusinessRoleListTokens,
2746                                &BusinessRoleListPref,
2747                                lboBusinessRoles,
2748                                intSelectedData);
2749     frameCERole->SetEditorMode(TRUE, CE_WORK);
2750     frameCERole->ShowModal();
2751     delete frameCERole;
2752     frameCERole = NULL;
2755 void frmContactEditor::DeleteBusinessRole( wxCommandEvent& event )
2757     long longSelected = -1;
2758     int intSelectedData = 0;
2759     
2760     if (!GetSelectedItem(lboBusinessRoles,
2761                          &longSelected,
2762                          &intSelectedData)){
2763         return;
2764     }
2765     
2766     lboBusinessRoles->DeleteItem(longSelected);
2767     
2768     DeleteMapData(intSelectedData, &BusinessRoleList,
2769                   &BusinessRoleListLanguage, &BusinessRoleListAltID,
2770                   &BusinessRoleListPID, &BusinessRoleListType,
2771                   &BusinessRoleListTokens, &BusinessRoleListPref);
2772     
2775 void frmContactEditor::AddBusinessOrganisation( wxCommandEvent& event )
2777     int intResult = 0;
2778     
2779     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
2780     frameCEOrg->SetEditorMode(FALSE, CE_WORK);
2781     intResult = GetLastInt(&GeneralOrganisationsList);
2782     frameCEOrg->SetupPointers(&GeneralOrganisationsList,
2783                               &BusinessOrganisationsListLanguage,
2784                               &BusinessOrganisationsListSortAs,
2785                               &BusinessOrganisationsListAltID,
2786                               &BusinessOrganisationsListPID,
2787                               &BusinessOrganisationsListType,
2788                               &BusinessOrganisationsListTokens,
2789                               &BusinessOrganisationsListPref,
2790                               lboBusinessOrganisations,
2791                               (intValueSeek));
2792     frameCEOrg->ShowModal();
2793     delete frameCEOrg;
2794     frameCEOrg = NULL;
2797 void frmContactEditor::ModifyBusinessOrganisation( wxCommandEvent& event )
2799     long longSelected = -1;
2800     int intSelectedData = 0;
2801     
2802     if (!GetSelectedItem(lboBusinessOrganisations,
2803                          &longSelected,
2804                          &intSelectedData)){
2805         return;
2806     }
2807     
2808     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
2809     frameCEOrg->SetupPointers(&BusinessOrganisationsList,
2810                               &BusinessOrganisationsListLanguage,
2811                               &BusinessOrganisationsListSortAs,
2812                               &BusinessOrganisationsListAltID,
2813                               &BusinessOrganisationsListPID,
2814                               &BusinessOrganisationsListType,
2815                               &BusinessOrganisationsListTokens,
2816                               &BusinessOrganisationsListPref,
2817                               lboBusinessOrganisations,
2818                               intSelectedData);
2819     frameCEOrg->SetEditorMode(TRUE, CE_WORK);
2820     frameCEOrg->ShowModal();
2821     delete frameCEOrg;
2822     frameCEOrg = NULL;
2825 void frmContactEditor::DeleteBusinessOrganisation( wxCommandEvent& event )
2827     long longSelected = -1;
2828     int intSelectedData = 0;
2829     
2830     if (!GetSelectedItem(lboBusinessOrganisations,
2831                          &longSelected,
2832                          &intSelectedData)){
2833         return;
2834     }
2835     
2836     lboBusinessOrganisations->DeleteItem(longSelected);
2837     
2838     DeleteMapData(intSelectedData, &BusinessOrganisationsList,
2839                   &BusinessOrganisationsListLanguage, &BusinessOrganisationsListSortAs,
2840                   &BusinessOrganisationsListAltID, &BusinessOrganisationsListPID,
2841                   &BusinessOrganisationsListType, &BusinessOrganisationsListTokens,
2842                   &BusinessOrganisationsListPref);
2843     
2846 void frmContactEditor::AddBusinessNote( wxCommandEvent& event )
2848     int intResult = 0;
2849     
2850     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
2851     frameCENote->SetEditorMode(FALSE, CE_WORK);
2852     intResult = GetLastInt(&BusinessNoteList);
2853     frameCENote->SetupPointers(&BusinessNoteList,
2854                                &BusinessNoteListLanguage,
2855                                &BusinessNoteListAltID,
2856                                &BusinessNoteListPID,
2857                                &BusinessNoteListType,
2858                                &BusinessNoteListTokens,
2859                                &BusinessNoteListPref,
2860                                lboBusinessNotes,
2861                                (intValueSeek));
2862     frameCENote->ShowModal();
2863     delete frameCENote;
2864     frameCENote = NULL;
2867 void frmContactEditor::ModifyBusinessNote( wxCommandEvent& event )
2869     long longSelected = -1;
2870     int intSelectedData = 0;
2871     
2872     if (!GetSelectedItem(lboBusinessNotes,
2873                          &longSelected,
2874                          &intSelectedData)){
2875         return;
2876     }
2877     
2878     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
2879     frameCENote->SetupPointers(&BusinessNoteList,
2880                                &BusinessNoteListLanguage,
2881                                &BusinessNoteListAltID,
2882                                &BusinessNoteListPID,
2883                                &BusinessNoteListType,
2884                                &BusinessNoteListTokens,
2885                                &BusinessNoteListPref,
2886                                lboBusinessNotes,
2887                                intSelectedData);
2888     frameCENote->SetEditorMode(TRUE, CE_WORK);
2889     frameCENote->ShowModal();
2890     delete frameCENote;
2891     frameCENote = NULL;
2894 void frmContactEditor::DeleteBusinessNote( wxCommandEvent& event )
2896     long longSelected = -1;
2897     int intSelectedData = 0;
2898     
2899     if (!GetSelectedItem(lboBusinessNotes,
2900                          &longSelected,
2901                          &intSelectedData)){
2902         return;
2903     }
2904     
2905     lboBusinessNotes->DeleteItem(longSelected);
2906     
2907     DeleteMapData(intSelectedData, &BusinessNoteList,
2908                   &BusinessNoteListLanguage, &BusinessNoteListAltID,
2909                   &BusinessNoteListPID, &BusinessNoteListType,
2910                   &BusinessNoteListTokens, &BusinessNoteListPref);
2911     
2914 void frmContactEditor::AddCategory( wxCommandEvent& event )
2916     int intResult = 0;
2917     
2918     frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
2919     frameCECategory->SetEditorMode(FALSE);
2920     intResult = GetLastInt(&CategoriesList);
2921     frameCECategory->SetupPointers(&CategoriesList,
2922                                    &CategoriesListAltID,
2923                                    &CategoriesListPID,
2924                                    &CategoriesListType,
2925                                    &CategoriesListTokens,
2926                                    &CategoriesListPref,
2927                                    lboCategories,
2928                                    (intValueSeek));
2929     frameCECategory->ShowModal();
2930     delete frameCECategory;
2931     frameCECategory = NULL;
2934 void frmContactEditor::ModifyCategory( wxCommandEvent& event )
2936     long longSelected = -1;
2937     int intSelectedData = 0;
2938     
2939     if (!GetSelectedItem(lboCategories,
2940                          &longSelected,
2941                          &intSelectedData)){
2942         return;
2943     }
2944     
2945     frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
2946     frameCECategory->SetupPointers(&CategoriesList,
2947                                    &CategoriesListAltID,
2948                                    &CategoriesListPID,
2949                                    &CategoriesListType,
2950                                    &CategoriesListTokens,
2951                                    &CategoriesListPref,
2952                                    lboCategories,
2953                                    intSelectedData);
2954     frameCECategory->SetEditorMode(TRUE);
2955     frameCECategory->ShowModal();
2956     delete frameCECategory;
2957     frameCECategory = NULL;
2960 void frmContactEditor::DeleteCategory( wxCommandEvent& event )
2962     long longSelected = -1;
2963     int intSelectedData = 0;
2964     
2965     if (!GetSelectedItem(lboCategories,
2966                          &longSelected,
2967                          &intSelectedData)){
2968         return;
2969     }
2970     
2971     lboCategories->DeleteItem(longSelected);
2972     
2973     DeleteMapData(intSelectedData, &CategoriesList,
2974                   &CategoriesListAltID, &CategoriesListPID,
2975                   &CategoriesListType, &CategoriesListTokens,
2976                   &CategoriesListPref);
2977     
2980 void frmContactEditor::AddGroup( wxCommandEvent& event )
2982     
2983     int intResult = 0;
2984     
2985     XABViewMode XVMData = MainPtr->GetViewMode();
2986     
2987     frmContactEditorGroup *frameCEGroup = new frmContactEditorGroup ( this );
2988     frameCEGroup->SetEditorMode(FALSE, XVMData);
2989     intResult = GetLastInt(&GroupsList);
2990     frameCEGroup->SetupPointers(&GroupsList,
2991                                 lboGroups,
2992                                 wxSContactAccount,
2993                                 intValueSeek);
2994     frameCEGroup->ShowModal();
2995     delete frameCEGroup;
2996     frameCEGroup = NULL;
2997     
3000 void frmContactEditor::ModifyGroup( wxCommandEvent& event )
3002     
3003     return;
3004     
3007 void frmContactEditor::DeleteGroup( wxCommandEvent& event )
3009     
3010     long longSelected = -1;
3011     int intSelectedData = 0;
3012     
3013     if (!GetSelectedItem(lboGroups,
3014                          &longSelected,
3015                          &intSelectedData)){
3016         return;
3017     }
3018     
3019     lboGroups->DeleteItem(longSelected);
3020     
3021     DeleteMapData(intSelectedData, &GroupsList);
3022     
3025 void frmContactEditor::AddPicture( wxCommandEvent& event )
3027     int intResult = 0;
3028     
3029     frmContactEditorPicture *frameCEPicture = new frmContactEditorPicture ( this );
3030     frameCEPicture->SetEditorMode(FALSE);
3031     intResult = GetLastInt(&PicturesList);
3032     frameCEPicture->SetupPointers(&PicturesList,
3033                                   &PicturesListAltID,
3034                                   &PicturesListPID,
3035                                   &PicturesListType,
3036                                   &PicturesListPicEncType,
3037                                   &PicturesListPictureType,
3038                                   &PicturesListTokens,
3039                                   &PicturesListMediatype,
3040                                   &PicturesListPref,
3041                                   lboPictures,
3042                                   (intValueSeek));
3043     frameCEPicture->ShowModal();
3044     delete frameCEPicture;
3045     frameCEPicture = NULL;
3048 void frmContactEditor::ModifyPicture( wxCommandEvent& event )
3050     long longSelected = -1;
3051     int intSelectedData = 0;
3052     
3053     if (!GetSelectedItem(lboPictures,
3054                          &longSelected,
3055                          &intSelectedData)){
3056         return;
3057     }
3058     
3059     frmContactEditorPicture *frameCEPicture = new frmContactEditorPicture ( this );
3060     frameCEPicture->SetupPointers(&PicturesList,
3061                                   &PicturesListAltID,
3062                                   &PicturesListPID,
3063                                   &PicturesListType,
3064                                   &PicturesListPicEncType,
3065                                   &PicturesListPictureType,
3066                                   &PicturesListTokens,
3067                                   &PicturesListMediatype,
3068                                   &PicturesListPref,
3069                                   lboPictures,
3070                                   intSelectedData);
3071     frameCEPicture->SetEditorMode(TRUE);
3072     frameCEPicture->ShowModal();
3073     delete frameCEPicture;
3074     frameCEPicture = NULL;
3075     
3078 void frmContactEditor::DeletePicture( wxCommandEvent& event )
3080     long longSelected = -1;
3081     int intSelectedData = 0;
3082     
3083     if (!GetSelectedItem(lboPictures,
3084                          &longSelected,
3085                          &intSelectedData)){
3086         return;
3087     }
3088     
3089     lboPictures->DeleteItem(longSelected);
3090     
3091     DeleteMapData(intSelectedData,
3092                   &PicturesList, &PicturesListAltID, &PicturesListPID, &PicturesListType,
3093                   &PicturesListPicEncType, &PicturesListPictureType, &PicturesListTokens,
3094                   &PicturesListMediatype, &PicturesListPref);
3095     
3096     wxMemoryInputStream istream(misc_emptyimage_png, sizeof(misc_emptyimage_png));
3097     wxImage misc_emptyimage_png(istream, wxBITMAP_TYPE_PNG);
3098     PictureImage = (wxBitmap)misc_emptyimage_png;
3099     
3100     imgPicture->SetBitmap(PictureImage);
3103 void frmContactEditor::LoadPicture( wxListEvent& event )
3105     
3106     long longSelected = -1;
3107     int intSelectedData = 0;
3108     
3109     if (!GetSelectedItem(lboPictures,
3110                          &longSelected,
3111                          &intSelectedData)){
3112         return;
3113     }
3114     
3115     std::string base64dec;
3116     
3117     std::map<int,std::string>::iterator initier;
3118     std::map<int,wxString>::iterator pictypeiter;
3119     
3120     initier = PicturesList.find(intSelectedData);
3121     pictypeiter = PicturesListPictureType.find(intSelectedData);
3122     
3123     base64dec = base64_decode(initier->second);
3124     
3125     wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size());
3126     wxImage photo;
3127     //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size());
3128     
3129     if (pictypeiter->second == wxT("image/jpeg")){
3130         
3131         if (!photo.LoadFile(istream, wxBITMAP_TYPE_JPEG)){
3132         
3133             return;
3134         
3135         }
3136         
3137     } else if (pictypeiter->second == wxT("image/png")){
3138         
3139         if (!photo.LoadFile(istream, wxBITMAP_TYPE_PNG)){
3140             
3141             return;
3142             
3143         }
3144         
3145     } else if (pictypeiter->second == wxT("image/gif")){
3146         
3147         if (!photo.LoadFile(istream, wxBITMAP_TYPE_GIF)){
3148             
3149             return;
3150             
3151         }
3152         
3153     } else {
3154     
3155         return;
3156     
3157     }
3158     
3159     PictureImage = (wxBitmap)photo;
3160     imgPicture->SetBitmap(PictureImage);
3161     
3164 void frmContactEditor::LoadLogo( wxListEvent& event )
3166     
3167     long longSelected = -1;
3168     int intSelectedData = 0;
3169     
3170     if (!GetSelectedItem(lboLogos,
3171                          &longSelected,
3172                          &intSelectedData)){
3173         return;
3174     }
3175     
3176     std::string base64dec;
3177     
3178     std::map<int,std::string>::iterator initier;
3179     
3180     initier = LogosList.find(intSelectedData);
3181     
3182     base64dec = base64_decode(initier->second);
3183     
3184     
3185     wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size());
3186     wxImage photo;
3187     //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size());
3188     
3189     if (!photo.LoadFile(istream, wxBITMAP_TYPE_ANY)){
3190         
3191         return;
3192         
3193     }
3194     
3195     
3196     LogoImage = (wxBitmap)photo;
3197     imgLogo->SetBitmap(LogoImage);
3198     
3201 void frmContactEditor::AddLogo( wxCommandEvent& event )
3203     int intResult = 0;
3204     
3205     frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this );
3206     frameCELogo->SetEditorMode(FALSE);
3207     intResult = GetLastInt(&LogosList);
3208     frameCELogo->SetupPointers(&LogosList,
3209                                &LogosListAltID,
3210                                &LogosListPID,
3211                                &LogosListType,
3212                                &LogosListPicEncType,
3213                                &LogosListPictureType,
3214                                &LogosListTokens,
3215                                &LogosListMediatype,
3216                                &LogosListPref,
3217                                lboLogos,
3218                                (intValueSeek));
3219     frameCELogo->ShowModal();
3220     delete frameCELogo;
3221     frameCELogo = NULL;
3224 void frmContactEditor::ModifyLogo( wxCommandEvent& event )
3226     long longSelected = -1;
3227     int intSelectedData = 0;
3228     
3229     if (!GetSelectedItem(lboLogos,
3230                          &longSelected,
3231                          &intSelectedData)){
3232         return;
3233     }
3234     
3235     frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this );
3236     frameCELogo->SetupPointers(&LogosList,
3237                                &LogosListAltID,
3238                                &LogosListPID,
3239                                &LogosListType,
3240                                &LogosListPicEncType,
3241                                &LogosListPictureType,
3242                                &LogosListTokens,
3243                                &LogosListMediatype,
3244                                &LogosListPref,
3245                                lboLogos,
3246                                intSelectedData);
3247     frameCELogo->SetEditorMode(TRUE);
3248     frameCELogo->ShowModal();
3249     delete frameCELogo;
3250     frameCELogo = NULL;
3253 void frmContactEditor::DeleteLogo( wxCommandEvent& event )
3255     long longSelected = -1;
3256     int intSelectedData = 0;
3257     
3258     if (!GetSelectedItem(lboLogos,
3259                          &longSelected,
3260                          &intSelectedData)){
3261         return;
3262     }
3263     
3264     lboLogos->DeleteItem(longSelected);
3265     
3266     DeleteMapData(intSelectedData,
3267                   &LogosList, &LogosListAltID, &LogosListPID, &LogosListType,
3268                   &LogosListPicEncType, &LogosListPictureType, &LogosListTokens,
3269                   &LogosListMediatype, &LogosListPref);
3270     
3271     wxMemoryInputStream istream(misc_emptyimage_png, sizeof(misc_emptyimage_png));
3272     wxImage misc_emptyimage_png(istream, wxBITMAP_TYPE_PNG);
3273     LogoImage = (wxBitmap)misc_emptyimage_png;
3274     
3275     imgLogo->SetBitmap(LogoImage);
3278 void frmContactEditor::AddSound( wxCommandEvent& event )
3280     int intResult = 0;
3281     
3282     frmContactEditorSound *frameCESound = new frmContactEditorSound ( this );
3283     frameCESound->SetEditorMode(FALSE);
3284     intResult = GetLastInt(&SoundsList);
3285     frameCESound->SetupPointers(&SoundsList,
3286                                 &SoundsListAltID,
3287                                 &SoundsListPID,
3288                                 &SoundsListType,
3289                                 &SoundsListAudioType,
3290                                 &SoundsListAudioEncType,
3291                                 &SoundsListTokens,
3292                                 &SoundsListMediatype,
3293                                 &SoundsListPref,
3294                                 lboSounds,
3295                                 (intValueSeek));
3296     frameCESound->ShowModal();
3297     delete frameCESound;
3298     frameCESound = NULL;
3301 void frmContactEditor::ModifySound( wxCommandEvent& event )
3303     long longSelected = -1;
3304     int intSelectedData = 0;
3305     
3306     if (!GetSelectedItem(lboSounds,
3307                          &longSelected,
3308                          &intSelectedData)){
3309         return;
3310     }
3311     
3312     frmContactEditorSound *frameCESound = new frmContactEditorSound ( this );
3313     frameCESound->SetupPointers(&SoundsList,
3314                                 &SoundsListAltID,
3315                                 &SoundsListPID,
3316                                 &SoundsListType,
3317                                 &SoundsListAudioType,
3318                                 &SoundsListAudioEncType,
3319                                 &SoundsListTokens,
3320                                 &SoundsListMediatype,
3321                                 &SoundsListPref,
3322                                 lboSounds,
3323                                 intSelectedData);
3324     frameCESound->SetEditorMode(TRUE);
3325     frameCESound->ShowModal();
3326     delete frameCESound;
3327     frameCESound = NULL;
3330 void frmContactEditor::DeleteSound( wxCommandEvent& event )
3332     long longSelected = -1;
3333     int intSelectedData = 0;
3334     
3335     if (!GetSelectedItem(lboSounds,
3336                          &longSelected,
3337                          &intSelectedData)){
3338         return;
3339     }
3340     
3341     lboSounds->DeleteItem(longSelected);
3342     
3343     DeleteMapData(intSelectedData, &SoundsList, &SoundsListAltID,
3344                   &SoundsListPID, &SoundsListType, &SoundsListAudioType,
3345                   &SoundsListAudioEncType, &SoundsListTokens, &SoundsListMediatype,
3346                   &SoundsListPref);
3347     
3350 void frmContactEditor::PlaySoundDetach()
3352     
3353     if (!AudioStreamPlayback.openFromMemory(base64dec.c_str(), base64declen)){
3354         
3355         // Can't load file. We must flee...
3356         // Also show an error message too.
3357         
3358         wxMessageBox(_("This file is in an audio format that is unsupported or is not an audio file."), _("Error opening audio file"), wxICON_ERROR);
3359         
3360         return;
3361         
3362     }
3363     
3364     btnStop->Enable();
3365     
3366     //AudioStreamPlayback.setbuffer(AudioBuffer);
3367     AudioStreamPlayback.play();
3368     
3369     /*timespec n1, n2;
3370      
3371      n1.tv_sec = 0;
3372      n1.tv_nsec = 100000000L;*/
3373     
3374     //while (TimeA != TimeB){
3375     while (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3376         
3377         // We poll this every 100ms in order to conserve CPU usage.
3378         
3379         SleepFor(100000000);
3380         
3381     }
3382     
3383     btnStop->Disable();
3384     
3387 void frmContactEditor::PlaySound( wxCommandEvent& event )
3389     
3390     //sf::Music *AudioPlayback = new sf::Music;
3391     //AudioStream *AudioStreamPlayback = new AudioStream;
3392     //sf::SoundBuffer *AudioBuffer = new sf::SoundBuffer;
3393     
3394     //sf::Sound *AudioPlayback = new sf::Sound;
3395     
3396     //delete(AudioPlayback);
3397     
3398     //delete(AudioPlayback);
3399     //delete(AudioStreamPlayback);
3400     //delete(AudioBuffer);
3401     
3402     //AudioPlayback = NULL;
3403     //AudioStreamPlayback = NULL;
3404     //AudioBuffer = NULL;
3405     
3406     //return;
3407     
3408     long longSelected = -1;
3409     int intSelectedData = 0;
3410     
3411     // Check if sound is still being played and if it is, stop it.
3412     
3413     if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3414         
3415         AudioStreamPlayback.stop();
3416         
3417     }
3418     
3419     if (!GetSelectedItem(lboSounds,
3420                          &longSelected,
3421                          &intSelectedData)){
3422         return;
3423     }
3424     
3425     std::map<int, std::string>::iterator initier;
3426     
3427     initier = SoundsList.find(intSelectedData);
3428     
3429     base64dec = base64_decode(initier->second);
3430     base64declen = base64dec.size();
3431     
3432     std::thread AudioPlaybackThread(&frmContactEditor::PlaySoundDetach, this);
3433     AudioPlaybackThread.detach();
3434     
3435     return;
3436     
3439 void frmContactEditor::StopSound( wxCommandEvent& event )
3441     
3442     if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3443         
3444         AudioStreamPlayback.stop();
3445         
3446     }
3447     
3448     btnStop->Disable();
3449     
3450     return;
3451     
3454 void frmContactEditor::AddCalendarAddress( wxCommandEvent& event )
3456     int intResult = 0;
3457     
3458     frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3459     frameCECalAdr->SetEditorMode(FALSE);
3460     intResult = GetLastInt(&CalendarList);
3461     frameCECalAdr->SetupPointers(&CalendarList,
3462                                  &CalendarListAltID,
3463                                  &CalendarListPID,
3464                                  &CalendarListType,
3465                                  &CalendarListTokens,
3466                                  &CalendarListPref,
3467                                  lboCalendarAddresses,
3468                                  (intValueSeek));
3469     frameCECalAdr->ShowModal();
3470     delete frameCECalAdr;
3471     frameCECalAdr = NULL;
3474 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
3476     long longSelected = -1;
3477     int intSelectedData = 0;
3478     
3479     if (!GetSelectedItem(lboCalendarAddresses,
3480                          &longSelected,
3481                          &intSelectedData)){
3482         return;
3483     }
3484     
3485     frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3486     frameCECalAdr->SetupPointers(&CalendarList,
3487                                  &CalendarListAltID,
3488                                  &CalendarListPID,
3489                                  &CalendarListType,
3490                                  &CalendarListTokens,
3491                                  &CalendarListPref,
3492                                  lboCalendarAddresses,
3493                                  intSelectedData);
3494     frameCECalAdr->SetEditorMode(TRUE);
3495     frameCECalAdr->ShowModal();
3496     delete frameCECalAdr;
3497     frameCECalAdr = NULL;
3500 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
3502     long longSelected = -1;
3503     int intSelectedData = 0;
3504     
3505     if (!GetSelectedItem(lboCalendarAddresses,
3506                          &longSelected,
3507                          &intSelectedData)){
3508         return;
3509     }
3510     
3511     lboCalendarAddresses->DeleteItem(longSelected);
3512     
3513     DeleteMapData(intSelectedData, &CalendarList, &CalendarListAltID,
3514                   &CalendarListPID, &CalendarListType, &CalendarListTokens,
3515                   &CalendarListPref);
3516     
3519 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
3521     int intResult = 0;
3522     
3523     frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3524     frameCECalAdr->SetEditorMode(FALSE);
3525     intResult = GetLastInt(&CalendarRequestList);
3526     frameCECalAdr->SetupPointers(&CalendarRequestList,
3527                                  &CalendarRequestListAltID,
3528                                  &CalendarRequestListPID,
3529                                  &CalendarRequestListType,
3530                                  &CalendarRequestListTokens,
3531                                  &CalendarRequestListPref,
3532                                  lboCalendarRequestAddress,
3533                                  (intValueSeek));
3534     frameCECalAdr->ShowModal();
3535     delete frameCECalAdr;
3536     frameCECalAdr = NULL;
3539 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
3541     long longSelected = -1;
3542     int intSelectedData = 0;
3543     
3544     if (!GetSelectedItem(lboCalendarRequestAddress,
3545                          &longSelected,
3546                          &intSelectedData)){
3547         return;
3548     }
3549     
3550     frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3551     frameCECalAdr->SetupPointers(&CalendarList,
3552                                  &CalendarRequestListAltID,
3553                                  &CalendarRequestListPID,
3554                                  &CalendarRequestListType,
3555                                  &CalendarRequestListTokens,
3556                                  &CalendarRequestListPref,
3557                                  lboCalendarRequestAddress,
3558                                  intSelectedData);
3559     frameCECalAdr->SetEditorMode(TRUE);
3560     frameCECalAdr->ShowModal();
3561     delete frameCECalAdr;
3562     frameCECalAdr = NULL;
3565 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
3567     long longSelected = -1;
3568     int intSelectedData = 0;
3569     
3570     if (!GetSelectedItem(lboCalendarRequestAddress,
3571                          &longSelected,
3572                          &intSelectedData)){
3573         return;
3574     }
3575     
3576     lboCalendarRequestAddress->DeleteItem(longSelected);
3577     
3578     DeleteMapData(intSelectedData, &CalendarRequestList,
3579                   &CalendarRequestListAltID, &CalendarRequestListPID,
3580                   &CalendarRequestListType, &CalendarRequestListTokens,
3581                   &CalendarRequestListPref);
3584 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
3586     int intResult = 0;
3587     
3588     frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3589     frameCECalAdr->SetEditorMode(FALSE);
3590     intResult = GetLastInt(&FreeBusyList);
3591     frameCECalAdr->SetupPointers(&FreeBusyList,
3592                                  &FreeBusyListAltID,
3593                                  &FreeBusyListPID,
3594                                  &FreeBusyListType,
3595                                  &FreeBusyListTokens,
3596                                  &FreeBusyListPref,
3597                                  lboFreeBusyAddresses,
3598                                  (intValueSeek));
3599     frameCECalAdr->ShowModal();
3600     delete frameCECalAdr;
3601     frameCECalAdr = NULL;
3604 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
3606     long longSelected = -1;
3607     int intSelectedData = 0;
3608     
3609     if (!GetSelectedItem(lboFreeBusyAddresses,
3610                          &longSelected,
3611                          &intSelectedData)){
3612         return;
3613     }
3614     
3615     frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3616     frameCECalAdr->SetupPointers(&FreeBusyList,
3617                                  &FreeBusyListAltID,
3618                                  &FreeBusyListPID,
3619                                  &FreeBusyListType,
3620                                  &FreeBusyListTokens,
3621                                  &FreeBusyListPref,
3622                                  lboFreeBusyAddresses,
3623                                  intSelectedData);
3624     frameCECalAdr->SetEditorMode(TRUE);
3625     frameCECalAdr->ShowModal();
3626     delete frameCECalAdr;
3627     frameCECalAdr = NULL;
3630 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
3632     long longSelected = -1;
3633     int intSelectedData = 0;
3634     
3635     if (!GetSelectedItem(lboFreeBusyAddresses,
3636                          &longSelected,
3637                          &intSelectedData)){
3638         return;
3639     }
3640     
3641     lboFreeBusyAddresses->DeleteItem(longSelected);
3642     
3643     DeleteMapData(intSelectedData, &FreeBusyList, &FreeBusyListAltID,
3644                   &FreeBusyListPID, &FreeBusyListType, &FreeBusyListTokens,
3645                   &FreeBusyListPref);
3646     
3649 void frmContactEditor::AddKey( wxCommandEvent& event )
3651     int intResult = 0;
3652     
3653     frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
3654     frameCEKey->SetEditorMode(FALSE);
3655     intResult = GetLastInt(&KeyList);
3656     frameCEKey->SetupPointers(&KeyList,
3657                               &KeyListAltID,
3658                               &KeyListPID,
3659                               &KeyListKeyType,
3660                               &KeyListDataType,
3661                               &KeyListType,
3662                               &KeyListTokens,
3663                               &KeyListPref,
3664                               lboKeys,
3665                               (intValueSeek));
3666     frameCEKey->ShowModal();
3667     delete frameCEKey;
3668     frameCEKey = NULL;
3671 void frmContactEditor::ModifyKey( wxCommandEvent& event )
3673     long longSelected = -1;
3674     int intSelectedData = 0;
3675     
3676     if (!GetSelectedItem(lboKeys,
3677                          &longSelected,
3678                          &intSelectedData)){
3679         return;
3680     }
3681     
3682     frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
3683     frameCEKey->SetupPointers(&KeyList,
3684                               &KeyListAltID,
3685                               &KeyListPID,
3686                               &KeyListKeyType,
3687                               &KeyListDataType,
3688                               &KeyListType,
3689                               &KeyListTokens,
3690                               &KeyListPref,
3691                               lboKeys,
3692                               intSelectedData);
3693     frameCEKey->SetEditorMode(TRUE);
3694     frameCEKey->ShowModal();
3695     delete frameCEKey;
3696     frameCEKey = NULL;
3699 void frmContactEditor::DeleteKey( wxCommandEvent& event )
3701     long longSelected = -1;
3702     int intSelectedData = 0;
3703     
3704     if (!GetSelectedItem(lboKeys,
3705                          &longSelected,
3706                          &intSelectedData)){
3707         return;
3708     }
3709     
3710     lboKeys->DeleteItem(longSelected);
3711     
3712     DeleteMapData(intSelectedData, &KeyList, &KeyListAltID,
3713                   &KeyListPID, &KeyListKeyType, &KeyListDataType, &KeyListType,
3714                   &KeyListTokens, &KeyListPref);
3715     
3718 void frmContactEditor::AddVendorNamespace( wxCommandEvent& event )
3720     int intResult = 0;
3721     
3722     frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
3723     frameCEVen->SetEditorMode(FALSE);
3724     intResult = GetLastInt(&VendorList);
3725     frameCEVen->SetupPointers(&VendorList,
3726                               &VendorListPEN,
3727                               &VendorListElement,
3728                               lboVendorNamespace,
3729                               (intValueSeek));
3730     frameCEVen->ShowModal();
3731     delete frameCEVen;
3732     frameCEVen = NULL;
3735 void frmContactEditor::ModifyVendorNamespace( wxCommandEvent& event )
3737     long longSelected = -1;
3738     int intSelectedData = 0;
3739     
3740     if (!GetSelectedItem(lboVendorNamespace,
3741                          &longSelected,
3742                          &intSelectedData)){
3743         return;
3744     }
3745     
3746     frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
3747     frameCEVen->SetupPointers(&VendorList,
3748                               &VendorListPEN,
3749                               &VendorListElement,
3750                               lboVendorNamespace,
3751                               intSelectedData);
3752     frameCEVen->SetEditorMode(TRUE);
3753     frameCEVen->ShowModal();
3754     delete frameCEVen;
3755     frameCEVen = NULL;
3758 void frmContactEditor::DeleteVendorNamespace( wxCommandEvent& event )
3760     long longSelected = -1;
3761     int intSelectedData = 0;
3762     
3763     if (!GetSelectedItem(lboVendorNamespace,
3764                          &longSelected,
3765                          &intSelectedData)){
3766         return;
3767     }
3768     
3769     lboVendorNamespace->DeleteItem(longSelected);
3770     
3771     DeleteMapData(intSelectedData, &VendorList, &VendorListPEN,
3772                   &VendorListElement);
3773     
3776 void frmContactEditor::AddXToken( wxCommandEvent& event )
3778     int intResult = 0;
3779     
3780     frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
3781     frameCEXT->SetEditorMode(FALSE);
3782     intResult = GetLastInt(&XTokenList);
3783     frameCEXT->SetupPointers(&XTokenList,
3784                              &XTokenListTokens,
3785                              lboXToken,
3786                              (intValueSeek));
3787     frameCEXT->ShowModal();
3788     delete frameCEXT;
3789     frameCEXT = NULL;
3792 void frmContactEditor::ModifyXToken( wxCommandEvent& event )
3794     long longSelected = -1;
3795     int intSelectedData = 0;
3796     
3797     if (!GetSelectedItem(lboXToken,
3798                          &longSelected,
3799                          &intSelectedData)){
3800         return;
3801     }
3802     
3803     frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
3804     frameCEXT->SetupPointers(&XTokenList,
3805                              &XTokenListTokens,
3806                              lboXToken,
3807                              intSelectedData);
3808     frameCEXT->SetEditorMode(TRUE);
3809     frameCEXT->ShowModal();
3810     delete frameCEXT;
3811     frameCEXT = NULL;
3814 void frmContactEditor::DeleteXToken( wxCommandEvent& event )
3816     long longSelected = -1;
3817     int intSelectedData = 0;
3818     
3819     if (!GetSelectedItem(lboXToken,
3820                          &longSelected,
3821                          &intSelectedData)){
3822         return;
3823     }
3824     
3825     lboXToken->DeleteItem(longSelected);
3826     
3827     DeleteMapData(intSelectedData, &XTokenList, &XTokenListTokens);
3828     
3831 void frmContactEditor::SaveContact( wxCommandEvent& event )
3833     
3834     // Check if Display As combo box has a value in it.
3835     // Do not go any further if there is no value.
3836     
3837     wxString cmbDisplayAsValue = cmbDisplayAs->GetValue();
3838     
3839     if (cmbDisplayAsValue.IsEmpty()){
3840         
3841         wxMessageBox(_("Display As value cannot be left blank."), _("Display As value empty"), wxICON_ERROR);
3842         return;
3843         
3844     }
3845     
3846     // Save the updated contact data.
3847     
3848     vCard ContactData;
3849     wxString FilenameFinal;
3850     bool ReplaceContact = FALSE;
3851     
3852     if (cmbType->GetCurrentSelection() == 1 ||
3853         cmbType->GetCurrentSelection() == 3 ||
3854         cmbType->GetCurrentSelection() == 4){
3855         
3856         if (IsGroup == TRUE){
3857             
3858             // Mark contact for replacing.
3859             
3860             ReplaceContact = TRUE;
3861             
3862         }
3863         
3864     } else if (cmbType->GetCurrentSelection() == 2){
3865         
3866         if (IsGroup == TRUE){
3867             
3868             // Mark contact for replacing.
3869             
3870             ReplaceContact = TRUE;
3871             
3872         }
3873         
3874     }
3875     
3876     if (ReplaceContact == TRUE){
3877         
3878         wxString wxDelSplitFilename;
3879         wxString wxDelFinalFilename;
3880         wxString wxSDelDataURL;
3881         wxStringTokenizer wSTDelFilename(wxSContactFilename, wxT("/"));
3882         while(wSTDelFilename.HasMoreTokens()){
3883             
3884             wxDelSplitFilename = wSTDelFilename.GetNextToken();
3885             
3886         }
3887         
3888         wxSDelDataURL = wxDelSplitFilename;
3889         
3890         // Delete the contact from the server as it will be useless in certain
3891         // address book clients.
3892         
3893         ActMgrPtr->AddTask(2, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDelDataURL, wxDelSplitFilename, wxSContactFilename, wxT(""));
3894         
3895         // Clear the filename so the trigger to recreate the UID is done.
3896         
3897         wxSContactFilename.Clear();
3898         EditMode = FALSE;
3899         
3900     }
3901     
3902     if (wxSContactFilename.IsEmpty()){
3903         
3904         // Generate a random UUID.
3905         
3906         UIDToken = GenerateUUID();
3907         UIDToken = UIDToken.MakeUpper();
3908         
3909         // Setup the filename.
3910         
3911         FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3912         
3913 #if defined(__HAIKU__)
3914         
3915         //preffilename = wxT("noo");
3916         
3917 #elif defined(__WIN32__)
3918         
3919         FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3920         FilenameFinal.Append(UIDToken);
3921         FilenameFinal.Append(wxT(".vcf"));
3922         wxSContactFilename = FilenameFinal;
3923         
3924 #else
3925         
3926         FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3927         FilenameFinal.Append(UIDToken);
3928         FilenameFinal.Append(wxT(".vcf"));
3929         wxSContactFilename = FilenameFinal;
3930         
3931 #endif
3932         
3933     } else {
3934         
3935         if (UIDToken.IsEmpty()){
3936             
3937             // UID Token is empty. (Shouldn't be).
3938             // Generate a new UID Token.
3939             
3940             /*boost::uuids::uuid ContactUUID = boost::uuids::random_generator()();
3941              std::string sstContactUUID = boost::uuids::to_string(ContactUUID);
3942              wxString strContactUUID(sstContactUUID.c_str(), wxConvUTF8);
3943              UIDToken = strContactUUID;*/
3944             UIDToken = GenerateUUID();
3945             UIDToken = UIDToken.MakeUpper();
3946             
3947         }
3948         FilenameFinal = wxSContactFilename;
3949         
3950     }
3951     
3952     // Setup the data and write it into the account folder.
3953     
3954     // Begin preperations to write the contact to a file.
3955     
3956     bool boolValue = FALSE;
3957     bool boolValue2 = FALSE;
3958     bool FNFirst = TRUE;
3959     bool NNGeneralFirst = TRUE;
3960     bool NNHomeFirst = TRUE;
3961     bool NNWorkFirst = TRUE;
3962     int intFNCount = 0;
3963     std::map<int,int>::iterator intiter;
3964     std::map<int,wxString>::iterator striter;
3965     
3966     ContactData.Add(wxT("BEGIN"), wxT("VCARD"), FALSE);
3967     ContactData.Add(wxT("VERSION"), wxT("4.0"), FALSE);
3968     
3969     // Setup the version string.
3970     
3971     strValue.Append(wxT("-//Xestia//Address Book Version "));
3972     strValue.Append(wxT(XSDAB_VERSION));
3973     strValue.Append(wxT("//KW"));
3974     
3975     ContactData.Add(wxT("PRODID"), strValue, FALSE);
3976     
3977     // Setup the name.
3978     
3979     strValue.Clear();
3980     
3981     // Setup the name field.
3982     
3983     strValue = txtSurname->GetValue() + wxT(";") +
3984     txtForename->GetValue() + wxT(";") +
3985     txtOtherNames->GetValue() + wxT(";") +
3986     txtTitle->GetValue() + wxT(";") +
3987     txtSuffix->GetValue();
3988     
3989     strValue2 = ContactData.Convert(cmbDisplayAs->GetValue(), FALSE);
3990     strValue2.Trim();
3991     
3992     if (NameTokens.IsEmpty()){
3993         ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\""), strValue, FALSE);
3994     } else {
3995         ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\";") + NameTokens, strValue, FALSE);
3996     }
3997     
3998     if (cmbType->GetCurrentSelection() == 1){
3999         
4000         ContactData.AddRaw(wxT("KIND"), wxT("individual"));
4001         
4002     } else if (cmbType->GetCurrentSelection() == 2){
4003         
4004         ContactData.AddRaw(wxT("KIND"), wxT("group"));
4005         
4006         // Go through each of the members and write them out.
4007         
4008         for (std::map<int, wxString>::iterator itemiter = GroupsList.begin();
4009              itemiter != GroupsList.end(); ++itemiter){
4010             
4011             ContactData.Add(wxT("MEMBER:urn:uuid"), itemiter->second, FALSE);
4012             
4013         }
4014         
4015     } else if (cmbType->GetCurrentSelection() == 3){
4016         
4017         ContactData.AddRaw(wxT("KIND"), wxT("org"));
4018         
4019     } else if (cmbType->GetCurrentSelection() == 4){
4020         
4021         ContactData.AddRaw(wxT("KIND"), wxT("location"));
4022         
4023     }
4024     
4025     
4026     // Setup the nicknames (General, Home & Business).
4027     
4028     strValue.Clear();
4029     strValue2.Clear();
4030     strValue3.Clear();
4031     
4032     boolValue = FALSE;
4033     boolValue2 = FALSE;
4034     intValue2 = 0;
4035     intValue  = 0;
4036     
4037     // Setup the gender.
4038     
4039     if (cmbGender->GetCurrentSelection() != 0){
4040         
4041         switch(cmbGender->GetCurrentSelection()){
4042                 
4043             case 1:
4044                 
4045                 strValue = wxT("M");
4046                 break;
4047                 
4048             case 2:
4049                 
4050                 strValue = wxT("F");
4051                 break;
4052                 
4053             case 3:
4054                 
4055                 strValue = wxT("O");
4056                 break;
4057                 
4058             case 4:
4059                 
4060                 strValue = wxT("N");
4061                 break;
4062                 
4063             case 5:
4064                 
4065                 strValue = wxT("U");
4066                 break;
4067                 
4068         }
4069         
4070     }
4071     
4072     if (!txtGenderDescription->IsEmpty()){
4073         
4074         strValue2 = txtGenderDescription->GetValue();
4075         
4076     }
4077     
4078     if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4079         
4080         EscapeString(&strValue2, FALSE);
4081         
4082         if (!GenderTokens.IsEmpty()){
4083             
4084             if (!strValue2.IsEmpty()){
4085                 
4086                 ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue + wxT(";") + strValue2);
4087                 
4088             } else {
4089                 
4090                 ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue);
4091                 
4092             }
4093             
4094         } else {
4095             
4096             if (!strValue2.IsEmpty()){
4097                 
4098                 ContactData.AddRaw(wxT("GENDER"), strValue + wxT(";") + strValue2);
4099                 
4100             } else {
4101                 
4102                 ContactData.AddRaw(wxT("GENDER"), strValue);
4103                 
4104             }
4105             
4106         }
4107         
4108     }
4109     
4110     strValue.Clear();
4111     strValue2.Clear();
4112     strValue3.Clear();
4113     
4114     boolValue = FALSE;
4115     boolValue2 = FALSE;
4116     intValue2 = 0;
4117     intValue  = 0;
4118     
4119     // Process Label.
4120     
4121     strValue3 = BirthdayAltID;
4122     
4123     if (!strValue3.IsEmpty()){
4124         
4125         strValue3.Trim();
4126         strValue3.Trim();
4127         boolValue2 = TRUE;
4128         strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\""));
4129         
4130         boolValue = TRUE;
4131         
4132     }
4133     
4134     //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4135     //strValue2 =
4136     
4137     // Process Language.
4138     
4139     strValue3 = BirthdayCalScale;
4140     
4141     if (!strValue3.IsEmpty()){
4142         
4143         strValue3.Trim();
4144         strValue3.Trim();
4145         
4146         if (boolValue2 == TRUE){
4147             
4148             strValue2.Append(wxT(";"));
4149             
4150         } else {
4151             
4152             boolValue2 = TRUE;
4153             
4154         }
4155         
4156         strValue2.Append(wxT("CALSCALE=") + strValue3);
4157         
4158         boolValue = TRUE;
4159         
4160     }
4161     
4162     // Process Tokens.
4163     
4164     strValue2 = BirthdayTokens;
4165     
4166     // Get the birthday and write it.
4167     
4168     ResetSaveProcessData();
4169     
4170     if (!txtBirthday->IsEmpty()){
4171         
4172         strValue = txtBirthday->GetValue();
4173         
4174         if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4175             
4176             if (!strValue2.IsEmpty()){
4177                 
4178                 EscapeString(&strValue2, FALSE);
4179                 EscapeString(&strValue, FALSE);
4180                 
4181                 ContactData.AddRaw(wxT("BDAY;VALUE=text;") + strValue2 + wxT(";"), strValue);
4182                 
4183             } else {
4184                 
4185                 EscapeString(&strValue, FALSE);
4186                 
4187                 ContactData.AddRaw(wxT("BDAY;VALUE=text"), strValue);
4188                 
4189             }
4190             
4191         }
4192         
4193     } else {
4194         
4195         // Deal with date.
4196         
4197         // Get Day, Month & Year.
4198         
4199         wxDateTime BirthdayDate;
4200         wxDateTime::Month BirthdayMonth;
4201         int BirthdayDay;
4202         int BirthdayYear;
4203         wxString DataBeforeT;
4204         wxString DataAfterT;
4205         wxString FinalBirthdayString;
4206         bool ProcessDataAfterT = FALSE;
4207         
4208         BirthdayDate = dapBirthday->GetValue();
4209         
4210         if (BirthdayDate.IsValid()){
4211             
4212             BirthdayDay = BirthdayDate.GetDay();
4213             BirthdayMonth = BirthdayDate.GetMonth();
4214             BirthdayYear = BirthdayDate.GetYear();
4215             
4216             // Look for T and replace data before this.
4217             
4218             wxStringTokenizer wSTDate(Birthday, wxT("T"));
4219             
4220             while (wSTDate.HasMoreTokens()){
4221                 
4222                 if (ProcessDataAfterT == FALSE){
4223                     
4224                     DataBeforeT = wSTDate.GetNextToken();
4225                     ProcessDataAfterT = TRUE;
4226                     
4227                 } else {
4228                     
4229                     DataAfterT = wSTDate.GetNextToken();
4230                     break;
4231                     
4232                 }
4233                 
4234             }
4235             
4236             // If there is not T then replace altogether.
4237             
4238             wxString FinalBirthdayDay;
4239             wxString FinalBirthdayMonth;
4240             wxString FinalBirthdayYear;
4241             
4242             if (BirthdayDay < 10){
4243                 
4244                 FinalBirthdayDay = wxT("0") + wxString::Format(wxT("%i"), BirthdayDay);
4245                 
4246             } else {
4247                 
4248                 FinalBirthdayDay = wxString::Format(wxT("%i"), BirthdayDay);
4249                 
4250             }
4251             
4252             if (((int)BirthdayMonth + 1) < 10){
4253                 
4254                 FinalBirthdayMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1));
4255                 
4256             } else {
4257                 
4258                 FinalBirthdayMonth = wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1));
4259                 
4260             }
4261             
4262             if (BirthdayYear == 0){
4263                 
4264                 FinalBirthdayYear = wxT("--");
4265                 
4266             } else {
4267                 
4268                 FinalBirthdayYear = wxString::Format(wxT("%i"), BirthdayYear);
4269                 
4270             }
4271             
4272             if (!DataAfterT.IsEmpty()){
4273                 
4274                 FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay + wxT("T") + DataAfterT;
4275                 
4276             } else {
4277                 
4278                 FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay;
4279                 
4280             }
4281             
4282             if (!FinalBirthdayString.IsEmpty() || !strValue2.IsEmpty()){
4283                 
4284                 if (!strValue2.IsEmpty()){
4285                     
4286                     EscapeString(&strValue2, FALSE);
4287                     EscapeString(&strValue, FALSE);
4288                     
4289                     ContactData.AddRaw(wxT("BDAY") + strValue2 + wxT(";"), FinalBirthdayString);
4290                     
4291                 } else {
4292                     
4293                     EscapeString(&strValue, FALSE);
4294                     
4295                     ContactData.AddRaw(wxT("BDAY"), FinalBirthdayString);
4296                     
4297                 }
4298                 
4299             }
4300             
4301         }
4302         
4303     }
4304     
4305     ResetSaveProcessData();
4306     
4307     // Process Label.
4308     
4309     strValue3 = AnniversaryAltID;
4310     
4311     if (!strValue3.IsEmpty()){
4312         
4313         strValue3.Trim();
4314         strValue3.Trim();
4315         boolValue2 = TRUE;
4316         strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\""));
4317         
4318         boolValue = TRUE;
4319         
4320     }
4321     
4322     //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4323     //strValue2 =
4324     
4325     // Process Language.
4326     
4327     strValue3 = AnniversaryCalScale;
4328     
4329     if (!strValue3.IsEmpty()){
4330         
4331         strValue3.Trim();
4332         strValue3.Trim();
4333         
4334         if (boolValue2 == TRUE){
4335             
4336             strValue2.Append(wxT(";"));
4337             
4338         } else {
4339             
4340             boolValue2 = TRUE;
4341             
4342         }
4343         
4344         strValue2.Append(wxT("CALSCALE=") + strValue3);
4345         
4346         boolValue = TRUE;
4347         
4348     }
4349     
4350     // Process Tokens.
4351     
4352     strValue2 = AnniversaryTokens;
4353     
4354     // Deal with ANNIVERSARY.
4355     
4356     if (!txtAnniversary->IsEmpty()){
4357         
4358         strValue = txtAnniversary->GetValue();
4359         
4360         if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4361             
4362             if (!strValue2.IsEmpty()){
4363                 
4364                 EscapeString(&strValue2, FALSE);
4365                 EscapeString(&strValue, FALSE);
4366                 
4367                 ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text;") + strValue2 + wxT(";"), strValue);
4368                 
4369             } else {
4370                 
4371                 EscapeString(&strValue, FALSE);
4372                 
4373                 ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text"), strValue);
4374                 
4375             }
4376             
4377         }
4378         
4379     } else {
4380         
4381         // Look for T and replace data before this.
4382         
4383         // Get Day, Month & Year.
4384         
4385         wxDateTime AnniversaryDate;
4386         wxDateTime::Month AnniversaryMonth;
4387         int AnniversaryDay;
4388         int AnniversaryYear;
4389         wxString DataBeforeT;
4390         wxString DataAfterT;
4391         wxString FinalAnniversaryString;
4392         bool ProcessDataAfterT = FALSE;
4393         
4394         AnniversaryDate = dapAnniversary->GetValue();
4395         
4396         if (AnniversaryDate.IsValid()){
4397             
4398             AnniversaryDay = AnniversaryDate.GetDay();
4399             AnniversaryMonth = AnniversaryDate.GetMonth();
4400             AnniversaryYear = AnniversaryDate.GetYear();
4401             
4402             // Look for T and replace data before this.
4403             
4404             wxStringTokenizer wSTDate(Anniversary, wxT("T"));
4405             
4406             while (wSTDate.HasMoreTokens()){
4407                 
4408                 if (ProcessDataAfterT == FALSE){
4409                     
4410                     DataBeforeT = wSTDate.GetNextToken();
4411                     ProcessDataAfterT = TRUE;
4412                     
4413                 } else {
4414                     
4415                     DataAfterT = wSTDate.GetNextToken();
4416                     break;
4417                     
4418                 }
4419                 
4420             }
4421             
4422             // If there is not T then replace altogether.
4423             
4424             wxString FinalAnniversaryDay;
4425             wxString FinalAnniversaryMonth;
4426             wxString FinalAnniversaryYear;
4427             
4428             if (AnniversaryDay < 10){
4429                 
4430                 FinalAnniversaryDay = wxT("0") + wxString::Format(wxT("%i"), AnniversaryDay);
4431                 
4432             } else {
4433                 
4434                 FinalAnniversaryDay = wxString::Format(wxT("%i"), AnniversaryDay);
4435                 
4436             }
4437             
4438             if (((int)AnniversaryMonth + 1) < 10){
4439                 
4440                 FinalAnniversaryMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1));
4441                 
4442             } else {
4443                 
4444                 FinalAnniversaryMonth = wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1));
4445                 
4446             }
4447             
4448             if (AnniversaryYear == 0){
4449                 
4450                 FinalAnniversaryYear = wxT("--");
4451                 
4452             } else {
4453                 
4454                 FinalAnniversaryYear = wxString::Format(wxT("%i"), AnniversaryYear);
4455                 
4456             }
4457             
4458             if (!DataAfterT.IsEmpty()){
4459                 
4460                 FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay + wxT("T") + DataAfterT;
4461                 
4462             } else {
4463                 
4464                 FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay;
4465                 
4466             }
4467             
4468             if (!FinalAnniversaryString.IsEmpty() || !strValue2.IsEmpty()){
4469                 
4470                 if (!strValue2.IsEmpty()){
4471                     
4472                     EscapeString(&strValue2, FALSE);
4473                     EscapeString(&strValue, FALSE);
4474                     
4475                     ContactData.AddRaw(wxT("ANNIVERSARY") + strValue2 + wxT(";"), FinalAnniversaryString);
4476                     
4477                 } else {
4478                     
4479                     EscapeString(&strValue, FALSE);
4480                     
4481                     ContactData.AddRaw(wxT("ANNIVERSARY"), FinalAnniversaryString);
4482                     
4483                 }
4484                 
4485             }
4486             
4487         }
4488         
4489     }
4490     
4491     // Setup the addresses (General, Home, Business).
4492     
4493     //intValue = GeneralAddressList.size();
4494     ResetSaveProcessData();
4495     
4496     for (std::map<int,wxString>::iterator iter = GeneralAddressList.begin();
4497          iter != GeneralAddressList.end(); ++iter){
4498         
4499         int intSeekValue = iter->first;
4500         
4501         wxString strAddressString;
4502         wxString strAddressFinalValue;
4503         std::map<int, wxString>::iterator iterValue;
4504         
4505         strAddressString.Append(wxT(";;"));
4506         
4507         // Get Address
4508         
4509         iterValue = GeneralAddressList.find(intSeekValue);
4510         strAddressFinalValue = iterValue->second;
4511         ProcessCaptureStrings(&strAddressFinalValue);
4512         strAddressString.Append(strAddressFinalValue + wxT(";"));
4513         strAddressFinalValue.Clear();
4514         
4515         // Get Town
4516         
4517         iterValue = GeneralAddressListTown.find(intSeekValue);
4518         strAddressFinalValue = iterValue->second;
4519         ProcessCaptureStrings(&strAddressFinalValue);
4520         strAddressString.Append(strAddressFinalValue + wxT(";"));
4521         strAddressFinalValue.Clear();
4522         
4523         // Get County
4524         
4525         iterValue = GeneralAddressListCounty.find(intSeekValue);
4526         strAddressFinalValue = iterValue->second;
4527         ProcessCaptureStrings(&strAddressFinalValue);
4528         strAddressString.Append(strAddressFinalValue + wxT(";"));
4529         strAddressFinalValue.Clear();
4530         
4531         // Get Post Code
4532         
4533         iterValue = GeneralAddressListPostCode.find(intSeekValue);
4534         strAddressFinalValue = iterValue->second;
4535         ProcessCaptureStrings(&strAddressFinalValue);
4536         strAddressString.Append(strAddressFinalValue + wxT(";"));
4537         strAddressFinalValue.Clear();
4538         
4539         // Get Country
4540         
4541         iterValue = GeneralAddressListCountry.find(intSeekValue);
4542         strAddressFinalValue = iterValue->second;
4543         ProcessCaptureStrings(&strAddressFinalValue);
4544         strAddressString.Append(strAddressFinalValue);
4545         strAddressFinalValue.Clear();
4546         
4547         ProcessSaveData(wxT("ADR"), &strValue2, &boolValue2, &boolValue,
4548                         &iter, &strAddressString, &ContactData,
4549                         wxT("LABEL"), &GeneralAddressListLabel,
4550                         wxT("LANGUAGE"), &GeneralAddressListLang,
4551                         wxT("ALTID"), &GeneralAddressListAltID,
4552                         wxT("PID"), &GeneralAddressListPID,
4553                         wxT("GEO"), &GeneralAddressListGeo,
4554                         wxT("TZ"), &GeneralAddressListTimezone,
4555                         wxT("MEDIATYPE"), &GeneralAddressListMediatype,
4556                         wxT("PREF"), &GeneralAddressListPref,
4557                         wxT(""), &GeneralAddressListTokens );
4558         
4559         ResetSaveProcessData();
4560         
4561     }
4562     
4563     ResetSaveProcessData();
4564     
4565     for (std::map<int,wxString>::iterator iter = HomeAddressList.begin();
4566          iter != HomeAddressList.end(); ++iter){
4567         
4568         int intSeekValue = iter->first;
4569         
4570         wxString strAddressString;
4571         wxString strAddressFinalValue;
4572         std::map<int, wxString>::iterator iterValue;
4573         
4574         strAddressString.Append(wxT(";;"));
4575         
4576         // Get Address
4577         
4578         iterValue = HomeAddressList.find(intSeekValue);
4579         strAddressFinalValue = iterValue->second;
4580         ProcessCaptureStrings(&strAddressFinalValue);
4581         
4582         strAddressString.Append(strAddressFinalValue + wxT(";"));
4583         
4584         // Get Town
4585         
4586         iterValue = HomeAddressListTown.find(intSeekValue);
4587         strAddressFinalValue = iterValue->second;
4588         ProcessCaptureStrings(&strAddressFinalValue);
4589         
4590         strAddressString.Append(strAddressFinalValue + wxT(";"));
4591         
4592         // Get County
4593         
4594         iterValue = HomeAddressListCounty.find(intSeekValue);
4595         strAddressFinalValue = iterValue->second;
4596         ProcessCaptureStrings(&strAddressFinalValue);
4597         
4598         strAddressString.Append(strAddressFinalValue + wxT(";"));
4599         
4600         // Get Post Code
4601         
4602         iterValue = HomeAddressListPostCode.find(intSeekValue);
4603         strAddressFinalValue = iterValue->second;
4604         ProcessCaptureStrings(&strAddressFinalValue);
4605         
4606         strAddressString.Append(strAddressFinalValue + wxT(";"));
4607         
4608         // Get Country
4609         
4610         iterValue = HomeAddressListCountry.find(intSeekValue);
4611         strAddressFinalValue = iterValue->second;
4612         ProcessCaptureStrings(&strAddressFinalValue);
4613         
4614         strAddressString.Append(strAddressFinalValue);
4615         
4616         ProcessSaveData(wxT("ADR;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4617                         &iter, &strAddressString, &ContactData,
4618                         wxT("LABEL"), &HomeAddressListLabel,
4619                         wxT("LANGUAGE"), &HomeAddressListLang,
4620                         wxT("ALTID"), &HomeAddressListAltID,
4621                         wxT("PID"), &HomeAddressListPID,
4622                         wxT("GEO"), &HomeAddressListGeo,
4623                         wxT("TZ"), &HomeAddressListTimezone,
4624                         wxT("MEDIATYPE"), &HomeAddressListMediatype,
4625                         wxT("PREF"), &HomeAddressListPref,
4626                         wxT(""), &HomeAddressListTokens );
4627         
4628         ResetSaveProcessData();
4629         
4630     }
4631     
4632     ResetSaveProcessData();
4633     
4634     for (std::map<int,wxString>::iterator iter = BusinessAddressList.begin();
4635          iter != BusinessAddressList.end(); ++iter){
4636         
4637         int intSeekValue = iter->first;
4638         
4639         wxString strAddressString;
4640         wxString strAddressFinalValue;
4641         std::map<int, wxString>::iterator iterValue;
4642         
4643         strAddressString.Append(wxT(";;"));
4644         
4645         // Get Address
4646         
4647         iterValue = BusinessAddressList.find(intSeekValue);
4648         strAddressFinalValue = iterValue->second;
4649         ProcessCaptureStrings(&strAddressFinalValue);
4650         
4651         strAddressString.Append(strAddressFinalValue + wxT(";"));
4652         
4653         // Get Town
4654         
4655         iterValue = BusinessAddressListTown.find(intSeekValue);
4656         strAddressFinalValue = iterValue->second;
4657         ProcessCaptureStrings(&strAddressFinalValue);
4658         
4659         strAddressString.Append(strAddressFinalValue + wxT(";"));
4660         
4661         // Get County
4662         
4663         iterValue = BusinessAddressListCounty.find(intSeekValue);
4664         strAddressFinalValue = iterValue->second;
4665         ProcessCaptureStrings(&strAddressFinalValue);
4666         
4667         strAddressString.Append(strAddressFinalValue + wxT(";"));
4668         
4669         // Get Post Code
4670         
4671         iterValue = BusinessAddressListPostCode.find(intSeekValue);
4672         strAddressFinalValue = iterValue->second;
4673         ProcessCaptureStrings(&strAddressFinalValue);
4674         
4675         strAddressString.Append(strAddressFinalValue + wxT(";"));
4676         
4677         // Get Country
4678         
4679         iterValue = BusinessAddressListCountry.find(intSeekValue);
4680         strAddressFinalValue = iterValue->second;
4681         ProcessCaptureStrings(&strAddressFinalValue);
4682         
4683         strAddressString.Append(strAddressFinalValue);
4684         
4685         ProcessSaveData(wxT("ADR;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4686                         &iter, &strAddressString, &ContactData,
4687                         wxT("LABEL"), &BusinessAddressListLabel,
4688                         wxT("LANGUAGE"), &BusinessAddressListLang,
4689                         wxT("ALTID"), &BusinessAddressListAltID,
4690                         wxT("PID"), &BusinessAddressListPID,
4691                         wxT("GEO"), &BusinessAddressListGeo,
4692                         wxT("TZ"), &BusinessAddressListTimezone,
4693                         wxT("MEDIATYPE"), &BusinessAddressListMediatype,
4694                         wxT("PREF"), &BusinessAddressListPref,
4695                         wxT(""), &BusinessAddressListTokens );
4696         
4697         ResetSaveProcessData();
4698         
4699     }
4700     
4701     // Sort out nicknames (if any).
4702     
4703     for (std::map<int,wxString>::iterator iter = GeneralNicknamesList.begin();
4704          iter != GeneralNicknamesList.end(); ++iter){
4705         
4706         intValue2 = iter->first;
4707         
4708         // Process Alternative ID.
4709         
4710         ProcessSaveData(wxT("NICKNAME"), &strValue2, &boolValue2, &boolValue,
4711                         &iter, &GeneralNicknamesList, &ContactData,
4712                         wxT("LANGUAGE"), &GeneralNicknamesListLanguage,
4713                         wxT("ALTID"), &GeneralNicknamesListAltID,
4714                         wxT("PID"), &GeneralNicknamesListPID,
4715                         wxT("PREF"), &GeneralNicknamesListPref,
4716                         wxT(""), &GeneralNicknamesListTokens );
4717         
4718         ResetSaveProcessData();
4719         
4720     }
4721     
4722     ResetSaveProcessData();
4723     
4724     for (std::map<int,wxString>::iterator iter = HomeNicknamesList.begin();
4725          iter != HomeNicknamesList.end(); ++iter){
4726         
4727         ProcessSaveData(wxT("NICKNAME;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4728                         &iter, &HomeNicknamesList, &ContactData,
4729                         wxT("LANGUAGE"), &HomeNicknamesListLanguage,
4730                         wxT("ALTID"), &HomeNicknamesListAltID,
4731                         wxT("PID"), &HomeNicknamesListPID,
4732                         wxT("PREF"), &HomeNicknamesListPref,
4733                         wxT(""), &HomeNicknamesListTokens );
4734         
4735         ResetSaveProcessData();
4736         
4737     }
4738     
4739     ResetSaveProcessData();
4740     
4741     for (std::map<int,wxString>::iterator iter = BusinessNicknamesList.begin();
4742          iter != BusinessNicknamesList.end(); ++iter){
4743         
4744         ProcessSaveData(wxT("NICKNAME;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4745                         &iter, &BusinessNicknamesList, &ContactData,
4746                         wxT("LANGUAGE"), &BusinessNicknamesListLanguage,
4747                         wxT("ALTID"), &BusinessNicknamesListAltID,
4748                         wxT("PID"), &BusinessNicknamesListPID,
4749                         wxT("PREF"), &BusinessNicknamesListPref,
4750                         wxT(""), &BusinessNicknamesListTokens );
4751         
4752         ResetSaveProcessData();
4753         
4754     }
4755     
4756     ResetSaveProcessData();
4757     
4758     // Sort out email (general, home and business).
4759     
4760     for (std::map<int,wxString>::iterator iter = GeneralEmailList.begin();
4761          iter != GeneralEmailList.end(); ++iter){
4762         
4763         //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4764         //strValue2 =
4765         
4766         wxString strAddressFinalValue;
4767         std::map<int, wxString>::iterator iterValue;
4768         
4769         ProcessSaveData(wxT("EMAIL"), &strValue2, &boolValue2, &boolValue,
4770                         &iter, &GeneralEmailList, &ContactData,
4771                         wxT("ALTID"), &GeneralEmailListAltID,
4772                         wxT("PID"), &GeneralEmailListPID,
4773                         wxT("PREF"), &GeneralEmailListPref,
4774                         wxT(""), &GeneralEmailListTokens );
4775         
4776         ResetSaveProcessData();
4777         
4778     }
4779     
4780     ResetSaveProcessData();
4781     
4782     for (std::map<int,wxString>::iterator iter = HomeEmailList.begin();
4783          iter != HomeEmailList.end(); ++iter){
4784         
4785         //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4786         //strValue2 =
4787         
4788         ProcessSaveData(wxT("EMAIL;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4789                         &iter, &HomeEmailList, &ContactData,
4790                         wxT("ALTID"), &HomeEmailListAltID,
4791                         wxT("PID"), &HomeEmailListPID,
4792                         wxT("PREF"), &HomeEmailListPref,
4793                         wxT(""), &HomeEmailListTokens );
4794         
4795         ResetSaveProcessData();
4796         
4797     }
4798     
4799     ResetSaveProcessData();
4800     
4801     for (std::map<int,wxString>::iterator iter = BusinessEmailList.begin();
4802          iter != BusinessEmailList.end(); ++iter){
4803         
4804         //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4805         //strValue2 =
4806         
4807         ProcessSaveData(wxT("EMAIL;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4808                         &iter, &BusinessEmailList, &ContactData,
4809                         wxT("ALTID"), &BusinessEmailListAltID,
4810                         wxT("PID"), &BusinessEmailListPID,
4811                         wxT("PREF"), &BusinessEmailListPref,
4812                         wxT(""), &BusinessEmailListTokens );
4813         
4814         ResetSaveProcessData();
4815         
4816     }
4817     
4818     ResetSaveProcessData();
4819     
4820     for (std::map<int,wxString>::iterator iter = GeneralIMList.begin();
4821          iter != GeneralIMList.end(); ++iter){
4822         
4823         intValue2 = iter->first;
4824         
4825         // Process Alternative ID.
4826         
4827         ProcessSaveData(wxT("IMPP"), &strValue2, &boolValue2, &boolValue,
4828                         &iter, &GeneralIMList, &ContactData,
4829                         wxT("ALTID"), &GeneralIMListAltID,
4830                         wxT("PID"), &GeneralIMListPID,
4831                         wxT("MEDIATYPE"), &GeneralIMListMediatype,
4832                         wxT("PREF"), &GeneralIMListPref,
4833                         wxT(""), &GeneralIMListTokens );
4834         
4835         ResetSaveProcessData();
4836         
4837     }
4838     
4839     ResetSaveProcessData();
4840     
4841     for (std::map<int,wxString>::iterator iter = HomeIMList.begin();
4842          iter != HomeIMList.end(); ++iter){
4843         
4844         ProcessSaveData(wxT("IMPP;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4845                         &iter, &HomeIMList, &ContactData,
4846                         wxT("ALTID"), &HomeIMListAltID,
4847                         wxT("PID"), &HomeIMListPID,
4848                         wxT("MEDIATYPE"), &HomeIMListMediatype,
4849                         wxT("PREF"), &HomeIMListPref,
4850                         wxT(""), &HomeIMListTokens );
4851         
4852         ResetSaveProcessData();
4853         
4854     }
4855     
4856     ResetSaveProcessData();
4857     
4858     for (std::map<int,wxString>::iterator iter = BusinessIMList.begin();
4859          iter != BusinessIMList.end(); ++iter){
4860         
4861         ProcessSaveData(wxT("IMPP;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4862                         &iter, &BusinessIMList, &ContactData,
4863                         wxT("ALTID"), &BusinessIMListAltID,
4864                         wxT("PID"), &BusinessIMListPID,
4865                         wxT("MEDIATYPE"), &BusinessIMListMediatype,
4866                         wxT("PREF"), &BusinessIMListPref,
4867                         wxT(""), &BusinessIMListTokens );
4868         
4869         ResetSaveProcessData();
4870         
4871     }
4872     
4873     ResetSaveProcessData();
4874     
4875     for (std::map<int,wxString>::iterator iter = GeneralTelephoneList.begin();
4876          iter != GeneralTelephoneList.end(); ++iter){
4877         
4878         wxString strAddressFinalValue = iter->second;
4879         
4880         ProcessCaptureStrings(&strAddressFinalValue);
4881         
4882         strAddressFinalValue.insert(0, wxT("tel:"));
4883         
4884         ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4885                         &iter, &strAddressFinalValue, &ContactData,
4886                         wxT("ALTID"), &GeneralTelephoneListAltID,
4887                         wxT("PID"), &GeneralTelephoneListPID,
4888                         wxT("TYPE"), &GeneralTelephoneListType,
4889                         wxT("PREF"), &GeneralTelephoneListPref,
4890                         wxT(""), &GeneralTelephoneListTokens );
4891         
4892         ResetSaveProcessData();
4893         
4894     }
4895     
4896     ResetSaveProcessData();
4897     
4898     for (std::map<int,wxString>::iterator iter = HomeTelephoneList.begin();
4899          iter != HomeTelephoneList.end(); ++iter){
4900         
4901         wxString strAddressFinalValue = iter->second;
4902         
4903         ProcessCaptureStrings(&strAddressFinalValue);
4904         
4905         strAddressFinalValue.insert(0, wxT("tel:"));
4906         
4907         ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4908                         &iter, &strAddressFinalValue, &ContactData,
4909                         wxT("ALTID"), &HomeTelephoneListAltID,
4910                         wxT("PID"), &HomeTelephoneListPID,
4911                         wxT("TYPE"), &HomeTelephoneListType,
4912                         wxT("PREF"), &HomeTelephoneListPref,
4913                         wxT(""), &HomeTelephoneListTokens );
4914         
4915         ResetSaveProcessData();
4916         
4917     }
4918     
4919     ResetSaveProcessData();
4920     
4921     for (std::map<int,wxString>::iterator iter = BusinessTelephoneList.begin();
4922          iter != BusinessTelephoneList.end(); ++iter){
4923         
4924         wxString strAddressFinalValue = iter->second;
4925         
4926         ProcessCaptureStrings(&strAddressFinalValue);
4927         
4928         strAddressFinalValue.insert(0, wxT("tel:"));
4929         
4930         ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4931                         &iter, &strAddressFinalValue, &ContactData,
4932                         wxT("ALTID"), &BusinessTelephoneListAltID,
4933                         wxT("PID"), &BusinessTelephoneListPID,
4934                         wxT("TYPE"), &BusinessTelephoneListType,
4935                         wxT("PREF"), &BusinessTelephoneListPref,
4936                         wxT(""), &BusinessTelephoneListTokens );
4937         
4938         ResetSaveProcessData();
4939         
4940     }
4941     
4942     ResetSaveProcessData();
4943     
4944     for (std::map<int,wxString>::iterator iter = GeneralLanguageList.begin();
4945          iter != GeneralLanguageList.end(); ++iter){
4946         
4947         intValue2 = iter->first;
4948         
4949         ProcessSaveData(wxT("LANG"), &strValue2, &boolValue2, &boolValue,
4950                         &iter, &GeneralLanguageList, &ContactData,
4951                         wxT("ALTID"), &GeneralLanguageListAltID,
4952                         wxT("PID"), &GeneralLanguageListPID,
4953                         wxT("PREF"), &GeneralLanguageListPref,
4954                         wxT(""), &GeneralLanguageListTokens );
4955         
4956         ResetSaveProcessData();
4957         
4958     }
4959     
4960     ResetSaveProcessData();
4961     
4962     for (std::map<int,wxString>::iterator iter = HomeLanguageList.begin();
4963          iter != HomeLanguageList.end(); ++iter){
4964         
4965         ProcessSaveData(wxT("LANG;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4966                         &iter, &HomeLanguageList, &ContactData,
4967                         wxT("ALTID"), &HomeLanguageListAltID,
4968                         wxT("PID"), &HomeLanguageListPID,
4969                         wxT("PREF"), &HomeLanguageListPref,
4970                         wxT(""), &HomeLanguageListTokens );
4971         
4972         ResetSaveProcessData();
4973         
4974     }
4975     
4976     ResetSaveProcessData();
4977     
4978     for (std::map<int,wxString>::iterator iter = BusinessLanguageList.begin();
4979          iter != BusinessLanguageList.end(); ++iter){
4980         
4981         ProcessSaveData(wxT("LANG;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4982                         &iter, &BusinessLanguageList, &ContactData,
4983                         wxT("ALTID"), &BusinessLanguageListAltID,
4984                         wxT("PID"), &BusinessLanguageListPID,
4985                         wxT("PREF"), &BusinessLanguageListPref,
4986                         wxT(""), &BusinessLanguageListTokens );
4987         
4988         ResetSaveProcessData();
4989         
4990     }
4991     
4992     ResetSaveProcessData();
4993     
4994     for (std::map<int,wxString>::iterator iter = GeneralTZList.begin();
4995          iter != GeneralTZList.end(); ++iter){
4996         
4997         ProcessSaveData(wxT("TZ"), &strValue2, &boolValue2, &boolValue,
4998                         &iter, &GeneralTZList, &ContactData,
4999                         wxT("ALTID"), &GeneralTZListAltID,
5000                         wxT("PID"), &GeneralTZListPID,
5001                         wxT("MEDIATYPE"), &GeneralTZListMediatype,
5002                         wxT("PREF"), &GeneralTZListPref,
5003                         wxT(""), &GeneralTZListTokens );
5004         
5005         ResetSaveProcessData();
5006         
5007     }
5008     
5009     ResetSaveProcessData();
5010     
5011     for (std::map<int,wxString>::iterator iter = HomeTZList.begin();
5012          iter != HomeTZList.end(); ++iter){
5013         
5014         ProcessSaveData(wxT("TZ;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5015                         &iter, &HomeTZList, &ContactData,
5016                         wxT("ALTID"), &HomeTZListAltID,
5017                         wxT("PID"), &HomeTZListPID,
5018                         wxT("MEDIATYPE"), &HomeTZListMediatype,
5019                         wxT("PREF"), &HomeTZListPref,
5020                         wxT(""), &HomeTZListTokens );
5021         
5022         ResetSaveProcessData();
5023         
5024     }
5025     
5026     ResetSaveProcessData();
5027     
5028     for (std::map<int,wxString>::iterator iter = BusinessTZList.begin();
5029          iter != BusinessTZList.end(); ++iter){
5030         
5031         ProcessSaveData(wxT("TZ;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5032                         &iter, &BusinessTZList, &ContactData,
5033                         wxT("ALTID"), &BusinessTZListAltID,
5034                         wxT("PID"), &BusinessTZListPID,
5035                         wxT("MEDIATYPE"), &BusinessTZListMediatype,
5036                         wxT("PREF"), &BusinessTZListPref,
5037                         wxT(""), &BusinessTZListTokens );
5038         
5039         ResetSaveProcessData();
5040         
5041     }
5042     
5043     ResetSaveProcessData();
5044     
5045     for (std::map<int,wxString>::iterator iter = GeneralGeographyList.begin();
5046          iter != GeneralGeographyList.end(); ++iter){
5047         
5048         wxString strAddressFinalValue = iter->second;
5049         
5050         ProcessCaptureStrings(&strAddressFinalValue);
5051         
5052         strAddressFinalValue.insert(0, wxT("geo:"));
5053         
5054         ProcessSaveData(wxT("GEO"), &strValue2, &boolValue2, &boolValue,
5055                         &iter, &strAddressFinalValue, &ContactData,
5056                         wxT("ALTID"), &GeneralGeographyListAltID,
5057                         wxT("PID"), &GeneralGeographyListPID,
5058                         wxT("MEDIATYPE"), &GeneralGeographyListMediatype,
5059                         wxT("PREF"), &GeneralGeographyListPref,
5060                         wxT(""), &GeneralGeographyListTokens );
5061         
5062         ResetSaveProcessData();
5063         
5064     }
5065     
5066     ResetSaveProcessData();
5067     
5068     for (std::map<int,wxString>::iterator iter = HomeGeographyList.begin();
5069          iter != HomeGeographyList.end(); ++iter){
5070         
5071         wxString strAddressFinalValue = iter->second;
5072         
5073         ProcessCaptureStrings(&strAddressFinalValue);
5074         
5075         strAddressFinalValue.insert(0, wxT("geo:"));
5076         
5077         ProcessSaveData(wxT("GEO;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5078                         &iter, &HomeGeographyList, &ContactData,
5079                         wxT("ALTID"), &HomeGeographyListAltID,
5080                         wxT("PID"), &HomeGeographyListPID,
5081                         wxT("MEDIATYPE"), &HomeGeographyListMediatype,
5082                         wxT("PREF"), &HomeGeographyListPref,
5083                         wxT(""), &HomeGeographyListTokens );
5084         
5085         ResetSaveProcessData();
5086         
5087     }
5088     
5089     ResetSaveProcessData();
5090     
5091     for (std::map<int,wxString>::iterator iter = BusinessGeographyList.begin();
5092          iter != BusinessGeographyList.end(); ++iter){
5093         
5094         wxString strAddressFinalValue = iter->second;
5095         
5096         ProcessCaptureStrings(&strAddressFinalValue);
5097         
5098         strAddressFinalValue.insert(0, wxT("geo:"));
5099         
5100         ProcessSaveData(wxT("GEO;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5101                         &iter, &BusinessGeographyList, &ContactData,
5102                         wxT("ALTID"), &BusinessGeographyListAltID,
5103                         wxT("PID"), &BusinessGeographyListPID,
5104                         wxT("MEDIATYPE"), &BusinessGeographyListMediatype,
5105                         wxT("PREF"), &BusinessGeographyListPref,
5106                         wxT(""), &BusinessGeographyListTokens );
5107         
5108         ResetSaveProcessData();
5109         
5110     }
5111     
5112     ResetSaveProcessData();
5113     
5114     for (std::map<int,wxString>::iterator iter = GeneralRelatedList.begin();
5115          iter != GeneralRelatedList.end(); ++iter){
5116         
5117         ProcessSaveData(wxT("RELATED"), &strValue2, &boolValue2, &boolValue,
5118                         &iter, &GeneralRelatedList, &ContactData,
5119                         wxT("ALTID"), &GeneralRelatedListAltID,
5120                         wxT("PID"), &GeneralRelatedListPID,
5121                         wxT("LANGUAGE"), &GeneralRelatedListLanguage,
5122                         wxT("TYPE"), &GeneralRelatedListRelType,
5123                         wxT("PREF"), &GeneralRelatedListPref,
5124                         wxT(""), &GeneralRelatedListTokens );
5125         
5126         ResetSaveProcessData();
5127         
5128     }
5129     
5130     ResetSaveProcessData();
5131     
5132     for (std::map<int,wxString>::iterator iter = GeneralWebsiteList.begin();
5133          iter != GeneralWebsiteList.end(); ++iter){
5134         
5135         ProcessSaveData(wxT("URL"), &strValue2, &boolValue2, &boolValue,
5136                         &iter, &GeneralWebsiteList, &ContactData,
5137                         wxT("ALTID"), &GeneralWebsiteListAltID,
5138                         wxT("PID"), &GeneralWebsiteListPID,
5139                         wxT("MEDIATYPE"), &GeneralWebsiteListMediatype,
5140                         wxT("PREF"), &GeneralWebsiteListPref,
5141                         wxT(""), &GeneralWebsiteListTokens );
5142         
5143         ResetSaveProcessData();
5144         
5145     }
5146     
5147     ResetSaveProcessData();
5148     
5149     for (std::map<int,wxString>::iterator iter = HomeWebsiteList.begin();
5150          iter != HomeWebsiteList.end(); ++iter){
5151         
5152         ProcessSaveData(wxT("URL;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5153                         &iter, &HomeWebsiteList, &ContactData,
5154                         wxT("ALTID"), &HomeWebsiteListAltID,
5155                         wxT("PID"), &HomeWebsiteListPID,
5156                         wxT("MEDIATYPE"), &HomeWebsiteListMediatype,
5157                         wxT("PREF"), &HomeWebsiteListPref,
5158                         wxT(""), &HomeWebsiteListTokens );
5159         
5160         ResetSaveProcessData();
5161         
5162     }
5163     
5164     ResetSaveProcessData();
5165     
5166     for (std::map<int,wxString>::iterator iter = BusinessWebsiteList.begin();
5167          iter != BusinessWebsiteList.end(); ++iter){
5168         
5169         ProcessSaveData(wxT("URL;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5170                         &iter, &BusinessWebsiteList, &ContactData,
5171                         wxT("ALTID"), &BusinessWebsiteListAltID,
5172                         wxT("PID"), &BusinessWebsiteListPID,
5173                         wxT("MEDIATYPE"), &BusinessWebsiteListMediatype,
5174                         wxT("PREF"), &BusinessWebsiteListPref,
5175                         wxT(""), &BusinessWebsiteListTokens );
5176         
5177         ResetSaveProcessData();
5178         
5179     }
5180     
5181     ResetSaveProcessData();
5182     
5183     for (std::map<int,wxString>::iterator iter = GeneralTitleList.begin();
5184          iter != GeneralTitleList.end(); ++iter){
5185         
5186         ProcessSaveData(wxT("TITLE"), &strValue2, &boolValue2, &boolValue,
5187                         &iter, &GeneralTitleList, &ContactData,
5188                         wxT("ALTID"), &GeneralTitleListAltID,
5189                         wxT("PID"), &GeneralTitleListPID,
5190                         wxT("LANGUAGE"), &GeneralTitleListLanguage,
5191                         wxT("PREF"), &GeneralTitleListPref,
5192                         wxT(""), &GeneralTitleListTokens );
5193         
5194         ResetSaveProcessData();
5195         
5196     }
5197     
5198     ResetSaveProcessData();
5199     
5200     for (std::map<int,wxString>::iterator iter = HomeTitleList.begin();
5201          iter != HomeTitleList.end(); ++iter){
5202         
5203         ProcessSaveData(wxT("TITLE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5204                         &iter, &HomeTitleList, &ContactData,
5205                         wxT("ALTID"), &HomeTitleListAltID,
5206                         wxT("PID"), &HomeTitleListPID,
5207                         wxT("LANGUAGE"), &HomeTitleListLanguage,
5208                         wxT("PREF"), &HomeTitleListPref,
5209                         wxT(""), &HomeTitleListTokens );
5210         
5211         ResetSaveProcessData();
5212         
5213     }
5214     
5215     ResetSaveProcessData();
5216     
5217     for (std::map<int,wxString>::iterator iter = BusinessTitleList.begin();
5218          iter != BusinessTitleList.end(); ++iter){
5219         
5220         ProcessSaveData(wxT("TITLE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5221                         &iter, &BusinessTitleList, &ContactData,
5222                         wxT("ALTID"), &BusinessTitleListAltID,
5223                         wxT("PID"), &BusinessTitleListPID,
5224                         wxT("LANGUAGE"), &BusinessTitleListLanguage,
5225                         wxT("PREF"), &BusinessTitleListPref,
5226                         wxT(""), &BusinessTitleListTokens );
5227         
5228         ResetSaveProcessData();
5229         
5230     }
5231     
5232     ResetSaveProcessData();
5233     
5234     for (std::map<int,wxString>::iterator iter = GeneralRoleList.begin();
5235          iter != GeneralRoleList.end(); ++iter){
5236         
5237         ProcessSaveData(wxT("ROLE"), &strValue2, &boolValue2, &boolValue,
5238                         &iter, &GeneralRoleList, &ContactData,
5239                         wxT("ALTID"), &GeneralRoleListAltID,
5240                         wxT("PID"), &GeneralRoleListPID,
5241                         wxT("LANGUAGE"), &GeneralRoleListLanguage,
5242                         wxT("PREF"), &GeneralRoleListPref,
5243                         wxT(""), &GeneralRoleListTokens );
5244         
5245         ResetSaveProcessData();
5246         
5247     }
5248     
5249     ResetSaveProcessData();
5250     
5251     for (std::map<int,wxString>::iterator iter = HomeRoleList.begin();
5252          iter != HomeRoleList.end(); ++iter){
5253         
5254         ProcessSaveData(wxT("ROLE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5255                         &iter, &HomeRoleList, &ContactData,
5256                         wxT("ALTID"), &HomeRoleListAltID,
5257                         wxT("PID"), &HomeRoleListPID,
5258                         wxT("LANGUAGE"), &HomeRoleListLanguage,
5259                         wxT("PREF"), &HomeRoleListPref,
5260                         wxT(""), &HomeRoleListTokens );
5261         
5262         ResetSaveProcessData();
5263         
5264     }
5265     
5266     ResetSaveProcessData();
5267     
5268     for (std::map<int,wxString>::iterator iter = BusinessRoleList.begin();
5269          iter != BusinessRoleList.end(); ++iter){
5270         
5271         ProcessSaveData(wxT("ROLE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5272                         &iter, &BusinessRoleList, &ContactData,
5273                         wxT("ALTID"), &BusinessRoleListAltID,
5274                         wxT("PID"), &BusinessRoleListPID,
5275                         wxT("LANGUAGE"), &BusinessRoleListLanguage,
5276                         wxT("PREF"), &BusinessRoleListPref,
5277                         wxT(""), &BusinessRoleListTokens );
5278         
5279         ResetSaveProcessData();
5280         
5281     }
5282     
5283     ResetSaveProcessData();
5284     
5285     for (std::map<int,wxString>::iterator iter = GeneralOrganisationsList.begin();
5286          iter != GeneralOrganisationsList.end(); ++iter){
5287         
5288         ProcessSaveData(wxT("ORG"), &strValue2, &boolValue2, &boolValue,
5289                         &iter, &GeneralOrganisationsList, &ContactData,
5290                         wxT("ALTID"), &GeneralOrganisationsListAltID,
5291                         wxT("PID"), &GeneralOrganisationsListPID,
5292                         wxT("LANGUAGE"), &GeneralOrganisationsListLanguage,
5293                         wxT("SORT-AS"), &GeneralOrganisationsListSortAs,
5294                         wxT("PREF"), &GeneralOrganisationsListPref,
5295                         wxT(""), &GeneralOrganisationsListTokens );
5296         
5297         ResetSaveProcessData();
5298         
5299     }
5300     
5301     ResetSaveProcessData();
5302     
5303     for (std::map<int,wxString>::iterator iter = HomeOrganisationsList.begin();
5304          iter != HomeOrganisationsList.end(); ++iter){
5305         
5306         ProcessSaveData(wxT("ORG;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5307                         &iter, &HomeOrganisationsList, &ContactData,
5308                         wxT("ALTID"), &HomeOrganisationsListAltID,
5309                         wxT("PID"), &HomeOrganisationsListPID,
5310                         wxT("LANGUAGE"), &HomeOrganisationsListLanguage,
5311                         wxT("SORT-AS"), &HomeOrganisationsListSortAs,
5312                         wxT("PREF"), &HomeOrganisationsListPref,
5313                         wxT(""), &HomeOrganisationsListTokens );
5314         
5315         ResetSaveProcessData();
5316         
5317     }
5318     
5319     ResetSaveProcessData();
5320     
5321     for (std::map<int,wxString>::iterator iter = BusinessOrganisationsList.begin();
5322          iter != BusinessOrganisationsList.end(); ++iter){
5323         
5324         ProcessSaveData(wxT("ORG;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5325                         &iter, &BusinessOrganisationsList, &ContactData,
5326                         wxT("ALTID"), &BusinessOrganisationsListAltID,
5327                         wxT("PID"), &BusinessOrganisationsListPID,
5328                         wxT("LANGUAGE"), &BusinessOrganisationsListLanguage,
5329                         wxT("SORT-AS"), &BusinessOrganisationsListSortAs,
5330                         wxT("PREF"), &BusinessOrganisationsListPref,
5331                         wxT(""), &BusinessOrganisationsListTokens );
5332         
5333         ResetSaveProcessData();
5334         
5335     }
5336     
5337     ResetSaveProcessData();
5338     
5339     for (std::map<int,wxString>::iterator iter = GeneralNoteList.begin();
5340          iter != GeneralNoteList.end(); ++iter){
5341         
5342         ProcessSaveData(wxT("NOTE"), &strValue2, &boolValue2, &boolValue,
5343                         &iter, &GeneralNoteList, &ContactData,
5344                         wxT("ALTID"), &GeneralNoteListAltID,
5345                         wxT("PID"), &GeneralNoteListPID,
5346                         wxT("LANGUAGE"), &GeneralNoteListLanguage,
5347                         wxT("PREF"), &GeneralNoteListPref,
5348                         wxT(""), &GeneralNoteListTokens );
5349         
5350         ResetSaveProcessData();
5351         
5352     }
5353     
5354     ResetSaveProcessData();
5355     
5356     for (std::map<int,wxString>::iterator iter = HomeNoteList.begin();
5357          iter != HomeNoteList.end(); ++iter){
5358         
5359         ProcessSaveData(wxT("NOTE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5360                         &iter, &HomeNoteList, &ContactData,
5361                         wxT("ALTID"), &HomeNoteListAltID,
5362                         wxT("PID"), &HomeNoteListPID,
5363                         wxT("LANGUAGE"), &HomeNoteListLanguage,
5364                         wxT("PREF"), &HomeNoteListPref,
5365                         wxT(""), &HomeNoteListTokens );
5366         
5367         ResetSaveProcessData();
5368         
5369     }
5370     
5371     ResetSaveProcessData();
5372     
5373     for (std::map<int,wxString>::iterator iter = BusinessNoteList.begin();
5374          iter != BusinessNoteList.end(); ++iter){
5375         
5376         ProcessSaveData(wxT("NOTE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5377                         &iter, &BusinessNoteList, &ContactData,
5378                         wxT("ALTID"), &BusinessNoteListAltID,
5379                         wxT("PID"), &BusinessNoteListPID,
5380                         wxT("LANGUAGE"), &BusinessNoteListLanguage,
5381                         wxT("PREF"), &BusinessNoteListPref,
5382                         wxT(""), &BusinessNoteListTokens );
5383         
5384         ResetSaveProcessData();
5385         
5386     }
5387     
5388     ResetSaveProcessData();
5389     
5390     for (std::map<int,wxString>::iterator iter = CategoriesList.begin();
5391          iter != CategoriesList.end(); ++iter){
5392         
5393         ProcessSaveData(wxT("CATEGORIES"), &strValue2, &boolValue2, &boolValue,
5394                         &iter, &CategoriesList, &ContactData,
5395                         wxT("ALTID"), &CategoriesListAltID,
5396                         wxT("PID"), &CategoriesListPID,
5397                         wxT("TYPE"), &CategoriesListType,
5398                         wxT("PREF"), &CategoriesListPref,
5399                         wxT(""), &CategoriesListTokens );
5400         
5401         ResetSaveProcessData();
5402         
5403     }
5404     
5405     // Pictures.
5406     
5407     for (std::map<int, std::string>::iterator iter = PicturesList.begin();
5408          iter != PicturesList.end(); ++iter){
5409         
5410         int intValueIndex = iter->first;
5411         
5412         std::map<int, std::string>::iterator stdstriter;
5413         std::map<int, wxString>::iterator enciter;
5414         
5415         striter = PicturesListPictureType.find(intValueIndex);
5416         enciter = PicturesListPicEncType.find(intValueIndex);
5417         
5418         ProcessSaveData(wxT("PHOTO"), &strValue2, &boolValue2, &boolValue,
5419                         &iter, &PicturesList, &striter,
5420                         &enciter, &ContactData,
5421                         wxT("ALTID"), &PicturesListAltID,
5422                         wxT("PID"), &PicturesListPID,
5423                         wxT("TYPE"), &PicturesListType,
5424                         wxT("PREF"), &PicturesListPref,
5425                         wxT(""), &PicturesListTokens);
5426         
5427         ResetSaveProcessData();
5428         
5429     }
5430     
5431     ResetSaveProcessData();
5432     
5433     // Logos.
5434     
5435     for (std::map<int, std::string>::iterator iter = LogosList.begin();
5436          iter != LogosList.end(); ++iter){
5437         
5438         int intValueIndex = iter->first;
5439         
5440         std::map<int, std::string>::iterator stdstriter;
5441         std::map<int, wxString>::iterator enciter;
5442         
5443         striter = LogosListPictureType.find(intValueIndex);
5444         enciter = LogosListPicEncType.find(intValueIndex);
5445         
5446         ProcessSaveData(wxT("LOGO"), &strValue2, &boolValue2, &boolValue,
5447                         &iter, &LogosList, &striter,
5448                         &enciter, &ContactData,
5449                         wxT("ALTID"), &LogosListAltID,
5450                         wxT("PID"), &LogosListPID,
5451                         wxT("TYPE"), &LogosListType,
5452                         wxT("PREF"), &LogosListPref,
5453                         wxT(""), &LogosListTokens );
5454         
5455         ResetSaveProcessData();
5456         
5457     }
5458     
5459     ResetSaveProcessData();
5460     
5461     // Sounds.
5462     
5463     for (std::map<int, std::string>::iterator iter = SoundsList.begin();
5464          iter != SoundsList.end(); ++iter){
5465         
5466         int intValueIndex = iter->first;
5467         
5468         std::map<int, std::string>::iterator stdstriter;
5469         std::map<int, wxString>::iterator enciter;
5470         
5471         striter = SoundsListAudioType.find(intValueIndex);
5472         enciter = SoundsListAudioEncType.find(intValueIndex);
5473         
5474         ProcessSaveData(wxT("SOUND"), &strValue2, &boolValue2, &boolValue,
5475                         &iter, &SoundsList, &striter,
5476                         &enciter, &ContactData,
5477                         wxT("ALTID"), &SoundsListAltID,
5478                         wxT("PID"), &SoundsListPID,
5479                         wxT("TYPE"), &SoundsListType,
5480                         wxT("PREF"), &SoundsListPref,
5481                         wxT(""), &SoundsListTokens );
5482         
5483         ResetSaveProcessData();
5484         
5485     }
5486     
5487     ResetSaveProcessData();
5488     
5489     for (std::map<int,wxString>::iterator iter = CalendarList.begin();
5490          iter != CalendarList.end(); ++iter){
5491         
5492         ProcessSaveData(wxT("CALURI"), &strValue2, &boolValue2, &boolValue,
5493                         &iter, &CalendarList, &ContactData,
5494                         wxT("ALTID"), &CalendarListAltID,
5495                         wxT("PID"), &CalendarListPID,
5496                         wxT("MEDIATYPE"), &CalendarListMediatype,
5497                         wxT("TYPE"), &CalendarListType,
5498                         wxT("PREF"), &CalendarListPref,
5499                         wxT(""), &CalendarListTokens );
5500         
5501         ResetSaveProcessData();
5502         
5503     }
5504     
5505     ResetSaveProcessData();
5506     
5507     for (std::map<int,wxString>::iterator iter = CalendarRequestList.begin();
5508          iter != CalendarRequestList.end(); ++iter){
5509         
5510         ProcessSaveData(wxT("CALADRURI"), &strValue2, &boolValue2, &boolValue,
5511                         &iter, &CalendarRequestList, &ContactData,
5512                         wxT("ALTID"), &CalendarRequestListAltID,
5513                         wxT("PID"), &CalendarRequestListPID,
5514                         wxT("MEDIATYPE"), &CalendarRequestListMediatype,
5515                         wxT("TYPE"), &CalendarRequestListType,
5516                         wxT("PREF"), &CalendarRequestListPref,
5517                         wxT(""), &CalendarRequestListTokens );
5518         
5519         ResetSaveProcessData();
5520         
5521     }
5522     
5523     ResetSaveProcessData();
5524     
5525     for (std::map<int,wxString>::iterator iter = FreeBusyList.begin();
5526          iter != FreeBusyList.end(); ++iter){
5527         
5528         ProcessSaveData(wxT("FBURL"), &strValue2, &boolValue2, &boolValue,
5529                         &iter, &FreeBusyList, &ContactData,
5530                         wxT("ALTID"), &FreeBusyListAltID,
5531                         wxT("PID"), &FreeBusyListPID,
5532                         wxT("MEDIATYPE"), &FreeBusyListMediatype,
5533                         wxT("TYPE"), &FreeBusyListType,
5534                         wxT("PREF"), &FreeBusyListPref,
5535                         wxT(""), &FreeBusyListTokens );
5536         
5537         ResetSaveProcessData();
5538         
5539     }
5540     
5541     for (std::map<int, wxString>::iterator iter = KeyList.begin();
5542          iter != KeyList.end(); ++iter){
5543         
5544         intValue2 = iter->first;
5545         
5546         // Process Alternative ID.
5547         
5548         striter = KeyListAltID.find(intValue2);
5549         
5550         if (striter->first == intValue2){
5551             
5552             strValue3 = striter->second;
5553             
5554             if (!strValue3.IsEmpty()){
5555                 
5556                 strValue3.Trim();
5557                 strValue3.Trim();
5558                 
5559                 if (boolValue2 == TRUE){
5560                     
5561                     strValue2.Append(wxT(";"));
5562                     
5563                 } else {
5564                     
5565                     boolValue2 = TRUE;
5566                     
5567                 }
5568                 
5569                 strValue2.Append(wxT("ALTID=") + strValue3);
5570                 
5571                 boolValue = TRUE;
5572                 
5573             }
5574             
5575         }
5576         
5577         // Process PID.
5578         
5579         striter = KeyListPID.find(intValue2);
5580         
5581         if (striter->first == intValue2){
5582             
5583             strValue3 = striter->second;
5584             
5585             if (!strValue3.IsEmpty()){
5586                 
5587                 strValue3.Trim();
5588                 strValue3.Trim();
5589                 
5590                 if (boolValue2 == TRUE){
5591                     
5592                     strValue2.Append(wxT(";"));
5593                     
5594                 } else {
5595                     
5596                     boolValue2 = TRUE;
5597                     
5598                 }
5599                 
5600                 strValue2.Append(wxT("PID=") + strValue3);
5601                 
5602                 boolValue = TRUE;
5603                 
5604             }
5605             
5606         }
5607         
5608         // Process Type.
5609         
5610         striter = KeyListType.find(intValue2);
5611         
5612         if (striter->first == intValue2){
5613             
5614             strValue3 = striter->second;
5615             
5616             if (!strValue3.IsEmpty()){
5617                 
5618                 strValue3.Trim();
5619                 strValue3.Trim();
5620                 
5621                 if (boolValue2 == TRUE){
5622                     
5623                     strValue2.Append(wxT(";"));
5624                     
5625                 } else {
5626                     
5627                     boolValue2 = TRUE;
5628                     
5629                 }
5630                 
5631                 strValue2.Append(wxT("TYPE=") + strValue3);
5632                 
5633                 boolValue = TRUE;
5634                 
5635             }
5636             
5637         }
5638         
5639         intiter = KeyListPref.find(intValue2);
5640         
5641         if (intiter->first == intValue2){
5642             
5643             intValue3 = intiter->second;
5644             
5645             if (intValue3){
5646                 
5647                 if (boolValue2 == TRUE){
5648                     
5649                     strValue2.Append(wxT(";"));
5650                     
5651                 } else {
5652                     
5653                     boolValue2 = TRUE;
5654                     
5655                 }
5656                 
5657                 strValue2.Append(wxT("PREF=") + wxString::Format(wxT("%i"), intValue3));
5658                 
5659                 boolValue = TRUE;
5660                 
5661             }
5662             
5663         }       
5664         
5665         // Process Tokens.
5666         
5667         striter = KeyListTokens.find(intValue2);
5668         
5669         if (striter->first == intValue2){
5670             
5671             strValue3 = striter->second;
5672             
5673             if (!strValue3.IsEmpty()){
5674                 
5675                 strValue3.Trim();
5676                 strValue3.Trim();
5677                 
5678                 if (boolValue2 == TRUE){
5679                     
5680                     strValue2.Append(wxT(";"));
5681                     
5682                 } else {
5683                     
5684                     boolValue2 = TRUE;
5685                     
5686                 }
5687                 
5688                 strValue2.Append(strValue3);
5689                 
5690                 boolValue = TRUE;
5691                 
5692             }
5693             
5694         }       
5695         
5696         // Get the key information.
5697         
5698         std::map<int, wxString>::iterator enciter;
5699         
5700         striter = KeyListDataType.find(intValue2);      
5701         //enciter = KeyListAudioEncType.find(intValue2);
5702         
5703         wxString strValueData;
5704         
5705         strValueData = iter->second;    
5706         //strValueData.insert(0, wxT("data:") + striter->second + wxT(";") + enciter->second + wxT(","));
5707         strValueData.insert(0, wxT("data:") + striter->second + wxT(";base64,"));       
5708         
5709         
5710         // Add to the vCard.
5711         
5712         if (boolValue == TRUE){
5713             
5714             ContactData.AddRaw(wxT("KEY;") + strValue2, strValueData);
5715             
5716         } else {
5717             
5718             ContactData.Add(wxT("KEY"), strValueData, TRUE);
5719             
5720         }
5721         
5722         ResetSaveProcessData();   
5723         
5724     }
5725     
5726     // Vendor specific items.
5727     
5728     ResetSaveProcessData();   
5729     
5730     for (std::map<int,wxString>::iterator iter = VendorList.begin();
5731          iter != VendorList.end(); ++iter){
5732         
5733         intValue2 = iter->first;        
5734         
5735         // Get the IANA PEN number.
5736         
5737         striter = VendorListPEN.find(intValue2);
5738         
5739         if (striter->first == intValue2){
5740             
5741             strValue2 = striter->second;
5742             
5743         }
5744         
5745         // Get the element name.
5746         
5747         striter = VendorListElement.find(intValue2);
5748         
5749         if (striter->first == intValue2){
5750             
5751             strValue3 = striter->second;
5752             
5753         }
5754         
5755         // Get the address.
5756         
5757         striter = VendorList.find(intValue2);
5758         
5759         if (striter->first == intValue2){
5760             
5761             strValue = striter->second;
5762             
5763         }
5764         
5765         // Add to the vCard.
5766         
5767         if (boolValue == TRUE){
5768             
5769             ContactData.AddRaw(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue);
5770             
5771         } else {
5772             
5773             ContactData.Add(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue, FALSE);
5774             
5775         }
5776         
5777         ResetSaveProcessData();
5778         
5779     }              
5780     
5781     ResetSaveProcessData();  
5782     
5783     // X-Tokens.
5784     
5785     for (std::map<int,wxString>::iterator iter = XTokenList.begin();
5786          iter != XTokenList.end(); ++iter){
5787         
5788         intValue2 = iter->first;        
5789         
5790         // Get the element name.
5791         
5792         striter = XTokenListTokens.find(intValue2);
5793         
5794         if (striter->first == intValue2){
5795             
5796             strValue2 = striter->second;
5797             
5798         }       
5799         
5800         // Get the address.
5801         
5802         striter = XTokenList.find(intValue2);
5803         
5804         if (striter->first == intValue2){
5805             
5806             strValue = striter->second;
5807             
5808         }
5809         
5810         // Add to the vCard.
5811         
5812         if (boolValue == TRUE){
5813             
5814             ContactData.AddRaw(wxT("X-") + strValue2, strValue);
5815             
5816         } else {
5817             
5818             ContactData.Add(wxT("X-") + strValue2, strValue, FALSE);
5819             
5820         }
5821         
5822         ResetSaveProcessData();
5823         
5824     }
5825     
5826     ResetSaveProcessData();
5827     
5828     if (FullNamesList.size() == 0){
5829         
5830         wxString FullName = cmbDisplayAs->GetValue();
5831         FullNamesList.insert(std::make_pair(0, FullName));
5832         FullNamesListAltID.insert(std::make_pair(0, wxT("")));
5833         FullNamesListPID.insert(std::make_pair(0, wxT("")));
5834         FullNamesListType.insert(std::make_pair(0, wxT("")));
5835         FullNamesListLanguage.insert(std::make_pair(0, wxT("")));
5836         FullNamesListPref.insert(std::make_pair(0, 0));
5837         FullNamesListTokens.insert(std::make_pair(0, wxT("")));
5838         FNFirst = FALSE;
5839         
5840     }
5841     
5842     for (std::map<int, wxString>::iterator iter = FullNamesList.begin();
5843          iter != FullNamesList.end(); ++iter){
5844         
5845         if (FNFirst == TRUE){
5846             
5847             iter->second = cmbDisplayAs->GetValue();
5848             FNFirst = FALSE;
5849             
5850         }
5851         
5852         std::map<int,wxString>::iterator mapS;
5853         
5854         mapS = FullNamesListTokens.find(iter->first);
5855         
5856         ProcessSaveData(wxT("FN"), &strValue2, &boolValue2, &boolValue, 
5857                         &iter, &FullNamesList, &ContactData,
5858                         wxT("ALTID"), &FullNamesListAltID,
5859                         wxT("PID"), &FullNamesListPID,
5860                         wxT("TYPE"), &FullNamesListType,
5861                         wxT("LANGUAGE"), &FullNamesListLanguage,
5862                         wxT("PREF"), &FullNamesListPref,
5863                         wxT(""), &FullNamesListTokens );
5864         
5865         // Get the address.
5866         
5867         ResetSaveProcessData();    
5868         
5869     }
5870     
5871     //ContactData.Add(wxT("FN"), cmbDisplayAs->GetValue(), FALSE);
5872     
5873     // Insert revision (REV) date.
5874     
5875     // Get today's date and time.
5876     
5877     wxDateTime DateTimeNow = wxDateTime::Now();
5878     
5879     wxString DateRev;
5880     
5881     // Set year, month and date.
5882     
5883     int intYear = DateTimeNow.GetYear();
5884     int intMonth = DateTimeNow.GetMonth();
5885     int intDay = DateTimeNow.GetDay();
5886     
5887     DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intYear));
5888     
5889     if (intMonth < 10){
5890         
5891         DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMonth));
5892         
5893     } else {
5894         
5895         DateRev.Append(wxString::Format(wxT("%i"), intMonth));
5896         
5897     }
5898     
5899     if (intDay < 10){
5900         
5901         DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intDay));
5902         
5903     } else {
5904         
5905         DateRev.Append(wxString::Format(wxT("%i"), intDay));
5906         
5907     }
5908     
5909     //DateRev.Append(wx);
5910     //DateRev.Append(wx);
5911     //DateRev.Append(wx);
5912     DateRev.Append(wxT("T"));
5913     
5914     // Set hour, minute and second.
5915     
5916     int intHour = DateTimeNow.GetHour();
5917     int intMinute = DateTimeNow.GetMinute();
5918     int intSecond = DateTimeNow.GetSecond();
5919     
5920     if (intHour < 10){
5921         
5922         DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intHour));
5923         
5924     } else {
5925         
5926         DateRev.Append(wxString::Format(wxT("%i"), intHour));    
5927         
5928     }
5929     
5930     if (intMinute < 10){
5931         
5932         DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMinute));
5933         
5934     } else {
5935         
5936         DateRev.Append(wxString::Format(wxT("%i"), intMinute));
5937         
5938     }
5939     
5940     if (intSecond < 10){
5941         
5942         DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intSecond));
5943         
5944     } else {
5945         
5946         DateRev.Append(wxString::Format(wxT("%i"), intSecond));
5947         
5948     }
5949     
5950     //   DateRev.Append(wx);
5951     //   DateRev.Append(wx);
5952     //   DateRev.Append(wxString DateTimeNow->);
5953     DateRev.Append(wxT("Z"));    
5954     
5955     ContactData.Add(wxT("UID"), UIDToken, FALSE);
5956     
5957     // End the vCard File.
5958     
5959     ContactData.Add(wxT("END"), wxT("VCARD"), FALSE);
5960     
5961     FMTimer.Stop();
5962     ContactData.WriteFile(FilenameFinal);
5963     
5964     vCard34Conv ConvFileFun;
5965     
5966     wxString wxSData;
5967     
5968     ConvFileFun.ConvertToV3(FilenameFinal, &wxSData);
5969     
5970     wxString AccountDirPrefix;
5971     wxString AccountDir;
5972     wxString PrefDir;
5973     
5974 #if defined(__HAIKU__)
5975     
5976     //preffilename = wxT("noo");
5978 #elif defined(__APPLE__)
5979     
5980     PrefDir = GetUserPrefDir();
5981     
5982     wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/"));
5983     
5984 #elif defined(__WIN32__)
5985     
5986     PrefDir = GetUserPrefDir();
5987     
5988     wxStringTokenizer wSTFilename(wxSContactFilename, wxT("\\"));
5989     
5990 #else
5991     
5992     PrefDir = GetUserPrefDir();
5993     
5994     wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/"));
5995     
5996 #endif
5997     
5998     XABPreferences PrefData(PrefDir);
5999     
6000     wxString AccountType;
6001     
6002     for (int i = 0; i < PrefData.accounts.GetCount(); i++){
6003         
6004         AccountDir = PrefData.accounts.GetAccountDirectory(i) + wxT(".carddav");
6005         
6006         if (AccountDir == wxSContactAccount){
6007             
6008             AccountDirPrefix = PrefData.accounts.GetAccountDirPrefix(i);
6009             AccountDirPrefix.Trim();
6010             AccountType = PrefData.accounts.GetAccountType(i);
6011             break;
6012             
6013         }
6014         
6015     }
6016     
6017     wxString wxSplitFilename;
6018     wxString wxSDataURL;
6019     
6020     while(wSTFilename.HasMoreTokens()){
6021         
6022         wxSplitFilename = wSTFilename.GetNextToken();
6023         
6024     }
6025     
6026     wxSDataURL = wxSplitFilename;
6027     //wxSDataURL.Append(wxSplitFilename);
6028     
6029     // Find out if the filename exists in the table.
6030     
6031     if (AccountType == wxT("CardDAV") || AccountType == wxT("carddav")){
6032         
6033         wxString ETagResult;
6034         wxString ETagOriginal;
6035         
6036         ETagDB *ETagDBPtr = NULL;
6037         
6038         ETagDBPtr = ETagTmrPtr->GetPointer(wxSContactAccount);
6039         
6040         wxString wxSETag = ETagDBPtr->GetETag(wxSplitFilename);
6041         wxString wxSETagOrig = ETagDBPtr->GetETagOriginal(wxSplitFilename);
6042         
6043         if (wxSETagOrig.IsEmpty()){
6044             
6045             // Generate the ETag.
6046             
6047             wxSETagOrig = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024);
6048             
6049         }
6050         
6051         if (wxSETag.IsEmpty()){
6052             
6053             // Update empty ETag.
6054             
6055             wxSETag = wxSETagOrig;
6056             ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag, wxSETagOrig);
6057             
6058         }
6059         else {
6060             
6061             // Don't change original ETag.
6062             
6063             wxSETag = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024);
6064             ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag);
6065             
6066         }
6067         
6068         if (EditMode == FALSE){
6069             
6070             ActMgrPtr->AddTask(0, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
6071             EditMode = TRUE;
6072             FMTimer.SetFilename(FilenameFinal);
6073             FMTimer.UpdateTimestamp();
6074             FMTimer.Start(10000, FALSE);
6075             
6076             wxCommandEvent reloadevent(RELOADCONTACTLIST);
6077             reloadevent.SetString(wxSContactAccount);
6078             wxPostEvent(this->GetParent(), reloadevent);
6079             
6080         }
6081         else {
6082             
6083             ActMgrPtr->AddTask(1, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
6084             FMTimer.UpdateTimestamp();
6085             FMTimer.Start(10000, FALSE);
6086             
6087         }
6088         
6089     }
6090     
6091     // Send a notification to update the main window
6092     // with the new details.
6093     
6094     UCNotif *ucd;
6095     ucd = new UCNotif;
6096     
6097     // TODO: Workout nickname settings by priority and
6098     // type.
6099     
6100     ucd->ContactAccount = wxSContactAccount;
6101     ucd->ContactFilename = FilenameFinal;
6102     ucd->ContactName = cmbDisplayAs->GetValue();
6103     ucd->ContactNameArray = ContactData.GetName();
6104     
6105     for (std::map<int,wxString>::iterator gniter = GeneralNicknamesList.begin();
6106          gniter != GeneralNicknamesList.end(); gniter++){
6107         
6108         ucd->ContactNickname = gniter->second;
6109         break;
6110         
6111     }
6112     
6113     wxCommandEvent event2(CE_UPDATECONTACTLIST);
6114     event2.SetClientData(ucd);
6115     wxPostEvent(MainPtr, event2);
6116     
6119 void frmContactEditor::SaveCloseContact( wxCommandEvent& event )
6121     
6122     // Save the updated contact data and close the form.
6123     
6126 void frmContactEditor::CloseContact( wxCommandEvent& event )
6128     
6129     Close();
6130     
6133 void frmContactEditor::CloseWindow( wxCloseEvent& event )
6135     
6136     // TODO: Check if any changes have been made,
6137     // ask if the changes should be made, process
6138     // action based on question and then close.
6139     
6140     WindowData *WData = new WindowData;
6141     
6142     WData->DataType = 1;
6143     WData->WindowPointer = this;
6144     WData->WindowID = ContactEditorUID;
6145     
6146     wxCommandEvent delevent(WINDOW_CLOSE);
6147     delevent.SetClientData(WData);
6148     wxPostEvent(GetParent(), delevent);
6149     
6150     Destroy();
6151     
6155 void frmContactEditor::CutText( wxCommandEvent& event )
6157     // This function left empty for future implementation.
6160 void frmContactEditor::CopyText( wxCommandEvent& event )
6162     // This function left empty for future implementation.
6165 void frmContactEditor::PasteText( wxCommandEvent& event )
6167     // This function left empty for future implementation.
6170 void frmContactEditor::SetupContact( wxString AccountName )
6172     
6173     wxSContactAccount = AccountName;
6174     
6177 bool frmContactEditor::ProcessEvent(wxEvent& event)
6179     
6180     // This section has been taken from the wxWidgets sample code of richtext.cpp
6181     // so that simple Cut/Copy/Paste code can be made.
6182     
6183     // As this code comes from the samples of the wxWidgets library, this is licenced
6184     // under the wxWindows Library Licence and is compatable with the LGPL and is
6185     // compatable with Xestia Address Book's licence.
6186     
6187     if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxChildFocusEvent)))
6188     {
6189         // Problem: we can get infinite recursion because the events
6190         // climb back up to this frame, and repeat.
6191         // Assume that command events don't cause another command event
6192         // to be called, so we can rely on inCommand not being overwritten
6193         
6194         static int s_eventType = 0;
6195         static wxWindowID s_id = 0;
6196         
6197         if (s_id != event.GetId() && s_eventType != event.GetEventType())
6198         {
6199             s_eventType = event.GetEventType();
6200             s_id = event.GetId();
6201             
6202             wxWindow* focusWin = wxFindFocusDescendant(this);
6203             if (focusWin && focusWin->GetEventHandler()->ProcessEvent(event))
6204             {
6205                 //s_command = NULL;
6206                 s_eventType = 0;
6207                 s_id = 0;
6208                 return true;
6209             }
6210             s_eventType = 0;
6211             s_id = 0;
6212         }
6213         else
6214         {
6215             return false;
6216         }
6217     }
6218     
6219     return wxFrame::ProcessEvent(event);
6222 void frmContactEditor::SetupHeaders()
6224     
6225     /* Items for the General Tab */
6226     
6227     SetupColumn(CE_NICKNAME, lboNicknames);
6228     SetupColumn(CE_ADDRESS, lboAddresses);
6229     SetupColumn(CE_EMAIL, lboEmails);
6230     SetupColumn(CE_IM, lboIM);
6231     SetupColumn(CE_TELEPHONE, lboTelephone);
6232     SetupColumn(CE_LANG, lboLanguages);
6233     SetupColumn(CE_TZ, lboTimezones);
6234     SetupColumn(CE_GEOPOSITION, lboGeoposition);
6235     SetupColumn(CE_RELATED, lboRelated);
6236     SetupColumn(CE_WEBSITE, lboWebsites);
6237     SetupColumn(CE_TITLE, lboTitles);
6238     SetupColumn(CE_ROLE, lboRoles);
6239     SetupColumn(CE_ORG, lboOrganisations);
6240     SetupColumn(CE_NOTE, lboNotes);
6241     
6242     /* Items for the Home Tab */
6243     
6244     SetupColumn(CE_NICKNAME, lboHomeNicknames);
6245     SetupColumn(CE_ADDRESS, lboHomeAddresses);
6246     SetupColumn(CE_EMAIL, lboHomeEmails);
6247     SetupColumn(CE_IM, lboHomeIM);
6248     SetupColumn(CE_TELEPHONE, lboHomeTelephone);        
6249     SetupColumn(CE_LANG, lboHomeLanguages);
6250     SetupColumn(CE_TZ, lboHomeTimezones);
6251     SetupColumn(CE_GEOPOSITION, lboHomeGeoposition);
6252     SetupColumn(CE_WEBSITE, lboHomeWebsites);
6253     SetupColumn(CE_TITLE, lboHomeTitles);
6254     SetupColumn(CE_ROLE, lboHomeRoles);
6255     SetupColumn(CE_ORG, lboHomeOrganisations);
6256     SetupColumn(CE_NOTE, lboHomeNotes);
6257     
6258     /* Items for the Business Tab */
6259     
6260     SetupColumn(CE_NICKNAME, lboBusinessNicknames);
6261     SetupColumn(CE_ADDRESS, lboBusinessAddresses);
6262     SetupColumn(CE_EMAIL, lboBusinessEmail);
6263     SetupColumn(CE_IM, lboBusinessIM);
6264     SetupColumn(CE_TELEPHONE, lboBusinessTelephone);    
6265     SetupColumn(CE_LANG, lboBusinessLanguages);
6266     SetupColumn(CE_TZ, lboBusinessTimezones);
6267     SetupColumn(CE_GEOPOSITION, lboBusinessGeoposition);
6268     SetupColumn(CE_WEBSITE, lboBusinessWebsites);
6269     SetupColumn(CE_TITLE, lboBusinessTitles);
6270     SetupColumn(CE_ROLE, lboBusinessRoles);
6271     SetupColumn(CE_ORG, lboBusinessOrganisations);
6272     SetupColumn(CE_NOTE, lboBusinessNotes);     
6273     
6274     /* Items for the Categories Tab */
6275     
6276     SetupColumn(CE_CATEGORIES, lboCategories);
6277     
6278     /* Items for the Groups Tab */
6279     
6280     SetupColumn(CE_GROUPS, lboGroups);
6281     
6282     /* Items for the Pictures and Logos Tab */
6283     
6284     SetupColumn(CE_PICTURES, lboPictures);
6285     SetupColumn(CE_PICTURES, lboLogos); 
6286     
6287     /* Items for the Sounds Tab */
6288     
6289     SetupColumn(CE_SOUNDS, lboSounds);
6290     
6291     /* Items for the Calendaring Tab */
6292     
6293     SetupColumn(CE_CALENDAR, lboCalendarAddresses);
6294     SetupColumn(CE_CALENDAR, lboCalendarRequestAddress);
6295     SetupColumn(CE_CALENDAR, lboFreeBusyAddresses);     
6296     
6297     /* Items for the Security Tab */
6298     
6299     SetupColumn(CE_KEY, lboKeys);
6300     
6301     /* Items for the Other Tab */
6302     
6303     SetupColumn(CE_TOKEN, lboVendorNamespace);
6304     SetupColumn(CE_TOKEN, lboXToken);
6305     
6308 void frmContactEditor::SetupColumn(wxString ColumnType, wxListCtrl *ListCtrl)
6310     
6311     wxListItem coldata; 
6312     
6313     if (ColumnType == CE_NICKNAME){
6314         
6315         coldata.SetId(0);
6316         coldata.SetText(_("Nickname"));
6317         coldata.SetWidth(128);
6318         ListCtrl->InsertColumn(0, coldata);
6319         
6320         coldata.SetId(1);
6321         coldata.SetText(_("Pri."));
6322         coldata.SetWidth(32);
6323         ListCtrl->InsertColumn(1, coldata);             
6324         
6325     } else if (ColumnType == CE_ADDRESS){
6326         
6327         coldata.SetId(0);
6328         coldata.SetText(_("Address"));
6329         coldata.SetWidth(128);
6330         ListCtrl->InsertColumn(0, coldata);
6331         
6332         coldata.SetId(1);
6333         coldata.SetText(_("Town"));
6334         coldata.SetWidth(64);
6335         ListCtrl->InsertColumn(1, coldata);             
6336         
6337         coldata.SetId(2);
6338         coldata.SetText(_("County"));
6339         coldata.SetWidth(64);
6340         ListCtrl->InsertColumn(2, coldata);
6341         
6342         coldata.SetId(3);
6343         coldata.SetText(_("Post code"));
6344         coldata.SetWidth(48);
6345         ListCtrl->InsertColumn(3, coldata);
6346         
6347         coldata.SetId(4);
6348         coldata.SetText(_("Pri."));
6349         coldata.SetWidth(32);
6350         ListCtrl->InsertColumn(4, coldata);             
6351         
6352     } else if (ColumnType == CE_EMAIL){
6353         
6354         coldata.SetId(0);
6355         coldata.SetText(_("Email address"));
6356         coldata.SetWidth(304);
6357         ListCtrl->InsertColumn(0, coldata);
6358         
6359         coldata.SetId(1);
6360         coldata.SetText(_("Pri."));
6361         coldata.SetWidth(32);
6362         ListCtrl->InsertColumn(1, coldata);
6363         
6364     } else if (ColumnType == CE_IM){
6365         
6366         coldata.SetId(0);
6367         coldata.SetText(_("Type"));
6368         coldata.SetWidth(64);
6369         ListCtrl->InsertColumn(0, coldata);
6370         
6371         coldata.SetId(1);
6372         coldata.SetText(_("Address"));
6373         coldata.SetWidth(240);
6374         ListCtrl->InsertColumn(1, coldata);
6375         
6376         coldata.SetId(2);
6377         coldata.SetText(_("Pri."));
6378         coldata.SetWidth(32);
6379         ListCtrl->InsertColumn(2, coldata);             
6380         
6381     } else if (ColumnType == CE_TELEPHONE){
6382         
6383         coldata.SetId(0);
6384         coldata.SetText(_("Telephone number"));
6385         coldata.SetWidth(128);
6386         ListCtrl->InsertColumn(0, coldata);
6387         
6388         coldata.SetId(1);
6389         coldata.SetText(_("Type"));
6390         coldata.SetWidth(64);
6391         ListCtrl->InsertColumn(1, coldata);             
6392         
6393         coldata.SetId(2);
6394         coldata.SetText(_("Pri."));
6395         coldata.SetWidth(32);
6396         ListCtrl->InsertColumn(2, coldata);             
6397         
6398     } else if (ColumnType == CE_LANG){
6399         
6400         coldata.SetId(0);
6401         coldata.SetText(_("Language"));
6402         coldata.SetWidth(128);
6403         ListCtrl->InsertColumn(0, coldata);
6404         
6405         coldata.SetId(1);
6406         coldata.SetText(_("Pri."));
6407         coldata.SetWidth(32);
6408         ListCtrl->InsertColumn(1, coldata);             
6409         
6410     } else if (ColumnType == CE_TZ){
6411         
6412         coldata.SetId(0);
6413         coldata.SetText(_("Timezone"));
6414         coldata.SetWidth(192);
6415         ListCtrl->InsertColumn(0, coldata);
6416         
6417         coldata.SetId(1);
6418         coldata.SetText(_("Pri."));
6419         coldata.SetWidth(32);
6420         ListCtrl->InsertColumn(1, coldata);             
6421         
6422     } else if (ColumnType == CE_RELATED){
6423         
6424         coldata.SetId(0);
6425         coldata.SetText(_("Type"));
6426         coldata.SetWidth(64);
6427         ListCtrl->InsertColumn(0, coldata);
6428         
6429         coldata.SetId(1);
6430         coldata.SetText(_("Name/Description"));
6431         coldata.SetWidth(192);
6432         ListCtrl->InsertColumn(1, coldata);
6433         
6434         coldata.SetId(2);
6435         coldata.SetText(_("Pri."));
6436         coldata.SetWidth(32);
6437         ListCtrl->InsertColumn(2, coldata);
6438         
6439     } else if (ColumnType == CE_WEBSITE){
6440         
6441         coldata.SetId(0);
6442         coldata.SetText(_("Website"));
6443         coldata.SetWidth(288);
6444         ListCtrl->InsertColumn(0, coldata);
6445         
6446         coldata.SetId(1);
6447         coldata.SetText(_("Pri."));
6448         coldata.SetWidth(32);
6449         ListCtrl->InsertColumn(1, coldata);
6450         
6451     } else if (ColumnType == CE_TITLE){
6452         
6453         coldata.SetId(0);
6454         coldata.SetText(_("Title"));
6455         coldata.SetWidth(288);
6456         ListCtrl->InsertColumn(0, coldata);
6457         
6458         coldata.SetId(1);
6459         coldata.SetText(_("Pri."));
6460         coldata.SetWidth(32);
6461         ListCtrl->InsertColumn(1, coldata);
6462         
6463     } else if (ColumnType == CE_ROLE){
6464         
6465         coldata.SetId(0);
6466         coldata.SetText(_("Role"));
6467         coldata.SetWidth(288);
6468         ListCtrl->InsertColumn(0, coldata);
6469         
6470         coldata.SetId(1);
6471         coldata.SetText(_("Pri."));
6472         coldata.SetWidth(32);
6473         ListCtrl->InsertColumn(1, coldata);
6474         
6475     } else if (ColumnType == CE_ORG){
6476         
6477         coldata.SetId(0);
6478         coldata.SetText(_("Organisation"));
6479         coldata.SetWidth(288);
6480         ListCtrl->InsertColumn(0, coldata);
6481         
6482         coldata.SetId(1);
6483         coldata.SetText(_("Pri."));
6484         coldata.SetWidth(32);
6485         ListCtrl->InsertColumn(1, coldata);
6486         
6487     } else if (ColumnType == CE_NOTE){
6488         
6489         coldata.SetId(0);
6490         coldata.SetText(_("Notes"));
6491         coldata.SetWidth(288);
6492         ListCtrl->InsertColumn(0, coldata);
6493         
6494         coldata.SetId(1);
6495         coldata.SetText(_("Pri."));
6496         coldata.SetWidth(32);
6497         ListCtrl->InsertColumn(1, coldata);     
6498         
6499     } else if (ColumnType == CE_CATEGORIES){
6500         
6501         coldata.SetId(0);
6502         coldata.SetText(_("Category"));
6503         coldata.SetWidth(320);
6504         ListCtrl->InsertColumn(0, coldata);
6505         
6506         coldata.SetId(1);
6507         coldata.SetText(_("Pri."));
6508         coldata.SetWidth(32);
6509         ListCtrl->InsertColumn(1, coldata);
6510         
6511     } else if (ColumnType == CE_GROUPS){
6512         
6513         coldata.SetId(0);
6514         coldata.SetText(_("Member"));
6515         coldata.SetWidth(320);
6516         ListCtrl->InsertColumn(0, coldata);
6517         
6518     } else if (ColumnType == CE_GEOPOSITION){
6519         
6520         coldata.SetId(0);
6521         coldata.SetText(_("Geoposition"));
6522         coldata.SetWidth(320);
6523         ListCtrl->InsertColumn(0, coldata);
6524         
6525         coldata.SetId(1);
6526         coldata.SetText(_("Pri."));
6527         coldata.SetWidth(32);
6528         ListCtrl->InsertColumn(1, coldata);
6529         
6530     } else if (ColumnType == CE_PICTURES){
6531         
6532         coldata.SetId(0);
6533         coldata.SetText(_("Pictures"));
6534         coldata.SetWidth(128);
6535         ListCtrl->InsertColumn(0, coldata);
6536         
6537         coldata.SetId(1);
6538         coldata.SetText(_("Type"));
6539         coldata.SetWidth(64);
6540         ListCtrl->InsertColumn(1, coldata);             
6541         
6542         coldata.SetId(2);
6543         coldata.SetText(_("Pri."));
6544         coldata.SetWidth(32);
6545         ListCtrl->InsertColumn(2, coldata);
6546         
6547     } else if (ColumnType == CE_SOUNDS){
6548         
6549         coldata.SetId(0);
6550         coldata.SetText(_("Sounds"));
6551         coldata.SetWidth(128);
6552         ListCtrl->InsertColumn(0, coldata);
6553         
6554         coldata.SetId(1);
6555         coldata.SetText(_("Type"));
6556         coldata.SetWidth(64);
6557         ListCtrl->InsertColumn(1, coldata);             
6558         
6559         coldata.SetId(2);
6560         coldata.SetText(_("Pri."));
6561         coldata.SetWidth(32);
6562         ListCtrl->InsertColumn(2, coldata);
6563         
6564     } else if (ColumnType == CE_CALENDAR){
6565         
6566         coldata.SetId(0);
6567         coldata.SetText(_("Calendar Address"));
6568         coldata.SetWidth(224);
6569         ListCtrl->InsertColumn(0, coldata);
6570         
6571         coldata.SetId(1);
6572         coldata.SetText(_("Type"));
6573         coldata.SetWidth(64);
6574         ListCtrl->InsertColumn(1, coldata);             
6575         
6576         coldata.SetId(2);
6577         coldata.SetText(_("Pri."));
6578         coldata.SetWidth(32);
6579         ListCtrl->InsertColumn(2, coldata);
6580         
6581     } else if (ColumnType == CE_KEY){
6582         
6583         coldata.SetId(0);
6584         coldata.SetText(_("Key information"));
6585         coldata.SetWidth(224);
6586         ListCtrl->InsertColumn(0, coldata);
6587         
6588         coldata.SetId(1);
6589         coldata.SetText(_("Type"));
6590         coldata.SetWidth(64);
6591         ListCtrl->InsertColumn(1, coldata);             
6592         
6593         coldata.SetId(2);
6594         coldata.SetText(_("Pri."));
6595         coldata.SetWidth(32);
6596         ListCtrl->InsertColumn(2, coldata);
6597         
6598     } else if (ColumnType == CE_TOKEN){
6599         
6600         coldata.SetId(0);
6601         coldata.SetText(_("Token"));
6602         coldata.SetWidth(320);
6603         ListCtrl->InsertColumn(0, coldata);
6604         
6605     }
6606     
6609 int frmContactEditor::GetLastInt(std::map<int, wxString> *MapData){
6610     
6611     /*
6612      int intResult = 0;
6613      
6614      std::map<int,wxString>::iterator iwxsit;
6615      
6616      for( iwxsit=(*MapData).begin(); iwxsit != (*MapData).end(); iwxsit++){
6617      intResult = (*iwxsit).first;
6618      }
6619      
6620      return intResult;
6621      */
6622     
6623     intValueSeek++;
6624     return intValueSeek;
6625     
6628 int frmContactEditor::GetLastInt(std::map<int, std::string> *MapData){
6629     
6630     /* int intResult = 0;
6631      
6632      std::map<int,std::string>::iterator iwxsit;
6633      
6634      for( iwxsit=(*MapData).begin(); iwxsit != (*MapData).end(); iwxsit++){
6635      intResult = (*iwxsit).first;
6636      }*/
6637     
6638     intValueSeek++;
6639     return intValueSeek;
6640     
6643 bool frmContactEditor::GetSelectedItem(wxListCtrl *ListCtrlPtr, 
6644                                        long *longSelected,
6645                                        int *intSelectedData){
6646     
6647     *longSelected = -1;
6648     *intSelectedData = 0;
6649     
6650     *longSelected = ListCtrlPtr->GetNextItem(*longSelected, 
6651                                              wxLIST_NEXT_ALL,
6652                                              wxLIST_STATE_SELECTED);
6653     
6654     *intSelectedData = (int)ListCtrlPtr->GetItemData(*longSelected);
6655     
6656     if (*longSelected == -1){
6657         return FALSE;
6658     }
6659     else {
6660         return TRUE;
6661     }
6662     
6665 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, std::string>* MapData){
6666     MapData->erase(IndexNum);
6669 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, wxString>* MapData){
6670     MapData->erase(IndexNum);
6673 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, int>* MapData){
6674     MapData->erase(IndexNum);
6677 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, bool>* MapData){
6678     MapData->erase(IndexNum);
6681 void frmContactEditor::ProcessSaveDataProc( wxString PropName,
6682                                            std::map<int,int>* MapData){
6683     
6684     int intIterVal = (*iterDataPtr)->first;
6685     
6686     std::map<int,int>::iterator intIter;
6687     
6688     intIter = MapData->find(intIterVal);
6689     
6690     int intPropValue; 
6691     
6692     if (intIter->first == intIterVal){
6693         
6694         intPropValue = intIter->second;
6695         
6696         if (intPropValue){
6697             
6698             if (*boolAdditionalPtr == TRUE){
6699                 
6700                 strPropertyPtr->Append(wxT(";"));
6701                 
6702             } else {
6703                 
6704                 *boolAdditionalPtr = TRUE;
6705                 
6706             }
6707             
6708             strPropertyPtr->Append(PropName + wxT("=") + wxString::Format(wxT("%i"), intPropValue));
6709             
6710             *boolExtraPtr = TRUE;
6711             
6712         }
6713         
6714     }
6715     
6718 void frmContactEditor::ProcessSaveDataProc( wxString PropName,
6719                                            std::map<int,wxString>* MapData){
6720     
6721     int intIterVal;
6722     
6723     intIterVal = (*iterDataPtr)->first;
6724     
6725     std::map<int,wxString>::iterator strIter;
6726     
6727     strIter = MapData->find(intIterVal);
6728     
6729     if (strIter == MapData->end()){
6730         
6731         return;
6732         
6733     }
6734     
6735     wxString strPropValue;
6736     
6737     if (strIter->first == intIterVal){
6738         
6739         strPropValue = strIter->second;
6740         
6741         if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6742             
6743             strPropValue.Trim();
6744             strPropValue.Trim();
6745             
6746             if (*boolAdditionalPtr == TRUE){
6747                 
6748                 strPropertyPtr->Append(wxT(";"));
6749                 
6750             } else {
6751                 
6752                 *boolAdditionalPtr = TRUE;
6753                 
6754             }
6755             
6756             strPropertyPtr->Append(strPropValue);       
6757             
6758             *boolExtraPtr = TRUE;
6759             
6760             return;
6761             
6762         }
6763         
6764         if (!strPropValue.IsEmpty()){
6765             
6766             strPropValue.Trim();
6767             strPropValue.Trim();
6768             
6769             if (*boolAdditionalPtr == TRUE){
6770                 
6771                 strPropertyPtr->Append(wxT(";"));
6772                 
6773             } else {
6774                 
6775                 *boolAdditionalPtr = TRUE;
6776                 
6777             }
6778             
6779             // Look for semi-colon in property name and if there is then
6780             // quote the value.
6781             
6782             if (PropName != wxT("TYPE")){
6783                 
6784                 EscapeString(&strPropValue, FALSE);     
6785                 
6786             }
6787             
6788             if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6789                 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6790                 
6791                 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6792                 
6793             } else {
6794                 
6795                 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6796                 
6797             }
6798             
6799             *boolExtraPtr = TRUE;
6800             
6801         }
6802         
6803     }
6804     
6807 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6808                                               std::map<int,std::string>* MapData){
6809     
6810     int intIterVal = (*iterDataStringPtr)->first;
6811     
6812     //std::map<int,wxString>::iterator strIter;
6813     
6814     std::map<int,std::string>::iterator stdstrIter;
6815     
6816     stdstrIter = MapData->find(intIterVal);     
6817     
6818     if (stdstrIter->first == intIterVal){
6819         
6820         wxString strPropValue(stdstrIter->second.c_str(), wxConvUTF8);
6821         
6822         if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6823             
6824             strPropValue.Trim();
6825             strPropValue.Trim();
6826             
6827             if (*boolAdditionalPtr == TRUE){
6828                 
6829                 strPropertyPtr->Append(wxT(";"));
6830                 
6831             } else {
6832                 
6833                 *boolAdditionalPtr = TRUE;
6834                 
6835             }
6836             
6837             strPropertyPtr->Append(strPropValue);
6838             
6839             *boolExtraPtr = TRUE;
6840             
6841             return;
6842             
6843         }
6844         
6845         if (!strPropValue.IsEmpty()){
6846             
6847             strPropValue.Trim();
6848             strPropValue.Trim();
6849             
6850             if (*boolAdditionalPtr == TRUE){
6851                 
6852                 strPropertyPtr->Append(wxT(";"));
6853                 
6854             } else {
6855                 
6856                 *boolAdditionalPtr = TRUE;
6857                 
6858             }
6859             
6860             // Look for semi-colon in property name and if there is then
6861             // quote the value.
6862             
6863             if (PropName != wxT("TYPE")){
6864                 
6865                 EscapeString(&strPropValue, FALSE);
6866                 
6867             }
6868             
6869             if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6870                 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6871                 
6872                 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6873                 
6874             } else {
6875                 
6876                 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6877                 
6878             }
6879             
6880             *boolExtraPtr = TRUE;
6881             
6882         }
6883         
6884     }
6885     
6889 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6890                                               std::map<int,int>* MapData){
6891     
6892     int intIterVal = (*iterDataStringPtr)->first;
6893     
6894     std::map<int,int>::iterator intIter;
6895     
6896     intIter = MapData->find(intIterVal);
6897     
6898     int intPropValue; 
6899     
6900     if (intIter->first == intIterVal){
6901         
6902         intPropValue = intIter->second;
6903         
6904         if (intPropValue){
6905             
6906             if (*boolAdditionalPtr == TRUE){
6907                 
6908                 strPropertyPtr->Append(wxT(";"));
6909                 
6910             } else {
6911                 
6912                 *boolAdditionalPtr = TRUE;
6913                 
6914             }
6915             
6916             strPropertyPtr->Append(PropName + wxT("=") + wxString::Format(wxT("%i"), intPropValue));
6917             
6918             *boolExtraPtr = TRUE;
6919             
6920         }
6921         
6922     }
6923     
6926 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6927                                               std::map<int,wxString>* MapData){
6928     
6929     int intIterVal;
6930     
6931     intIterVal = (*iterDataStringPtr)->first;
6932     
6933     std::map<int,wxString>::iterator strIter;
6934     
6935     strIter = MapData->find(intIterVal);
6936     
6937     wxString strPropValue;
6938     
6939     if (strIter->first == intIterVal){
6940         
6941         strPropValue = strIter->second;
6942         
6943         if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6944             
6945             strPropValue.Trim();
6946             strPropValue.Trim();
6947             
6948             if (*boolAdditionalPtr == TRUE){
6949                 
6950                 strPropertyPtr->Append(wxT(";"));
6951                 
6952             } else {
6953                 
6954                 *boolAdditionalPtr = TRUE;
6955                 
6956             }
6957             
6958             strPropertyPtr->Append(strPropValue);       
6959             
6960             *boolExtraPtr = TRUE;
6961             
6962             return;
6963             
6964         }
6965         
6966         if (!strPropValue.IsEmpty()){
6967             
6968             strPropValue.Trim();
6969             strPropValue.Trim();
6970             
6971             if (*boolAdditionalPtr == TRUE){
6972                 
6973                 strPropertyPtr->Append(wxT(";"));
6974                 
6975             } else {
6976                 
6977                 *boolAdditionalPtr = TRUE;
6978                 
6979             }
6980             
6981             // Look for semi-colon in property name and if there is then
6982             // quote the value.
6983             
6984             if (PropName != wxT("TYPE")){
6985                 
6986                 EscapeString(&strPropValue, FALSE);
6987                 
6988             }
6989             
6990             if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6991                 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6992                 
6993                 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6994                 
6995             } else {
6996                 
6997                 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6998                 
6999             }
7000             
7001             *boolExtraPtr = TRUE;
7002             
7003         }
7004         
7005     }
7006     
7009 void frmContactEditor::ProcessCaptureStringsProc(wxString *strCapture){
7010     
7011     CaptureString(strCapture, FALSE);
7012     
7015 void frmContactEditor::ResetSaveProcessData(){
7016     
7017     strValue.Clear();
7018     strValue2.Clear();
7019     strValue3.Clear();    
7020     
7021     boolValue = FALSE;
7022     boolValue2 = FALSE;    
7023     intValue2 = 0;
7024     intValue  = 0;
7025     
7028 void frmContactEditor::SetupPointers(frmActivityMgr *ActMgr, wxETagProcessTimer *ETagProc,
7029                                      frmMain *MainPtrInc){
7030     
7031     ActMgrPtr = ActMgr;
7032     ETagTmrPtr = ETagProc;
7033     MainPtr = MainPtrInc;
7034     
7037 void frmContactEditor::ClearContact(){
7038     
7039     // Clear out the GUI and values.
7040     
7041     // Clear GUI.
7042     
7043     txtTitle->Clear();
7044     txtForename->Clear();
7045     txtSurname->Clear();
7046     txtOtherNames->Clear();
7047     txtSuffix->Clear();
7048     cmbDisplayAs->Clear();
7049     cmbDisplayAs->SetValue(wxT(""));
7050     wxDateTime EmptyDate;
7051     wxBitmap EmptyBitmap;
7052     dapAnniversary->SetValue(EmptyDate);
7053     dapBirthday->SetValue(EmptyDate);
7054     txtBirthday->Clear();
7055     txtAnniversary->Clear();
7056     cmbGender->Select(0);
7057     txtGenderDescription->Clear();
7058     
7059     lboNicknames->DeleteAllItems();
7060     lboHomeNicknames->DeleteAllItems();
7061     lboBusinessNicknames->DeleteAllItems();
7062     
7063     lboAddresses->DeleteAllItems();
7064     lboHomeAddresses->DeleteAllItems();
7065     lboBusinessAddresses->DeleteAllItems();
7066     
7067     lboEmails->DeleteAllItems();
7068     lboHomeEmails->DeleteAllItems();
7069     lboBusinessEmail->DeleteAllItems();
7070     
7071     lboIM->DeleteAllItems();
7072     lboHomeIM->DeleteAllItems();
7073     lboBusinessIM->DeleteAllItems();
7074     
7075     lboTelephone->DeleteAllItems();
7076     lboHomeTelephone->DeleteAllItems();
7077     lboBusinessTelephone->DeleteAllItems();
7078     
7079     lboLanguages->DeleteAllItems();
7080     lboHomeLanguages->DeleteAllItems();
7081     lboBusinessLanguages->DeleteAllItems();
7082     
7083     lboTimezones->DeleteAllItems();
7084     lboHomeTimezones->DeleteAllItems();
7085     lboBusinessTimezones->DeleteAllItems();
7086     
7087     lboGeoposition->DeleteAllItems();
7088     lboHomeGeoposition->DeleteAllItems();
7089     lboBusinessGeoposition->DeleteAllItems();
7090     
7091     lboRelated->DeleteAllItems();
7092     
7093     lboWebsites->DeleteAllItems();
7094     lboHomeWebsites->DeleteAllItems();
7095     lboBusinessWebsites->DeleteAllItems();
7096     
7097     lboTitles->DeleteAllItems();
7098     lboHomeTitles->DeleteAllItems();
7099     lboBusinessTitles->DeleteAllItems();
7100     
7101     lboRoles->DeleteAllItems();
7102     lboHomeRoles->DeleteAllItems();
7103     lboBusinessRoles->DeleteAllItems();
7104     
7105     lboOrganisations->DeleteAllItems();
7106     lboHomeOrganisations->DeleteAllItems();
7107     lboBusinessOrganisations->DeleteAllItems();
7108     
7109     lboNotes->DeleteAllItems();
7110     lboHomeNotes->DeleteAllItems();
7111     lboBusinessNotes->DeleteAllItems();
7112     
7113     lboCategories->DeleteAllItems();
7114     
7115     lboGroups->DeleteAllItems();
7116     
7117     // Clear Picture
7118     lboPictures->DeleteAllItems();
7119     imgPicture->SetBitmap(EmptyBitmap);
7120     
7121     // Clear Logo
7122     lboLogos->DeleteAllItems();
7123     imgLogo->SetBitmap(EmptyBitmap);
7124     
7125     lboSounds->DeleteAllItems();
7126     
7127     lboCalendarAddresses->DeleteAllItems();
7128     lboCalendarRequestAddress->DeleteAllItems();
7129     lboFreeBusyAddresses->DeleteAllItems();
7130     
7131     lboKeys->DeleteAllItems();
7132     
7133     lboVendorNamespace->DeleteAllItems();
7134     lboXToken->DeleteAllItems();
7135     
7136     // Clear values out.
7137     
7138     wxString NameTitle;
7139     wxString NameForename;
7140     wxString NameSurname;
7141     wxString NameOtherNames;
7142     wxString NameSuffix;
7143     wxString NameNickname;
7144     wxString NameDisplayAs;
7145     wxString NameLanguage;
7146     wxString NameAltID;
7147     wxString NameTokens;
7148     
7149     wxString Birthday;
7150     wxString BirthdayAltID;
7151     wxString BirthdayCalScale;
7152     wxString BirthdayTokens;
7153     wxString Anniversary;
7154     wxString AnniversaryAltID;
7155     wxString AnniversaryCalScale;
7156     wxString AnniversaryTokens;
7157     
7158     wxString Gender;
7159     wxString GenderDetails;
7160     wxString GenderTokens;
7161     
7162     wxString UIDToken;
7163     
7164     /* We don't use these at the moment but we want to keep
7165      them for compatability reasons */
7166     
7167     /*std::map<int, wxString> ExtraFullNames;*/
7168     /*std::map<int, wxString> ExtraNicknames;*/
7169     
7170     FullNamesList.clear();    
7171     FullNamesListType.clear();
7172     FullNamesListLanguage.clear();
7173     FullNamesListAltID.clear();
7174     FullNamesListPID.clear();
7175     FullNamesListTokens.clear();
7176     FullNamesListPref.clear();
7177     
7178     GeneralNicknamesList.clear();
7179     GeneralNicknamesListType.clear();
7180     GeneralNicknamesListLanguage.clear();
7181     GeneralNicknamesListAltID.clear();
7182     GeneralNicknamesListPID.clear();
7183     GeneralNicknamesListTokens.clear();        
7184     GeneralNicknamesListPref.clear();        
7185     
7186     GeneralAddressList.clear();
7187     GeneralAddressListTown.clear();
7188     GeneralAddressListCounty.clear();
7189     GeneralAddressListPostCode.clear();
7190     GeneralAddressListCountry.clear();
7191     GeneralAddressListLabel.clear();
7192     GeneralAddressListLang.clear();        
7193     GeneralAddressListAltID.clear();
7194     GeneralAddressListPID.clear();
7195     GeneralAddressListTokens.clear();
7196     GeneralAddressListGeo.clear();
7197     GeneralAddressListTimezone.clear();        
7198     GeneralAddressListType.clear();
7199     GeneralAddressListMediatype.clear();
7200     GeneralAddressListPref.clear();
7201     
7202     GeneralEmailList.clear();
7203     GeneralEmailListAltID.clear();
7204     GeneralEmailListPID.clear();
7205     GeneralEmailListType.clear();
7206     GeneralEmailListTokens.clear();
7207     GeneralEmailListPref.clear();
7208     
7209     GeneralIMList.clear();
7210     GeneralIMListAltID.clear();
7211     GeneralIMListPID.clear();
7212     GeneralIMListType.clear();
7213     GeneralIMListTokens.clear();
7214     GeneralIMListMediatype.clear();
7215     GeneralIMListPref.clear();
7216     
7217     GeneralTelephoneList.clear();
7218     GeneralTelephoneListAltID.clear();
7219     GeneralTelephoneListPID.clear();
7220     GeneralTelephoneListType.clear();
7221     GeneralTelephoneListTokens.clear();
7222     GeneralTelephoneListPref.clear();
7223     
7224     GeneralLanguageList.clear();
7225     GeneralLanguageListAltID.clear();
7226     GeneralLanguageListPID.clear();
7227     GeneralLanguageListType.clear();
7228     GeneralLanguageListTokens.clear();
7229     GeneralLanguageListPref.clear();
7230     
7231     GeneralTZList.clear();
7232     GeneralTZListAltID.clear();
7233     GeneralTZListPID.clear();
7234     GeneralTZListType.clear();
7235     GeneralTZListTokens.clear();
7236     GeneralTZListMediatype.clear();
7237     GeneralTZListPref.clear();
7238     
7239     GeneralGeographyList.clear();
7240     GeneralGeographyListAltID.clear();
7241     GeneralGeographyListPID.clear();
7242     GeneralGeographyListType.clear();
7243     GeneralGeographyListTokens.clear();
7244     GeneralGeographyListMediatype.clear();
7245     GeneralGeographyListPref.clear();
7246     
7247     GeneralRelatedList.clear();
7248     GeneralRelatedListRelType.clear();
7249     GeneralRelatedListLanguage.clear();
7250     GeneralRelatedListAltID.clear();
7251     GeneralRelatedListPID.clear();
7252     GeneralRelatedListType.clear();
7253     GeneralRelatedListTokens.clear();
7254     GeneralRelatedListPref.clear();
7255     
7256     GeneralWebsiteList.clear();
7257     GeneralWebsiteListAltID.clear();
7258     GeneralWebsiteListPID.clear();
7259     GeneralWebsiteListType.clear();
7260     GeneralWebsiteListTokens.clear();
7261     GeneralWebsiteListMediatype.clear();
7262     GeneralWebsiteListPref.clear();
7263     
7264     GeneralTitleList.clear();
7265     GeneralTitleListLanguage.clear();        
7266     GeneralTitleListAltID.clear();
7267     GeneralTitleListPID.clear();
7268     GeneralTitleListType.clear();
7269     GeneralTitleListTokens.clear();
7270     GeneralTitleListPref.clear();
7271     
7272     GeneralRoleList.clear();
7273     GeneralRoleListLanguage.clear();        
7274     GeneralRoleListAltID.clear();
7275     GeneralRoleListPID.clear();
7276     GeneralRoleListType.clear();
7277     GeneralRoleListTokens.clear();
7278     GeneralRoleListPref.clear();
7279     
7280     GeneralOrganisationsList.clear();
7281     GeneralOrganisationsListLanguage.clear();        
7282     GeneralOrganisationsListAltID.clear();
7283     GeneralOrganisationsListPID.clear();
7284     GeneralOrganisationsListType.clear();
7285     GeneralOrganisationsListTokens.clear();
7286     GeneralOrganisationsListSortAs.clear();
7287     GeneralOrganisationsListPref.clear();
7288     
7289     GeneralNoteList.clear();
7290     GeneralNoteListLanguage.clear();        
7291     GeneralNoteListAltID.clear();
7292     GeneralNoteListPID.clear();
7293     GeneralNoteListType.clear();
7294     GeneralNoteListTokens.clear();
7295     GeneralNoteListPref.clear();
7296     
7297     /* Items on Home Tab */        
7298     
7299     HomeNicknamesList.clear();
7300     HomeNicknamesListType.clear();
7301     HomeNicknamesListLanguage.clear();
7302     HomeNicknamesListAltID.clear();
7303     HomeNicknamesListPID.clear();
7304     HomeNicknamesListTokens.clear();        
7305     HomeNicknamesListPref.clear();        
7306     
7307     HomeAddressList.clear();
7308     HomeAddressListTown.clear();
7309     HomeAddressListCounty.clear();
7310     HomeAddressListPostCode.clear();
7311     HomeAddressListCountry.clear();
7312     HomeAddressListLabel.clear();
7313     HomeAddressListLang.clear();        
7314     HomeAddressListAltID.clear();
7315     HomeAddressListPID.clear();
7316     HomeAddressListTokens.clear();
7317     HomeAddressListGeo.clear();
7318     HomeAddressListTimezone.clear();        
7319     HomeAddressListType.clear();
7320     HomeAddressListMediatype.clear();
7321     HomeAddressListPref.clear();
7322     
7323     HomeEmailList.clear();
7324     HomeEmailListAltID.clear();
7325     HomeEmailListPID.clear();
7326     HomeEmailListType.clear();
7327     HomeEmailListTokens.clear();
7328     HomeEmailListPref.clear();
7329     
7330     HomeIMList.clear();
7331     HomeIMListAltID.clear();
7332     HomeIMListPID.clear();
7333     HomeIMListType.clear();
7334     HomeIMListTokens.clear();
7335     HomeIMListMediatype.clear();
7336     HomeIMListPref.clear();
7337     
7338     HomeTelephoneList.clear();
7339     HomeTelephoneListAltID.clear();
7340     HomeTelephoneListPID.clear();
7341     HomeTelephoneListType.clear();
7342     HomeTelephoneListTokens.clear();
7343     HomeTelephoneListPref.clear();
7344     
7345     HomeLanguageList.clear();
7346     HomeLanguageListAltID.clear();
7347     HomeLanguageListPID.clear();
7348     HomeLanguageListType.clear();
7349     HomeLanguageListTokens.clear();
7350     HomeLanguageListPref.clear();
7351     
7352     HomeTZList.clear();
7353     HomeTZListAltID.clear();
7354     HomeTZListPID.clear();
7355     HomeTZListType.clear();
7356     HomeTZListTokens.clear();
7357     HomeTZListMediatype.clear();
7358     HomeTZListPref.clear();
7359     
7360     HomeGeographyList.clear();
7361     HomeGeographyListAltID.clear();
7362     HomeGeographyListPID.clear();
7363     HomeGeographyListType.clear();
7364     HomeGeographyListTokens.clear();
7365     HomeGeographyListMediatype.clear();
7366     HomeGeographyListPref.clear();
7367     
7368     HomeRelatedList.clear();
7369     HomeRelatedListRelType.clear();
7370     HomeRelatedListLanguage.clear();
7371     HomeRelatedListAltID.clear();
7372     HomeRelatedListPID.clear();
7373     HomeRelatedListType.clear();
7374     HomeRelatedListTokens.clear();
7375     HomeRelatedListPref.clear();        
7376     
7377     HomeWebsiteList.clear();
7378     HomeWebsiteListAltID.clear();
7379     HomeWebsiteListPID.clear();
7380     HomeWebsiteListType.clear();
7381     HomeWebsiteListTokens.clear();
7382     HomeWebsiteListMediatype.clear();
7383     HomeWebsiteListPref.clear();
7384     
7385     HomeTitleList.clear();
7386     HomeTitleListLanguage.clear();
7387     HomeTitleListAltID.clear();
7388     HomeTitleListPID.clear();
7389     HomeTitleListType.clear();
7390     HomeTitleListTokens.clear();
7391     HomeTitleListPref.clear();
7392     
7393     HomeRoleList.clear();
7394     HomeRoleListLanguage.clear();        
7395     HomeRoleListAltID.clear();
7396     HomeRoleListPID.clear();
7397     HomeRoleListType.clear();
7398     HomeRoleListTokens.clear();
7399     HomeRoleListPref.clear();
7400     
7401     HomeOrganisationsList.clear();
7402     HomeOrganisationsListLanguage.clear();        
7403     HomeOrganisationsListAltID.clear();
7404     HomeOrganisationsListPID.clear();
7405     HomeOrganisationsListType.clear();
7406     HomeOrganisationsListTokens.clear();
7407     HomeOrganisationsListSortAs.clear();
7408     HomeOrganisationsListPref.clear();
7409     
7410     HomeNoteList.clear();
7411     HomeNoteListLanguage.clear();        
7412     HomeNoteListAltID.clear();
7413     HomeNoteListPID.clear();
7414     HomeNoteListType.clear();
7415     HomeNoteListTokens.clear();
7416     HomeNoteListPref.clear();        
7417     
7418     /* Items on the Business tab */
7419     
7420     BusinessNicknamesList.clear();
7421     BusinessNicknamesListType.clear();
7422     BusinessNicknamesListLanguage.clear();
7423     BusinessNicknamesListAltID.clear();
7424     BusinessNicknamesListPID.clear();
7425     BusinessNicknamesListTokens.clear();        
7426     BusinessNicknamesListPref.clear();        
7427     
7428     BusinessAddressList.clear();
7429     BusinessAddressListTown.clear();
7430     BusinessAddressListCounty.clear();
7431     BusinessAddressListPostCode.clear();
7432     BusinessAddressListCountry.clear();
7433     BusinessAddressListLabel.clear();
7434     BusinessAddressListLang.clear();        
7435     BusinessAddressListAltID.clear();
7436     BusinessAddressListPID.clear();
7437     BusinessAddressListTokens.clear();
7438     BusinessAddressListGeo.clear();
7439     BusinessAddressListTimezone.clear();        
7440     BusinessAddressListType.clear();
7441     BusinessAddressListMediatype.clear();
7442     BusinessAddressListPref.clear();
7443     
7444     BusinessEmailList.clear();
7445     BusinessEmailListAltID.clear();
7446     BusinessEmailListPID.clear();
7447     BusinessEmailListType.clear();
7448     BusinessEmailListTokens.clear();
7449     BusinessEmailListPref.clear();
7450     
7451     BusinessIMList.clear();
7452     BusinessIMListAltID.clear();
7453     BusinessIMListPID.clear();
7454     BusinessIMListType.clear();
7455     BusinessIMListTokens.clear();
7456     BusinessIMListMediatype.clear();
7457     BusinessIMListPref.clear();
7458     
7459     BusinessTelephoneList.clear();
7460     BusinessTelephoneListAltID.clear();
7461     BusinessTelephoneListPID.clear();
7462     BusinessTelephoneListType.clear();
7463     BusinessTelephoneListTokens.clear();
7464     BusinessTelephoneListPref.clear();
7465     
7466     BusinessLanguageList.clear();
7467     BusinessLanguageListAltID.clear();
7468     BusinessLanguageListPID.clear();
7469     BusinessLanguageListType.clear();
7470     BusinessLanguageListTokens.clear();
7471     BusinessLanguageListPref.clear();
7472     
7473     BusinessTZList.clear();
7474     BusinessTZListAltID.clear();
7475     BusinessTZListPID.clear();
7476     BusinessTZListType.clear();
7477     BusinessTZListTokens.clear();
7478     BusinessTZListMediatype.clear();
7479     BusinessTZListPref.clear();
7480     
7481     BusinessGeographyList.clear();
7482     BusinessGeographyListAltID.clear();
7483     BusinessGeographyListPID.clear();
7484     BusinessGeographyListType.clear();
7485     BusinessGeographyListTokens.clear();
7486     BusinessGeographyListMediatype.clear();
7487     BusinessGeographyListPref.clear();
7488     
7489     BusinessRelatedList.clear();
7490     BusinessRelatedListRelType.clear();
7491     BusinessRelatedListLanguage.clear();
7492     BusinessRelatedListAltID.clear();
7493     BusinessRelatedListPID.clear();
7494     BusinessRelatedListType.clear();
7495     BusinessRelatedListTokens.clear();
7496     BusinessRelatedListPref.clear();            
7497     
7498     BusinessWebsiteList.clear();
7499     BusinessWebsiteListAltID.clear();
7500     BusinessWebsiteListPID.clear();
7501     BusinessWebsiteListType.clear();
7502     BusinessWebsiteListTokens.clear();
7503     BusinessWebsiteListMediatype.clear();
7504     BusinessWebsiteListPref.clear();
7505     
7506     BusinessTitleList.clear();
7507     BusinessTitleListLanguage.clear();        
7508     BusinessTitleListAltID.clear();
7509     BusinessTitleListPID.clear();
7510     BusinessTitleListType.clear();
7511     BusinessTitleListTokens.clear();
7512     BusinessTitleListPref.clear();
7513     
7514     BusinessRoleList.clear();
7515     BusinessRoleListLanguage.clear();        
7516     BusinessRoleListAltID.clear();
7517     BusinessRoleListPID.clear();
7518     BusinessRoleListType.clear();
7519     BusinessRoleListTokens.clear();
7520     BusinessRoleListPref.clear();
7521     
7522     BusinessOrganisationsList.clear();
7523     BusinessOrganisationsListLanguage.clear();        
7524     BusinessOrganisationsListAltID.clear();
7525     BusinessOrganisationsListPID.clear();
7526     BusinessOrganisationsListType.clear();
7527     BusinessOrganisationsListTokens.clear();
7528     BusinessOrganisationsListSortAs.clear();        
7529     BusinessOrganisationsListPref.clear();
7530     
7531     BusinessNoteList.clear();
7532     BusinessNoteListLanguage.clear();        
7533     BusinessNoteListAltID.clear();
7534     BusinessNoteListPID.clear();
7535     BusinessNoteListType.clear();
7536     BusinessNoteListTokens.clear();
7537     BusinessNoteListPref.clear();        
7538     
7539     /* Items on the Categories tab */
7540     
7541     CategoriesList.clear();
7542     CategoriesListAltID.clear();
7543     CategoriesListPID.clear();
7544     CategoriesListType.clear();
7545     CategoriesListTokens.clear();
7546     CategoriesListPref.clear();    
7547     
7548     /* Items on the Groups tab */
7549     
7550     GroupsList.clear();
7551     GroupsListAltID.clear();
7552     GroupsListPID.clear();
7553     GroupsListType.clear();
7554     GroupsListTokens.clear();
7555     GroupsListPref.clear();
7556     
7557     /* Items on the Pictures tab */
7558     
7559     PicturesList.clear();
7560     PicturesListAltID.clear();
7561     PicturesListPID.clear();
7562     PicturesListType.clear();
7563     PicturesListPicEncType.clear();
7564     PicturesListPictureType.clear();
7565     PicturesListTokens.clear();
7566     PicturesListMediatype.clear();        
7567     PicturesListPref.clear();
7568     
7569     /* Items on the Logos tab */
7570     
7571     LogosList.clear();
7572     LogosListAltID.clear();
7573     LogosListPID.clear();
7574     LogosListType.clear();
7575     LogosListPicEncType.clear();        
7576     LogosListPictureType.clear();
7577     LogosListTokens.clear();
7578     LogosListMediatype.clear();        
7579     LogosListPref.clear();
7580     
7581     /* Items on the Sounds tab */
7582     
7583     SoundsList.clear();
7584     SoundsListAltID.clear();
7585     SoundsListPID.clear();
7586     SoundsListType.clear();
7587     SoundsListAudioEncType.clear();        
7588     SoundsListAudioType.clear();        
7589     SoundsListTokens.clear();
7590     SoundsListMediatype.clear();        
7591     SoundsListPref.clear();    
7592     
7593     /* Items on the Calendaring tab */
7594     
7595     CalendarList.clear();
7596     CalendarListAltID.clear();
7597     CalendarListPID.clear();
7598     CalendarListType.clear();
7599     CalendarListTokens.clear();
7600     CalendarListMediatype.clear();        
7601     CalendarListPref.clear();
7602     
7603     CalendarRequestList.clear();
7604     CalendarRequestListAltID.clear();
7605     CalendarRequestListPID.clear();
7606     CalendarRequestListType.clear();
7607     CalendarRequestListTokens.clear();
7608     CalendarRequestListMediatype.clear();        
7609     CalendarRequestListPref.clear();        
7610     
7611     FreeBusyList.clear();
7612     FreeBusyListAltID.clear();
7613     FreeBusyListPID.clear();
7614     FreeBusyListType.clear();
7615     FreeBusyListTokens.clear();
7616     FreeBusyListMediatype.clear();        
7617     FreeBusyListPref.clear();
7618     
7619     /* Items on the Security tab */
7620     
7621     KeyList.clear();
7622     KeyListAltID.clear();
7623     KeyListPID.clear();
7624     KeyListKeyType.clear();        
7625     KeyListDataType.clear();        
7626     KeyListDataEncType.clear();
7627     KeyListType.clear();
7628     KeyListTokens.clear();
7629     KeyListPref.clear();
7630     
7631     /* Items on the Other tab */
7632     
7633     VendorList.clear();
7634     VendorListPEN.clear();
7635     VendorListElement.clear();
7636     
7637     XTokenList.clear();        
7638     XTokenListTokens.clear();
7639     
7640     wxSContactFilename.Clear();
7641     boolContactModified = FALSE;
7642     intSeekSelectedData = 0;
7643     
7644     /* Section for saving/loading data */
7645     
7646     ETag.Clear();
7647     ETagOriginal.Clear();
7648     
7649     strValue.Clear();
7650     strValue2.Clear();
7651     strValue3.Clear();
7652     
7653     boolValue = FALSE;
7654     boolValue2 = FALSE;
7655     intValue = 0;
7656     intValue2 = 0;
7657     intValue3 = 0;
7658     BinaryDataProc = FALSE;
7659     EditMode = TRUE;
7660     DialogOpen = FALSE;
7661     
7662     PictureImage = wxNullBitmap;
7663     LogoImage = wxNullBitmap;
7664     
7667 void frmContactEditor::ContactFileChanged( wxCommandEvent &event ){
7668     
7669     // Stop the timer.
7670     
7671     FMTimer.Stop();
7672     
7673     // Check if a dialog is already open.
7674     
7675     if (DialogOpen == TRUE){
7676         
7677         FMTimer.Start(1000, FALSE);
7678         return;
7679         
7680     }
7681     
7682     // Bring up a Yes/No modal dialog asking if the changed file should be reloaded.
7683     
7684     int QuestionResponse;
7685     
7686     QuestionResponse = wxMessageBox(_("This contact has changed. Saving the contact may overwrite or lose any changes done by that change. Do you want to reload the contact with the changes made?"), _("Contact information has changed"), wxYES_NO, this);
7687     
7688     if (QuestionResponse == wxYES){
7689         
7690         // Reload the contact.
7691         wxString wxSReloadContactName = wxSContactFilename;
7692         ClearContact();
7693         LoadContact(wxSReloadContactName);
7694         
7695     } else {
7696         
7697         // Do nothing other than update the timestamp so this message
7698         // doesn't appear until the next time it changes.
7699         
7700         FMTimer.UpdateTimestamp();
7701         
7702     }  
7703     
7704     // Start the timer.
7705     
7706     FMTimer.Start();
7707     
7710 void frmContactEditor::UpdateMembersTab( wxCommandEvent &event ){
7711     
7712     if (cmbType->GetCurrentSelection() == 2){
7713         
7714         tabMembers->Show();     
7715         
7716     } else {
7717         
7718         tabMembers->Hide();
7719         
7720     }
7721     
7724 void frmContactEditor::SetUID(int UID){
7725     
7726     ContactEditorUID = UID;
7727     
7730 void frmContactEditor::UpdateDisplayAs( wxCommandEvent &event ){
7731     
7732     // Generate a drop down list of common names to use for the display as drop down box.
7733     
7734     wxString SetValue = cmbDisplayAs->GetValue();
7735     
7736     cmbDisplayAs->Clear();
7737     cmbDisplayAs->Append(txtForename->GetValue() + wxT(" ") + txtSurname->GetValue());
7738     if (!txtOtherNames->GetValue().IsEmpty()){
7739         
7740         cmbDisplayAs->Append(txtForename->GetValue() + wxT(" ") + txtOtherNames->GetValue()  + wxT(" ") + txtForename->GetValue());     
7741         
7742     }
7743     cmbDisplayAs->Append(txtSurname->GetValue() + wxT(", ") + txtForename->GetValue()); 
7744     if (!txtOtherNames->GetValue().IsEmpty()){
7745         
7746         cmbDisplayAs->Append(txtForename->GetValue() + wxT(", ") + wxT(" ") + txtForename->GetValue() + wxT(" ") + txtOtherNames->GetValue());
7747         
7748     }
7749     if (!txtTitle->GetValue().IsEmpty()){
7750         cmbDisplayAs->Append(txtTitle->GetValue() + wxT(" ") + txtForename->GetValue() + wxT(" ") + txtSurname->GetValue());
7751     }
7752     
7753     cmbDisplayAs->SetValue(SetValue);
7754     
7755     this->SetTitle(cmbDisplayAs->GetValue());
7756     
7759 void frmContactEditor::UpdateName( wxCommandEvent &event ){
7760     
7761     this->SetTitle(cmbDisplayAs->GetValue());
7762     
7763     WindowData *WData = new WindowData;
7764     
7765     WData->DataType = 1;
7766     WData->WindowPointer = this;
7767     WData->WindowID = ContactEditorUID;
7768     
7769     wxCommandEvent editevent(WINDOW_EDIT);
7770     editevent.SetClientData(WData);
7771     wxPostEvent(GetParent(), editevent);
7772     
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