Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Merge branch 'master' of ssh://digit.mahou.co.uk/home/kirinji/repos/xestiaab
[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     
112 void frmContactEditor::AddGeneralNickname( wxCommandEvent& event )
114     int intResult = 0;
115     
116     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
117     frameCENickname->SetEditorMode(FALSE, CE_GENERAL);
118     intResult = GetLastInt(&GeneralNicknamesList);
119     frameCENickname->SetupPointers(&GeneralNicknamesList,
120                                    &GeneralNicknamesListAltID,
121                                    &GeneralNicknamesListPID,
122                                    &GeneralNicknamesListType,
123                                    &GeneralNicknamesListLanguage,
124                                    &GeneralNicknamesListTokens,
125                                    &GeneralNicknamesListPref,
126                                    lboNicknames,
127                                    (intValueSeek));
128     frameCENickname->ShowModal();
129     delete frameCENickname;
130     frameCENickname = NULL;
133 void frmContactEditor::ModifyGeneralNickname( wxCommandEvent& event )
135     
136     long longSelected = -1;
137     int intSelectedData = 0;
138     
139     if (!GetSelectedItem(lboNicknames,
140                          &longSelected,
141                          &intSelectedData)){
142         return;
143     }
144     
145     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
146     frameCENickname->SetupPointers(&GeneralNicknamesList,
147                                    &GeneralNicknamesListAltID,
148                                    &GeneralNicknamesListPID,
149                                    &GeneralNicknamesListType,
150                                    &GeneralNicknamesListLanguage,
151                                    &GeneralNicknamesListTokens,
152                                    &GeneralNicknamesListPref,
153                                    lboNicknames,
154                                    intSelectedData);
155     frameCENickname->SetEditorMode(TRUE, CE_GENERAL);
156     frameCENickname->ShowModal();
157     delete frameCENickname;
158     frameCENickname = NULL;
159     
162 void frmContactEditor::DeleteGeneralNickname( wxCommandEvent& event )
164     
165     long longSelected = -1;
166     int intSelectedData = 0;
167     
168     if (!GetSelectedItem(lboNicknames,
169                          &longSelected,
170                          &intSelectedData)){
171         return;
172     }
173     
174     lboNicknames->DeleteItem(longSelected);
175     
176     DeleteMapData(intSelectedData,
177                   &GeneralNicknamesList,
178                   &GeneralNicknamesListLanguage,
179                   &GeneralNicknamesListAltID,
180                   &GeneralNicknamesListPID,
181                   &GeneralNicknamesListTokens,
182                   &GeneralNicknamesListType,
183                   &GeneralNicknamesListPref);
184     
187 void frmContactEditor::AddGeneralAddress( wxCommandEvent& event )
189     
190     int intResult = 0;
191     
192     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
193     frameCEAddress->SetEditorMode(FALSE, CE_GENERAL);
194     intResult = GetLastInt(&GeneralAddressList);
195     frameCEAddress->SetupPointers(&GeneralAddressList,
196                                   &GeneralAddressListTown,
197                                   &GeneralAddressListCounty,
198                                   &GeneralAddressListPostCode,
199                                   &GeneralAddressListCountry,
200                                   &GeneralAddressListLabel,
201                                   &GeneralAddressListLang,
202                                   &GeneralAddressListAltID,
203                                   &GeneralAddressListPID,
204                                   &GeneralAddressListTokens,
205                                   &GeneralAddressListGeo,
206                                   &GeneralAddressListTimezone,
207                                   &GeneralAddressListType,
208                                   &GeneralAddressListMediatype,
209                                   &GeneralAddressListPref,
210                                   lboAddresses,
211                                   (intValueSeek));
212     frameCEAddress->ShowModal();
213     delete frameCEAddress;
214     frameCEAddress = NULL;
217 void frmContactEditor::ModifyGeneralAddress( wxCommandEvent& event )
219     
220     long longSelected = -1;
221     int intSelectedData = 0;
222     
223     if (!GetSelectedItem(lboAddresses,
224                          &longSelected,
225                          &intSelectedData)){
226         return;
227     }
228     
229     if (longSelected == -1){
230         return;
231     }
232     
233     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
234     frameCEAddress->SetupPointers(&GeneralAddressList,
235                                   &GeneralAddressListTown,
236                                   &GeneralAddressListCounty,
237                                   &GeneralAddressListPostCode,
238                                   &GeneralAddressListCountry,
239                                   &GeneralAddressListLabel,
240                                   &GeneralAddressListLang,
241                                   &GeneralAddressListAltID,
242                                   &GeneralAddressListPID,
243                                   &GeneralAddressListTokens,
244                                   &GeneralAddressListGeo,
245                                   &GeneralAddressListTimezone,
246                                   &GeneralAddressListType,
247                                   &GeneralAddressListMediatype,
248                                   &GeneralAddressListPref,
249                                   lboAddresses,
250                                   intSelectedData);
251     frameCEAddress->SetEditorMode(TRUE, CE_GENERAL);
252     frameCEAddress->ShowModal();
253     delete frameCEAddress;
254     frameCEAddress = NULL;
255     
258 void frmContactEditor::DeleteGeneralAddress( wxCommandEvent& event )
260     
261     long longSelected = -1;
262     int intSelectedData = 0;
263     
264     if (!GetSelectedItem(lboAddresses,
265                          &longSelected,
266                          &intSelectedData)){
267         return;
268     }
269     
270     lboAddresses->DeleteItem(longSelected);
271     
272     DeleteMapData(intSelectedData, &GeneralAddressList,
273                   &GeneralAddressListTown, &GeneralAddressListCounty,
274                   &GeneralAddressListPostCode, &GeneralAddressListCountry,
275                   &GeneralAddressList, &GeneralAddressListLabel,
276                   &GeneralAddressListLang, &GeneralAddressListAltID,
277                   &GeneralAddressListPID, &GeneralAddressListTokens,
278                   &GeneralAddressListGeo, &GeneralAddressListTimezone,
279                   &GeneralAddressListType, &GeneralAddressListMediatype,
280                   &GeneralAddressListPref);
281     
284 void frmContactEditor::AddGeneralEmail( wxCommandEvent& event )
286     int intResult = 0;
287     
288     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
289     frameCEEmail->SetEditorMode(FALSE, CE_GENERAL);
290     intResult = GetLastInt(&GeneralAddressList);
291     frameCEEmail->SetupPointers(&GeneralEmailList,
292                                 &GeneralEmailListAltID,
293                                 &GeneralEmailListPID,
294                                 &GeneralEmailListType,
295                                 &GeneralEmailListTokens,
296                                 &GeneralEmailListPref,
297                                 lboEmails,
298                                 (intValueSeek));
299     frameCEEmail->ShowModal();
300     delete frameCEEmail;
301     frameCEEmail = NULL;
304 void frmContactEditor::ModifyGeneralEmail( wxCommandEvent& event )
306     long longSelected = -1;
307     int intSelectedData = 0;
308     
309     if (!GetSelectedItem(lboEmails,
310                          &longSelected,
311                          &intSelectedData)){
312         return;
313     }
314     
315     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
316     frameCEEmail->SetupPointers(&GeneralEmailList,
317                                 &GeneralEmailListAltID,
318                                 &GeneralEmailListPID,
319                                 &GeneralEmailListType,
320                                 &GeneralEmailListTokens,
321                                 &GeneralEmailListPref,
322                                 lboEmails,
323                                 intSelectedData);
324     frameCEEmail->SetEditorMode(TRUE, CE_GENERAL);
325     frameCEEmail->ShowModal();
326     delete frameCEEmail;
327     frameCEEmail = NULL;
330 void frmContactEditor::DeleteGeneralEmail( wxCommandEvent& event )
332     long longSelected = -1;
333     int intSelectedData = 0;
334     
335     if (!GetSelectedItem(lboEmails,
336                          &longSelected,
337                          &intSelectedData)){
338         return;
339     }
340     
341     lboEmails->DeleteItem(longSelected);
342     
343     DeleteMapData(intSelectedData, &GeneralEmailList,
344                   &GeneralEmailListAltID, &GeneralEmailListPID,
345                   &GeneralEmailListType, &GeneralEmailListTokens,
346                   &GeneralEmailListPref);
347     
350 void frmContactEditor::AddGeneralIM( wxCommandEvent& event )
352     int intResult = 0;
353     
354     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
355     frameCEIM->SetEditorMode(FALSE, CE_GENERAL);
356     intResult = GetLastInt(&GeneralIMList);
357     frameCEIM->SetupPointers(&GeneralIMList,
358                              &GeneralIMListAltID,
359                              &GeneralIMListPID,
360                              &GeneralIMListType,
361                              &GeneralIMListTokens,
362                              &GeneralIMListMediatype,
363                              &GeneralIMListPref,
364                              lboIM,
365                              (intValueSeek));
366     frameCEIM->ShowModal();
367     delete frameCEIM;
368     frameCEIM = NULL;
371 void frmContactEditor::ModifyGeneralIM( wxCommandEvent& event )
373     long longSelected = -1;
374     int intSelectedData = 0;
375     
376     if (!GetSelectedItem(lboIM,
377                          &longSelected,
378                          &intSelectedData)){
379         return;
380     }
381     
382     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
383     frameCEIM->SetupPointers(&GeneralIMList,
384                              &GeneralIMListAltID,
385                              &GeneralIMListPID,
386                              &GeneralIMListType,
387                              &GeneralIMListTokens,
388                              &GeneralIMListMediatype,
389                              &GeneralIMListPref,
390                              lboIM,
391                              intSelectedData);
392     frameCEIM->SetEditorMode(TRUE, CE_GENERAL);
393     frameCEIM->ShowModal();
394     delete frameCEIM;
395     frameCEIM = NULL;
398 void frmContactEditor::DeleteGeneralIM( wxCommandEvent& event )
400     long longSelected = -1;
401     int intSelectedData = 0;
402     
403     if (!GetSelectedItem(lboIM,
404                          &longSelected,
405                          &intSelectedData)){
406         return;
407     }
408     
409     lboIM->DeleteItem(longSelected);
410     
411     DeleteMapData(intSelectedData, &GeneralIMList,
412                   &GeneralIMListAltID, &GeneralIMListPID,
413                   &GeneralIMListType, &GeneralIMListTokens,
414                   &GeneralIMListMediatype, &GeneralIMListPref);
415     
418 void frmContactEditor::AddGeneralTelephone( wxCommandEvent& event )
420     int intResult = 0;
421     
422     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
423     frameCETel->SetEditorMode(FALSE, CE_GENERAL);
424     intResult = GetLastInt(&GeneralTelephoneList);
425     frameCETel->SetupPointers(&GeneralTelephoneList,
426                               &GeneralTelephoneListAltID,
427                               &GeneralTelephoneListPID,
428                               &GeneralTelephoneListType,
429                               &GeneralTelephoneListTokens,
430                               &GeneralTelephoneListPref,
431                               lboTelephone,
432                               (intValueSeek));
433     frameCETel->ShowModal();
434     delete frameCETel;
435     frameCETel = NULL;
438 void frmContactEditor::ModifyGeneralTelephone( wxCommandEvent& event )
440     long longSelected = -1;
441     int intSelectedData = 0;
442     
443     if (!GetSelectedItem(lboTelephone,
444                          &longSelected,
445                          &intSelectedData)){
446         return;
447     }
448     
449     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
450     frameCETel->SetupPointers(&GeneralTelephoneList,
451                               &GeneralTelephoneListAltID,
452                               &GeneralTelephoneListPID,
453                               &GeneralTelephoneListType,
454                               &GeneralTelephoneListTokens,
455                               &GeneralTelephoneListPref,
456                               lboTelephone,
457                               intSelectedData);
458     frameCETel->SetEditorMode(TRUE, CE_GENERAL);
459     frameCETel->ShowModal();
460     delete frameCETel;
461     frameCETel = NULL;
464 void frmContactEditor::DeleteGeneralTelephone( wxCommandEvent& event )
466     long longSelected = -1;
467     int intSelectedData = 0;
468     
469     if (!GetSelectedItem(lboTelephone,
470                          &longSelected,
471                          &intSelectedData)){
472         return;
473     }
474     
475     lboTelephone->DeleteItem(longSelected);
476     
477     DeleteMapData(intSelectedData, &GeneralTelephoneList,
478                   &GeneralTelephoneListAltID, &GeneralTelephoneListPID,
479                   &GeneralTelephoneListType, &GeneralTelephoneListTokens,
480                   &GeneralTelephoneListPref);
481     
484 void frmContactEditor::AddGeneralLanguages( wxCommandEvent& event )
486     int intResult = 0;
487     
488     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
489     frameCELang->SetEditorMode(FALSE, CE_GENERAL);
490     intResult = GetLastInt(&GeneralLanguageList);
491     frameCELang->SetupPointers(&GeneralLanguageList,
492                                &GeneralLanguageListAltID,
493                                &GeneralLanguageListPID,
494                                &GeneralLanguageListType,
495                                &GeneralLanguageListTokens,
496                                &GeneralLanguageListPref,
497                                lboLanguages,
498                                (intValueSeek));
499     frameCELang->ShowModal();
500     delete frameCELang;
501     frameCELang = NULL;
504 void frmContactEditor::ModifyGeneralLanguages( wxCommandEvent& event )
506     long longSelected = -1;
507     int intSelectedData = 0;
508     
509     if (!GetSelectedItem(lboLanguages,
510                          &longSelected,
511                          &intSelectedData)){
512         return;
513     }
514     
515     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
516     frameCELang->SetupPointers(&GeneralLanguageList,
517                                &GeneralLanguageListAltID,
518                                &GeneralLanguageListPID,
519                                &GeneralLanguageListType,
520                                &GeneralLanguageListTokens,
521                                &GeneralLanguageListPref,
522                                lboLanguages,
523                                intSelectedData);
524     frameCELang->SetEditorMode(TRUE, CE_GENERAL);
525     frameCELang->ShowModal();
526     delete frameCELang;
527     frameCELang = NULL;
530 void frmContactEditor::DeleteGeneralLanguage( wxCommandEvent& event )
532     long longSelected = -1;
533     int intSelectedData = 0;
534     
535     if (!GetSelectedItem(lboLanguages,
536                          &longSelected,
537                          &intSelectedData)){
538         return;
539     }
540     
541     lboLanguages->DeleteItem(longSelected);
542     
543     DeleteMapData(intSelectedData, &GeneralLanguageList,
544                   &GeneralLanguageListAltID, &GeneralLanguageListPID,
545                   &GeneralLanguageListType, &GeneralLanguageListTokens,
546                   &GeneralLanguageListPref);
547     
550 void frmContactEditor::AddGeneralTimezone( wxCommandEvent& event )
552     int intResult = 0;
553     
554     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
555     frameCETZ->SetEditorMode(FALSE, CE_GENERAL);
556     intResult = GetLastInt(&GeneralTZList);
557     frameCETZ->SetupPointers(&GeneralTZList,
558                              &GeneralTZListAltID,
559                              &GeneralTZListPID,
560                              &GeneralTZListType,
561                              &GeneralTZListTokens,
562                              &GeneralTZListMediatype,
563                              &GeneralTZListPref,
564                              lboTimezones,
565                              (intValueSeek));
566     frameCETZ->ShowModal();
567     delete frameCETZ;
568     frameCETZ = NULL;
571 void frmContactEditor::ModifyGeneralTimezone( wxCommandEvent& event )
573     long longSelected = -1;
574     int intSelectedData = 0;
575     
576     if (!GetSelectedItem(lboTimezones,
577                          &longSelected,
578                          &intSelectedData)){
579         return;
580     }
581     
582     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
583     frameCETZ->SetupPointers(&GeneralTZList,
584                              &GeneralTZListAltID,
585                              &GeneralTZListPID,
586                              &GeneralTZListType,
587                              &GeneralTZListTokens,
588                              &GeneralTZListMediatype,
589                              &GeneralTZListPref,
590                              lboTimezones,
591                              intSelectedData);
592     frameCETZ->SetEditorMode(TRUE, CE_GENERAL);
593     frameCETZ->ShowModal();
594     delete frameCETZ;
595     frameCETZ = NULL;
598 void frmContactEditor::DeleteGeneralTimezone( wxCommandEvent& event )
600     long longSelected = -1;
601     int intSelectedData = 0;
602     
603     if (!GetSelectedItem(lboTimezones,
604                          &longSelected,
605                          &intSelectedData)){
606         return;
607     }
608     
609     lboTimezones->DeleteItem(longSelected);
610     
611     DeleteMapData(intSelectedData, &GeneralTZList,
612                   &GeneralTZListAltID, &GeneralTZListPID,
613                   &GeneralTZListType, &GeneralTZListTokens,
614                   &GeneralTZListMediatype, &GeneralTZListPref);
615     
618 void frmContactEditor::AddGeneralGeoposition( wxCommandEvent& event )
620     int intResult = 0;
621     
622     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
623     frameCEGeo->SetEditorMode(FALSE, CE_GENERAL);
624     intResult = GetLastInt(&GeneralGeographyList);
625     frameCEGeo->SetupPointers(&GeneralGeographyList,
626                               &GeneralGeographyListAltID,
627                               &GeneralGeographyListPID,
628                               &GeneralGeographyListType,
629                               &GeneralGeographyListTokens,
630                               &GeneralGeographyListMediatype,
631                               &GeneralGeographyListPref,
632                               lboGeoposition,
633                               (intValueSeek));
634     frameCEGeo->ShowModal();
635     delete frameCEGeo;
636     frameCEGeo = NULL;
639 void frmContactEditor::ModifyGeneralGeoposition( wxCommandEvent& event )
641     long longSelected = -1;
642     int intSelectedData = 0;
643     
644     if (!GetSelectedItem(lboGeoposition,
645                          &longSelected,
646                          &intSelectedData)){
647         return;
648     }
649     
650     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
651     frameCEGeo->SetupPointers(&GeneralGeographyList,
652                               &GeneralGeographyListAltID,
653                               &GeneralGeographyListPID,
654                               &GeneralGeographyListType,
655                               &GeneralGeographyListTokens,
656                               &GeneralGeographyListMediatype,
657                               &GeneralGeographyListPref,
658                               lboGeoposition,
659                               intSelectedData);
660     frameCEGeo->SetEditorMode(TRUE, CE_GENERAL);
661     frameCEGeo->ShowModal();
662     delete frameCEGeo;
663     frameCEGeo = NULL;
666 void frmContactEditor::DeleteGeneralGeoposition( wxCommandEvent& event )
668     long longSelected = -1;
669     int intSelectedData = 0;
670     
671     if (!GetSelectedItem(lboGeoposition,
672                          &longSelected,
673                          &intSelectedData)){
674         return;
675     }
676     
677     lboGeoposition->DeleteItem(longSelected);
678     
679     DeleteMapData(intSelectedData, &GeneralGeographyList,
680                   &GeneralGeographyListAltID, &GeneralGeographyListPID,
681                   &GeneralGeographyListType, &GeneralGeographyListTokens,
682                   &GeneralGeographyListMediatype, &GeneralGeographyListPref);
683     
686 void frmContactEditor::AddGeneralRelated( wxCommandEvent& event )
688     int intResult = 0;
689     
690     frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
691     frameCERel->SetEditorMode(FALSE, CE_GENERAL);
692     intResult = GetLastInt(&GeneralRelatedList);
693     frameCERel->SetupPointers(&GeneralRelatedList,
694                               &GeneralRelatedListRelType,
695                               &GeneralRelatedListAltID,
696                               &GeneralRelatedListPID,
697                               &GeneralRelatedListType,
698                               &GeneralRelatedListTokens,
699                               &GeneralRelatedListPref,
700                               lboRelated,
701                               (intValueSeek));
702     frameCERel->ShowModal();
703     delete frameCERel;
704     frameCERel = NULL;
707 void frmContactEditor::ModifyGeneralRelated( wxCommandEvent& event )
709     long longSelected = -1;
710     int intSelectedData = 0;
711     
712     if (!GetSelectedItem(lboRelated,
713                          &longSelected,
714                          &intSelectedData)){
715         return;
716     }
717     
718     frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
719     frameCERel->SetupPointers(&GeneralRelatedList,
720                               &GeneralRelatedListRelType,
721                               &GeneralRelatedListAltID,
722                               &GeneralRelatedListPID,
723                               &GeneralRelatedListType,
724                               &GeneralRelatedListTokens,
725                               &GeneralRelatedListPref,
726                               lboRelated,
727                               intSelectedData);
728     frameCERel->SetEditorMode(TRUE, CE_GENERAL);
729     frameCERel->ShowModal();
730     delete frameCERel;
731     frameCERel = NULL;
734 void frmContactEditor::DeleteGeneralRelated( wxCommandEvent& event )
736     long longSelected = -1;
737     int intSelectedData = 0;
738     
739     if (!GetSelectedItem(lboRelated,
740                          &longSelected,
741                          &intSelectedData)){
742         return;
743     }
744     
745     lboRelated->DeleteItem(longSelected);
746     
747     GeneralRelatedList.erase(intSelectedData);
748     GeneralRelatedListRelType.erase(intSelectedData);
749     GeneralRelatedListAltID.erase(intSelectedData);
750     GeneralRelatedListPID.erase(intSelectedData);
751     GeneralRelatedListType.erase(intSelectedData);
752     GeneralRelatedListTokens.erase(intSelectedData);
753     GeneralRelatedListPref.erase(intSelectedData);
756 void frmContactEditor::AddGeneralWebsite( wxCommandEvent& event )
758     int intResult = 0;
759     
760     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
761     frameCEWeb->SetEditorMode(FALSE, CE_GENERAL);
762     intResult = GetLastInt(&GeneralWebsiteList);
763     frameCEWeb->SetupPointers(&GeneralWebsiteList,
764                               &GeneralWebsiteListAltID,
765                               &GeneralWebsiteListPID,
766                               &GeneralWebsiteListType,
767                               &GeneralWebsiteListTokens,
768                               &GeneralWebsiteListMediatype,
769                               &GeneralWebsiteListPref,
770                               lboWebsites,
771                               (intValueSeek));
772     frameCEWeb->ShowModal();
773     delete frameCEWeb;
774     frameCEWeb = NULL;
777 void frmContactEditor::ModifyGeneralWebsite( wxCommandEvent& event )
779     long longSelected = -1;
780     int intSelectedData = 0;
781     
782     if (!GetSelectedItem(lboWebsites,
783                          &longSelected,
784                          &intSelectedData)){
785         return;
786     }
787     
788     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
789     frameCEWeb->SetupPointers(&GeneralWebsiteList,
790                               &GeneralWebsiteListAltID,
791                               &GeneralWebsiteListPID,
792                               &GeneralWebsiteListType,
793                               &GeneralWebsiteListTokens,
794                               &GeneralWebsiteListMediatype,
795                               &GeneralWebsiteListPref,
796                               lboWebsites,
797                               intSelectedData);
798     frameCEWeb->SetEditorMode(TRUE, CE_GENERAL);
799     frameCEWeb->ShowModal();
800     delete frameCEWeb;
801     frameCEWeb = NULL;
804 void frmContactEditor::DeleteGeneralWebsite( wxCommandEvent& event )
806     long longSelected = -1;
807     int intSelectedData = 0;
808     
809     if (!GetSelectedItem(lboWebsites,
810                          &longSelected,
811                          &intSelectedData)){
812         return;
813     }
814     
815     lboWebsites->DeleteItem(longSelected);
816     
817     DeleteMapData(intSelectedData, &GeneralWebsiteList,
818                   &GeneralWebsiteListAltID, &GeneralWebsiteListPID,
819                   &GeneralWebsiteListType, &GeneralWebsiteListTokens,
820                   &GeneralWebsiteListMediatype, &GeneralWebsiteListPref);
821     
824 void frmContactEditor::AddGeneralTitle( wxCommandEvent& event )
826     int intResult = 0;
827     
828     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
829     frameCETitle->SetEditorMode(FALSE, CE_GENERAL);
830     intResult = GetLastInt(&GeneralTitleList);
831     frameCETitle->SetupPointers(&GeneralTitleList,
832                                 &GeneralTitleListLanguage,
833                                 &GeneralTitleListAltID,
834                                 &GeneralTitleListPID,
835                                 &GeneralTitleListType,
836                                 &GeneralTitleListTokens,
837                                 &GeneralTitleListPref,
838                                 lboTitles,
839                                 (intValueSeek));
840     frameCETitle->ShowModal();
841     delete frameCETitle;
842     frameCETitle = NULL;
845 void frmContactEditor::ModifyGeneralTitle( wxCommandEvent& event )
847     long longSelected = -1;
848     int intSelectedData = 0;
849     
850     if (!GetSelectedItem(lboTitles,
851                          &longSelected,
852                          &intSelectedData)){
853         return;
854     }
855     
856     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
857     frameCETitle->SetupPointers(&GeneralTitleList,
858                                 &GeneralTitleListLanguage,
859                                 &GeneralTitleListAltID,
860                                 &GeneralTitleListPID,
861                                 &GeneralTitleListType,
862                                 &GeneralTitleListTokens,
863                                 &GeneralTitleListPref,
864                                 lboTitles,
865                                 intSelectedData);
866     frameCETitle->SetEditorMode(TRUE, CE_GENERAL);
867     frameCETitle->ShowModal();
868     delete frameCETitle;
869     frameCETitle = NULL;
872 void frmContactEditor::DeleteGeneralTitle( wxCommandEvent& event )
874     long longSelected = -1;
875     int intSelectedData = 0;
876     
877     if (!GetSelectedItem(lboTitles,
878                          &longSelected,
879                          &intSelectedData)){
880         return;
881     }
882     
883     lboTitles->DeleteItem(longSelected);
884     
885     DeleteMapData(intSelectedData, &GeneralTitleList,
886                   &GeneralTitleListLanguage, &GeneralTitleListAltID,
887                   &GeneralTitleListPID, &GeneralTitleListType,
888                   &GeneralTitleListTokens, &GeneralTitleListPref);
889     
892 void frmContactEditor::AddGeneralRole( wxCommandEvent& event )
894     int intResult = 0;
895     
896     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
897     frameCERole->SetEditorMode(FALSE, CE_GENERAL);
898     intResult = GetLastInt(&GeneralRoleList);
899     frameCERole->SetupPointers(&GeneralRoleList,
900                                &GeneralRoleListLanguage,
901                                &GeneralRoleListAltID,
902                                &GeneralRoleListPID,
903                                &GeneralRoleListType,
904                                &GeneralRoleListTokens,
905                                &GeneralRoleListPref,
906                                lboRoles,
907                                (intValueSeek));
908     frameCERole->ShowModal();
909     delete frameCERole;
910     frameCERole = NULL;
913 void frmContactEditor::ModifyGeneralRole( wxCommandEvent& event )
915     long longSelected = -1;
916     int intSelectedData = 0;
917     
918     if (!GetSelectedItem(lboRoles,
919                          &longSelected,
920                          &intSelectedData)){
921         return;
922     }
923     
924     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
925     frameCERole->SetupPointers(&GeneralRoleList,
926                                &GeneralRoleListLanguage,
927                                &GeneralRoleListAltID,
928                                &GeneralRoleListPID,
929                                &GeneralRoleListType,
930                                &GeneralRoleListTokens,
931                                &GeneralRoleListPref,
932                                lboRoles,
933                                intSelectedData);
934     frameCERole->SetEditorMode(TRUE, CE_GENERAL);
935     frameCERole->ShowModal();
936     delete frameCERole;
937     frameCERole = NULL;
940 void frmContactEditor::DeleteGeneralRole( wxCommandEvent& event )
942     long longSelected = -1;
943     int intSelectedData = 0;
944     
945     if (!GetSelectedItem(lboRoles,
946                          &longSelected,
947                          &intSelectedData)){
948         return;
949     }
950     
951     lboRoles->DeleteItem(longSelected);
952     
953     DeleteMapData(intSelectedData, &GeneralRoleList,
954                   &GeneralRoleListLanguage, &GeneralRoleListAltID,
955                   &GeneralRoleListPID, &GeneralRoleListType,
956                   &GeneralRoleListTokens, &GeneralRoleListPref);
957     
960 void frmContactEditor::AddGeneralOrganisation( wxCommandEvent& event )
962     int intResult = 0;
963     
964     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
965     frameCEOrg->SetEditorMode(FALSE, CE_GENERAL);
966     intResult = GetLastInt(&GeneralOrganisationsList);
967     frameCEOrg->SetupPointers(&GeneralOrganisationsList,
968                               &GeneralOrganisationsListLanguage,
969                               &GeneralOrganisationsListSortAs,
970                               &GeneralOrganisationsListAltID,
971                               &GeneralOrganisationsListPID,
972                               &GeneralOrganisationsListType,
973                               &GeneralOrganisationsListTokens,
974                               &GeneralOrganisationsListPref,
975                               lboOrganisations,
976                               (intValueSeek));
977     frameCEOrg->ShowModal();
978     delete frameCEOrg;
979     frameCEOrg = NULL;
982 void frmContactEditor::ModifyGeneralOrganisation( wxCommandEvent& event )
984     long longSelected = -1;
985     int intSelectedData = 0;
986     
987     if (!GetSelectedItem(lboOrganisations,
988                          &longSelected,
989                          &intSelectedData)){
990         return;
991     }
992     
993     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
994     frameCEOrg->SetupPointers(&GeneralOrganisationsList,
995                               &GeneralOrganisationsListLanguage,
996                               &GeneralOrganisationsListSortAs,
997                               &GeneralOrganisationsListAltID,
998                               &GeneralOrganisationsListPID,
999                               &GeneralOrganisationsListType,
1000                               &GeneralOrganisationsListTokens,
1001                               &GeneralOrganisationsListPref,
1002                               lboOrganisations,
1003                               intSelectedData);
1004     frameCEOrg->SetEditorMode(TRUE, CE_GENERAL);
1005     frameCEOrg->ShowModal();
1006     delete frameCEOrg;
1007     frameCEOrg = NULL;
1010 void frmContactEditor::DeleteGeneralOrganisation( wxCommandEvent& event )
1012     long longSelected = -1;
1013     int intSelectedData = 0;
1014     
1015     if (!GetSelectedItem(lboOrganisations,
1016                          &longSelected,
1017                          &intSelectedData)){
1018         return;
1019     }
1020     
1021     lboOrganisations->DeleteItem(longSelected);
1022     
1023     DeleteMapData(intSelectedData, &GeneralOrganisationsList,
1024                   &GeneralOrganisationsListLanguage, &GeneralOrganisationsListSortAs,
1025                   &GeneralOrganisationsListAltID, &GeneralOrganisationsListPID,
1026                   &GeneralOrganisationsListType, &GeneralOrganisationsListTokens,
1027                   &GeneralOrganisationsListPref);
1028     
1031 void frmContactEditor::AddGeneralNote( wxCommandEvent& event )
1033     int intResult = 0;
1034     
1035     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1036     frameCENote->SetEditorMode(FALSE, CE_GENERAL);
1037     intResult = GetLastInt(&GeneralNoteList);
1038     frameCENote->SetupPointers(&GeneralNoteList,
1039                                &GeneralNoteListLanguage,
1040                                &GeneralNoteListAltID,
1041                                &GeneralNoteListPID,
1042                                &GeneralNoteListType,
1043                                &GeneralNoteListTokens,
1044                                &GeneralNoteListPref,
1045                                lboNotes,
1046                                (intValueSeek));
1047     frameCENote->ShowModal();
1048     delete frameCENote;
1049     frameCENote = NULL;
1052 void frmContactEditor::ModifyGeneralNote( wxCommandEvent& event )
1054     long longSelected = -1;
1055     int intSelectedData = 0;
1056     
1057     if (!GetSelectedItem(lboNotes,
1058                          &longSelected,
1059                          &intSelectedData)){
1060         return;
1061     }
1062     
1063     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1064     frameCENote->SetupPointers(&GeneralNoteList,
1065                                &GeneralNoteListLanguage,
1066                                &GeneralNoteListAltID,
1067                                &GeneralNoteListPID,
1068                                &GeneralNoteListType,
1069                                &GeneralNoteListTokens,
1070                                &GeneralNoteListPref,
1071                                lboNotes,
1072                                intSelectedData);
1073     frameCENote->SetEditorMode(TRUE, CE_GENERAL);
1074     frameCENote->ShowModal();
1075     delete frameCENote;
1076     frameCENote = NULL;
1079 void frmContactEditor::DeleteGeneralNote( wxCommandEvent& event )
1081     long longSelected = -1;
1082     int intSelectedData = 0;
1083     
1084     if (!GetSelectedItem(lboNotes,
1085                          &longSelected,
1086                          &intSelectedData)){
1087         return;
1088     }
1089     
1090     lboNotes->DeleteItem(longSelected);
1091     
1092     DeleteMapData(intSelectedData, &GeneralNoteList,
1093                   &GeneralNoteListLanguage, &GeneralNoteListAltID,
1094                   &GeneralNoteListPID, &GeneralNoteListType,
1095                   &GeneralNoteListTokens, &GeneralNoteListPref);
1096     
1099 void frmContactEditor::AddHomeNickname( wxCommandEvent& event )
1101     int intResult = 0;
1102     
1103     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
1104     frameCENickname->SetEditorMode(FALSE, CE_HOME);
1105     intResult = GetLastInt(&HomeNicknamesList);
1106     frameCENickname->SetupPointers(&HomeNicknamesList,
1107                                    &HomeNicknamesListAltID,
1108                                    &HomeNicknamesListPID,
1109                                    &HomeNicknamesListType,
1110                                    &HomeNicknamesListLanguage,
1111                                    &HomeNicknamesListTokens,
1112                                    &HomeNicknamesListPref,
1113                                    lboHomeNicknames,
1114                                    (intValueSeek));
1115     frameCENickname->ShowModal();
1116     delete frameCENickname;
1117     frameCENickname = NULL;
1120 void frmContactEditor::ModifyHomeNickname( wxCommandEvent& event )
1122     long longSelected = -1;
1123     int intSelectedData = 0;
1124     
1125     if (!GetSelectedItem(lboHomeNicknames,
1126                          &longSelected,
1127                          &intSelectedData)){
1128         return;
1129     }
1130     
1131     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
1132     frameCENickname->SetupPointers(&HomeNicknamesList,
1133                                    &HomeNicknamesListAltID,
1134                                    &HomeNicknamesListPID,
1135                                    &HomeNicknamesListType,
1136                                    &HomeNicknamesListLanguage,
1137                                    &HomeNicknamesListTokens,
1138                                    &HomeNicknamesListPref,
1139                                    lboHomeNicknames,
1140                                    intSelectedData);
1141     frameCENickname->SetEditorMode(TRUE, CE_HOME);
1142     frameCENickname->ShowModal();
1143     delete frameCENickname;
1144     frameCENickname = NULL;
1147 void frmContactEditor::DeleteHomeNickname( wxCommandEvent& event )
1149     
1150     long longSelected = -1;
1151     int intSelectedData = 0;
1152     
1153     if (!GetSelectedItem(lboHomeNicknames,
1154                          &longSelected,
1155                          &intSelectedData)){
1156         return;
1157     }
1158     
1159     lboHomeNicknames->DeleteItem(longSelected);
1160     
1161     DeleteMapData(intSelectedData,
1162                   &HomeNicknamesList,
1163                   &HomeNicknamesListLanguage,
1164                   &HomeNicknamesListAltID,
1165                   &HomeNicknamesListPID,
1166                   &HomeNicknamesListTokens,
1167                   &HomeNicknamesListType,
1168                   &HomeNicknamesListPref);
1169     
1172 void frmContactEditor::AddHomeAddress( wxCommandEvent& event )
1174     int intResult = 0;
1175     
1176     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
1177     frameCEAddress->SetEditorMode(FALSE, CE_HOME);
1178     intResult = GetLastInt(&HomeAddressList);
1179     frameCEAddress->SetupPointers(&HomeAddressList,
1180                                   &HomeAddressListTown,
1181                                   &HomeAddressListCounty,
1182                                   &HomeAddressListPostCode,
1183                                   &HomeAddressListCountry,
1184                                   &HomeAddressListLabel,
1185                                   &HomeAddressListLang,
1186                                   &HomeAddressListAltID,
1187                                   &HomeAddressListPID,
1188                                   &HomeAddressListTokens,
1189                                   &HomeAddressListGeo,
1190                                   &HomeAddressListTimezone,
1191                                   &HomeAddressListType,
1192                                   &HomeAddressListMediatype,
1193                                   &HomeAddressListPref,
1194                                   lboHomeAddresses,
1195                                   (intValueSeek));
1196     frameCEAddress->ShowModal();
1197     delete frameCEAddress;
1198     frameCEAddress = NULL;
1201 void frmContactEditor::ModifyHomeAddress( wxCommandEvent& event )
1203     long longSelected = -1;
1204     int intSelectedData = 0;
1205     
1206     if (!GetSelectedItem(lboHomeAddresses,
1207                          &longSelected,
1208                          &intSelectedData)){
1209         return;
1210     }
1211     
1212     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
1213     frameCEAddress->SetupPointers(&HomeAddressList,
1214                                   &HomeAddressListTown,
1215                                   &HomeAddressListCounty,
1216                                   &HomeAddressListPostCode,
1217                                   &HomeAddressListCountry,
1218                                   &HomeAddressListLabel,
1219                                   &HomeAddressListLang,
1220                                   &HomeAddressListAltID,
1221                                   &HomeAddressListPID,
1222                                   &HomeAddressListTokens,
1223                                   &HomeAddressListGeo,
1224                                   &HomeAddressListTimezone,
1225                                   &HomeAddressListType,
1226                                   &HomeAddressListMediatype,
1227                                   &HomeAddressListPref,
1228                                   lboHomeAddresses,
1229                                   intSelectedData);
1230     frameCEAddress->SetEditorMode(TRUE, CE_HOME);
1231     frameCEAddress->ShowModal();
1232     delete frameCEAddress;
1233     frameCEAddress = NULL;
1236 void frmContactEditor::DeleteHomeAddress( wxCommandEvent& event )
1238     
1239     long longSelected = -1;
1240     int intSelectedData = 0;
1241     
1242     if (!GetSelectedItem(lboHomeAddresses,
1243                          &longSelected,
1244                          &intSelectedData)){
1245         return;
1246     }
1247     
1248     lboHomeAddresses->DeleteItem(longSelected);
1249     
1250     DeleteMapData(intSelectedData, &HomeAddressList,
1251                   &HomeAddressListTown, &HomeAddressListCounty,
1252                   &HomeAddressListPostCode, &HomeAddressListCountry,
1253                   &HomeAddressList, &HomeAddressListLabel,
1254                   &HomeAddressListLang, &HomeAddressListAltID,
1255                   &HomeAddressListPID, &HomeAddressListTokens,
1256                   &HomeAddressListGeo, &HomeAddressListTimezone,
1257                   &HomeAddressListType, &HomeAddressListMediatype,
1258                   &HomeAddressListPref);
1259     
1262 void frmContactEditor::AddHomeEmail( wxCommandEvent& event )
1264     int intResult = 0;
1265     
1266     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
1267     frameCEEmail->SetEditorMode(FALSE, CE_HOME);
1268     intResult = GetLastInt(&HomeAddressList);
1269     frameCEEmail->SetupPointers(&HomeEmailList,
1270                                 &HomeEmailListAltID,
1271                                 &HomeEmailListPID,
1272                                 &HomeEmailListType,
1273                                 &HomeEmailListTokens,
1274                                 &HomeEmailListPref,
1275                                 lboHomeEmails,
1276                                 (intValueSeek));
1277     frameCEEmail->ShowModal();
1278     delete frameCEEmail;
1279     frameCEEmail = NULL;
1282 void frmContactEditor::ModifyHomeEmail( wxCommandEvent& event )
1284     long longSelected = -1;
1285     int intSelectedData = 0;
1286     
1287     if (!GetSelectedItem(lboHomeEmails,
1288                          &longSelected,
1289                          &intSelectedData)){
1290         return;
1291     }
1292     
1293     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
1294     frameCEEmail->SetupPointers(&HomeEmailList,
1295                                 &HomeEmailListAltID,
1296                                 &HomeEmailListPID,
1297                                 &HomeEmailListType,
1298                                 &HomeEmailListTokens,
1299                                 &HomeEmailListPref,
1300                                 lboHomeEmails,
1301                                 intSelectedData);
1302     frameCEEmail->SetEditorMode(TRUE, CE_HOME);
1303     frameCEEmail->ShowModal();
1304     delete frameCEEmail;
1305     frameCEEmail = NULL;
1309 void frmContactEditor::DeleteHomeEmail( wxCommandEvent& event )
1311     long longSelected = -1;
1312     int intSelectedData = 0;
1313     
1314     if (!GetSelectedItem(lboHomeEmails,
1315                          &longSelected,
1316                          &intSelectedData)){
1317         return;
1318     }
1319     
1320     lboHomeEmails->DeleteItem(longSelected);
1321     
1322     DeleteMapData(intSelectedData, &HomeEmailList,
1323                   &HomeEmailListAltID, &HomeEmailListPID,
1324                   &HomeEmailListType, &HomeEmailListTokens,
1325                   &HomeEmailListPref);
1329 void frmContactEditor::AddHomeIM( wxCommandEvent& event )
1331     int intResult = 0;
1332     
1333     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
1334     frameCEIM->SetEditorMode(FALSE, CE_HOME);
1335     intResult = GetLastInt(&HomeIMList);
1336     frameCEIM->SetupPointers(&HomeIMList,
1337                              &HomeIMListAltID,
1338                              &HomeIMListPID,
1339                              &HomeIMListType,
1340                              &HomeIMListTokens,
1341                              &HomeIMListMediatype,
1342                              &HomeIMListPref,
1343                              lboHomeIM,
1344                              (intValueSeek));
1345     frameCEIM->ShowModal();
1346     delete frameCEIM;
1347     frameCEIM = NULL;
1350 void frmContactEditor::ModifyHomeIM( wxCommandEvent& event )
1352     long longSelected = -1;
1353     int intSelectedData = 0;
1354     
1355     if (!GetSelectedItem(lboHomeIM,
1356                          &longSelected,
1357                          &intSelectedData)){
1358         return;
1359     }
1360     
1361     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
1362     frameCEIM->SetupPointers(&HomeIMList,
1363                              &HomeIMListAltID,
1364                              &HomeIMListPID,
1365                              &HomeIMListType,
1366                              &HomeIMListTokens,
1367                              &HomeIMListMediatype,
1368                              &HomeIMListPref,
1369                              lboHomeIM,
1370                              intSelectedData);
1371     frameCEIM->SetEditorMode(TRUE, CE_HOME);
1372     frameCEIM->ShowModal();
1373     delete frameCEIM;
1374     frameCEIM = NULL;
1377 void frmContactEditor::DeleteHomeIM( wxCommandEvent& event )
1379     long longSelected = -1;
1380     int intSelectedData = 0;
1381     
1382     if (!GetSelectedItem(lboHomeIM,
1383                          &longSelected,
1384                          &intSelectedData)){
1385         return;
1386     }
1387     
1388     lboHomeIM->DeleteItem(longSelected);
1389     
1390     DeleteMapData(intSelectedData, &HomeIMList,
1391                   &HomeIMListAltID, &HomeIMListPID,
1392                   &HomeIMListType, &HomeIMListTokens,
1393                   &HomeIMListMediatype, &HomeIMListPref);
1394     
1397 void frmContactEditor::AddHomeTelephone( wxCommandEvent& event )
1399     int intResult = 0;
1400     
1401     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
1402     frameCETel->SetEditorMode(FALSE, CE_HOME);
1403     intResult = GetLastInt(&HomeTelephoneList);
1404     frameCETel->SetupPointers(&HomeTelephoneList,
1405                               &HomeTelephoneListAltID,
1406                               &HomeTelephoneListPID,
1407                               &HomeTelephoneListType,
1408                               &HomeTelephoneListTokens,
1409                               &HomeTelephoneListPref,
1410                               lboHomeTelephone,
1411                               (intValueSeek));
1412     frameCETel->ShowModal();
1413     delete frameCETel;
1414     frameCETel = NULL;
1417 void frmContactEditor::ModifyHomeTelephone( wxCommandEvent& event )
1419     long longSelected = -1;
1420     int intSelectedData = 0;
1421     
1422     if (!GetSelectedItem(lboHomeTelephone,
1423                          &longSelected,
1424                          &intSelectedData)){
1425         return;
1426     }
1427     
1428     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
1429     frameCETel->SetupPointers(&HomeTelephoneList,
1430                               &HomeTelephoneListAltID,
1431                               &HomeTelephoneListPID,
1432                               &HomeTelephoneListType,
1433                               &HomeTelephoneListTokens,
1434                               &HomeTelephoneListPref,
1435                               lboHomeTelephone,
1436                               intSelectedData);
1437     frameCETel->SetEditorMode(TRUE, CE_HOME);
1438     frameCETel->ShowModal();
1439     delete frameCETel;
1440     frameCETel = NULL;
1443 void frmContactEditor::DeleteHomeTelephone( wxCommandEvent& event )
1445     long longSelected = -1;
1446     int intSelectedData = 0;
1447     
1448     if (!GetSelectedItem(lboHomeTelephone,
1449                          &longSelected,
1450                          &intSelectedData)){
1451         return;
1452     }
1453     
1454     lboHomeTelephone->DeleteItem(longSelected);
1455     
1456     DeleteMapData(intSelectedData, &HomeTelephoneList,
1457                   &HomeTelephoneListAltID, &HomeTelephoneListPID,
1458                   &HomeTelephoneListType, &HomeTelephoneListTokens,
1459                   &HomeTelephoneListPref);
1460     
1463 void frmContactEditor::AddHomeLanguage( wxCommandEvent& event )
1465     int intResult = 0;
1466     
1467     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
1468     frameCELang->SetEditorMode(FALSE, CE_HOME);
1469     intResult = GetLastInt(&HomeLanguageList);
1470     frameCELang->SetupPointers(&HomeLanguageList,
1471                                &HomeLanguageListAltID,
1472                                &HomeLanguageListPID,
1473                                &HomeLanguageListType,
1474                                &HomeLanguageListTokens,
1475                                &HomeLanguageListPref,
1476                                lboHomeLanguages,
1477                                (intValueSeek));
1478     frameCELang->ShowModal();
1479     delete frameCELang;
1480     frameCELang = NULL;
1483 void frmContactEditor::ModifyHomeLanguage( wxCommandEvent& event )
1485     long longSelected = -1;
1486     int intSelectedData = 0;
1487     
1488     if (!GetSelectedItem(lboHomeLanguages,
1489                          &longSelected,
1490                          &intSelectedData)){
1491         return;
1492     }
1493     
1494     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
1495     frameCELang->SetupPointers(&HomeLanguageList,
1496                                &HomeLanguageListAltID,
1497                                &HomeLanguageListPID,
1498                                &HomeLanguageListType,
1499                                &HomeLanguageListTokens,
1500                                &HomeLanguageListPref,
1501                                lboHomeLanguages,
1502                                intSelectedData);
1503     frameCELang->SetEditorMode(TRUE, CE_HOME);
1504     frameCELang->ShowModal();
1505     delete frameCELang;
1506     frameCELang = NULL;
1509 void frmContactEditor::DeleteHomeLanguage( wxCommandEvent& event )
1511     long longSelected = -1;
1512     int intSelectedData = 0;
1513     
1514     if (!GetSelectedItem(lboHomeLanguages,
1515                          &longSelected,
1516                          &intSelectedData)){
1517         return;
1518     }
1519     
1520     lboHomeLanguages->DeleteItem(longSelected);
1521     
1522     DeleteMapData(intSelectedData, &HomeLanguageList,
1523                   &HomeLanguageListAltID, &HomeLanguageListPID,
1524                   &HomeLanguageListType, &HomeLanguageListTokens,
1525                   &HomeLanguageListPref);
1526     
1529 void frmContactEditor::AddHomeTimezone( wxCommandEvent& event )
1531     int intResult = 0;
1532     
1533     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
1534     frameCETZ->SetEditorMode(FALSE, CE_HOME);
1535     intResult = GetLastInt(&HomeTZList);
1536     frameCETZ->SetupPointers(&HomeTZList,
1537                              &HomeTZListAltID,
1538                              &HomeTZListPID,
1539                              &HomeTZListType,
1540                              &HomeTZListTokens,
1541                              &HomeTZListMediatype,
1542                              &HomeTZListPref,
1543                              lboHomeTimezones,
1544                              (intValueSeek));
1545     frameCETZ->ShowModal();
1546     delete frameCETZ;
1547     frameCETZ = NULL;
1550 void frmContactEditor::ModifyHomeTimezone( wxCommandEvent& event )
1552     long longSelected = -1;
1553     int intSelectedData = 0;
1554     
1555     if (!GetSelectedItem(lboHomeTimezones,
1556                          &longSelected,
1557                          &intSelectedData)){
1558         return;
1559     }
1560     
1561     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
1562     frameCETZ->SetupPointers(&HomeTZList,
1563                              &HomeTZListAltID,
1564                              &HomeTZListPID,
1565                              &HomeTZListType,
1566                              &HomeTZListTokens,
1567                              &HomeTZListMediatype,
1568                              &HomeTZListPref,
1569                              lboHomeTimezones,
1570                              intSelectedData);
1571     frameCETZ->SetEditorMode(TRUE, CE_HOME);
1572     frameCETZ->ShowModal();
1573     delete frameCETZ;
1574     frameCETZ = NULL;
1577 void frmContactEditor::DeleteHomeTimezone( wxCommandEvent& event )
1579     long longSelected = -1;
1580     int intSelectedData = 0;
1581     
1582     if (!GetSelectedItem(lboHomeTimezones,
1583                          &longSelected,
1584                          &intSelectedData)){
1585         return;
1586     }
1587     
1588     lboHomeTimezones->DeleteItem(longSelected);
1589     
1590     DeleteMapData(intSelectedData, &HomeTZList,
1591                   &HomeTZListAltID, &HomeTZListPID,
1592                   &HomeTZListType, &HomeTZListTokens,
1593                   &HomeTZListMediatype, &HomeTZListPref);
1594     
1597 void frmContactEditor::AddHomeGeoposition( wxCommandEvent& event )
1599     int intResult = 0;
1600     
1601     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
1602     frameCEGeo->SetEditorMode(FALSE, CE_HOME);
1603     intResult = GetLastInt(&HomeGeographyList);
1604     frameCEGeo->SetupPointers(&HomeGeographyList,
1605                               &HomeGeographyListAltID,
1606                               &HomeGeographyListPID,
1607                               &HomeGeographyListType,
1608                               &HomeGeographyListTokens,
1609                               &HomeGeographyListMediatype,
1610                               &HomeGeographyListPref,
1611                               lboHomeGeoposition,
1612                               (intValueSeek));
1613     frameCEGeo->ShowModal();
1614     delete frameCEGeo;
1615     frameCEGeo = NULL;
1618 void frmContactEditor::ModifyHomeGeoposition( wxCommandEvent& event )
1620     long longSelected = -1;
1621     int intSelectedData = 0;
1622     
1623     if (!GetSelectedItem(lboHomeGeoposition,
1624                          &longSelected,
1625                          &intSelectedData)){
1626         return;
1627     }
1628     
1629     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
1630     frameCEGeo->SetupPointers(&HomeGeographyList,
1631                               &HomeGeographyListAltID,
1632                               &HomeGeographyListPID,
1633                               &HomeGeographyListType,
1634                               &HomeGeographyListTokens,
1635                               &HomeGeographyListMediatype,
1636                               &HomeGeographyListPref,
1637                               lboHomeGeoposition,
1638                               intSelectedData);
1639     frameCEGeo->SetEditorMode(TRUE, CE_HOME);
1640     frameCEGeo->ShowModal();
1641     delete frameCEGeo;
1642     frameCEGeo = NULL;
1645 void frmContactEditor::DeleteHomeGeoposition( wxCommandEvent& event )
1647     long longSelected = -1;
1648     int intSelectedData = 0;
1649     
1650     if (!GetSelectedItem(lboHomeGeoposition,
1651                          &longSelected,
1652                          &intSelectedData)){
1653         return;
1654     }
1655     
1656     lboHomeGeoposition->DeleteItem(longSelected);
1657     
1658     DeleteMapData(intSelectedData, &HomeGeographyList,
1659                   &HomeGeographyListAltID, &HomeGeographyListPID,
1660                   &HomeGeographyListType, &HomeGeographyListTokens,
1661                   &HomeGeographyListMediatype, &HomeGeographyListPref);
1662     
1665 void frmContactEditor::AddHomeWebsite( wxCommandEvent& event )
1667     int intResult = 0;
1668     
1669     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
1670     frameCEWeb->SetEditorMode(FALSE, CE_HOME);
1671     intResult = GetLastInt(&HomeWebsiteList);
1672     frameCEWeb->SetupPointers(&HomeWebsiteList,
1673                               &HomeWebsiteListAltID,
1674                               &HomeWebsiteListPID,
1675                               &HomeWebsiteListType,
1676                               &HomeWebsiteListTokens,
1677                               &HomeWebsiteListMediatype,
1678                               &HomeWebsiteListPref,
1679                               lboHomeWebsites,
1680                               (intValueSeek));
1681     frameCEWeb->ShowModal();
1682     delete frameCEWeb;
1683     frameCEWeb = NULL;
1686 void frmContactEditor::ModifyHomeWebsite( wxCommandEvent& event )
1688     long longSelected = -1;
1689     int intSelectedData = 0;
1690     
1691     if (!GetSelectedItem(lboHomeWebsites,
1692                          &longSelected,
1693                          &intSelectedData)){
1694         return;
1695     }
1696     
1697     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
1698     frameCEWeb->SetupPointers(&HomeWebsiteList,
1699                               &HomeWebsiteListAltID,
1700                               &HomeWebsiteListPID,
1701                               &HomeWebsiteListType,
1702                               &HomeWebsiteListTokens,
1703                               &HomeWebsiteListMediatype,
1704                               &HomeWebsiteListPref,
1705                               lboHomeWebsites,
1706                               intSelectedData);
1707     frameCEWeb->SetEditorMode(TRUE, CE_HOME);
1708     frameCEWeb->ShowModal();
1709     delete frameCEWeb;
1710     frameCEWeb = NULL;
1713 void frmContactEditor::DeleteHomeWebsite( wxCommandEvent& event )
1715     long longSelected = -1;
1716     int intSelectedData = 0;
1717     
1718     if (!GetSelectedItem(lboHomeWebsites,
1719                          &longSelected,
1720                          &intSelectedData)){
1721         return;
1722     }
1723     
1724     lboHomeWebsites->DeleteItem(longSelected);
1725     
1726     DeleteMapData(intSelectedData, &HomeWebsiteList,
1727                   &HomeWebsiteListAltID, &HomeWebsiteListPID,
1728                   &HomeWebsiteListType, &HomeWebsiteListTokens,
1729                   &HomeWebsiteListMediatype, &HomeWebsiteListPref);
1730     
1733 void frmContactEditor::AddHomeTitle( wxCommandEvent& event )
1735     int intResult = 0;
1736     
1737     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
1738     frameCETitle->SetEditorMode(FALSE, CE_HOME);
1739     intResult = GetLastInt(&HomeTitleList);
1740     frameCETitle->SetupPointers(&HomeTitleList,
1741                                 &HomeTitleListLanguage,
1742                                 &HomeTitleListAltID,
1743                                 &HomeTitleListPID,
1744                                 &HomeTitleListType,
1745                                 &HomeTitleListTokens,
1746                                 &HomeTitleListPref,
1747                                 lboHomeTitles,
1748                                 (intValueSeek));
1749     frameCETitle->ShowModal();
1750     delete frameCETitle;
1751     frameCETitle = NULL;
1754 void frmContactEditor::ModifyHomeTitle( wxCommandEvent& event )
1756     long longSelected = -1;
1757     int intSelectedData = 0;
1758     
1759     if (!GetSelectedItem(lboHomeTitles,
1760                          &longSelected,
1761                          &intSelectedData)){
1762         return;
1763     }
1764     
1765     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
1766     frameCETitle->SetupPointers(&HomeTitleList,
1767                                 &HomeTitleListLanguage,
1768                                 &HomeTitleListAltID,
1769                                 &HomeTitleListPID,
1770                                 &HomeTitleListType,
1771                                 &HomeTitleListTokens,
1772                                 &HomeTitleListPref,
1773                                 lboHomeTitles,
1774                                 intSelectedData);
1775     frameCETitle->SetEditorMode(TRUE, CE_HOME);
1776     frameCETitle->ShowModal();
1777     delete frameCETitle;
1778     frameCETitle = NULL;
1781 void frmContactEditor::DeleteHomeTitle( wxCommandEvent& event )
1783     long longSelected = -1;
1784     int intSelectedData = 0;
1785     
1786     if (!GetSelectedItem(lboHomeTitles,
1787                          &longSelected,
1788                          &intSelectedData)){
1789         return;
1790     }
1791     
1792     lboHomeTitles->DeleteItem(longSelected);
1793     
1794     DeleteMapData(intSelectedData, &HomeTitleList,
1795                   &HomeTitleListLanguage, &HomeTitleListAltID,
1796                   &HomeTitleListPID, &HomeTitleListType,
1797                   &HomeTitleListTokens, &HomeTitleListPref);
1798     
1801 void frmContactEditor::AddHomeRole( wxCommandEvent& event )
1803     int intResult = 0;
1804     
1805     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
1806     frameCERole->SetEditorMode(FALSE, CE_HOME);
1807     intResult = GetLastInt(&HomeRoleList);
1808     frameCERole->SetupPointers(&HomeRoleList,
1809                                &HomeRoleListLanguage,
1810                                &HomeRoleListAltID,
1811                                &HomeRoleListPID,
1812                                &HomeRoleListType,
1813                                &HomeRoleListTokens,
1814                                &HomeRoleListPref,
1815                                lboHomeRoles,
1816                                (intValueSeek));
1817     frameCERole->ShowModal();
1818     delete frameCERole;
1819     frameCERole = NULL;
1822 void frmContactEditor::ModifyHomeRole( wxCommandEvent& event )
1824     long longSelected = -1;
1825     int intSelectedData = 0;
1826     
1827     if (!GetSelectedItem(lboHomeRoles,
1828                          &longSelected,
1829                          &intSelectedData)){
1830         return;
1831     }
1832     
1833     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
1834     frameCERole->SetupPointers(&HomeRoleList,
1835                                &HomeRoleListLanguage,
1836                                &HomeRoleListAltID,
1837                                &HomeRoleListPID,
1838                                &HomeRoleListType,
1839                                &HomeRoleListTokens,
1840                                &HomeRoleListPref,
1841                                lboHomeRoles,
1842                                intSelectedData);
1843     frameCERole->SetEditorMode(TRUE, CE_HOME);
1844     frameCERole->ShowModal();
1845     delete frameCERole;
1846     frameCERole = NULL;
1849 void frmContactEditor::DeleteHomeRole( wxCommandEvent& event )
1851     long longSelected = -1;
1852     int intSelectedData = 0;
1853     
1854     if (!GetSelectedItem(lboHomeRoles,
1855                          &longSelected,
1856                          &intSelectedData)){
1857         return;
1858     }
1859     
1860     lboHomeRoles->DeleteItem(longSelected);
1861     
1862     DeleteMapData(intSelectedData, &HomeRoleList,
1863                   &HomeRoleListLanguage, &HomeRoleListAltID,
1864                   &HomeRoleListPID, &HomeRoleListType,
1865                   &HomeRoleListTokens, &HomeRoleListPref);
1866     
1869 void frmContactEditor::AddHomeOrganisation( wxCommandEvent& event )
1871     int intResult = 0;
1872     
1873     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
1874     frameCEOrg->SetEditorMode(FALSE, CE_HOME);
1875     intResult = GetLastInt(&HomeOrganisationsList);
1876     frameCEOrg->SetupPointers(&HomeOrganisationsList,
1877                               &HomeOrganisationsListLanguage,
1878                               &HomeOrganisationsListSortAs,
1879                               &HomeOrganisationsListAltID,
1880                               &HomeOrganisationsListPID,
1881                               &HomeOrganisationsListType,
1882                               &HomeOrganisationsListTokens,
1883                               &HomeOrganisationsListPref,
1884                               lboHomeOrganisations,
1885                               (intValueSeek));
1886     frameCEOrg->ShowModal();
1887     delete frameCEOrg;
1888     frameCEOrg = NULL;
1891 void frmContactEditor::ModifyHomeOrganisation( wxCommandEvent& event )
1893     long longSelected = -1;
1894     int intSelectedData = 0;
1895     
1896     if (!GetSelectedItem(lboHomeOrganisations,
1897                          &longSelected,
1898                          &intSelectedData)){
1899         return;
1900     }
1901     
1902     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
1903     frameCEOrg->SetupPointers(&HomeOrganisationsList,
1904                               &HomeOrganisationsListLanguage,
1905                               &HomeOrganisationsListSortAs,
1906                               &HomeOrganisationsListAltID,
1907                               &HomeOrganisationsListPID,
1908                               &HomeOrganisationsListType,
1909                               &HomeOrganisationsListTokens,
1910                               &HomeOrganisationsListPref,
1911                               lboHomeOrganisations,
1912                               intSelectedData);
1913     frameCEOrg->SetEditorMode(TRUE, CE_HOME);
1914     frameCEOrg->ShowModal();
1915     delete frameCEOrg;
1916     frameCEOrg = NULL;
1919 void frmContactEditor::DeleteHomeOrganisation( wxCommandEvent& event )
1921     long longSelected = -1;
1922     int intSelectedData = 0;
1923     
1924     if (!GetSelectedItem(lboHomeOrganisations,
1925                          &longSelected,
1926                          &intSelectedData)){
1927         return;
1928     }
1929     
1930     lboHomeOrganisations->DeleteItem(longSelected);
1931     
1932     DeleteMapData(intSelectedData, &HomeOrganisationsList,
1933                   &HomeOrganisationsListLanguage, &HomeOrganisationsListSortAs,
1934                   &HomeOrganisationsListAltID, &HomeOrganisationsListPID,
1935                   &HomeOrganisationsListType, &HomeOrganisationsListTokens,
1936                   &HomeOrganisationsListPref);
1937     
1940 void frmContactEditor::AddHomeNote( wxCommandEvent& event )
1942     int intResult = 0;
1943     
1944     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1945     frameCENote->SetEditorMode(FALSE, CE_HOME);
1946     intResult = GetLastInt(&HomeNoteList);
1947     frameCENote->SetupPointers(&HomeNoteList,
1948                                &HomeNoteListLanguage,
1949                                &HomeNoteListAltID,
1950                                &HomeNoteListPID,
1951                                &HomeNoteListType,
1952                                &HomeNoteListTokens,
1953                                &HomeNoteListPref,
1954                                lboHomeNotes,
1955                                (intValueSeek));
1956     frameCENote->ShowModal();
1957     delete frameCENote;
1958     frameCENote = NULL;
1961 void frmContactEditor::ModifyHomeNote( wxCommandEvent& event )
1963     long longSelected = -1;
1964     int intSelectedData = 0;
1965     
1966     if (!GetSelectedItem(lboHomeNotes,
1967                          &longSelected,
1968                          &intSelectedData)){
1969         return;
1970     }
1971     
1972     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1973     frameCENote->SetupPointers(&HomeNoteList,
1974                                &HomeNoteListLanguage,
1975                                &HomeNoteListAltID,
1976                                &HomeNoteListPID,
1977                                &HomeNoteListType,
1978                                &HomeNoteListTokens,
1979                                &HomeNoteListPref,
1980                                lboHomeNotes,
1981                                intSelectedData);
1982     frameCENote->SetEditorMode(TRUE, CE_HOME);
1983     frameCENote->ShowModal();
1984     delete frameCENote;
1985     frameCENote = NULL;
1988 void frmContactEditor::DeleteHomeNote( wxCommandEvent& event )
1990     long longSelected = -1;
1991     int intSelectedData = 0;
1992     
1993     if (!GetSelectedItem(lboHomeNotes,
1994                          &longSelected,
1995                          &intSelectedData)){
1996         return;
1997     }
1998     
1999     lboNotes->DeleteItem(longSelected);
2000     
2001     DeleteMapData(intSelectedData, &HomeNoteList,
2002                   &HomeNoteListLanguage, &HomeNoteListAltID,
2003                   &HomeNoteListPID, &HomeNoteListType,
2004                   &HomeNoteListTokens, &HomeNoteListPref);
2005     
2008 void frmContactEditor::AddBusinessNickname( wxCommandEvent& event )
2010     int intResult = 0;
2011     
2012     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
2013     frameCENickname->SetEditorMode(FALSE, CE_WORK);
2014     intResult = GetLastInt(&BusinessNicknamesList);
2015     frameCENickname->SetupPointers(&BusinessNicknamesList,
2016                                    &BusinessNicknamesListAltID,
2017                                    &BusinessNicknamesListPID,
2018                                    &BusinessNicknamesListType,
2019                                    &BusinessNicknamesListLanguage,
2020                                    &BusinessNicknamesListTokens,
2021                                    &BusinessNicknamesListPref,
2022                                    lboBusinessNicknames,
2023                                    (intValueSeek));
2024     frameCENickname->ShowModal();
2025     delete frameCENickname;
2026     frameCENickname = NULL;
2029 void frmContactEditor::ModifyBusinessNickname( wxCommandEvent& event )
2031     long longSelected = -1;
2032     int intSelectedData = 0;
2033     
2034     if (!GetSelectedItem(lboBusinessNicknames,
2035                          &longSelected,
2036                          &intSelectedData)){
2037         return;
2038     }
2039     
2040     frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
2041     frameCENickname->SetupPointers(&BusinessNicknamesList,
2042                                    &BusinessNicknamesListAltID,
2043                                    &BusinessNicknamesListPID,
2044                                    &BusinessNicknamesListType,
2045                                    &BusinessNicknamesListLanguage,
2046                                    &BusinessNicknamesListTokens,
2047                                    &BusinessNicknamesListPref,
2048                                    lboBusinessNicknames,
2049                                    intSelectedData);
2050     frameCENickname->SetEditorMode(TRUE, CE_WORK);
2051     frameCENickname->ShowModal();
2052     delete frameCENickname;
2053     frameCENickname = NULL;
2056 void frmContactEditor::DeleteBusinessNickname( wxCommandEvent& event )
2058     long longSelected = -1;
2059     int intSelectedData = 0;
2060     
2061     if (!GetSelectedItem(lboBusinessNicknames,
2062                          &longSelected,
2063                          &intSelectedData)){
2064         return;
2065     }
2066     
2067     lboBusinessNicknames->DeleteItem(longSelected);
2068     
2069     DeleteMapData(intSelectedData,
2070                   &BusinessNicknamesList,
2071                   &BusinessNicknamesListLanguage,
2072                   &BusinessNicknamesListAltID,
2073                   &BusinessNicknamesListPID,
2074                   &BusinessNicknamesListTokens,
2075                   &BusinessNicknamesListType,
2076                   &BusinessNicknamesListPref);
2079 void frmContactEditor::AddBusinessAddress( wxCommandEvent& event )
2081     int intResult = 0;
2082     
2083     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
2084     frameCEAddress->SetEditorMode(FALSE, CE_WORK);
2085     intResult = GetLastInt(&BusinessAddressList);
2086     frameCEAddress->SetupPointers(&BusinessAddressList,
2087                                   &BusinessAddressListTown,
2088                                   &BusinessAddressListCounty,
2089                                   &BusinessAddressListPostCode,
2090                                   &BusinessAddressListCountry,
2091                                   &BusinessAddressListLabel,
2092                                   &BusinessAddressListLang,
2093                                   &BusinessAddressListAltID,
2094                                   &BusinessAddressListPID,
2095                                   &BusinessAddressListTokens,
2096                                   &BusinessAddressListGeo,
2097                                   &BusinessAddressListTimezone,
2098                                   &BusinessAddressListType,
2099                                   &BusinessAddressListMediatype,
2100                                   &BusinessAddressListPref,
2101                                   lboBusinessAddresses,
2102                                   (intValueSeek));
2103     frameCEAddress->ShowModal();
2104     delete frameCEAddress;
2105     frameCEAddress = NULL;
2108 void frmContactEditor::ModifyBusinessAddress( wxCommandEvent& event )
2110     long longSelected = -1;
2111     int intSelectedData = 0;
2112     
2113     if (!GetSelectedItem(lboBusinessAddresses,
2114                          &longSelected,
2115                          &intSelectedData)){
2116         return;
2117     }
2118     
2119     frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
2120     frameCEAddress->SetupPointers(&BusinessAddressList,
2121                                   &BusinessAddressListTown,
2122                                   &BusinessAddressListCounty,
2123                                   &BusinessAddressListPostCode,
2124                                   &BusinessAddressListCountry,
2125                                   &BusinessAddressListLabel,
2126                                   &BusinessAddressListLang,
2127                                   &BusinessAddressListAltID,
2128                                   &BusinessAddressListPID,
2129                                   &BusinessAddressListTokens,
2130                                   &BusinessAddressListGeo,
2131                                   &BusinessAddressListTimezone,
2132                                   &BusinessAddressListType,
2133                                   &BusinessAddressListMediatype,
2134                                   &BusinessAddressListPref,
2135                                   lboBusinessAddresses,
2136                                   intSelectedData);
2137     frameCEAddress->SetEditorMode(TRUE, CE_WORK);
2138     frameCEAddress->ShowModal();
2139     delete frameCEAddress;
2140     frameCEAddress = NULL;
2143 void frmContactEditor::DeleteBusinessAddress( wxCommandEvent& event )
2145     long longSelected = -1;
2146     int intSelectedData = 0;
2147     
2148     if (!GetSelectedItem(lboBusinessAddresses,
2149                          &longSelected,
2150                          &intSelectedData)){
2151         return;
2152     }
2153     
2154     lboBusinessAddresses->DeleteItem(longSelected);
2155     DeleteMapData(intSelectedData, &BusinessAddressList,
2156                   &BusinessAddressListTown, &BusinessAddressListCounty,
2157                   &BusinessAddressListPostCode, &BusinessAddressListCountry,
2158                   &BusinessAddressList, &BusinessAddressListLabel,
2159                   &BusinessAddressListLang, &BusinessAddressListAltID,
2160                   &BusinessAddressListPID, &BusinessAddressListTokens,
2161                   &BusinessAddressListGeo, &BusinessAddressListTimezone,
2162                   &BusinessAddressListType, &BusinessAddressListMediatype,
2163                   &BusinessAddressListPref);
2164     
2167 void frmContactEditor::AddBusinessEmail( wxCommandEvent& event )
2169     int intResult = 0;
2170     
2171     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
2172     frameCEEmail->SetEditorMode(FALSE, CE_WORK);
2173     intResult = GetLastInt(&BusinessAddressList);
2174     frameCEEmail->SetupPointers(&BusinessEmailList,
2175                                 &BusinessEmailListAltID,
2176                                 &BusinessEmailListPID,
2177                                 &BusinessEmailListType,
2178                                 &BusinessEmailListTokens,
2179                                 &BusinessEmailListPref,
2180                                 lboBusinessEmail,
2181                                 (intValueSeek));
2182     frameCEEmail->ShowModal();
2183     delete frameCEEmail;
2184     frameCEEmail = NULL;
2187 void frmContactEditor::ModifyBusinessEmail( wxCommandEvent& event )
2189     long longSelected = -1;
2190     int intSelectedData = 0;
2191     
2192     if (!GetSelectedItem(lboBusinessEmail,
2193                          &longSelected,
2194                          &intSelectedData)){
2195         return;
2196     }
2197     
2198     frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
2199     frameCEEmail->SetupPointers(&BusinessEmailList,
2200                                 &BusinessEmailListAltID,
2201                                 &BusinessEmailListPID,
2202                                 &BusinessEmailListType,
2203                                 &BusinessEmailListTokens,
2204                                 &BusinessEmailListPref,
2205                                 lboBusinessEmail,
2206                                 intSelectedData);
2207     frameCEEmail->SetEditorMode(TRUE, CE_WORK);
2208     frameCEEmail->ShowModal();
2209     delete frameCEEmail;
2210     frameCEEmail = NULL;
2213 void frmContactEditor::DeleteBusinessEmail( wxCommandEvent& event )
2215     long longSelected = -1;
2216     int intSelectedData = 0;
2217     
2218     if (!GetSelectedItem(lboBusinessEmail,
2219                          &longSelected,
2220                          &intSelectedData)){
2221         return;
2222     }
2223     
2224     lboBusinessEmail->DeleteItem(longSelected);
2225     
2226     DeleteMapData(intSelectedData, &BusinessEmailList,
2227                   &BusinessEmailListAltID, &BusinessEmailListPID,
2228                   &BusinessEmailListType, &BusinessEmailListTokens,
2229                   &BusinessEmailListPref);
2230     
2233 void frmContactEditor::AddBusinessIM( wxCommandEvent& event )
2235     int intResult = 0;
2236     
2237     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
2238     frameCEIM->SetEditorMode(FALSE, CE_WORK);
2239     intResult = GetLastInt(&BusinessIMList);
2240     frameCEIM->SetupPointers(&BusinessIMList,
2241                              &BusinessIMListAltID,
2242                              &BusinessIMListPID,
2243                              &BusinessIMListType,
2244                              &BusinessIMListTokens,
2245                              &BusinessIMListMediatype,
2246                              &BusinessIMListPref,
2247                              lboBusinessIM,
2248                              (intValueSeek));
2249     frameCEIM->ShowModal();
2250     delete frameCEIM;
2251     frameCEIM = NULL;
2254 void frmContactEditor::ModifyBusinessIM( wxCommandEvent& event )
2256     long longSelected = -1;
2257     int intSelectedData = 0;
2258     
2259     if (!GetSelectedItem(lboBusinessIM,
2260                          &longSelected,
2261                          &intSelectedData)){
2262         return;
2263     }
2264     
2265     frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
2266     frameCEIM->SetupPointers(&BusinessIMList,
2267                              &BusinessIMListAltID,
2268                              &BusinessIMListPID,
2269                              &BusinessIMListType,
2270                              &BusinessIMListTokens,
2271                              &BusinessIMListMediatype,
2272                              &BusinessIMListPref,
2273                              lboBusinessIM,
2274                              intSelectedData);
2275     frameCEIM->SetEditorMode(TRUE, CE_WORK);
2276     frameCEIM->ShowModal();
2277     delete frameCEIM;
2278     frameCEIM = NULL;
2281 void frmContactEditor::DeleteBusinessIM( wxCommandEvent& event )
2283     long longSelected = -1;
2284     int intSelectedData = 0;
2285     
2286     if (!GetSelectedItem(lboBusinessIM,
2287                          &longSelected,
2288                          &intSelectedData)){
2289         return;
2290     }
2291     
2292     lboBusinessIM->DeleteItem(longSelected);
2293     
2294     DeleteMapData(intSelectedData, &BusinessIMList,
2295                   &BusinessIMListAltID, &BusinessIMListPID,
2296                   &BusinessIMListType, &BusinessIMListTokens,
2297                   &BusinessIMListMediatype, &BusinessIMListPref);
2298     
2301 void frmContactEditor::AddBusinessTelephone( wxCommandEvent& event )
2303     int intResult = 0;
2304     
2305     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
2306     frameCETel->SetEditorMode(FALSE, CE_WORK);
2307     intResult = GetLastInt(&BusinessTelephoneList);
2308     frameCETel->SetupPointers(&BusinessTelephoneList,
2309                               &BusinessTelephoneListAltID,
2310                               &BusinessTelephoneListPID,
2311                               &BusinessTelephoneListType,
2312                               &BusinessTelephoneListTokens,
2313                               &BusinessTelephoneListPref,
2314                               lboBusinessTelephone,
2315                               (intValueSeek));
2316     frameCETel->ShowModal();
2317     delete frameCETel;
2318     frameCETel = NULL;
2321 void frmContactEditor::ModifyBusinessTelephone( wxCommandEvent& event )
2323     long longSelected = -1;
2324     int intSelectedData = 0;
2325     
2326     if (!GetSelectedItem(lboBusinessTelephone,
2327                          &longSelected,
2328                          &intSelectedData)){
2329         return;
2330     }
2331     
2332     frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
2333     frameCETel->SetupPointers(&BusinessTelephoneList,
2334                               &BusinessTelephoneListAltID,
2335                               &BusinessTelephoneListPID,
2336                               &BusinessTelephoneListType,
2337                               &BusinessTelephoneListTokens,
2338                               &BusinessTelephoneListPref,
2339                               lboBusinessTelephone,
2340                               intSelectedData);
2341     frameCETel->SetEditorMode(TRUE, CE_WORK);
2342     frameCETel->ShowModal();
2343     delete frameCETel;
2344     frameCETel = NULL;
2347 void frmContactEditor::DeleteBusinessTelephone( wxCommandEvent& event )
2349     long longSelected = -1;
2350     int intSelectedData = 0;
2351     
2352     if (!GetSelectedItem(lboBusinessTelephone,
2353                          &longSelected,
2354                          &intSelectedData)){
2355         return;
2356     }
2357     
2358     lboBusinessTelephone->DeleteItem(longSelected);
2359     
2360     DeleteMapData(intSelectedData, &BusinessTelephoneList,
2361                   &BusinessTelephoneListAltID, &BusinessTelephoneListPID,
2362                   &BusinessTelephoneListType, &BusinessTelephoneListTokens,
2363                   &BusinessTelephoneListPref);
2364     
2367 void frmContactEditor::AddBusinessLanguage( wxCommandEvent& event )
2369     int intResult = 0;
2370     
2371     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
2372     frameCELang->SetEditorMode(FALSE, CE_WORK);
2373     intResult = GetLastInt(&BusinessLanguageList);
2374     frameCELang->SetupPointers(&BusinessLanguageList,
2375                                &BusinessLanguageListAltID,
2376                                &BusinessLanguageListPID,
2377                                &BusinessLanguageListType,
2378                                &BusinessLanguageListTokens,
2379                                &BusinessLanguageListPref,
2380                                lboBusinessLanguages,
2381                                (intValueSeek));
2382     frameCELang->ShowModal();
2383     delete frameCELang;
2384     frameCELang = NULL;
2387 void frmContactEditor::ModifyBusinessLanguage( wxCommandEvent& event )
2389     long longSelected = -1;
2390     int intSelectedData = 0;
2391     
2392     if (!GetSelectedItem(lboBusinessLanguages,
2393                          &longSelected,
2394                          &intSelectedData)){
2395         return;
2396     }
2397     
2398     frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
2399     frameCELang->SetupPointers(&BusinessLanguageList,
2400                                &BusinessLanguageListAltID,
2401                                &BusinessLanguageListPID,
2402                                &BusinessLanguageListType,
2403                                &BusinessLanguageListTokens,
2404                                &BusinessLanguageListPref,
2405                                lboBusinessLanguages,
2406                                intSelectedData);
2407     frameCELang->SetEditorMode(TRUE, CE_WORK);
2408     frameCELang->ShowModal();
2409     delete frameCELang;
2410     frameCELang = NULL;
2413 void frmContactEditor::DeleteBusinessLanguage( wxCommandEvent& event )
2415     long longSelected = -1;
2416     int intSelectedData = 0;
2417     
2418     if (!GetSelectedItem(lboBusinessLanguages,
2419                          &longSelected,
2420                          &intSelectedData)){
2421         return;
2422     }
2423     
2424     lboBusinessLanguages->DeleteItem(longSelected);
2425     
2426     DeleteMapData(intSelectedData, &BusinessLanguageList,
2427                   &BusinessLanguageListAltID, &BusinessLanguageListPID,
2428                   &BusinessLanguageListType, &BusinessLanguageListTokens,
2429                   &BusinessLanguageListPref);
2430     
2433 void frmContactEditor::AddBusinessTimezone( wxCommandEvent& event )
2435     int intResult = 0;
2436     
2437     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
2438     frameCETZ->SetEditorMode(FALSE, CE_WORK);
2439     intResult = GetLastInt(&BusinessTZList);
2440     frameCETZ->SetupPointers(&BusinessTZList,
2441                              &BusinessTZListAltID,
2442                              &BusinessTZListPID,
2443                              &BusinessTZListType,
2444                              &BusinessTZListTokens,
2445                              &BusinessTZListMediatype,
2446                              &BusinessTZListPref,
2447                              lboBusinessTimezones,
2448                              (intValueSeek));
2449     frameCETZ->ShowModal();
2450     delete frameCETZ;
2451     frameCETZ = NULL;
2454 void frmContactEditor::ModifyBusinessTimezone( wxCommandEvent& event )
2456     long longSelected = -1;
2457     int intSelectedData = 0;
2458     
2459     if (!GetSelectedItem(lboBusinessTimezones,
2460                          &longSelected,
2461                          &intSelectedData)){
2462         return;
2463     }
2464     
2465     frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
2466     frameCETZ->SetupPointers(&BusinessTZList,
2467                              &BusinessTZListAltID,
2468                              &BusinessTZListPID,
2469                              &BusinessTZListType,
2470                              &BusinessTZListTokens,
2471                              &BusinessTZListMediatype,
2472                              &BusinessTZListPref,
2473                              lboBusinessTimezones,
2474                              intSelectedData);
2475     frameCETZ->SetEditorMode(TRUE, CE_WORK);
2476     frameCETZ->ShowModal();
2477     delete frameCETZ;
2478     frameCETZ = NULL;
2481 void frmContactEditor::DeleteBusinessTimezone( wxCommandEvent& event )
2483     long longSelected = -1;
2484     int intSelectedData = 0;
2485     
2486     if (!GetSelectedItem(lboBusinessTimezones,
2487                          &longSelected,
2488                          &intSelectedData)){
2489         return;
2490     }
2491     
2492     lboBusinessTimezones->DeleteItem(longSelected);
2493     
2494     DeleteMapData(intSelectedData, &BusinessTZList,
2495                   &BusinessTZListAltID, &BusinessTZListPID,
2496                   &BusinessTZListType, &BusinessTZListTokens,
2497                   &BusinessTZListMediatype, &BusinessTZListPref);
2498     
2501 void frmContactEditor::AddBusinessGeoposition( wxCommandEvent& event )
2503     int intResult = 0;
2504     
2505     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
2506     frameCEGeo->SetEditorMode(FALSE, CE_WORK);
2507     intResult = GetLastInt(&BusinessGeographyList);
2508     frameCEGeo->SetupPointers(&BusinessGeographyList,
2509                               &BusinessGeographyListAltID,
2510                               &BusinessGeographyListPID,
2511                               &BusinessGeographyListType,
2512                               &BusinessGeographyListTokens,
2513                               &BusinessGeographyListMediatype,
2514                               &BusinessGeographyListPref,
2515                               lboBusinessGeoposition,
2516                               (intValueSeek));
2517     frameCEGeo->ShowModal();
2518     delete frameCEGeo;
2519     frameCEGeo = NULL;
2522 void frmContactEditor::ModifyBusinessGeoposition( wxCommandEvent& event )
2524     long longSelected = -1;
2525     int intSelectedData = 0;
2526     
2527     if (!GetSelectedItem(lboBusinessGeoposition,
2528                          &longSelected,
2529                          &intSelectedData)){
2530         return;
2531     }
2532     
2533     frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
2534     frameCEGeo->SetupPointers(&BusinessGeographyList,
2535                               &BusinessGeographyListAltID,
2536                               &BusinessGeographyListPID,
2537                               &BusinessGeographyListType,
2538                               &BusinessGeographyListTokens,
2539                               &BusinessGeographyListMediatype,
2540                               &BusinessGeographyListPref,
2541                               lboBusinessGeoposition,
2542                               intSelectedData);
2543     frameCEGeo->SetEditorMode(TRUE, CE_WORK);
2544     frameCEGeo->ShowModal();
2545     delete frameCEGeo;
2546     frameCEGeo = NULL;
2549 void frmContactEditor::DeleteBusinessGeoposition( wxCommandEvent& event )
2551     long longSelected = -1;
2552     int intSelectedData = 0;
2553     
2554     if (!GetSelectedItem(lboBusinessGeoposition,
2555                          &longSelected,
2556                          &intSelectedData)){
2557         return;
2558     }
2559     
2560     lboBusinessGeoposition->DeleteItem(longSelected);
2561     
2562     DeleteMapData(intSelectedData, &BusinessGeographyList,
2563                   &BusinessGeographyListAltID, &BusinessGeographyListPID,
2564                   &BusinessGeographyListType, &BusinessGeographyListTokens,
2565                   &BusinessGeographyListMediatype, &BusinessGeographyListPref);
2566     
2569 void frmContactEditor::AddBusinessWebsite( wxCommandEvent& event )
2571     int intResult = 0;
2572     
2573     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
2574     frameCEWeb->SetEditorMode(FALSE, CE_WORK);
2575     intResult = GetLastInt(&BusinessWebsiteList);
2576     frameCEWeb->SetupPointers(&BusinessWebsiteList,
2577                               &BusinessWebsiteListAltID,
2578                               &BusinessWebsiteListPID,
2579                               &BusinessWebsiteListType,
2580                               &BusinessWebsiteListTokens,
2581                               &BusinessWebsiteListMediatype,
2582                               &BusinessWebsiteListPref,
2583                               lboBusinessWebsites,
2584                               (intValueSeek));
2585     frameCEWeb->ShowModal();
2586     delete frameCEWeb;
2587     frameCEWeb = NULL;
2590 void frmContactEditor::ModifyBusinessWebsite( wxCommandEvent& event )
2592     long longSelected = -1;
2593     int intSelectedData = 0;
2594     
2595     if (!GetSelectedItem(lboBusinessWebsites,
2596                          &longSelected,
2597                          &intSelectedData)){
2598         return;
2599     }
2600     
2601     frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
2602     frameCEWeb->SetupPointers(&BusinessWebsiteList,
2603                               &BusinessWebsiteListAltID,
2604                               &BusinessWebsiteListPID,
2605                               &BusinessWebsiteListType,
2606                               &BusinessWebsiteListTokens,
2607                               &BusinessWebsiteListMediatype,
2608                               &BusinessWebsiteListPref,
2609                               lboBusinessWebsites,
2610                               intSelectedData);
2611     frameCEWeb->SetEditorMode(TRUE, CE_WORK);
2612     frameCEWeb->ShowModal();
2613     delete frameCEWeb;
2614     frameCEWeb = NULL;
2617 void frmContactEditor::DeleteBusinessWebsite( wxCommandEvent& event )
2619     long longSelected = -1;
2620     int intSelectedData = 0;
2621     
2622     if (!GetSelectedItem(lboBusinessWebsites,
2623                          &longSelected,
2624                          &intSelectedData)){
2625         return;
2626     }
2627     
2628     lboBusinessWebsites->DeleteItem(longSelected);
2629     
2630     DeleteMapData(intSelectedData, &BusinessWebsiteList,
2631                   &BusinessWebsiteListAltID, &BusinessWebsiteListPID,
2632                   &BusinessWebsiteListType, &BusinessWebsiteListTokens,
2633                   &BusinessWebsiteListMediatype, &BusinessWebsiteListPref);
2634     
2637 void frmContactEditor::AddBusinessTitle( wxCommandEvent& event )
2639     int intResult = 0;
2640     
2641     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
2642     frameCETitle->SetEditorMode(FALSE, CE_WORK);
2643     intResult = GetLastInt(&BusinessTitleList);
2644     frameCETitle->SetupPointers(&BusinessTitleList,
2645                                 &BusinessTitleListLanguage,
2646                                 &BusinessTitleListAltID,
2647                                 &BusinessTitleListPID,
2648                                 &BusinessTitleListType,
2649                                 &BusinessTitleListTokens,
2650                                 &BusinessTitleListPref,
2651                                 lboBusinessTitles,
2652                                 (intValueSeek));
2653     frameCETitle->ShowModal();
2654     delete frameCETitle;
2655     frameCETitle = NULL;
2658 void frmContactEditor::ModifyBusinessTitle( wxCommandEvent& event )
2660     long longSelected = -1;
2661     int intSelectedData = 0;
2662     
2663     if (!GetSelectedItem(lboBusinessTitles,
2664                          &longSelected,
2665                          &intSelectedData)){
2666         return;
2667     }
2668     
2669     frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
2670     frameCETitle->SetupPointers(&BusinessTitleList,
2671                                 &BusinessTitleListLanguage,
2672                                 &BusinessTitleListAltID,
2673                                 &BusinessTitleListPID,
2674                                 &BusinessTitleListType,
2675                                 &BusinessTitleListTokens,
2676                                 &BusinessTitleListPref,
2677                                 lboBusinessTitles,
2678                                 intSelectedData);
2679     frameCETitle->SetEditorMode(TRUE, CE_WORK);
2680     frameCETitle->ShowModal();
2681     delete frameCETitle;
2682     frameCETitle = NULL;
2685 void frmContactEditor::DeleteBusinessTitle( wxCommandEvent& event )
2687     long longSelected = -1;
2688     int intSelectedData = 0;
2689     
2690     if (!GetSelectedItem(lboBusinessTitles,
2691                          &longSelected,
2692                          &intSelectedData)){
2693         return;
2694     }
2695     
2696     lboTitles->DeleteItem(longSelected);
2697     
2698     DeleteMapData(intSelectedData, &BusinessTitleList,
2699                   &BusinessTitleListLanguage, &BusinessTitleListAltID,
2700                   &BusinessTitleListPID, &BusinessTitleListType,
2701                   &BusinessTitleListTokens, &BusinessTitleListPref);
2702     
2705 void frmContactEditor::AddBusinessRole( wxCommandEvent& event )
2707     int intResult = 0;
2708     
2709     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
2710     frameCERole->SetEditorMode(FALSE, CE_WORK);
2711     intResult = GetLastInt(&BusinessRoleList);
2712     frameCERole->SetupPointers(&BusinessRoleList,
2713                                &BusinessRoleListLanguage,
2714                                &BusinessRoleListAltID,
2715                                &BusinessRoleListPID,
2716                                &BusinessRoleListType,
2717                                &BusinessRoleListTokens,
2718                                &BusinessRoleListPref,
2719                                lboBusinessRoles,
2720                                (intValueSeek));
2721     frameCERole->ShowModal();
2722     delete frameCERole;
2723     frameCERole = NULL;
2726 void frmContactEditor::ModifyBusinessRole( wxCommandEvent& event )
2728     long longSelected = -1;
2729     int intSelectedData = 0;
2730     
2731     if (!GetSelectedItem(lboBusinessRoles,
2732                          &longSelected,
2733                          &intSelectedData)){
2734         return;
2735     }
2736     
2737     frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
2738     frameCERole->SetupPointers(&BusinessRoleList,
2739                                &BusinessRoleListLanguage,
2740                                &BusinessRoleListAltID,
2741                                &BusinessRoleListPID,
2742                                &BusinessRoleListType,
2743                                &BusinessRoleListTokens,
2744                                &BusinessRoleListPref,
2745                                lboBusinessRoles,
2746                                intSelectedData);
2747     frameCERole->SetEditorMode(TRUE, CE_WORK);
2748     frameCERole->ShowModal();
2749     delete frameCERole;
2750     frameCERole = NULL;
2753 void frmContactEditor::DeleteBusinessRole( wxCommandEvent& event )
2755     long longSelected = -1;
2756     int intSelectedData = 0;
2757     
2758     if (!GetSelectedItem(lboBusinessRoles,
2759                          &longSelected,
2760                          &intSelectedData)){
2761         return;
2762     }
2763     
2764     lboBusinessRoles->DeleteItem(longSelected);
2765     
2766     DeleteMapData(intSelectedData, &BusinessRoleList,
2767                   &BusinessRoleListLanguage, &BusinessRoleListAltID,
2768                   &BusinessRoleListPID, &BusinessRoleListType,
2769                   &BusinessRoleListTokens, &BusinessRoleListPref);
2770     
2773 void frmContactEditor::AddBusinessOrganisation( wxCommandEvent& event )
2775     int intResult = 0;
2776     
2777     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
2778     frameCEOrg->SetEditorMode(FALSE, CE_WORK);
2779     intResult = GetLastInt(&GeneralOrganisationsList);
2780     frameCEOrg->SetupPointers(&GeneralOrganisationsList,
2781                               &BusinessOrganisationsListLanguage,
2782                               &BusinessOrganisationsListSortAs,
2783                               &BusinessOrganisationsListAltID,
2784                               &BusinessOrganisationsListPID,
2785                               &BusinessOrganisationsListType,
2786                               &BusinessOrganisationsListTokens,
2787                               &BusinessOrganisationsListPref,
2788                               lboBusinessOrganisations,
2789                               (intValueSeek));
2790     frameCEOrg->ShowModal();
2791     delete frameCEOrg;
2792     frameCEOrg = NULL;
2795 void frmContactEditor::ModifyBusinessOrganisation( wxCommandEvent& event )
2797     long longSelected = -1;
2798     int intSelectedData = 0;
2799     
2800     if (!GetSelectedItem(lboBusinessOrganisations,
2801                          &longSelected,
2802                          &intSelectedData)){
2803         return;
2804     }
2805     
2806     frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
2807     frameCEOrg->SetupPointers(&BusinessOrganisationsList,
2808                               &BusinessOrganisationsListLanguage,
2809                               &BusinessOrganisationsListSortAs,
2810                               &BusinessOrganisationsListAltID,
2811                               &BusinessOrganisationsListPID,
2812                               &BusinessOrganisationsListType,
2813                               &BusinessOrganisationsListTokens,
2814                               &BusinessOrganisationsListPref,
2815                               lboBusinessOrganisations,
2816                               intSelectedData);
2817     frameCEOrg->SetEditorMode(TRUE, CE_WORK);
2818     frameCEOrg->ShowModal();
2819     delete frameCEOrg;
2820     frameCEOrg = NULL;
2823 void frmContactEditor::DeleteBusinessOrganisation( wxCommandEvent& event )
2825     long longSelected = -1;
2826     int intSelectedData = 0;
2827     
2828     if (!GetSelectedItem(lboBusinessOrganisations,
2829                          &longSelected,
2830                          &intSelectedData)){
2831         return;
2832     }
2833     
2834     lboBusinessOrganisations->DeleteItem(longSelected);
2835     
2836     DeleteMapData(intSelectedData, &BusinessOrganisationsList,
2837                   &BusinessOrganisationsListLanguage, &BusinessOrganisationsListSortAs,
2838                   &BusinessOrganisationsListAltID, &BusinessOrganisationsListPID,
2839                   &BusinessOrganisationsListType, &BusinessOrganisationsListTokens,
2840                   &BusinessOrganisationsListPref);
2841     
2844 void frmContactEditor::AddBusinessNote( wxCommandEvent& event )
2846     int intResult = 0;
2847     
2848     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
2849     frameCENote->SetEditorMode(FALSE, CE_WORK);
2850     intResult = GetLastInt(&BusinessNoteList);
2851     frameCENote->SetupPointers(&BusinessNoteList,
2852                                &BusinessNoteListLanguage,
2853                                &BusinessNoteListAltID,
2854                                &BusinessNoteListPID,
2855                                &BusinessNoteListType,
2856                                &BusinessNoteListTokens,
2857                                &BusinessNoteListPref,
2858                                lboBusinessNotes,
2859                                (intValueSeek));
2860     frameCENote->ShowModal();
2861     delete frameCENote;
2862     frameCENote = NULL;
2865 void frmContactEditor::ModifyBusinessNote( wxCommandEvent& event )
2867     long longSelected = -1;
2868     int intSelectedData = 0;
2869     
2870     if (!GetSelectedItem(lboBusinessNotes,
2871                          &longSelected,
2872                          &intSelectedData)){
2873         return;
2874     }
2875     
2876     frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
2877     frameCENote->SetupPointers(&BusinessNoteList,
2878                                &BusinessNoteListLanguage,
2879                                &BusinessNoteListAltID,
2880                                &BusinessNoteListPID,
2881                                &BusinessNoteListType,
2882                                &BusinessNoteListTokens,
2883                                &BusinessNoteListPref,
2884                                lboBusinessNotes,
2885                                intSelectedData);
2886     frameCENote->SetEditorMode(TRUE, CE_WORK);
2887     frameCENote->ShowModal();
2888     delete frameCENote;
2889     frameCENote = NULL;
2892 void frmContactEditor::DeleteBusinessNote( wxCommandEvent& event )
2894     long longSelected = -1;
2895     int intSelectedData = 0;
2896     
2897     if (!GetSelectedItem(lboBusinessNotes,
2898                          &longSelected,
2899                          &intSelectedData)){
2900         return;
2901     }
2902     
2903     lboBusinessNotes->DeleteItem(longSelected);
2904     
2905     DeleteMapData(intSelectedData, &BusinessNoteList,
2906                   &BusinessNoteListLanguage, &BusinessNoteListAltID,
2907                   &BusinessNoteListPID, &BusinessNoteListType,
2908                   &BusinessNoteListTokens, &BusinessNoteListPref);
2909     
2912 void frmContactEditor::AddCategory( wxCommandEvent& event )
2914     int intResult = 0;
2915     
2916     frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
2917     frameCECategory->SetEditorMode(FALSE);
2918     intResult = GetLastInt(&CategoriesList);
2919     frameCECategory->SetupPointers(&CategoriesList,
2920                                    &CategoriesListAltID,
2921                                    &CategoriesListPID,
2922                                    &CategoriesListType,
2923                                    &CategoriesListTokens,
2924                                    &CategoriesListPref,
2925                                    lboCategories,
2926                                    (intValueSeek));
2927     frameCECategory->ShowModal();
2928     delete frameCECategory;
2929     frameCECategory = NULL;
2932 void frmContactEditor::ModifyCategory( wxCommandEvent& event )
2934     long longSelected = -1;
2935     int intSelectedData = 0;
2936     
2937     if (!GetSelectedItem(lboCategories,
2938                          &longSelected,
2939                          &intSelectedData)){
2940         return;
2941     }
2942     
2943     frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
2944     frameCECategory->SetupPointers(&CategoriesList,
2945                                    &CategoriesListAltID,
2946                                    &CategoriesListPID,
2947                                    &CategoriesListType,
2948                                    &CategoriesListTokens,
2949                                    &CategoriesListPref,
2950                                    lboCategories,
2951                                    intSelectedData);
2952     frameCECategory->SetEditorMode(TRUE);
2953     frameCECategory->ShowModal();
2954     delete frameCECategory;
2955     frameCECategory = NULL;
2958 void frmContactEditor::DeleteCategory( wxCommandEvent& event )
2960     long longSelected = -1;
2961     int intSelectedData = 0;
2962     
2963     if (!GetSelectedItem(lboCategories,
2964                          &longSelected,
2965                          &intSelectedData)){
2966         return;
2967     }
2968     
2969     lboCategories->DeleteItem(longSelected);
2970     
2971     DeleteMapData(intSelectedData, &CategoriesList,
2972                   &CategoriesListAltID, &CategoriesListPID,
2973                   &CategoriesListType, &CategoriesListTokens,
2974                   &CategoriesListPref);
2975     
2978 void frmContactEditor::AddGroup( wxCommandEvent& event )
2980     
2981     int intResult = 0;
2982     
2983     XABViewMode XVMData = MainPtr->GetViewMode();
2984     
2985     frmContactEditorGroup *frameCEGroup = new frmContactEditorGroup ( this );
2986     frameCEGroup->SetEditorMode(FALSE, XVMData);
2987     intResult = GetLastInt(&GroupsList);
2988     frameCEGroup->SetupPointers(&GroupsList,
2989                                 lboGroups,
2990                                 wxSContactAccount,
2991                                 intValueSeek);
2992     frameCEGroup->ShowModal();
2993     delete frameCEGroup;
2994     frameCEGroup = NULL;
2995     
2998 void frmContactEditor::ModifyGroup( wxCommandEvent& event )
3000     
3001     return;
3002     
3005 void frmContactEditor::DeleteGroup( wxCommandEvent& event )
3007     
3008     long longSelected = -1;
3009     int intSelectedData = 0;
3010     
3011     if (!GetSelectedItem(lboGroups,
3012                          &longSelected,
3013                          &intSelectedData)){
3014         return;
3015     }
3016     
3017     lboGroups->DeleteItem(longSelected);
3018     
3019     DeleteMapData(intSelectedData, &GroupsList);
3020     
3023 void frmContactEditor::AddPicture( wxCommandEvent& event )
3025     int intResult = 0;
3026     
3027     frmContactEditorPicture *frameCEPicture = new frmContactEditorPicture ( this );
3028     frameCEPicture->SetEditorMode(FALSE);
3029     intResult = GetLastInt(&PicturesList);
3030     frameCEPicture->SetupPointers(&PicturesList,
3031                                   &PicturesListAltID,
3032                                   &PicturesListPID,
3033                                   &PicturesListType,
3034                                   &PicturesListPicEncType,
3035                                   &PicturesListPictureType,
3036                                   &PicturesListTokens,
3037                                   &PicturesListMediatype,
3038                                   &PicturesListPref,
3039                                   lboPictures,
3040                                   (intValueSeek));
3041     frameCEPicture->ShowModal();
3042     delete frameCEPicture;
3043     frameCEPicture = NULL;
3046 void frmContactEditor::ModifyPicture( wxCommandEvent& event )
3048     long longSelected = -1;
3049     int intSelectedData = 0;
3050     
3051     if (!GetSelectedItem(lboPictures,
3052                          &longSelected,
3053                          &intSelectedData)){
3054         return;
3055     }
3056     
3057     frmContactEditorPicture *frameCEPicture = new frmContactEditorPicture ( this );
3058     frameCEPicture->SetupPointers(&PicturesList,
3059                                   &PicturesListAltID,
3060                                   &PicturesListPID,
3061                                   &PicturesListType,
3062                                   &PicturesListPicEncType,
3063                                   &PicturesListPictureType,
3064                                   &PicturesListTokens,
3065                                   &PicturesListMediatype,
3066                                   &PicturesListPref,
3067                                   lboPictures,
3068                                   intSelectedData);
3069     frameCEPicture->SetEditorMode(TRUE);
3070     frameCEPicture->ShowModal();
3071     delete frameCEPicture;
3072     frameCEPicture = NULL;
3073     
3076 void frmContactEditor::DeletePicture( wxCommandEvent& event )
3078     long longSelected = -1;
3079     int intSelectedData = 0;
3080     
3081     if (!GetSelectedItem(lboPictures,
3082                          &longSelected,
3083                          &intSelectedData)){
3084         return;
3085     }
3086     
3087     lboPictures->DeleteItem(longSelected);
3088     
3089     DeleteMapData(intSelectedData,
3090                   &PicturesList, &PicturesListAltID, &PicturesListPID, &PicturesListType,
3091                   &PicturesListPicEncType, &PicturesListPictureType, &PicturesListTokens,
3092                   &PicturesListMediatype, &PicturesListPref);
3093     
3094     wxMemoryInputStream istream(misc_emptyimage_png, sizeof(misc_emptyimage_png));
3095     wxImage misc_emptyimage_png(istream, wxBITMAP_TYPE_PNG);
3096     PictureImage = (wxBitmap)misc_emptyimage_png;
3097     
3098     imgPicture->SetBitmap(PictureImage);
3101 void frmContactEditor::LoadPicture( wxListEvent& event )
3103     
3104     long longSelected = -1;
3105     int intSelectedData = 0;
3106     
3107     if (!GetSelectedItem(lboPictures,
3108                          &longSelected,
3109                          &intSelectedData)){
3110         return;
3111     }
3112     
3113     std::string base64dec;
3114     
3115     std::map<int,std::string>::iterator initier;
3116     std::map<int,wxString>::iterator pictypeiter;
3117     
3118     initier = PicturesList.find(intSelectedData);
3119     pictypeiter = PicturesListPictureType.find(intSelectedData);
3120     
3121     base64dec = base64_decode(initier->second);
3122     
3123     wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size());
3124     wxImage photo;
3125     //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size());
3126     
3127     wxPuts(wxT("PicType:") + pictypeiter->second);
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         }
6077         else {
6078             
6079             ActMgrPtr->AddTask(1, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
6080             FMTimer.UpdateTimestamp();
6081             FMTimer.Start(10000, FALSE);
6082             
6083         }
6084         
6085     }
6086     
6087     // Send a notification to update the main window
6088     // with the new details.
6089     
6090     UCNotif *ucd;
6091     ucd = new UCNotif;
6092     
6093     // TODO: Workout nickname settings by priority and
6094     // type.
6095     
6096     ucd->ContactAccount = wxSContactAccount;
6097     ucd->ContactFilename = FilenameFinal;
6098     ucd->ContactName = cmbDisplayAs->GetValue();
6099     ucd->ContactNameArray = ContactData.GetName();
6100     
6101     for (std::map<int,wxString>::iterator gniter = GeneralNicknamesList.begin();
6102          gniter != GeneralNicknamesList.end(); gniter++){
6103         
6104         ucd->ContactNickname = gniter->second;
6105         break;
6106         
6107     }
6108     
6109     wxCommandEvent event2(CE_UPDATECONTACTLIST);
6110     event2.SetClientData(ucd);
6111     wxPostEvent(MainPtr, event2);
6112     
6115 void frmContactEditor::SaveCloseContact( wxCommandEvent& event )
6117     
6118     // Save the updated contact data and close the form.
6119     
6122 void frmContactEditor::CloseContact( wxCommandEvent& event )
6124     
6125     Close();
6126     
6129 void frmContactEditor::CloseWindow( wxCloseEvent& event )
6131     
6132     // TODO: Check if any changes have been made,
6133     // ask if the changes should be made, process
6134     // action based on question and then close.
6135     
6136     WindowData *WData = new WindowData;
6137     
6138     WData->DataType = 1;
6139     WData->WindowPointer = this;
6140     WData->WindowID = ContactEditorUID;
6141     
6142     wxCommandEvent delevent(WINDOW_CLOSE);
6143     delevent.SetClientData(WData);
6144     wxPostEvent(GetParent(), delevent);
6145     
6146     Destroy();
6147     
6151 void frmContactEditor::CutText( wxCommandEvent& event )
6153     // This function left empty for future implementation.
6156 void frmContactEditor::CopyText( wxCommandEvent& event )
6158     // This function left empty for future implementation.
6161 void frmContactEditor::PasteText( wxCommandEvent& event )
6163     // This function left empty for future implementation.
6166 void frmContactEditor::SetupContact( wxString AccountName )
6168     
6169     wxSContactAccount = AccountName;
6170     
6173 bool frmContactEditor::ProcessEvent(wxEvent& event)
6175     
6176     // This section has been taken from the wxWidgets sample code of richtext.cpp
6177     // so that simple Cut/Copy/Paste code can be made.
6178     
6179     // As this code comes from the samples of the wxWidgets library, this is licenced
6180     // under the wxWindows Library Licence and is compatable with the LGPL and is
6181     // compatable with Xestia Address Book's licence.
6182     
6183     if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxChildFocusEvent)))
6184     {
6185         // Problem: we can get infinite recursion because the events
6186         // climb back up to this frame, and repeat.
6187         // Assume that command events don't cause another command event
6188         // to be called, so we can rely on inCommand not being overwritten
6189         
6190         static int s_eventType = 0;
6191         static wxWindowID s_id = 0;
6192         
6193         if (s_id != event.GetId() && s_eventType != event.GetEventType())
6194         {
6195             s_eventType = event.GetEventType();
6196             s_id = event.GetId();
6197             
6198             wxWindow* focusWin = wxFindFocusDescendant(this);
6199             if (focusWin && focusWin->GetEventHandler()->ProcessEvent(event))
6200             {
6201                 //s_command = NULL;
6202                 s_eventType = 0;
6203                 s_id = 0;
6204                 return true;
6205             }
6206             s_eventType = 0;
6207             s_id = 0;
6208         }
6209         else
6210         {
6211             return false;
6212         }
6213     }
6214     
6215     return wxFrame::ProcessEvent(event);
6218 void frmContactEditor::SetupHeaders()
6220     
6221     /* Items for the General Tab */
6222     
6223     SetupColumn(CE_NICKNAME, lboNicknames);
6224     SetupColumn(CE_ADDRESS, lboAddresses);
6225     SetupColumn(CE_EMAIL, lboEmails);
6226     SetupColumn(CE_IM, lboIM);
6227     SetupColumn(CE_TELEPHONE, lboTelephone);
6228     SetupColumn(CE_LANG, lboLanguages);
6229     SetupColumn(CE_TZ, lboTimezones);
6230     SetupColumn(CE_GEOPOSITION, lboGeoposition);
6231     SetupColumn(CE_RELATED, lboRelated);
6232     SetupColumn(CE_WEBSITE, lboWebsites);
6233     SetupColumn(CE_TITLE, lboTitles);
6234     SetupColumn(CE_ROLE, lboRoles);
6235     SetupColumn(CE_ORG, lboOrganisations);
6236     SetupColumn(CE_NOTE, lboNotes);
6237     
6238     /* Items for the Home Tab */
6239     
6240     SetupColumn(CE_NICKNAME, lboHomeNicknames);
6241     SetupColumn(CE_ADDRESS, lboHomeAddresses);
6242     SetupColumn(CE_EMAIL, lboHomeEmails);
6243     SetupColumn(CE_IM, lboHomeIM);
6244     SetupColumn(CE_TELEPHONE, lboHomeTelephone);        
6245     SetupColumn(CE_LANG, lboHomeLanguages);
6246     SetupColumn(CE_TZ, lboHomeTimezones);
6247     SetupColumn(CE_GEOPOSITION, lboHomeGeoposition);
6248     SetupColumn(CE_WEBSITE, lboHomeWebsites);
6249     SetupColumn(CE_TITLE, lboHomeTitles);
6250     SetupColumn(CE_ROLE, lboHomeRoles);
6251     SetupColumn(CE_ORG, lboHomeOrganisations);
6252     SetupColumn(CE_NOTE, lboHomeNotes);
6253     
6254     /* Items for the Business Tab */
6255     
6256     SetupColumn(CE_NICKNAME, lboBusinessNicknames);
6257     SetupColumn(CE_ADDRESS, lboBusinessAddresses);
6258     SetupColumn(CE_EMAIL, lboBusinessEmail);
6259     SetupColumn(CE_IM, lboBusinessIM);
6260     SetupColumn(CE_TELEPHONE, lboBusinessTelephone);    
6261     SetupColumn(CE_LANG, lboBusinessLanguages);
6262     SetupColumn(CE_TZ, lboBusinessTimezones);
6263     SetupColumn(CE_GEOPOSITION, lboBusinessGeoposition);
6264     SetupColumn(CE_WEBSITE, lboBusinessWebsites);
6265     SetupColumn(CE_TITLE, lboBusinessTitles);
6266     SetupColumn(CE_ROLE, lboBusinessRoles);
6267     SetupColumn(CE_ORG, lboBusinessOrganisations);
6268     SetupColumn(CE_NOTE, lboBusinessNotes);     
6269     
6270     /* Items for the Categories Tab */
6271     
6272     SetupColumn(CE_CATEGORIES, lboCategories);
6273     
6274     /* Items for the Groups Tab */
6275     
6276     SetupColumn(CE_GROUPS, lboGroups);
6277     
6278     /* Items for the Pictures and Logos Tab */
6279     
6280     SetupColumn(CE_PICTURES, lboPictures);
6281     SetupColumn(CE_PICTURES, lboLogos); 
6282     
6283     /* Items for the Sounds Tab */
6284     
6285     SetupColumn(CE_SOUNDS, lboSounds);
6286     
6287     /* Items for the Calendaring Tab */
6288     
6289     SetupColumn(CE_CALENDAR, lboCalendarAddresses);
6290     SetupColumn(CE_CALENDAR, lboCalendarRequestAddress);
6291     SetupColumn(CE_CALENDAR, lboFreeBusyAddresses);     
6292     
6293     /* Items for the Security Tab */
6294     
6295     SetupColumn(CE_KEY, lboKeys);
6296     
6297     /* Items for the Other Tab */
6298     
6299     SetupColumn(CE_TOKEN, lboVendorNamespace);
6300     SetupColumn(CE_TOKEN, lboXToken);
6301     
6304 void frmContactEditor::SetupColumn(wxString ColumnType, wxListCtrl *ListCtrl)
6306     
6307     wxListItem coldata; 
6308     
6309     if (ColumnType == CE_NICKNAME){
6310         
6311         coldata.SetId(0);
6312         coldata.SetText(_("Nickname"));
6313         coldata.SetWidth(128);
6314         ListCtrl->InsertColumn(0, coldata);
6315         
6316         coldata.SetId(1);
6317         coldata.SetText(_("Pri."));
6318         coldata.SetWidth(32);
6319         ListCtrl->InsertColumn(1, coldata);             
6320         
6321     } else if (ColumnType == CE_ADDRESS){
6322         
6323         coldata.SetId(0);
6324         coldata.SetText(_("Address"));
6325         coldata.SetWidth(128);
6326         ListCtrl->InsertColumn(0, coldata);
6327         
6328         coldata.SetId(1);
6329         coldata.SetText(_("Town"));
6330         coldata.SetWidth(64);
6331         ListCtrl->InsertColumn(1, coldata);             
6332         
6333         coldata.SetId(2);
6334         coldata.SetText(_("County"));
6335         coldata.SetWidth(64);
6336         ListCtrl->InsertColumn(2, coldata);
6337         
6338         coldata.SetId(3);
6339         coldata.SetText(_("Post code"));
6340         coldata.SetWidth(48);
6341         ListCtrl->InsertColumn(3, coldata);
6342         
6343         coldata.SetId(4);
6344         coldata.SetText(_("Pri."));
6345         coldata.SetWidth(32);
6346         ListCtrl->InsertColumn(4, coldata);             
6347         
6348     } else if (ColumnType == CE_EMAIL){
6349         
6350         coldata.SetId(0);
6351         coldata.SetText(_("Email address"));
6352         coldata.SetWidth(304);
6353         ListCtrl->InsertColumn(0, coldata);
6354         
6355         coldata.SetId(1);
6356         coldata.SetText(_("Pri."));
6357         coldata.SetWidth(32);
6358         ListCtrl->InsertColumn(1, coldata);
6359         
6360     } else if (ColumnType == CE_IM){
6361         
6362         coldata.SetId(0);
6363         coldata.SetText(_("Type"));
6364         coldata.SetWidth(64);
6365         ListCtrl->InsertColumn(0, coldata);
6366         
6367         coldata.SetId(1);
6368         coldata.SetText(_("Address"));
6369         coldata.SetWidth(240);
6370         ListCtrl->InsertColumn(1, coldata);
6371         
6372         coldata.SetId(2);
6373         coldata.SetText(_("Pri."));
6374         coldata.SetWidth(32);
6375         ListCtrl->InsertColumn(2, coldata);             
6376         
6377     } else if (ColumnType == CE_TELEPHONE){
6378         
6379         coldata.SetId(0);
6380         coldata.SetText(_("Telephone number"));
6381         coldata.SetWidth(128);
6382         ListCtrl->InsertColumn(0, coldata);
6383         
6384         coldata.SetId(1);
6385         coldata.SetText(_("Type"));
6386         coldata.SetWidth(64);
6387         ListCtrl->InsertColumn(1, coldata);             
6388         
6389         coldata.SetId(2);
6390         coldata.SetText(_("Pri."));
6391         coldata.SetWidth(32);
6392         ListCtrl->InsertColumn(2, coldata);             
6393         
6394     } else if (ColumnType == CE_LANG){
6395         
6396         coldata.SetId(0);
6397         coldata.SetText(_("Language"));
6398         coldata.SetWidth(128);
6399         ListCtrl->InsertColumn(0, coldata);
6400         
6401         coldata.SetId(1);
6402         coldata.SetText(_("Pri."));
6403         coldata.SetWidth(32);
6404         ListCtrl->InsertColumn(1, coldata);             
6405         
6406     } else if (ColumnType == CE_TZ){
6407         
6408         coldata.SetId(0);
6409         coldata.SetText(_("Timezone"));
6410         coldata.SetWidth(192);
6411         ListCtrl->InsertColumn(0, coldata);
6412         
6413         coldata.SetId(1);
6414         coldata.SetText(_("Pri."));
6415         coldata.SetWidth(32);
6416         ListCtrl->InsertColumn(1, coldata);             
6417         
6418     } else if (ColumnType == CE_RELATED){
6419         
6420         coldata.SetId(0);
6421         coldata.SetText(_("Type"));
6422         coldata.SetWidth(64);
6423         ListCtrl->InsertColumn(0, coldata);
6424         
6425         coldata.SetId(1);
6426         coldata.SetText(_("Name/Description"));
6427         coldata.SetWidth(192);
6428         ListCtrl->InsertColumn(1, coldata);
6429         
6430         coldata.SetId(2);
6431         coldata.SetText(_("Pri."));
6432         coldata.SetWidth(32);
6433         ListCtrl->InsertColumn(2, coldata);
6434         
6435     } else if (ColumnType == CE_WEBSITE){
6436         
6437         coldata.SetId(0);
6438         coldata.SetText(_("Website"));
6439         coldata.SetWidth(288);
6440         ListCtrl->InsertColumn(0, coldata);
6441         
6442         coldata.SetId(1);
6443         coldata.SetText(_("Pri."));
6444         coldata.SetWidth(32);
6445         ListCtrl->InsertColumn(1, coldata);
6446         
6447     } else if (ColumnType == CE_TITLE){
6448         
6449         coldata.SetId(0);
6450         coldata.SetText(_("Title"));
6451         coldata.SetWidth(288);
6452         ListCtrl->InsertColumn(0, coldata);
6453         
6454         coldata.SetId(1);
6455         coldata.SetText(_("Pri."));
6456         coldata.SetWidth(32);
6457         ListCtrl->InsertColumn(1, coldata);
6458         
6459     } else if (ColumnType == CE_ROLE){
6460         
6461         coldata.SetId(0);
6462         coldata.SetText(_("Role"));
6463         coldata.SetWidth(288);
6464         ListCtrl->InsertColumn(0, coldata);
6465         
6466         coldata.SetId(1);
6467         coldata.SetText(_("Pri."));
6468         coldata.SetWidth(32);
6469         ListCtrl->InsertColumn(1, coldata);
6470         
6471     } else if (ColumnType == CE_ORG){
6472         
6473         coldata.SetId(0);
6474         coldata.SetText(_("Organisation"));
6475         coldata.SetWidth(288);
6476         ListCtrl->InsertColumn(0, coldata);
6477         
6478         coldata.SetId(1);
6479         coldata.SetText(_("Pri."));
6480         coldata.SetWidth(32);
6481         ListCtrl->InsertColumn(1, coldata);
6482         
6483     } else if (ColumnType == CE_NOTE){
6484         
6485         coldata.SetId(0);
6486         coldata.SetText(_("Notes"));
6487         coldata.SetWidth(288);
6488         ListCtrl->InsertColumn(0, coldata);
6489         
6490         coldata.SetId(1);
6491         coldata.SetText(_("Pri."));
6492         coldata.SetWidth(32);
6493         ListCtrl->InsertColumn(1, coldata);     
6494         
6495     } else if (ColumnType == CE_CATEGORIES){
6496         
6497         coldata.SetId(0);
6498         coldata.SetText(_("Category"));
6499         coldata.SetWidth(320);
6500         ListCtrl->InsertColumn(0, coldata);
6501         
6502         coldata.SetId(1);
6503         coldata.SetText(_("Pri."));
6504         coldata.SetWidth(32);
6505         ListCtrl->InsertColumn(1, coldata);
6506         
6507     } else if (ColumnType == CE_GROUPS){
6508         
6509         coldata.SetId(0);
6510         coldata.SetText(_("Member"));
6511         coldata.SetWidth(320);
6512         ListCtrl->InsertColumn(0, coldata);
6513         
6514     } else if (ColumnType == CE_GEOPOSITION){
6515         
6516         coldata.SetId(0);
6517         coldata.SetText(_("Geoposition"));
6518         coldata.SetWidth(320);
6519         ListCtrl->InsertColumn(0, coldata);
6520         
6521         coldata.SetId(1);
6522         coldata.SetText(_("Pri."));
6523         coldata.SetWidth(32);
6524         ListCtrl->InsertColumn(1, coldata);
6525         
6526     } else if (ColumnType == CE_PICTURES){
6527         
6528         coldata.SetId(0);
6529         coldata.SetText(_("Pictures"));
6530         coldata.SetWidth(128);
6531         ListCtrl->InsertColumn(0, coldata);
6532         
6533         coldata.SetId(1);
6534         coldata.SetText(_("Type"));
6535         coldata.SetWidth(64);
6536         ListCtrl->InsertColumn(1, coldata);             
6537         
6538         coldata.SetId(2);
6539         coldata.SetText(_("Pri."));
6540         coldata.SetWidth(32);
6541         ListCtrl->InsertColumn(2, coldata);
6542         
6543     } else if (ColumnType == CE_SOUNDS){
6544         
6545         coldata.SetId(0);
6546         coldata.SetText(_("Sounds"));
6547         coldata.SetWidth(128);
6548         ListCtrl->InsertColumn(0, coldata);
6549         
6550         coldata.SetId(1);
6551         coldata.SetText(_("Type"));
6552         coldata.SetWidth(64);
6553         ListCtrl->InsertColumn(1, coldata);             
6554         
6555         coldata.SetId(2);
6556         coldata.SetText(_("Pri."));
6557         coldata.SetWidth(32);
6558         ListCtrl->InsertColumn(2, coldata);
6559         
6560     } else if (ColumnType == CE_CALENDAR){
6561         
6562         coldata.SetId(0);
6563         coldata.SetText(_("Calendar Address"));
6564         coldata.SetWidth(224);
6565         ListCtrl->InsertColumn(0, coldata);
6566         
6567         coldata.SetId(1);
6568         coldata.SetText(_("Type"));
6569         coldata.SetWidth(64);
6570         ListCtrl->InsertColumn(1, coldata);             
6571         
6572         coldata.SetId(2);
6573         coldata.SetText(_("Pri."));
6574         coldata.SetWidth(32);
6575         ListCtrl->InsertColumn(2, coldata);
6576         
6577     } else if (ColumnType == CE_KEY){
6578         
6579         coldata.SetId(0);
6580         coldata.SetText(_("Key information"));
6581         coldata.SetWidth(224);
6582         ListCtrl->InsertColumn(0, coldata);
6583         
6584         coldata.SetId(1);
6585         coldata.SetText(_("Type"));
6586         coldata.SetWidth(64);
6587         ListCtrl->InsertColumn(1, coldata);             
6588         
6589         coldata.SetId(2);
6590         coldata.SetText(_("Pri."));
6591         coldata.SetWidth(32);
6592         ListCtrl->InsertColumn(2, coldata);
6593         
6594     } else if (ColumnType == CE_TOKEN){
6595         
6596         coldata.SetId(0);
6597         coldata.SetText(_("Token"));
6598         coldata.SetWidth(320);
6599         ListCtrl->InsertColumn(0, coldata);
6600         
6601     }
6602     
6605 int frmContactEditor::GetLastInt(std::map<int, wxString> *MapData){
6606     
6607     /*
6608      int intResult = 0;
6609      
6610      std::map<int,wxString>::iterator iwxsit;
6611      
6612      for( iwxsit=(*MapData).begin(); iwxsit != (*MapData).end(); iwxsit++){
6613      intResult = (*iwxsit).first;
6614      }
6615      
6616      return intResult;
6617      */
6618     
6619     intValueSeek++;
6620     return intValueSeek;
6621     
6624 int frmContactEditor::GetLastInt(std::map<int, std::string> *MapData){
6625     
6626     /* int intResult = 0;
6627      
6628      std::map<int,std::string>::iterator iwxsit;
6629      
6630      for( iwxsit=(*MapData).begin(); iwxsit != (*MapData).end(); iwxsit++){
6631      intResult = (*iwxsit).first;
6632      }*/
6633     
6634     intValueSeek++;
6635     return intValueSeek;
6636     
6639 bool frmContactEditor::GetSelectedItem(wxListCtrl *ListCtrlPtr, 
6640                                        long *longSelected,
6641                                        int *intSelectedData){
6642     
6643     *longSelected = -1;
6644     *intSelectedData = 0;
6645     
6646     *longSelected = ListCtrlPtr->GetNextItem(*longSelected, 
6647                                              wxLIST_NEXT_ALL,
6648                                              wxLIST_STATE_SELECTED);
6649     
6650     *intSelectedData = (int)ListCtrlPtr->GetItemData(*longSelected);
6651     
6652     if (*longSelected == -1){
6653         return FALSE;
6654     }
6655     else {
6656         return TRUE;
6657     }
6658     
6661 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, std::string>* MapData){
6662     MapData->erase(IndexNum);
6665 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, wxString>* MapData){
6666     MapData->erase(IndexNum);
6669 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, int>* MapData){
6670     MapData->erase(IndexNum);
6673 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, bool>* MapData){
6674     MapData->erase(IndexNum);
6677 void frmContactEditor::ProcessSaveDataProc( wxString PropName,
6678                                            std::map<int,int>* MapData){
6679     
6680     int intIterVal = (*iterDataPtr)->first;
6681     
6682     std::map<int,int>::iterator intIter;
6683     
6684     intIter = MapData->find(intIterVal);
6685     
6686     int intPropValue; 
6687     
6688     if (intIter->first == intIterVal){
6689         
6690         intPropValue = intIter->second;
6691         
6692         if (intPropValue){
6693             
6694             if (*boolAdditionalPtr == TRUE){
6695                 
6696                 strPropertyPtr->Append(wxT(";"));
6697                 
6698             } else {
6699                 
6700                 *boolAdditionalPtr = TRUE;
6701                 
6702             }
6703             
6704             strPropertyPtr->Append(PropName + wxT("=") + wxString::Format(wxT("%i"), intPropValue));
6705             
6706             *boolExtraPtr = TRUE;
6707             
6708         }
6709         
6710     }
6711     
6714 void frmContactEditor::ProcessSaveDataProc( wxString PropName,
6715                                            std::map<int,wxString>* MapData){
6716     
6717     int intIterVal;
6718     
6719     intIterVal = (*iterDataPtr)->first;
6720     
6721     std::map<int,wxString>::iterator strIter;
6722     
6723     strIter = MapData->find(intIterVal);
6724     
6725     if (strIter == MapData->end()){
6726         
6727         return;
6728         
6729     }
6730     
6731     wxString strPropValue;
6732     
6733     if (strIter->first == intIterVal){
6734         
6735         strPropValue = strIter->second;
6736         
6737         if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6738             
6739             strPropValue.Trim();
6740             strPropValue.Trim();
6741             
6742             if (*boolAdditionalPtr == TRUE){
6743                 
6744                 strPropertyPtr->Append(wxT(";"));
6745                 
6746             } else {
6747                 
6748                 *boolAdditionalPtr = TRUE;
6749                 
6750             }
6751             
6752             strPropertyPtr->Append(strPropValue);       
6753             
6754             *boolExtraPtr = TRUE;
6755             
6756             return;
6757             
6758         }
6759         
6760         if (!strPropValue.IsEmpty()){
6761             
6762             strPropValue.Trim();
6763             strPropValue.Trim();
6764             
6765             if (*boolAdditionalPtr == TRUE){
6766                 
6767                 strPropertyPtr->Append(wxT(";"));
6768                 
6769             } else {
6770                 
6771                 *boolAdditionalPtr = TRUE;
6772                 
6773             }
6774             
6775             // Look for semi-colon in property name and if there is then
6776             // quote the value.
6777             
6778             if (PropName != wxT("TYPE")){
6779                 
6780                 EscapeString(&strPropValue, FALSE);     
6781                 
6782             }
6783             
6784             if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6785                 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6786                 
6787                 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6788                 
6789             } else {
6790                 
6791                 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6792                 
6793             }
6794             
6795             *boolExtraPtr = TRUE;
6796             
6797         }
6798         
6799     }
6800     
6803 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6804                                               std::map<int,std::string>* MapData){
6805     
6806     int intIterVal = (*iterDataStringPtr)->first;
6807     
6808     //std::map<int,wxString>::iterator strIter;
6809     
6810     std::map<int,std::string>::iterator stdstrIter;
6811     
6812     stdstrIter = MapData->find(intIterVal);     
6813     
6814     if (stdstrIter->first == intIterVal){
6815         
6816         wxString strPropValue(stdstrIter->second.c_str(), wxConvUTF8);
6817         
6818         if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6819             
6820             strPropValue.Trim();
6821             strPropValue.Trim();
6822             
6823             if (*boolAdditionalPtr == TRUE){
6824                 
6825                 strPropertyPtr->Append(wxT(";"));
6826                 
6827             } else {
6828                 
6829                 *boolAdditionalPtr = TRUE;
6830                 
6831             }
6832             
6833             strPropertyPtr->Append(strPropValue);
6834             
6835             *boolExtraPtr = TRUE;
6836             
6837             return;
6838             
6839         }
6840         
6841         if (!strPropValue.IsEmpty()){
6842             
6843             strPropValue.Trim();
6844             strPropValue.Trim();
6845             
6846             if (*boolAdditionalPtr == TRUE){
6847                 
6848                 strPropertyPtr->Append(wxT(";"));
6849                 
6850             } else {
6851                 
6852                 *boolAdditionalPtr = TRUE;
6853                 
6854             }
6855             
6856             // Look for semi-colon in property name and if there is then
6857             // quote the value.
6858             
6859             if (PropName != wxT("TYPE")){
6860                 
6861                 EscapeString(&strPropValue, FALSE);
6862                 
6863             }
6864             
6865             if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6866                 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6867                 
6868                 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6869                 
6870             } else {
6871                 
6872                 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6873                 
6874             }
6875             
6876             *boolExtraPtr = TRUE;
6877             
6878         }
6879         
6880     }
6881     
6885 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6886                                               std::map<int,int>* MapData){
6887     
6888     int intIterVal = (*iterDataStringPtr)->first;
6889     
6890     std::map<int,int>::iterator intIter;
6891     
6892     intIter = MapData->find(intIterVal);
6893     
6894     int intPropValue; 
6895     
6896     if (intIter->first == intIterVal){
6897         
6898         intPropValue = intIter->second;
6899         
6900         if (intPropValue){
6901             
6902             if (*boolAdditionalPtr == TRUE){
6903                 
6904                 strPropertyPtr->Append(wxT(";"));
6905                 
6906             } else {
6907                 
6908                 *boolAdditionalPtr = TRUE;
6909                 
6910             }
6911             
6912             strPropertyPtr->Append(PropName + wxT("=") + wxString::Format(wxT("%i"), intPropValue));
6913             
6914             *boolExtraPtr = TRUE;
6915             
6916         }
6917         
6918     }
6919     
6922 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6923                                               std::map<int,wxString>* MapData){
6924     
6925     int intIterVal;
6926     
6927     intIterVal = (*iterDataStringPtr)->first;
6928     
6929     std::map<int,wxString>::iterator strIter;
6930     
6931     strIter = MapData->find(intIterVal);
6932     
6933     wxString strPropValue;
6934     
6935     if (strIter->first == intIterVal){
6936         
6937         strPropValue = strIter->second;
6938         
6939         if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6940             
6941             strPropValue.Trim();
6942             strPropValue.Trim();
6943             
6944             if (*boolAdditionalPtr == TRUE){
6945                 
6946                 strPropertyPtr->Append(wxT(";"));
6947                 
6948             } else {
6949                 
6950                 *boolAdditionalPtr = TRUE;
6951                 
6952             }
6953             
6954             strPropertyPtr->Append(strPropValue);       
6955             
6956             *boolExtraPtr = TRUE;
6957             
6958             return;
6959             
6960         }
6961         
6962         if (!strPropValue.IsEmpty()){
6963             
6964             strPropValue.Trim();
6965             strPropValue.Trim();
6966             
6967             if (*boolAdditionalPtr == TRUE){
6968                 
6969                 strPropertyPtr->Append(wxT(";"));
6970                 
6971             } else {
6972                 
6973                 *boolAdditionalPtr = TRUE;
6974                 
6975             }
6976             
6977             // Look for semi-colon in property name and if there is then
6978             // quote the value.
6979             
6980             if (PropName != wxT("TYPE")){
6981                 
6982                 EscapeString(&strPropValue, FALSE);
6983                 
6984             }
6985             
6986             if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6987                 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6988                 
6989                 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6990                 
6991             } else {
6992                 
6993                 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6994                 
6995             }
6996             
6997             *boolExtraPtr = TRUE;
6998             
6999         }
7000         
7001     }
7002     
7005 void frmContactEditor::ProcessCaptureStringsProc(wxString *strCapture){
7006     
7007     CaptureString(strCapture, FALSE);
7008     
7011 void frmContactEditor::ResetSaveProcessData(){
7012     
7013     strValue.Clear();
7014     strValue2.Clear();
7015     strValue3.Clear();    
7016     
7017     boolValue = FALSE;
7018     boolValue2 = FALSE;    
7019     intValue2 = 0;
7020     intValue  = 0;
7021     
7024 void frmContactEditor::SetupPointers(frmActivityMgr *ActMgr, wxETagProcessTimer *ETagProc,
7025                                      frmMain *MainPtrInc){
7026     
7027     ActMgrPtr = ActMgr;
7028     ETagTmrPtr = ETagProc;
7029     MainPtr = MainPtrInc;
7030     
7033 void frmContactEditor::ClearContact(){
7034     
7035     // Clear out the GUI and values.
7036     
7037     // Clear GUI.
7038     
7039     txtTitle->Clear();
7040     txtForename->Clear();
7041     txtSurname->Clear();
7042     txtOtherNames->Clear();
7043     txtSuffix->Clear();
7044     cmbDisplayAs->Clear();
7045     cmbDisplayAs->SetValue(wxT(""));
7046     wxDateTime EmptyDate;
7047     wxBitmap EmptyBitmap;
7048     dapAnniversary->SetValue(EmptyDate);
7049     dapBirthday->SetValue(EmptyDate);
7050     txtBirthday->Clear();
7051     txtAnniversary->Clear();
7052     cmbGender->Select(0);
7053     txtGenderDescription->Clear();
7054     
7055     lboNicknames->DeleteAllItems();
7056     lboHomeNicknames->DeleteAllItems();
7057     lboBusinessNicknames->DeleteAllItems();
7058     
7059     lboAddresses->DeleteAllItems();
7060     lboHomeAddresses->DeleteAllItems();
7061     lboBusinessAddresses->DeleteAllItems();
7062     
7063     lboEmails->DeleteAllItems();
7064     lboHomeEmails->DeleteAllItems();
7065     lboBusinessEmail->DeleteAllItems();
7066     
7067     lboIM->DeleteAllItems();
7068     lboHomeIM->DeleteAllItems();
7069     lboBusinessIM->DeleteAllItems();
7070     
7071     lboTelephone->DeleteAllItems();
7072     lboHomeTelephone->DeleteAllItems();
7073     lboBusinessTelephone->DeleteAllItems();
7074     
7075     lboLanguages->DeleteAllItems();
7076     lboHomeLanguages->DeleteAllItems();
7077     lboBusinessLanguages->DeleteAllItems();
7078     
7079     lboTimezones->DeleteAllItems();
7080     lboHomeTimezones->DeleteAllItems();
7081     lboBusinessTimezones->DeleteAllItems();
7082     
7083     lboGeoposition->DeleteAllItems();
7084     lboHomeGeoposition->DeleteAllItems();
7085     lboBusinessGeoposition->DeleteAllItems();
7086     
7087     lboRelated->DeleteAllItems();
7088     
7089     lboWebsites->DeleteAllItems();
7090     lboHomeWebsites->DeleteAllItems();
7091     lboBusinessWebsites->DeleteAllItems();
7092     
7093     lboTitles->DeleteAllItems();
7094     lboHomeTitles->DeleteAllItems();
7095     lboBusinessTitles->DeleteAllItems();
7096     
7097     lboRoles->DeleteAllItems();
7098     lboHomeRoles->DeleteAllItems();
7099     lboBusinessRoles->DeleteAllItems();
7100     
7101     lboOrganisations->DeleteAllItems();
7102     lboHomeOrganisations->DeleteAllItems();
7103     lboBusinessOrganisations->DeleteAllItems();
7104     
7105     lboNotes->DeleteAllItems();
7106     lboHomeNotes->DeleteAllItems();
7107     lboBusinessNotes->DeleteAllItems();
7108     
7109     lboCategories->DeleteAllItems();
7110     
7111     lboGroups->DeleteAllItems();
7112     
7113     // Clear Picture
7114     lboPictures->DeleteAllItems();
7115     imgPicture->SetBitmap(EmptyBitmap);
7116     
7117     // Clear Logo
7118     lboLogos->DeleteAllItems();
7119     imgLogo->SetBitmap(EmptyBitmap);
7120     
7121     lboSounds->DeleteAllItems();
7122     
7123     lboCalendarAddresses->DeleteAllItems();
7124     lboCalendarRequestAddress->DeleteAllItems();
7125     lboFreeBusyAddresses->DeleteAllItems();
7126     
7127     lboKeys->DeleteAllItems();
7128     
7129     lboVendorNamespace->DeleteAllItems();
7130     lboXToken->DeleteAllItems();
7131     
7132     // Clear values out.
7133     
7134     wxString NameTitle;
7135     wxString NameForename;
7136     wxString NameSurname;
7137     wxString NameOtherNames;
7138     wxString NameSuffix;
7139     wxString NameNickname;
7140     wxString NameDisplayAs;
7141     wxString NameLanguage;
7142     wxString NameAltID;
7143     wxString NameTokens;
7144     
7145     wxString Birthday;
7146     wxString BirthdayAltID;
7147     wxString BirthdayCalScale;
7148     wxString BirthdayTokens;
7149     wxString Anniversary;
7150     wxString AnniversaryAltID;
7151     wxString AnniversaryCalScale;
7152     wxString AnniversaryTokens;
7153     
7154     wxString Gender;
7155     wxString GenderDetails;
7156     wxString GenderTokens;
7157     
7158     wxString UIDToken;
7159     
7160     /* We don't use these at the moment but we want to keep
7161      them for compatability reasons */
7162     
7163     /*std::map<int, wxString> ExtraFullNames;*/
7164     /*std::map<int, wxString> ExtraNicknames;*/
7165     
7166     FullNamesList.clear();    
7167     FullNamesListType.clear();
7168     FullNamesListLanguage.clear();
7169     FullNamesListAltID.clear();
7170     FullNamesListPID.clear();
7171     FullNamesListTokens.clear();
7172     FullNamesListPref.clear();
7173     
7174     GeneralNicknamesList.clear();
7175     GeneralNicknamesListType.clear();
7176     GeneralNicknamesListLanguage.clear();
7177     GeneralNicknamesListAltID.clear();
7178     GeneralNicknamesListPID.clear();
7179     GeneralNicknamesListTokens.clear();        
7180     GeneralNicknamesListPref.clear();        
7181     
7182     GeneralAddressList.clear();
7183     GeneralAddressListTown.clear();
7184     GeneralAddressListCounty.clear();
7185     GeneralAddressListPostCode.clear();
7186     GeneralAddressListCountry.clear();
7187     GeneralAddressListLabel.clear();
7188     GeneralAddressListLang.clear();        
7189     GeneralAddressListAltID.clear();
7190     GeneralAddressListPID.clear();
7191     GeneralAddressListTokens.clear();
7192     GeneralAddressListGeo.clear();
7193     GeneralAddressListTimezone.clear();        
7194     GeneralAddressListType.clear();
7195     GeneralAddressListMediatype.clear();
7196     GeneralAddressListPref.clear();
7197     
7198     GeneralEmailList.clear();
7199     GeneralEmailListAltID.clear();
7200     GeneralEmailListPID.clear();
7201     GeneralEmailListType.clear();
7202     GeneralEmailListTokens.clear();
7203     GeneralEmailListPref.clear();
7204     
7205     GeneralIMList.clear();
7206     GeneralIMListAltID.clear();
7207     GeneralIMListPID.clear();
7208     GeneralIMListType.clear();
7209     GeneralIMListTokens.clear();
7210     GeneralIMListMediatype.clear();
7211     GeneralIMListPref.clear();
7212     
7213     GeneralTelephoneList.clear();
7214     GeneralTelephoneListAltID.clear();
7215     GeneralTelephoneListPID.clear();
7216     GeneralTelephoneListType.clear();
7217     GeneralTelephoneListTokens.clear();
7218     GeneralTelephoneListPref.clear();
7219     
7220     GeneralLanguageList.clear();
7221     GeneralLanguageListAltID.clear();
7222     GeneralLanguageListPID.clear();
7223     GeneralLanguageListType.clear();
7224     GeneralLanguageListTokens.clear();
7225     GeneralLanguageListPref.clear();
7226     
7227     GeneralTZList.clear();
7228     GeneralTZListAltID.clear();
7229     GeneralTZListPID.clear();
7230     GeneralTZListType.clear();
7231     GeneralTZListTokens.clear();
7232     GeneralTZListMediatype.clear();
7233     GeneralTZListPref.clear();
7234     
7235     GeneralGeographyList.clear();
7236     GeneralGeographyListAltID.clear();
7237     GeneralGeographyListPID.clear();
7238     GeneralGeographyListType.clear();
7239     GeneralGeographyListTokens.clear();
7240     GeneralGeographyListMediatype.clear();
7241     GeneralGeographyListPref.clear();
7242     
7243     GeneralRelatedList.clear();
7244     GeneralRelatedListRelType.clear();
7245     GeneralRelatedListLanguage.clear();
7246     GeneralRelatedListAltID.clear();
7247     GeneralRelatedListPID.clear();
7248     GeneralRelatedListType.clear();
7249     GeneralRelatedListTokens.clear();
7250     GeneralRelatedListPref.clear();
7251     
7252     GeneralWebsiteList.clear();
7253     GeneralWebsiteListAltID.clear();
7254     GeneralWebsiteListPID.clear();
7255     GeneralWebsiteListType.clear();
7256     GeneralWebsiteListTokens.clear();
7257     GeneralWebsiteListMediatype.clear();
7258     GeneralWebsiteListPref.clear();
7259     
7260     GeneralTitleList.clear();
7261     GeneralTitleListLanguage.clear();        
7262     GeneralTitleListAltID.clear();
7263     GeneralTitleListPID.clear();
7264     GeneralTitleListType.clear();
7265     GeneralTitleListTokens.clear();
7266     GeneralTitleListPref.clear();
7267     
7268     GeneralRoleList.clear();
7269     GeneralRoleListLanguage.clear();        
7270     GeneralRoleListAltID.clear();
7271     GeneralRoleListPID.clear();
7272     GeneralRoleListType.clear();
7273     GeneralRoleListTokens.clear();
7274     GeneralRoleListPref.clear();
7275     
7276     GeneralOrganisationsList.clear();
7277     GeneralOrganisationsListLanguage.clear();        
7278     GeneralOrganisationsListAltID.clear();
7279     GeneralOrganisationsListPID.clear();
7280     GeneralOrganisationsListType.clear();
7281     GeneralOrganisationsListTokens.clear();
7282     GeneralOrganisationsListSortAs.clear();
7283     GeneralOrganisationsListPref.clear();
7284     
7285     GeneralNoteList.clear();
7286     GeneralNoteListLanguage.clear();        
7287     GeneralNoteListAltID.clear();
7288     GeneralNoteListPID.clear();
7289     GeneralNoteListType.clear();
7290     GeneralNoteListTokens.clear();
7291     GeneralNoteListPref.clear();
7292     
7293     /* Items on Home Tab */        
7294     
7295     HomeNicknamesList.clear();
7296     HomeNicknamesListType.clear();
7297     HomeNicknamesListLanguage.clear();
7298     HomeNicknamesListAltID.clear();
7299     HomeNicknamesListPID.clear();
7300     HomeNicknamesListTokens.clear();        
7301     HomeNicknamesListPref.clear();        
7302     
7303     HomeAddressList.clear();
7304     HomeAddressListTown.clear();
7305     HomeAddressListCounty.clear();
7306     HomeAddressListPostCode.clear();
7307     HomeAddressListCountry.clear();
7308     HomeAddressListLabel.clear();
7309     HomeAddressListLang.clear();        
7310     HomeAddressListAltID.clear();
7311     HomeAddressListPID.clear();
7312     HomeAddressListTokens.clear();
7313     HomeAddressListGeo.clear();
7314     HomeAddressListTimezone.clear();        
7315     HomeAddressListType.clear();
7316     HomeAddressListMediatype.clear();
7317     HomeAddressListPref.clear();
7318     
7319     HomeEmailList.clear();
7320     HomeEmailListAltID.clear();
7321     HomeEmailListPID.clear();
7322     HomeEmailListType.clear();
7323     HomeEmailListTokens.clear();
7324     HomeEmailListPref.clear();
7325     
7326     HomeIMList.clear();
7327     HomeIMListAltID.clear();
7328     HomeIMListPID.clear();
7329     HomeIMListType.clear();
7330     HomeIMListTokens.clear();
7331     HomeIMListMediatype.clear();
7332     HomeIMListPref.clear();
7333     
7334     HomeTelephoneList.clear();
7335     HomeTelephoneListAltID.clear();
7336     HomeTelephoneListPID.clear();
7337     HomeTelephoneListType.clear();
7338     HomeTelephoneListTokens.clear();
7339     HomeTelephoneListPref.clear();
7340     
7341     HomeLanguageList.clear();
7342     HomeLanguageListAltID.clear();
7343     HomeLanguageListPID.clear();
7344     HomeLanguageListType.clear();
7345     HomeLanguageListTokens.clear();
7346     HomeLanguageListPref.clear();
7347     
7348     HomeTZList.clear();
7349     HomeTZListAltID.clear();
7350     HomeTZListPID.clear();
7351     HomeTZListType.clear();
7352     HomeTZListTokens.clear();
7353     HomeTZListMediatype.clear();
7354     HomeTZListPref.clear();
7355     
7356     HomeGeographyList.clear();
7357     HomeGeographyListAltID.clear();
7358     HomeGeographyListPID.clear();
7359     HomeGeographyListType.clear();
7360     HomeGeographyListTokens.clear();
7361     HomeGeographyListMediatype.clear();
7362     HomeGeographyListPref.clear();
7363     
7364     HomeRelatedList.clear();
7365     HomeRelatedListRelType.clear();
7366     HomeRelatedListLanguage.clear();
7367     HomeRelatedListAltID.clear();
7368     HomeRelatedListPID.clear();
7369     HomeRelatedListType.clear();
7370     HomeRelatedListTokens.clear();
7371     HomeRelatedListPref.clear();        
7372     
7373     HomeWebsiteList.clear();
7374     HomeWebsiteListAltID.clear();
7375     HomeWebsiteListPID.clear();
7376     HomeWebsiteListType.clear();
7377     HomeWebsiteListTokens.clear();
7378     HomeWebsiteListMediatype.clear();
7379     HomeWebsiteListPref.clear();
7380     
7381     HomeTitleList.clear();
7382     HomeTitleListLanguage.clear();
7383     HomeTitleListAltID.clear();
7384     HomeTitleListPID.clear();
7385     HomeTitleListType.clear();
7386     HomeTitleListTokens.clear();
7387     HomeTitleListPref.clear();
7388     
7389     HomeRoleList.clear();
7390     HomeRoleListLanguage.clear();        
7391     HomeRoleListAltID.clear();
7392     HomeRoleListPID.clear();
7393     HomeRoleListType.clear();
7394     HomeRoleListTokens.clear();
7395     HomeRoleListPref.clear();
7396     
7397     HomeOrganisationsList.clear();
7398     HomeOrganisationsListLanguage.clear();        
7399     HomeOrganisationsListAltID.clear();
7400     HomeOrganisationsListPID.clear();
7401     HomeOrganisationsListType.clear();
7402     HomeOrganisationsListTokens.clear();
7403     HomeOrganisationsListSortAs.clear();
7404     HomeOrganisationsListPref.clear();
7405     
7406     HomeNoteList.clear();
7407     HomeNoteListLanguage.clear();        
7408     HomeNoteListAltID.clear();
7409     HomeNoteListPID.clear();
7410     HomeNoteListType.clear();
7411     HomeNoteListTokens.clear();
7412     HomeNoteListPref.clear();        
7413     
7414     /* Items on the Business tab */
7415     
7416     BusinessNicknamesList.clear();
7417     BusinessNicknamesListType.clear();
7418     BusinessNicknamesListLanguage.clear();
7419     BusinessNicknamesListAltID.clear();
7420     BusinessNicknamesListPID.clear();
7421     BusinessNicknamesListTokens.clear();        
7422     BusinessNicknamesListPref.clear();        
7423     
7424     BusinessAddressList.clear();
7425     BusinessAddressListTown.clear();
7426     BusinessAddressListCounty.clear();
7427     BusinessAddressListPostCode.clear();
7428     BusinessAddressListCountry.clear();
7429     BusinessAddressListLabel.clear();
7430     BusinessAddressListLang.clear();        
7431     BusinessAddressListAltID.clear();
7432     BusinessAddressListPID.clear();
7433     BusinessAddressListTokens.clear();
7434     BusinessAddressListGeo.clear();
7435     BusinessAddressListTimezone.clear();        
7436     BusinessAddressListType.clear();
7437     BusinessAddressListMediatype.clear();
7438     BusinessAddressListPref.clear();
7439     
7440     BusinessEmailList.clear();
7441     BusinessEmailListAltID.clear();
7442     BusinessEmailListPID.clear();
7443     BusinessEmailListType.clear();
7444     BusinessEmailListTokens.clear();
7445     BusinessEmailListPref.clear();
7446     
7447     BusinessIMList.clear();
7448     BusinessIMListAltID.clear();
7449     BusinessIMListPID.clear();
7450     BusinessIMListType.clear();
7451     BusinessIMListTokens.clear();
7452     BusinessIMListMediatype.clear();
7453     BusinessIMListPref.clear();
7454     
7455     BusinessTelephoneList.clear();
7456     BusinessTelephoneListAltID.clear();
7457     BusinessTelephoneListPID.clear();
7458     BusinessTelephoneListType.clear();
7459     BusinessTelephoneListTokens.clear();
7460     BusinessTelephoneListPref.clear();
7461     
7462     BusinessLanguageList.clear();
7463     BusinessLanguageListAltID.clear();
7464     BusinessLanguageListPID.clear();
7465     BusinessLanguageListType.clear();
7466     BusinessLanguageListTokens.clear();
7467     BusinessLanguageListPref.clear();
7468     
7469     BusinessTZList.clear();
7470     BusinessTZListAltID.clear();
7471     BusinessTZListPID.clear();
7472     BusinessTZListType.clear();
7473     BusinessTZListTokens.clear();
7474     BusinessTZListMediatype.clear();
7475     BusinessTZListPref.clear();
7476     
7477     BusinessGeographyList.clear();
7478     BusinessGeographyListAltID.clear();
7479     BusinessGeographyListPID.clear();
7480     BusinessGeographyListType.clear();
7481     BusinessGeographyListTokens.clear();
7482     BusinessGeographyListMediatype.clear();
7483     BusinessGeographyListPref.clear();
7484     
7485     BusinessRelatedList.clear();
7486     BusinessRelatedListRelType.clear();
7487     BusinessRelatedListLanguage.clear();
7488     BusinessRelatedListAltID.clear();
7489     BusinessRelatedListPID.clear();
7490     BusinessRelatedListType.clear();
7491     BusinessRelatedListTokens.clear();
7492     BusinessRelatedListPref.clear();            
7493     
7494     BusinessWebsiteList.clear();
7495     BusinessWebsiteListAltID.clear();
7496     BusinessWebsiteListPID.clear();
7497     BusinessWebsiteListType.clear();
7498     BusinessWebsiteListTokens.clear();
7499     BusinessWebsiteListMediatype.clear();
7500     BusinessWebsiteListPref.clear();
7501     
7502     BusinessTitleList.clear();
7503     BusinessTitleListLanguage.clear();        
7504     BusinessTitleListAltID.clear();
7505     BusinessTitleListPID.clear();
7506     BusinessTitleListType.clear();
7507     BusinessTitleListTokens.clear();
7508     BusinessTitleListPref.clear();
7509     
7510     BusinessRoleList.clear();
7511     BusinessRoleListLanguage.clear();        
7512     BusinessRoleListAltID.clear();
7513     BusinessRoleListPID.clear();
7514     BusinessRoleListType.clear();
7515     BusinessRoleListTokens.clear();
7516     BusinessRoleListPref.clear();
7517     
7518     BusinessOrganisationsList.clear();
7519     BusinessOrganisationsListLanguage.clear();        
7520     BusinessOrganisationsListAltID.clear();
7521     BusinessOrganisationsListPID.clear();
7522     BusinessOrganisationsListType.clear();
7523     BusinessOrganisationsListTokens.clear();
7524     BusinessOrganisationsListSortAs.clear();        
7525     BusinessOrganisationsListPref.clear();
7526     
7527     BusinessNoteList.clear();
7528     BusinessNoteListLanguage.clear();        
7529     BusinessNoteListAltID.clear();
7530     BusinessNoteListPID.clear();
7531     BusinessNoteListType.clear();
7532     BusinessNoteListTokens.clear();
7533     BusinessNoteListPref.clear();        
7534     
7535     /* Items on the Categories tab */
7536     
7537     CategoriesList.clear();
7538     CategoriesListAltID.clear();
7539     CategoriesListPID.clear();
7540     CategoriesListType.clear();
7541     CategoriesListTokens.clear();
7542     CategoriesListPref.clear();    
7543     
7544     /* Items on the Groups tab */
7545     
7546     GroupsList.clear();
7547     GroupsListAltID.clear();
7548     GroupsListPID.clear();
7549     GroupsListType.clear();
7550     GroupsListTokens.clear();
7551     GroupsListPref.clear();
7552     
7553     /* Items on the Pictures tab */
7554     
7555     PicturesList.clear();
7556     PicturesListAltID.clear();
7557     PicturesListPID.clear();
7558     PicturesListType.clear();
7559     PicturesListPicEncType.clear();
7560     PicturesListPictureType.clear();
7561     PicturesListTokens.clear();
7562     PicturesListMediatype.clear();        
7563     PicturesListPref.clear();
7564     
7565     /* Items on the Logos tab */
7566     
7567     LogosList.clear();
7568     LogosListAltID.clear();
7569     LogosListPID.clear();
7570     LogosListType.clear();
7571     LogosListPicEncType.clear();        
7572     LogosListPictureType.clear();
7573     LogosListTokens.clear();
7574     LogosListMediatype.clear();        
7575     LogosListPref.clear();
7576     
7577     /* Items on the Sounds tab */
7578     
7579     SoundsList.clear();
7580     SoundsListAltID.clear();
7581     SoundsListPID.clear();
7582     SoundsListType.clear();
7583     SoundsListAudioEncType.clear();        
7584     SoundsListAudioType.clear();        
7585     SoundsListTokens.clear();
7586     SoundsListMediatype.clear();        
7587     SoundsListPref.clear();    
7588     
7589     /* Items on the Calendaring tab */
7590     
7591     CalendarList.clear();
7592     CalendarListAltID.clear();
7593     CalendarListPID.clear();
7594     CalendarListType.clear();
7595     CalendarListTokens.clear();
7596     CalendarListMediatype.clear();        
7597     CalendarListPref.clear();
7598     
7599     CalendarRequestList.clear();
7600     CalendarRequestListAltID.clear();
7601     CalendarRequestListPID.clear();
7602     CalendarRequestListType.clear();
7603     CalendarRequestListTokens.clear();
7604     CalendarRequestListMediatype.clear();        
7605     CalendarRequestListPref.clear();        
7606     
7607     FreeBusyList.clear();
7608     FreeBusyListAltID.clear();
7609     FreeBusyListPID.clear();
7610     FreeBusyListType.clear();
7611     FreeBusyListTokens.clear();
7612     FreeBusyListMediatype.clear();        
7613     FreeBusyListPref.clear();
7614     
7615     /* Items on the Security tab */
7616     
7617     KeyList.clear();
7618     KeyListAltID.clear();
7619     KeyListPID.clear();
7620     KeyListKeyType.clear();        
7621     KeyListDataType.clear();        
7622     KeyListDataEncType.clear();
7623     KeyListType.clear();
7624     KeyListTokens.clear();
7625     KeyListPref.clear();
7626     
7627     /* Items on the Other tab */
7628     
7629     VendorList.clear();
7630     VendorListPEN.clear();
7631     VendorListElement.clear();
7632     
7633     XTokenList.clear();        
7634     XTokenListTokens.clear();
7635     
7636     wxSContactFilename.Clear();
7637     boolContactModified = FALSE;
7638     intSeekSelectedData = 0;
7639     
7640     /* Section for saving/loading data */
7641     
7642     ETag.Clear();
7643     ETagOriginal.Clear();
7644     
7645     strValue.Clear();
7646     strValue2.Clear();
7647     strValue3.Clear();
7648     
7649     boolValue = FALSE;
7650     boolValue2 = FALSE;
7651     intValue = 0;
7652     intValue2 = 0;
7653     intValue3 = 0;
7654     BinaryDataProc = FALSE;
7655     EditMode = TRUE;
7656     DialogOpen = FALSE;
7657     
7658     PictureImage = wxNullBitmap;
7659     LogoImage = wxNullBitmap;
7660     
7663 void frmContactEditor::ContactFileChanged( wxCommandEvent &event ){
7664     
7665     // Stop the timer.
7666     
7667     FMTimer.Stop();
7668     
7669     // Check if a dialog is already open.
7670     
7671     if (DialogOpen == TRUE){
7672         
7673         FMTimer.Start(1000, FALSE);
7674         return;
7675         
7676     }
7677     
7678     // Bring up a Yes/No modal dialog asking if the changed file should be reloaded.
7679     
7680     int QuestionResponse;
7681     
7682     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);
7683     
7684     if (QuestionResponse == wxYES){
7685         
7686         // Reload the contact.
7687         wxString wxSReloadContactName = wxSContactFilename;
7688         ClearContact();
7689         LoadContact(wxSReloadContactName);
7690         
7691     } else {
7692         
7693         // Do nothing other than update the timestamp so this message
7694         // doesn't appear until the next time it changes.
7695         
7696         FMTimer.UpdateTimestamp();
7697         
7698     }  
7699     
7700     // Start the timer.
7701     
7702     FMTimer.Start();
7703     
7706 void frmContactEditor::UpdateMembersTab( wxCommandEvent &event ){
7707     
7708     if (cmbType->GetCurrentSelection() == 2){
7709         
7710         tabMembers->Show();     
7711         
7712     } else {
7713         
7714         tabMembers->Hide();
7715         
7716     }
7717     
7720 void frmContactEditor::SetUID(int UID){
7721     
7722     ContactEditorUID = UID;
7723     
7726 void frmContactEditor::UpdateDisplayAs( wxCommandEvent &event ){
7727     
7728     // Generate a drop down list of common names to use for the display as drop down box.
7729     
7730     wxString SetValue = cmbDisplayAs->GetValue();
7731     
7732     cmbDisplayAs->Clear();
7733     cmbDisplayAs->Append(txtForename->GetValue() + wxT(" ") + txtSurname->GetValue());
7734     if (!txtOtherNames->GetValue().IsEmpty()){
7735         
7736         cmbDisplayAs->Append(txtForename->GetValue() + wxT(" ") + txtOtherNames->GetValue()  + wxT(" ") + txtForename->GetValue());     
7737         
7738     }
7739     cmbDisplayAs->Append(txtSurname->GetValue() + wxT(", ") + txtForename->GetValue()); 
7740     if (!txtOtherNames->GetValue().IsEmpty()){
7741         
7742         cmbDisplayAs->Append(txtForename->GetValue() + wxT(", ") + wxT(" ") + txtForename->GetValue() + wxT(" ") + txtOtherNames->GetValue());
7743         
7744     }
7745     if (!txtTitle->GetValue().IsEmpty()){
7746         cmbDisplayAs->Append(txtTitle->GetValue() + wxT(" ") + txtSurname->GetValue() + wxT(" ") + txtForename->GetValue());
7747     }
7748     
7749     cmbDisplayAs->SetValue(SetValue);
7750     
7751     this->SetTitle(cmbDisplayAs->GetValue());
7752     
7755 void frmContactEditor::UpdateName( wxCommandEvent &event ){
7756     
7757     this->SetTitle(cmbDisplayAs->GetValue());
7758     
7759     WindowData *WData = new WindowData;
7760     
7761     WData->DataType = 1;
7762     WData->WindowPointer = this;
7763     WData->WindowID = ContactEditorUID;
7764     
7765     wxCommandEvent editevent(WINDOW_EDIT);
7766     editevent.SetClientData(WData);
7767     wxPostEvent(GetParent(), editevent);
7768     
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