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"
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
78 // Replace intResult with intValueSeek.
80 BEGIN_EVENT_TABLE(frmContactEditor, wxFrame)
81 EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, frmContactEditor::ContactFileChanged)
84 frmContactEditor::frmContactEditor( wxWindow* parent )
86 frmContactEditorADT( parent )
88 boolContactModified = FALSE;
90 dapAnniversary->SetValue(NoDate);
91 dapBirthday->SetValue(NoDate);
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);
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);
106 FMTimer.SetupPointers(this);
107 //wxIcon contacticon;
108 //contacticon.CopyFromBitmap(contacticonbmp);
112 void frmContactEditor::AddGeneralNickname( wxCommandEvent& event )
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,
128 frameCENickname->ShowModal();
129 delete frameCENickname;
130 frameCENickname = NULL;
133 void frmContactEditor::ModifyGeneralNickname( wxCommandEvent& event )
136 long longSelected = -1;
137 int intSelectedData = 0;
139 if (!GetSelectedItem(lboNicknames,
145 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
146 frameCENickname->SetupPointers(&GeneralNicknamesList,
147 &GeneralNicknamesListAltID,
148 &GeneralNicknamesListPID,
149 &GeneralNicknamesListType,
150 &GeneralNicknamesListLanguage,
151 &GeneralNicknamesListTokens,
152 &GeneralNicknamesListPref,
155 frameCENickname->SetEditorMode(TRUE, CE_GENERAL);
156 frameCENickname->ShowModal();
157 delete frameCENickname;
158 frameCENickname = NULL;
162 void frmContactEditor::DeleteGeneralNickname( wxCommandEvent& event )
165 long longSelected = -1;
166 int intSelectedData = 0;
168 if (!GetSelectedItem(lboNicknames,
174 lboNicknames->DeleteItem(longSelected);
176 DeleteMapData(intSelectedData,
177 &GeneralNicknamesList,
178 &GeneralNicknamesListLanguage,
179 &GeneralNicknamesListAltID,
180 &GeneralNicknamesListPID,
181 &GeneralNicknamesListTokens,
182 &GeneralNicknamesListType,
183 &GeneralNicknamesListPref);
187 void frmContactEditor::AddGeneralAddress( wxCommandEvent& event )
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,
212 frameCEAddress->ShowModal();
213 delete frameCEAddress;
214 frameCEAddress = NULL;
217 void frmContactEditor::ModifyGeneralAddress( wxCommandEvent& event )
220 long longSelected = -1;
221 int intSelectedData = 0;
223 if (!GetSelectedItem(lboAddresses,
229 if (longSelected == -1){
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,
251 frameCEAddress->SetEditorMode(TRUE, CE_GENERAL);
252 frameCEAddress->ShowModal();
253 delete frameCEAddress;
254 frameCEAddress = NULL;
258 void frmContactEditor::DeleteGeneralAddress( wxCommandEvent& event )
261 long longSelected = -1;
262 int intSelectedData = 0;
264 if (!GetSelectedItem(lboAddresses,
270 lboAddresses->DeleteItem(longSelected);
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);
284 void frmContactEditor::AddGeneralEmail( wxCommandEvent& event )
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,
299 frameCEEmail->ShowModal();
304 void frmContactEditor::ModifyGeneralEmail( wxCommandEvent& event )
306 long longSelected = -1;
307 int intSelectedData = 0;
309 if (!GetSelectedItem(lboEmails,
315 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
316 frameCEEmail->SetupPointers(&GeneralEmailList,
317 &GeneralEmailListAltID,
318 &GeneralEmailListPID,
319 &GeneralEmailListType,
320 &GeneralEmailListTokens,
321 &GeneralEmailListPref,
324 frameCEEmail->SetEditorMode(TRUE, CE_GENERAL);
325 frameCEEmail->ShowModal();
330 void frmContactEditor::DeleteGeneralEmail( wxCommandEvent& event )
332 long longSelected = -1;
333 int intSelectedData = 0;
335 if (!GetSelectedItem(lboEmails,
341 lboEmails->DeleteItem(longSelected);
343 DeleteMapData(intSelectedData, &GeneralEmailList,
344 &GeneralEmailListAltID, &GeneralEmailListPID,
345 &GeneralEmailListType, &GeneralEmailListTokens,
346 &GeneralEmailListPref);
350 void frmContactEditor::AddGeneralIM( wxCommandEvent& event )
354 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
355 frameCEIM->SetEditorMode(FALSE, CE_GENERAL);
356 intResult = GetLastInt(&GeneralIMList);
357 frameCEIM->SetupPointers(&GeneralIMList,
361 &GeneralIMListTokens,
362 &GeneralIMListMediatype,
366 frameCEIM->ShowModal();
371 void frmContactEditor::ModifyGeneralIM( wxCommandEvent& event )
373 long longSelected = -1;
374 int intSelectedData = 0;
376 if (!GetSelectedItem(lboIM,
382 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
383 frameCEIM->SetupPointers(&GeneralIMList,
387 &GeneralIMListTokens,
388 &GeneralIMListMediatype,
392 frameCEIM->SetEditorMode(TRUE, CE_GENERAL);
393 frameCEIM->ShowModal();
398 void frmContactEditor::DeleteGeneralIM( wxCommandEvent& event )
400 long longSelected = -1;
401 int intSelectedData = 0;
403 if (!GetSelectedItem(lboIM,
409 lboIM->DeleteItem(longSelected);
411 DeleteMapData(intSelectedData, &GeneralIMList,
412 &GeneralIMListAltID, &GeneralIMListPID,
413 &GeneralIMListType, &GeneralIMListTokens,
414 &GeneralIMListMediatype, &GeneralIMListPref);
418 void frmContactEditor::AddGeneralTelephone( wxCommandEvent& event )
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,
433 frameCETel->ShowModal();
438 void frmContactEditor::ModifyGeneralTelephone( wxCommandEvent& event )
440 long longSelected = -1;
441 int intSelectedData = 0;
443 if (!GetSelectedItem(lboTelephone,
449 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
450 frameCETel->SetupPointers(&GeneralTelephoneList,
451 &GeneralTelephoneListAltID,
452 &GeneralTelephoneListPID,
453 &GeneralTelephoneListType,
454 &GeneralTelephoneListTokens,
455 &GeneralTelephoneListPref,
458 frameCETel->SetEditorMode(TRUE, CE_GENERAL);
459 frameCETel->ShowModal();
464 void frmContactEditor::DeleteGeneralTelephone( wxCommandEvent& event )
466 long longSelected = -1;
467 int intSelectedData = 0;
469 if (!GetSelectedItem(lboTelephone,
475 lboTelephone->DeleteItem(longSelected);
477 DeleteMapData(intSelectedData, &GeneralTelephoneList,
478 &GeneralTelephoneListAltID, &GeneralTelephoneListPID,
479 &GeneralTelephoneListType, &GeneralTelephoneListTokens,
480 &GeneralTelephoneListPref);
484 void frmContactEditor::AddGeneralLanguages( wxCommandEvent& event )
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,
499 frameCELang->ShowModal();
504 void frmContactEditor::ModifyGeneralLanguages( wxCommandEvent& event )
506 long longSelected = -1;
507 int intSelectedData = 0;
509 if (!GetSelectedItem(lboLanguages,
515 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
516 frameCELang->SetupPointers(&GeneralLanguageList,
517 &GeneralLanguageListAltID,
518 &GeneralLanguageListPID,
519 &GeneralLanguageListType,
520 &GeneralLanguageListTokens,
521 &GeneralLanguageListPref,
524 frameCELang->SetEditorMode(TRUE, CE_GENERAL);
525 frameCELang->ShowModal();
530 void frmContactEditor::DeleteGeneralLanguage( wxCommandEvent& event )
532 long longSelected = -1;
533 int intSelectedData = 0;
535 if (!GetSelectedItem(lboLanguages,
541 lboLanguages->DeleteItem(longSelected);
543 DeleteMapData(intSelectedData, &GeneralLanguageList,
544 &GeneralLanguageListAltID, &GeneralLanguageListPID,
545 &GeneralLanguageListType, &GeneralLanguageListTokens,
546 &GeneralLanguageListPref);
550 void frmContactEditor::AddGeneralTimezone( wxCommandEvent& event )
554 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
555 frameCETZ->SetEditorMode(FALSE, CE_GENERAL);
556 intResult = GetLastInt(&GeneralTZList);
557 frameCETZ->SetupPointers(&GeneralTZList,
561 &GeneralTZListTokens,
562 &GeneralTZListMediatype,
566 frameCETZ->ShowModal();
571 void frmContactEditor::ModifyGeneralTimezone( wxCommandEvent& event )
573 long longSelected = -1;
574 int intSelectedData = 0;
576 if (!GetSelectedItem(lboTimezones,
582 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
583 frameCETZ->SetupPointers(&GeneralTZList,
587 &GeneralTZListTokens,
588 &GeneralTZListMediatype,
592 frameCETZ->SetEditorMode(TRUE, CE_GENERAL);
593 frameCETZ->ShowModal();
598 void frmContactEditor::DeleteGeneralTimezone( wxCommandEvent& event )
600 long longSelected = -1;
601 int intSelectedData = 0;
603 if (!GetSelectedItem(lboTimezones,
609 lboTimezones->DeleteItem(longSelected);
611 DeleteMapData(intSelectedData, &GeneralTZList,
612 &GeneralTZListAltID, &GeneralTZListPID,
613 &GeneralTZListType, &GeneralTZListTokens,
614 &GeneralTZListMediatype, &GeneralTZListPref);
618 void frmContactEditor::AddGeneralGeoposition( wxCommandEvent& event )
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,
634 frameCEGeo->ShowModal();
639 void frmContactEditor::ModifyGeneralGeoposition( wxCommandEvent& event )
641 long longSelected = -1;
642 int intSelectedData = 0;
644 if (!GetSelectedItem(lboGeoposition,
650 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
651 frameCEGeo->SetupPointers(&GeneralGeographyList,
652 &GeneralGeographyListAltID,
653 &GeneralGeographyListPID,
654 &GeneralGeographyListType,
655 &GeneralGeographyListTokens,
656 &GeneralGeographyListMediatype,
657 &GeneralGeographyListPref,
660 frameCEGeo->SetEditorMode(TRUE, CE_GENERAL);
661 frameCEGeo->ShowModal();
666 void frmContactEditor::DeleteGeneralGeoposition( wxCommandEvent& event )
668 long longSelected = -1;
669 int intSelectedData = 0;
671 if (!GetSelectedItem(lboGeoposition,
677 lboGeoposition->DeleteItem(longSelected);
679 DeleteMapData(intSelectedData, &GeneralGeographyList,
680 &GeneralGeographyListAltID, &GeneralGeographyListPID,
681 &GeneralGeographyListType, &GeneralGeographyListTokens,
682 &GeneralGeographyListMediatype, &GeneralGeographyListPref);
686 void frmContactEditor::AddGeneralRelated( wxCommandEvent& event )
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,
702 frameCERel->ShowModal();
707 void frmContactEditor::ModifyGeneralRelated( wxCommandEvent& event )
709 long longSelected = -1;
710 int intSelectedData = 0;
712 if (!GetSelectedItem(lboRelated,
718 frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
719 frameCERel->SetupPointers(&GeneralRelatedList,
720 &GeneralRelatedListRelType,
721 &GeneralRelatedListAltID,
722 &GeneralRelatedListPID,
723 &GeneralRelatedListType,
724 &GeneralRelatedListTokens,
725 &GeneralRelatedListPref,
728 frameCERel->SetEditorMode(TRUE, CE_GENERAL);
729 frameCERel->ShowModal();
734 void frmContactEditor::DeleteGeneralRelated( wxCommandEvent& event )
736 long longSelected = -1;
737 int intSelectedData = 0;
739 if (!GetSelectedItem(lboRelated,
745 lboRelated->DeleteItem(longSelected);
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 )
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,
772 frameCEWeb->ShowModal();
777 void frmContactEditor::ModifyGeneralWebsite( wxCommandEvent& event )
779 long longSelected = -1;
780 int intSelectedData = 0;
782 if (!GetSelectedItem(lboWebsites,
788 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
789 frameCEWeb->SetupPointers(&GeneralWebsiteList,
790 &GeneralWebsiteListAltID,
791 &GeneralWebsiteListPID,
792 &GeneralWebsiteListType,
793 &GeneralWebsiteListTokens,
794 &GeneralWebsiteListMediatype,
795 &GeneralWebsiteListPref,
798 frameCEWeb->SetEditorMode(TRUE, CE_GENERAL);
799 frameCEWeb->ShowModal();
804 void frmContactEditor::DeleteGeneralWebsite( wxCommandEvent& event )
806 long longSelected = -1;
807 int intSelectedData = 0;
809 if (!GetSelectedItem(lboWebsites,
815 lboWebsites->DeleteItem(longSelected);
817 DeleteMapData(intSelectedData, &GeneralWebsiteList,
818 &GeneralWebsiteListAltID, &GeneralWebsiteListPID,
819 &GeneralWebsiteListType, &GeneralWebsiteListTokens,
820 &GeneralWebsiteListMediatype, &GeneralWebsiteListPref);
824 void frmContactEditor::AddGeneralTitle( wxCommandEvent& event )
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,
840 frameCETitle->ShowModal();
845 void frmContactEditor::ModifyGeneralTitle( wxCommandEvent& event )
847 long longSelected = -1;
848 int intSelectedData = 0;
850 if (!GetSelectedItem(lboTitles,
856 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
857 frameCETitle->SetupPointers(&GeneralTitleList,
858 &GeneralTitleListLanguage,
859 &GeneralTitleListAltID,
860 &GeneralTitleListPID,
861 &GeneralTitleListType,
862 &GeneralTitleListTokens,
863 &GeneralTitleListPref,
866 frameCETitle->SetEditorMode(TRUE, CE_GENERAL);
867 frameCETitle->ShowModal();
872 void frmContactEditor::DeleteGeneralTitle( wxCommandEvent& event )
874 long longSelected = -1;
875 int intSelectedData = 0;
877 if (!GetSelectedItem(lboTitles,
883 lboTitles->DeleteItem(longSelected);
885 DeleteMapData(intSelectedData, &GeneralTitleList,
886 &GeneralTitleListLanguage, &GeneralTitleListAltID,
887 &GeneralTitleListPID, &GeneralTitleListType,
888 &GeneralTitleListTokens, &GeneralTitleListPref);
892 void frmContactEditor::AddGeneralRole( wxCommandEvent& event )
896 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
897 frameCERole->SetEditorMode(FALSE, CE_GENERAL);
898 intResult = GetLastInt(&GeneralRoleList);
899 frameCERole->SetupPointers(&GeneralRoleList,
900 &GeneralRoleListLanguage,
901 &GeneralRoleListAltID,
903 &GeneralRoleListType,
904 &GeneralRoleListTokens,
905 &GeneralRoleListPref,
908 frameCERole->ShowModal();
913 void frmContactEditor::ModifyGeneralRole( wxCommandEvent& event )
915 long longSelected = -1;
916 int intSelectedData = 0;
918 if (!GetSelectedItem(lboRoles,
924 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
925 frameCERole->SetupPointers(&GeneralRoleList,
926 &GeneralRoleListLanguage,
927 &GeneralRoleListAltID,
929 &GeneralRoleListType,
930 &GeneralRoleListTokens,
931 &GeneralRoleListPref,
934 frameCERole->SetEditorMode(TRUE, CE_GENERAL);
935 frameCERole->ShowModal();
940 void frmContactEditor::DeleteGeneralRole( wxCommandEvent& event )
942 long longSelected = -1;
943 int intSelectedData = 0;
945 if (!GetSelectedItem(lboRoles,
951 lboRoles->DeleteItem(longSelected);
953 DeleteMapData(intSelectedData, &GeneralRoleList,
954 &GeneralRoleListLanguage, &GeneralRoleListAltID,
955 &GeneralRoleListPID, &GeneralRoleListType,
956 &GeneralRoleListTokens, &GeneralRoleListPref);
960 void frmContactEditor::AddGeneralOrganisation( wxCommandEvent& event )
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,
977 frameCEOrg->ShowModal();
982 void frmContactEditor::ModifyGeneralOrganisation( wxCommandEvent& event )
984 long longSelected = -1;
985 int intSelectedData = 0;
987 if (!GetSelectedItem(lboOrganisations,
993 frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
994 frameCEOrg->SetupPointers(&GeneralOrganisationsList,
995 &GeneralOrganisationsListLanguage,
996 &GeneralOrganisationsListSortAs,
997 &GeneralOrganisationsListAltID,
998 &GeneralOrganisationsListPID,
999 &GeneralOrganisationsListType,
1000 &GeneralOrganisationsListTokens,
1001 &GeneralOrganisationsListPref,
1004 frameCEOrg->SetEditorMode(TRUE, CE_GENERAL);
1005 frameCEOrg->ShowModal();
1010 void frmContactEditor::DeleteGeneralOrganisation( wxCommandEvent& event )
1012 long longSelected = -1;
1013 int intSelectedData = 0;
1015 if (!GetSelectedItem(lboOrganisations,
1021 lboOrganisations->DeleteItem(longSelected);
1023 DeleteMapData(intSelectedData, &GeneralOrganisationsList,
1024 &GeneralOrganisationsListLanguage, &GeneralOrganisationsListSortAs,
1025 &GeneralOrganisationsListAltID, &GeneralOrganisationsListPID,
1026 &GeneralOrganisationsListType, &GeneralOrganisationsListTokens,
1027 &GeneralOrganisationsListPref);
1031 void frmContactEditor::AddGeneralNote( wxCommandEvent& event )
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,
1047 frameCENote->ShowModal();
1052 void frmContactEditor::ModifyGeneralNote( wxCommandEvent& event )
1054 long longSelected = -1;
1055 int intSelectedData = 0;
1057 if (!GetSelectedItem(lboNotes,
1063 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1064 frameCENote->SetupPointers(&GeneralNoteList,
1065 &GeneralNoteListLanguage,
1066 &GeneralNoteListAltID,
1067 &GeneralNoteListPID,
1068 &GeneralNoteListType,
1069 &GeneralNoteListTokens,
1070 &GeneralNoteListPref,
1073 frameCENote->SetEditorMode(TRUE, CE_GENERAL);
1074 frameCENote->ShowModal();
1079 void frmContactEditor::DeleteGeneralNote( wxCommandEvent& event )
1081 long longSelected = -1;
1082 int intSelectedData = 0;
1084 if (!GetSelectedItem(lboNotes,
1090 lboNotes->DeleteItem(longSelected);
1092 DeleteMapData(intSelectedData, &GeneralNoteList,
1093 &GeneralNoteListLanguage, &GeneralNoteListAltID,
1094 &GeneralNoteListPID, &GeneralNoteListType,
1095 &GeneralNoteListTokens, &GeneralNoteListPref);
1099 void frmContactEditor::AddHomeNickname( wxCommandEvent& event )
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,
1115 frameCENickname->ShowModal();
1116 delete frameCENickname;
1117 frameCENickname = NULL;
1120 void frmContactEditor::ModifyHomeNickname( wxCommandEvent& event )
1122 long longSelected = -1;
1123 int intSelectedData = 0;
1125 if (!GetSelectedItem(lboHomeNicknames,
1131 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
1132 frameCENickname->SetupPointers(&HomeNicknamesList,
1133 &HomeNicknamesListAltID,
1134 &HomeNicknamesListPID,
1135 &HomeNicknamesListType,
1136 &HomeNicknamesListLanguage,
1137 &HomeNicknamesListTokens,
1138 &HomeNicknamesListPref,
1141 frameCENickname->SetEditorMode(TRUE, CE_HOME);
1142 frameCENickname->ShowModal();
1143 delete frameCENickname;
1144 frameCENickname = NULL;
1147 void frmContactEditor::DeleteHomeNickname( wxCommandEvent& event )
1150 long longSelected = -1;
1151 int intSelectedData = 0;
1153 if (!GetSelectedItem(lboHomeNicknames,
1159 lboHomeNicknames->DeleteItem(longSelected);
1161 DeleteMapData(intSelectedData,
1163 &HomeNicknamesListLanguage,
1164 &HomeNicknamesListAltID,
1165 &HomeNicknamesListPID,
1166 &HomeNicknamesListTokens,
1167 &HomeNicknamesListType,
1168 &HomeNicknamesListPref);
1172 void frmContactEditor::AddHomeAddress( wxCommandEvent& event )
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,
1196 frameCEAddress->ShowModal();
1197 delete frameCEAddress;
1198 frameCEAddress = NULL;
1201 void frmContactEditor::ModifyHomeAddress( wxCommandEvent& event )
1203 long longSelected = -1;
1204 int intSelectedData = 0;
1206 if (!GetSelectedItem(lboHomeAddresses,
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,
1230 frameCEAddress->SetEditorMode(TRUE, CE_HOME);
1231 frameCEAddress->ShowModal();
1232 delete frameCEAddress;
1233 frameCEAddress = NULL;
1236 void frmContactEditor::DeleteHomeAddress( wxCommandEvent& event )
1239 long longSelected = -1;
1240 int intSelectedData = 0;
1242 if (!GetSelectedItem(lboHomeAddresses,
1248 lboHomeAddresses->DeleteItem(longSelected);
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);
1262 void frmContactEditor::AddHomeEmail( wxCommandEvent& event )
1266 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
1267 frameCEEmail->SetEditorMode(FALSE, CE_HOME);
1268 intResult = GetLastInt(&HomeAddressList);
1269 frameCEEmail->SetupPointers(&HomeEmailList,
1270 &HomeEmailListAltID,
1273 &HomeEmailListTokens,
1277 frameCEEmail->ShowModal();
1278 delete frameCEEmail;
1279 frameCEEmail = NULL;
1282 void frmContactEditor::ModifyHomeEmail( wxCommandEvent& event )
1284 long longSelected = -1;
1285 int intSelectedData = 0;
1287 if (!GetSelectedItem(lboHomeEmails,
1293 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
1294 frameCEEmail->SetupPointers(&HomeEmailList,
1295 &HomeEmailListAltID,
1298 &HomeEmailListTokens,
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;
1314 if (!GetSelectedItem(lboHomeEmails,
1320 lboHomeEmails->DeleteItem(longSelected);
1322 DeleteMapData(intSelectedData, &HomeEmailList,
1323 &HomeEmailListAltID, &HomeEmailListPID,
1324 &HomeEmailListType, &HomeEmailListTokens,
1325 &HomeEmailListPref);
1329 void frmContactEditor::AddHomeIM( wxCommandEvent& event )
1333 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
1334 frameCEIM->SetEditorMode(FALSE, CE_HOME);
1335 intResult = GetLastInt(&HomeIMList);
1336 frameCEIM->SetupPointers(&HomeIMList,
1341 &HomeIMListMediatype,
1345 frameCEIM->ShowModal();
1350 void frmContactEditor::ModifyHomeIM( wxCommandEvent& event )
1352 long longSelected = -1;
1353 int intSelectedData = 0;
1355 if (!GetSelectedItem(lboHomeIM,
1361 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
1362 frameCEIM->SetupPointers(&HomeIMList,
1367 &HomeIMListMediatype,
1371 frameCEIM->SetEditorMode(TRUE, CE_HOME);
1372 frameCEIM->ShowModal();
1377 void frmContactEditor::DeleteHomeIM( wxCommandEvent& event )
1379 long longSelected = -1;
1380 int intSelectedData = 0;
1382 if (!GetSelectedItem(lboHomeIM,
1388 lboHomeIM->DeleteItem(longSelected);
1390 DeleteMapData(intSelectedData, &HomeIMList,
1391 &HomeIMListAltID, &HomeIMListPID,
1392 &HomeIMListType, &HomeIMListTokens,
1393 &HomeIMListMediatype, &HomeIMListPref);
1397 void frmContactEditor::AddHomeTelephone( wxCommandEvent& event )
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,
1412 frameCETel->ShowModal();
1417 void frmContactEditor::ModifyHomeTelephone( wxCommandEvent& event )
1419 long longSelected = -1;
1420 int intSelectedData = 0;
1422 if (!GetSelectedItem(lboHomeTelephone,
1428 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
1429 frameCETel->SetupPointers(&HomeTelephoneList,
1430 &HomeTelephoneListAltID,
1431 &HomeTelephoneListPID,
1432 &HomeTelephoneListType,
1433 &HomeTelephoneListTokens,
1434 &HomeTelephoneListPref,
1437 frameCETel->SetEditorMode(TRUE, CE_HOME);
1438 frameCETel->ShowModal();
1443 void frmContactEditor::DeleteHomeTelephone( wxCommandEvent& event )
1445 long longSelected = -1;
1446 int intSelectedData = 0;
1448 if (!GetSelectedItem(lboHomeTelephone,
1454 lboHomeTelephone->DeleteItem(longSelected);
1456 DeleteMapData(intSelectedData, &HomeTelephoneList,
1457 &HomeTelephoneListAltID, &HomeTelephoneListPID,
1458 &HomeTelephoneListType, &HomeTelephoneListTokens,
1459 &HomeTelephoneListPref);
1463 void frmContactEditor::AddHomeLanguage( wxCommandEvent& event )
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,
1478 frameCELang->ShowModal();
1483 void frmContactEditor::ModifyHomeLanguage( wxCommandEvent& event )
1485 long longSelected = -1;
1486 int intSelectedData = 0;
1488 if (!GetSelectedItem(lboHomeLanguages,
1494 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
1495 frameCELang->SetupPointers(&HomeLanguageList,
1496 &HomeLanguageListAltID,
1497 &HomeLanguageListPID,
1498 &HomeLanguageListType,
1499 &HomeLanguageListTokens,
1500 &HomeLanguageListPref,
1503 frameCELang->SetEditorMode(TRUE, CE_HOME);
1504 frameCELang->ShowModal();
1509 void frmContactEditor::DeleteHomeLanguage( wxCommandEvent& event )
1511 long longSelected = -1;
1512 int intSelectedData = 0;
1514 if (!GetSelectedItem(lboHomeLanguages,
1520 lboHomeLanguages->DeleteItem(longSelected);
1522 DeleteMapData(intSelectedData, &HomeLanguageList,
1523 &HomeLanguageListAltID, &HomeLanguageListPID,
1524 &HomeLanguageListType, &HomeLanguageListTokens,
1525 &HomeLanguageListPref);
1529 void frmContactEditor::AddHomeTimezone( wxCommandEvent& event )
1533 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
1534 frameCETZ->SetEditorMode(FALSE, CE_HOME);
1535 intResult = GetLastInt(&HomeTZList);
1536 frameCETZ->SetupPointers(&HomeTZList,
1541 &HomeTZListMediatype,
1545 frameCETZ->ShowModal();
1550 void frmContactEditor::ModifyHomeTimezone( wxCommandEvent& event )
1552 long longSelected = -1;
1553 int intSelectedData = 0;
1555 if (!GetSelectedItem(lboHomeTimezones,
1561 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
1562 frameCETZ->SetupPointers(&HomeTZList,
1567 &HomeTZListMediatype,
1571 frameCETZ->SetEditorMode(TRUE, CE_HOME);
1572 frameCETZ->ShowModal();
1577 void frmContactEditor::DeleteHomeTimezone( wxCommandEvent& event )
1579 long longSelected = -1;
1580 int intSelectedData = 0;
1582 if (!GetSelectedItem(lboHomeTimezones,
1588 lboHomeTimezones->DeleteItem(longSelected);
1590 DeleteMapData(intSelectedData, &HomeTZList,
1591 &HomeTZListAltID, &HomeTZListPID,
1592 &HomeTZListType, &HomeTZListTokens,
1593 &HomeTZListMediatype, &HomeTZListPref);
1597 void frmContactEditor::AddHomeGeoposition( wxCommandEvent& event )
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,
1613 frameCEGeo->ShowModal();
1618 void frmContactEditor::ModifyHomeGeoposition( wxCommandEvent& event )
1620 long longSelected = -1;
1621 int intSelectedData = 0;
1623 if (!GetSelectedItem(lboHomeGeoposition,
1629 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
1630 frameCEGeo->SetupPointers(&HomeGeographyList,
1631 &HomeGeographyListAltID,
1632 &HomeGeographyListPID,
1633 &HomeGeographyListType,
1634 &HomeGeographyListTokens,
1635 &HomeGeographyListMediatype,
1636 &HomeGeographyListPref,
1639 frameCEGeo->SetEditorMode(TRUE, CE_HOME);
1640 frameCEGeo->ShowModal();
1645 void frmContactEditor::DeleteHomeGeoposition( wxCommandEvent& event )
1647 long longSelected = -1;
1648 int intSelectedData = 0;
1650 if (!GetSelectedItem(lboHomeGeoposition,
1656 lboHomeGeoposition->DeleteItem(longSelected);
1658 DeleteMapData(intSelectedData, &HomeGeographyList,
1659 &HomeGeographyListAltID, &HomeGeographyListPID,
1660 &HomeGeographyListType, &HomeGeographyListTokens,
1661 &HomeGeographyListMediatype, &HomeGeographyListPref);
1665 void frmContactEditor::AddHomeWebsite( wxCommandEvent& event )
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,
1681 frameCEWeb->ShowModal();
1686 void frmContactEditor::ModifyHomeWebsite( wxCommandEvent& event )
1688 long longSelected = -1;
1689 int intSelectedData = 0;
1691 if (!GetSelectedItem(lboHomeWebsites,
1697 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
1698 frameCEWeb->SetupPointers(&HomeWebsiteList,
1699 &HomeWebsiteListAltID,
1700 &HomeWebsiteListPID,
1701 &HomeWebsiteListType,
1702 &HomeWebsiteListTokens,
1703 &HomeWebsiteListMediatype,
1704 &HomeWebsiteListPref,
1707 frameCEWeb->SetEditorMode(TRUE, CE_HOME);
1708 frameCEWeb->ShowModal();
1713 void frmContactEditor::DeleteHomeWebsite( wxCommandEvent& event )
1715 long longSelected = -1;
1716 int intSelectedData = 0;
1718 if (!GetSelectedItem(lboHomeWebsites,
1724 lboHomeWebsites->DeleteItem(longSelected);
1726 DeleteMapData(intSelectedData, &HomeWebsiteList,
1727 &HomeWebsiteListAltID, &HomeWebsiteListPID,
1728 &HomeWebsiteListType, &HomeWebsiteListTokens,
1729 &HomeWebsiteListMediatype, &HomeWebsiteListPref);
1733 void frmContactEditor::AddHomeTitle( wxCommandEvent& event )
1737 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
1738 frameCETitle->SetEditorMode(FALSE, CE_HOME);
1739 intResult = GetLastInt(&HomeTitleList);
1740 frameCETitle->SetupPointers(&HomeTitleList,
1741 &HomeTitleListLanguage,
1742 &HomeTitleListAltID,
1745 &HomeTitleListTokens,
1749 frameCETitle->ShowModal();
1750 delete frameCETitle;
1751 frameCETitle = NULL;
1754 void frmContactEditor::ModifyHomeTitle( wxCommandEvent& event )
1756 long longSelected = -1;
1757 int intSelectedData = 0;
1759 if (!GetSelectedItem(lboHomeTitles,
1765 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
1766 frameCETitle->SetupPointers(&HomeTitleList,
1767 &HomeTitleListLanguage,
1768 &HomeTitleListAltID,
1771 &HomeTitleListTokens,
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;
1786 if (!GetSelectedItem(lboHomeTitles,
1792 lboHomeTitles->DeleteItem(longSelected);
1794 DeleteMapData(intSelectedData, &HomeTitleList,
1795 &HomeTitleListLanguage, &HomeTitleListAltID,
1796 &HomeTitleListPID, &HomeTitleListType,
1797 &HomeTitleListTokens, &HomeTitleListPref);
1801 void frmContactEditor::AddHomeRole( wxCommandEvent& event )
1805 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
1806 frameCERole->SetEditorMode(FALSE, CE_HOME);
1807 intResult = GetLastInt(&HomeRoleList);
1808 frameCERole->SetupPointers(&HomeRoleList,
1809 &HomeRoleListLanguage,
1813 &HomeRoleListTokens,
1817 frameCERole->ShowModal();
1822 void frmContactEditor::ModifyHomeRole( wxCommandEvent& event )
1824 long longSelected = -1;
1825 int intSelectedData = 0;
1827 if (!GetSelectedItem(lboHomeRoles,
1833 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
1834 frameCERole->SetupPointers(&HomeRoleList,
1835 &HomeRoleListLanguage,
1839 &HomeRoleListTokens,
1843 frameCERole->SetEditorMode(TRUE, CE_HOME);
1844 frameCERole->ShowModal();
1849 void frmContactEditor::DeleteHomeRole( wxCommandEvent& event )
1851 long longSelected = -1;
1852 int intSelectedData = 0;
1854 if (!GetSelectedItem(lboHomeRoles,
1860 lboHomeRoles->DeleteItem(longSelected);
1862 DeleteMapData(intSelectedData, &HomeRoleList,
1863 &HomeRoleListLanguage, &HomeRoleListAltID,
1864 &HomeRoleListPID, &HomeRoleListType,
1865 &HomeRoleListTokens, &HomeRoleListPref);
1869 void frmContactEditor::AddHomeOrganisation( wxCommandEvent& event )
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,
1886 frameCEOrg->ShowModal();
1891 void frmContactEditor::ModifyHomeOrganisation( wxCommandEvent& event )
1893 long longSelected = -1;
1894 int intSelectedData = 0;
1896 if (!GetSelectedItem(lboHomeOrganisations,
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,
1913 frameCEOrg->SetEditorMode(TRUE, CE_HOME);
1914 frameCEOrg->ShowModal();
1919 void frmContactEditor::DeleteHomeOrganisation( wxCommandEvent& event )
1921 long longSelected = -1;
1922 int intSelectedData = 0;
1924 if (!GetSelectedItem(lboHomeOrganisations,
1930 lboHomeOrganisations->DeleteItem(longSelected);
1932 DeleteMapData(intSelectedData, &HomeOrganisationsList,
1933 &HomeOrganisationsListLanguage, &HomeOrganisationsListSortAs,
1934 &HomeOrganisationsListAltID, &HomeOrganisationsListPID,
1935 &HomeOrganisationsListType, &HomeOrganisationsListTokens,
1936 &HomeOrganisationsListPref);
1940 void frmContactEditor::AddHomeNote( wxCommandEvent& event )
1944 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1945 frameCENote->SetEditorMode(FALSE, CE_HOME);
1946 intResult = GetLastInt(&HomeNoteList);
1947 frameCENote->SetupPointers(&HomeNoteList,
1948 &HomeNoteListLanguage,
1952 &HomeNoteListTokens,
1956 frameCENote->ShowModal();
1961 void frmContactEditor::ModifyHomeNote( wxCommandEvent& event )
1963 long longSelected = -1;
1964 int intSelectedData = 0;
1966 if (!GetSelectedItem(lboHomeNotes,
1972 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1973 frameCENote->SetupPointers(&HomeNoteList,
1974 &HomeNoteListLanguage,
1978 &HomeNoteListTokens,
1982 frameCENote->SetEditorMode(TRUE, CE_HOME);
1983 frameCENote->ShowModal();
1988 void frmContactEditor::DeleteHomeNote( wxCommandEvent& event )
1990 long longSelected = -1;
1991 int intSelectedData = 0;
1993 if (!GetSelectedItem(lboHomeNotes,
1999 lboNotes->DeleteItem(longSelected);
2001 DeleteMapData(intSelectedData, &HomeNoteList,
2002 &HomeNoteListLanguage, &HomeNoteListAltID,
2003 &HomeNoteListPID, &HomeNoteListType,
2004 &HomeNoteListTokens, &HomeNoteListPref);
2008 void frmContactEditor::AddBusinessNickname( wxCommandEvent& event )
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,
2024 frameCENickname->ShowModal();
2025 delete frameCENickname;
2026 frameCENickname = NULL;
2029 void frmContactEditor::ModifyBusinessNickname( wxCommandEvent& event )
2031 long longSelected = -1;
2032 int intSelectedData = 0;
2034 if (!GetSelectedItem(lboBusinessNicknames,
2040 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
2041 frameCENickname->SetupPointers(&BusinessNicknamesList,
2042 &BusinessNicknamesListAltID,
2043 &BusinessNicknamesListPID,
2044 &BusinessNicknamesListType,
2045 &BusinessNicknamesListLanguage,
2046 &BusinessNicknamesListTokens,
2047 &BusinessNicknamesListPref,
2048 lboBusinessNicknames,
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;
2061 if (!GetSelectedItem(lboBusinessNicknames,
2067 lboBusinessNicknames->DeleteItem(longSelected);
2069 DeleteMapData(intSelectedData,
2070 &BusinessNicknamesList,
2071 &BusinessNicknamesListLanguage,
2072 &BusinessNicknamesListAltID,
2073 &BusinessNicknamesListPID,
2074 &BusinessNicknamesListTokens,
2075 &BusinessNicknamesListType,
2076 &BusinessNicknamesListPref);
2079 void frmContactEditor::AddBusinessAddress( wxCommandEvent& event )
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,
2103 frameCEAddress->ShowModal();
2104 delete frameCEAddress;
2105 frameCEAddress = NULL;
2108 void frmContactEditor::ModifyBusinessAddress( wxCommandEvent& event )
2110 long longSelected = -1;
2111 int intSelectedData = 0;
2113 if (!GetSelectedItem(lboBusinessAddresses,
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,
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;
2148 if (!GetSelectedItem(lboBusinessAddresses,
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);
2167 void frmContactEditor::AddBusinessEmail( wxCommandEvent& event )
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,
2182 frameCEEmail->ShowModal();
2183 delete frameCEEmail;
2184 frameCEEmail = NULL;
2187 void frmContactEditor::ModifyBusinessEmail( wxCommandEvent& event )
2189 long longSelected = -1;
2190 int intSelectedData = 0;
2192 if (!GetSelectedItem(lboBusinessEmail,
2198 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
2199 frameCEEmail->SetupPointers(&BusinessEmailList,
2200 &BusinessEmailListAltID,
2201 &BusinessEmailListPID,
2202 &BusinessEmailListType,
2203 &BusinessEmailListTokens,
2204 &BusinessEmailListPref,
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;
2218 if (!GetSelectedItem(lboBusinessEmail,
2224 lboBusinessEmail->DeleteItem(longSelected);
2226 DeleteMapData(intSelectedData, &BusinessEmailList,
2227 &BusinessEmailListAltID, &BusinessEmailListPID,
2228 &BusinessEmailListType, &BusinessEmailListTokens,
2229 &BusinessEmailListPref);
2233 void frmContactEditor::AddBusinessIM( wxCommandEvent& event )
2237 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
2238 frameCEIM->SetEditorMode(FALSE, CE_WORK);
2239 intResult = GetLastInt(&BusinessIMList);
2240 frameCEIM->SetupPointers(&BusinessIMList,
2241 &BusinessIMListAltID,
2243 &BusinessIMListType,
2244 &BusinessIMListTokens,
2245 &BusinessIMListMediatype,
2246 &BusinessIMListPref,
2249 frameCEIM->ShowModal();
2254 void frmContactEditor::ModifyBusinessIM( wxCommandEvent& event )
2256 long longSelected = -1;
2257 int intSelectedData = 0;
2259 if (!GetSelectedItem(lboBusinessIM,
2265 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
2266 frameCEIM->SetupPointers(&BusinessIMList,
2267 &BusinessIMListAltID,
2269 &BusinessIMListType,
2270 &BusinessIMListTokens,
2271 &BusinessIMListMediatype,
2272 &BusinessIMListPref,
2275 frameCEIM->SetEditorMode(TRUE, CE_WORK);
2276 frameCEIM->ShowModal();
2281 void frmContactEditor::DeleteBusinessIM( wxCommandEvent& event )
2283 long longSelected = -1;
2284 int intSelectedData = 0;
2286 if (!GetSelectedItem(lboBusinessIM,
2292 lboBusinessIM->DeleteItem(longSelected);
2294 DeleteMapData(intSelectedData, &BusinessIMList,
2295 &BusinessIMListAltID, &BusinessIMListPID,
2296 &BusinessIMListType, &BusinessIMListTokens,
2297 &BusinessIMListMediatype, &BusinessIMListPref);
2301 void frmContactEditor::AddBusinessTelephone( wxCommandEvent& event )
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,
2316 frameCETel->ShowModal();
2321 void frmContactEditor::ModifyBusinessTelephone( wxCommandEvent& event )
2323 long longSelected = -1;
2324 int intSelectedData = 0;
2326 if (!GetSelectedItem(lboBusinessTelephone,
2332 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
2333 frameCETel->SetupPointers(&BusinessTelephoneList,
2334 &BusinessTelephoneListAltID,
2335 &BusinessTelephoneListPID,
2336 &BusinessTelephoneListType,
2337 &BusinessTelephoneListTokens,
2338 &BusinessTelephoneListPref,
2339 lboBusinessTelephone,
2341 frameCETel->SetEditorMode(TRUE, CE_WORK);
2342 frameCETel->ShowModal();
2347 void frmContactEditor::DeleteBusinessTelephone( wxCommandEvent& event )
2349 long longSelected = -1;
2350 int intSelectedData = 0;
2352 if (!GetSelectedItem(lboBusinessTelephone,
2358 lboBusinessTelephone->DeleteItem(longSelected);
2360 DeleteMapData(intSelectedData, &BusinessTelephoneList,
2361 &BusinessTelephoneListAltID, &BusinessTelephoneListPID,
2362 &BusinessTelephoneListType, &BusinessTelephoneListTokens,
2363 &BusinessTelephoneListPref);
2367 void frmContactEditor::AddBusinessLanguage( wxCommandEvent& event )
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,
2382 frameCELang->ShowModal();
2387 void frmContactEditor::ModifyBusinessLanguage( wxCommandEvent& event )
2389 long longSelected = -1;
2390 int intSelectedData = 0;
2392 if (!GetSelectedItem(lboBusinessLanguages,
2398 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
2399 frameCELang->SetupPointers(&BusinessLanguageList,
2400 &BusinessLanguageListAltID,
2401 &BusinessLanguageListPID,
2402 &BusinessLanguageListType,
2403 &BusinessLanguageListTokens,
2404 &BusinessLanguageListPref,
2405 lboBusinessLanguages,
2407 frameCELang->SetEditorMode(TRUE, CE_WORK);
2408 frameCELang->ShowModal();
2413 void frmContactEditor::DeleteBusinessLanguage( wxCommandEvent& event )
2415 long longSelected = -1;
2416 int intSelectedData = 0;
2418 if (!GetSelectedItem(lboBusinessLanguages,
2424 lboBusinessLanguages->DeleteItem(longSelected);
2426 DeleteMapData(intSelectedData, &BusinessLanguageList,
2427 &BusinessLanguageListAltID, &BusinessLanguageListPID,
2428 &BusinessLanguageListType, &BusinessLanguageListTokens,
2429 &BusinessLanguageListPref);
2433 void frmContactEditor::AddBusinessTimezone( wxCommandEvent& event )
2437 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
2438 frameCETZ->SetEditorMode(FALSE, CE_WORK);
2439 intResult = GetLastInt(&BusinessTZList);
2440 frameCETZ->SetupPointers(&BusinessTZList,
2441 &BusinessTZListAltID,
2443 &BusinessTZListType,
2444 &BusinessTZListTokens,
2445 &BusinessTZListMediatype,
2446 &BusinessTZListPref,
2447 lboBusinessTimezones,
2449 frameCETZ->ShowModal();
2454 void frmContactEditor::ModifyBusinessTimezone( wxCommandEvent& event )
2456 long longSelected = -1;
2457 int intSelectedData = 0;
2459 if (!GetSelectedItem(lboBusinessTimezones,
2465 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
2466 frameCETZ->SetupPointers(&BusinessTZList,
2467 &BusinessTZListAltID,
2469 &BusinessTZListType,
2470 &BusinessTZListTokens,
2471 &BusinessTZListMediatype,
2472 &BusinessTZListPref,
2473 lboBusinessTimezones,
2475 frameCETZ->SetEditorMode(TRUE, CE_WORK);
2476 frameCETZ->ShowModal();
2481 void frmContactEditor::DeleteBusinessTimezone( wxCommandEvent& event )
2483 long longSelected = -1;
2484 int intSelectedData = 0;
2486 if (!GetSelectedItem(lboBusinessTimezones,
2492 lboBusinessTimezones->DeleteItem(longSelected);
2494 DeleteMapData(intSelectedData, &BusinessTZList,
2495 &BusinessTZListAltID, &BusinessTZListPID,
2496 &BusinessTZListType, &BusinessTZListTokens,
2497 &BusinessTZListMediatype, &BusinessTZListPref);
2501 void frmContactEditor::AddBusinessGeoposition( wxCommandEvent& event )
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,
2517 frameCEGeo->ShowModal();
2522 void frmContactEditor::ModifyBusinessGeoposition( wxCommandEvent& event )
2524 long longSelected = -1;
2525 int intSelectedData = 0;
2527 if (!GetSelectedItem(lboBusinessGeoposition,
2533 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
2534 frameCEGeo->SetupPointers(&BusinessGeographyList,
2535 &BusinessGeographyListAltID,
2536 &BusinessGeographyListPID,
2537 &BusinessGeographyListType,
2538 &BusinessGeographyListTokens,
2539 &BusinessGeographyListMediatype,
2540 &BusinessGeographyListPref,
2541 lboBusinessGeoposition,
2543 frameCEGeo->SetEditorMode(TRUE, CE_WORK);
2544 frameCEGeo->ShowModal();
2549 void frmContactEditor::DeleteBusinessGeoposition( wxCommandEvent& event )
2551 long longSelected = -1;
2552 int intSelectedData = 0;
2554 if (!GetSelectedItem(lboBusinessGeoposition,
2560 lboBusinessGeoposition->DeleteItem(longSelected);
2562 DeleteMapData(intSelectedData, &BusinessGeographyList,
2563 &BusinessGeographyListAltID, &BusinessGeographyListPID,
2564 &BusinessGeographyListType, &BusinessGeographyListTokens,
2565 &BusinessGeographyListMediatype, &BusinessGeographyListPref);
2569 void frmContactEditor::AddBusinessWebsite( wxCommandEvent& event )
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,
2585 frameCEWeb->ShowModal();
2590 void frmContactEditor::ModifyBusinessWebsite( wxCommandEvent& event )
2592 long longSelected = -1;
2593 int intSelectedData = 0;
2595 if (!GetSelectedItem(lboBusinessWebsites,
2601 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
2602 frameCEWeb->SetupPointers(&BusinessWebsiteList,
2603 &BusinessWebsiteListAltID,
2604 &BusinessWebsiteListPID,
2605 &BusinessWebsiteListType,
2606 &BusinessWebsiteListTokens,
2607 &BusinessWebsiteListMediatype,
2608 &BusinessWebsiteListPref,
2609 lboBusinessWebsites,
2611 frameCEWeb->SetEditorMode(TRUE, CE_WORK);
2612 frameCEWeb->ShowModal();
2617 void frmContactEditor::DeleteBusinessWebsite( wxCommandEvent& event )
2619 long longSelected = -1;
2620 int intSelectedData = 0;
2622 if (!GetSelectedItem(lboBusinessWebsites,
2628 lboBusinessWebsites->DeleteItem(longSelected);
2630 DeleteMapData(intSelectedData, &BusinessWebsiteList,
2631 &BusinessWebsiteListAltID, &BusinessWebsiteListPID,
2632 &BusinessWebsiteListType, &BusinessWebsiteListTokens,
2633 &BusinessWebsiteListMediatype, &BusinessWebsiteListPref);
2637 void frmContactEditor::AddBusinessTitle( wxCommandEvent& event )
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,
2653 frameCETitle->ShowModal();
2654 delete frameCETitle;
2655 frameCETitle = NULL;
2658 void frmContactEditor::ModifyBusinessTitle( wxCommandEvent& event )
2660 long longSelected = -1;
2661 int intSelectedData = 0;
2663 if (!GetSelectedItem(lboBusinessTitles,
2669 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
2670 frameCETitle->SetupPointers(&BusinessTitleList,
2671 &BusinessTitleListLanguage,
2672 &BusinessTitleListAltID,
2673 &BusinessTitleListPID,
2674 &BusinessTitleListType,
2675 &BusinessTitleListTokens,
2676 &BusinessTitleListPref,
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;
2690 if (!GetSelectedItem(lboBusinessTitles,
2696 lboTitles->DeleteItem(longSelected);
2698 DeleteMapData(intSelectedData, &BusinessTitleList,
2699 &BusinessTitleListLanguage, &BusinessTitleListAltID,
2700 &BusinessTitleListPID, &BusinessTitleListType,
2701 &BusinessTitleListTokens, &BusinessTitleListPref);
2705 void frmContactEditor::AddBusinessRole( wxCommandEvent& event )
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,
2721 frameCERole->ShowModal();
2726 void frmContactEditor::ModifyBusinessRole( wxCommandEvent& event )
2728 long longSelected = -1;
2729 int intSelectedData = 0;
2731 if (!GetSelectedItem(lboBusinessRoles,
2737 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
2738 frameCERole->SetupPointers(&BusinessRoleList,
2739 &BusinessRoleListLanguage,
2740 &BusinessRoleListAltID,
2741 &BusinessRoleListPID,
2742 &BusinessRoleListType,
2743 &BusinessRoleListTokens,
2744 &BusinessRoleListPref,
2747 frameCERole->SetEditorMode(TRUE, CE_WORK);
2748 frameCERole->ShowModal();
2753 void frmContactEditor::DeleteBusinessRole( wxCommandEvent& event )
2755 long longSelected = -1;
2756 int intSelectedData = 0;
2758 if (!GetSelectedItem(lboBusinessRoles,
2764 lboBusinessRoles->DeleteItem(longSelected);
2766 DeleteMapData(intSelectedData, &BusinessRoleList,
2767 &BusinessRoleListLanguage, &BusinessRoleListAltID,
2768 &BusinessRoleListPID, &BusinessRoleListType,
2769 &BusinessRoleListTokens, &BusinessRoleListPref);
2773 void frmContactEditor::AddBusinessOrganisation( wxCommandEvent& event )
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,
2790 frameCEOrg->ShowModal();
2795 void frmContactEditor::ModifyBusinessOrganisation( wxCommandEvent& event )
2797 long longSelected = -1;
2798 int intSelectedData = 0;
2800 if (!GetSelectedItem(lboBusinessOrganisations,
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,
2817 frameCEOrg->SetEditorMode(TRUE, CE_WORK);
2818 frameCEOrg->ShowModal();
2823 void frmContactEditor::DeleteBusinessOrganisation( wxCommandEvent& event )
2825 long longSelected = -1;
2826 int intSelectedData = 0;
2828 if (!GetSelectedItem(lboBusinessOrganisations,
2834 lboBusinessOrganisations->DeleteItem(longSelected);
2836 DeleteMapData(intSelectedData, &BusinessOrganisationsList,
2837 &BusinessOrganisationsListLanguage, &BusinessOrganisationsListSortAs,
2838 &BusinessOrganisationsListAltID, &BusinessOrganisationsListPID,
2839 &BusinessOrganisationsListType, &BusinessOrganisationsListTokens,
2840 &BusinessOrganisationsListPref);
2844 void frmContactEditor::AddBusinessNote( wxCommandEvent& event )
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,
2860 frameCENote->ShowModal();
2865 void frmContactEditor::ModifyBusinessNote( wxCommandEvent& event )
2867 long longSelected = -1;
2868 int intSelectedData = 0;
2870 if (!GetSelectedItem(lboBusinessNotes,
2876 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
2877 frameCENote->SetupPointers(&BusinessNoteList,
2878 &BusinessNoteListLanguage,
2879 &BusinessNoteListAltID,
2880 &BusinessNoteListPID,
2881 &BusinessNoteListType,
2882 &BusinessNoteListTokens,
2883 &BusinessNoteListPref,
2886 frameCENote->SetEditorMode(TRUE, CE_WORK);
2887 frameCENote->ShowModal();
2892 void frmContactEditor::DeleteBusinessNote( wxCommandEvent& event )
2894 long longSelected = -1;
2895 int intSelectedData = 0;
2897 if (!GetSelectedItem(lboBusinessNotes,
2903 lboBusinessNotes->DeleteItem(longSelected);
2905 DeleteMapData(intSelectedData, &BusinessNoteList,
2906 &BusinessNoteListLanguage, &BusinessNoteListAltID,
2907 &BusinessNoteListPID, &BusinessNoteListType,
2908 &BusinessNoteListTokens, &BusinessNoteListPref);
2912 void frmContactEditor::AddCategory( wxCommandEvent& event )
2916 frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
2917 frameCECategory->SetEditorMode(FALSE);
2918 intResult = GetLastInt(&CategoriesList);
2919 frameCECategory->SetupPointers(&CategoriesList,
2920 &CategoriesListAltID,
2922 &CategoriesListType,
2923 &CategoriesListTokens,
2924 &CategoriesListPref,
2927 frameCECategory->ShowModal();
2928 delete frameCECategory;
2929 frameCECategory = NULL;
2932 void frmContactEditor::ModifyCategory( wxCommandEvent& event )
2934 long longSelected = -1;
2935 int intSelectedData = 0;
2937 if (!GetSelectedItem(lboCategories,
2943 frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
2944 frameCECategory->SetupPointers(&CategoriesList,
2945 &CategoriesListAltID,
2947 &CategoriesListType,
2948 &CategoriesListTokens,
2949 &CategoriesListPref,
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;
2963 if (!GetSelectedItem(lboCategories,
2969 lboCategories->DeleteItem(longSelected);
2971 DeleteMapData(intSelectedData, &CategoriesList,
2972 &CategoriesListAltID, &CategoriesListPID,
2973 &CategoriesListType, &CategoriesListTokens,
2974 &CategoriesListPref);
2978 void frmContactEditor::AddGroup( wxCommandEvent& event )
2983 XABViewMode XVMData = MainPtr->GetViewMode();
2985 frmContactEditorGroup *frameCEGroup = new frmContactEditorGroup ( this );
2986 frameCEGroup->SetEditorMode(FALSE, XVMData);
2987 intResult = GetLastInt(&GroupsList);
2988 frameCEGroup->SetupPointers(&GroupsList,
2992 frameCEGroup->ShowModal();
2993 delete frameCEGroup;
2994 frameCEGroup = NULL;
2998 void frmContactEditor::ModifyGroup( wxCommandEvent& event )
3005 void frmContactEditor::DeleteGroup( wxCommandEvent& event )
3008 long longSelected = -1;
3009 int intSelectedData = 0;
3011 if (!GetSelectedItem(lboGroups,
3017 lboGroups->DeleteItem(longSelected);
3019 DeleteMapData(intSelectedData, &GroupsList);
3023 void frmContactEditor::AddPicture( wxCommandEvent& event )
3027 frmContactEditorPicture *frameCEPicture = new frmContactEditorPicture ( this );
3028 frameCEPicture->SetEditorMode(FALSE);
3029 intResult = GetLastInt(&PicturesList);
3030 frameCEPicture->SetupPointers(&PicturesList,
3034 &PicturesListPicEncType,
3035 &PicturesListPictureType,
3036 &PicturesListTokens,
3037 &PicturesListMediatype,
3041 frameCEPicture->ShowModal();
3042 delete frameCEPicture;
3043 frameCEPicture = NULL;
3046 void frmContactEditor::ModifyPicture( wxCommandEvent& event )
3048 long longSelected = -1;
3049 int intSelectedData = 0;
3051 if (!GetSelectedItem(lboPictures,
3057 frmContactEditorPicture *frameCEPicture = new frmContactEditorPicture ( this );
3058 frameCEPicture->SetupPointers(&PicturesList,
3062 &PicturesListPicEncType,
3063 &PicturesListPictureType,
3064 &PicturesListTokens,
3065 &PicturesListMediatype,
3069 frameCEPicture->SetEditorMode(TRUE);
3070 frameCEPicture->ShowModal();
3071 delete frameCEPicture;
3072 frameCEPicture = NULL;
3076 void frmContactEditor::DeletePicture( wxCommandEvent& event )
3078 long longSelected = -1;
3079 int intSelectedData = 0;
3081 if (!GetSelectedItem(lboPictures,
3087 lboPictures->DeleteItem(longSelected);
3089 DeleteMapData(intSelectedData,
3090 &PicturesList, &PicturesListAltID, &PicturesListPID, &PicturesListType,
3091 &PicturesListPicEncType, &PicturesListPictureType, &PicturesListTokens,
3092 &PicturesListMediatype, &PicturesListPref);
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;
3098 imgPicture->SetBitmap(PictureImage);
3101 void frmContactEditor::LoadPicture( wxListEvent& event )
3104 long longSelected = -1;
3105 int intSelectedData = 0;
3107 if (!GetSelectedItem(lboPictures,
3113 std::string base64dec;
3115 std::map<int,std::string>::iterator initier;
3117 initier = PicturesList.find(intSelectedData);
3119 base64dec = base64_decode(initier->second);
3122 wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size());
3124 //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size());
3126 if (!photo.LoadFile(istream, wxBITMAP_TYPE_ANY)){
3133 PictureImage = (wxBitmap)photo;
3134 imgPicture->SetBitmap(PictureImage);
3138 void frmContactEditor::LoadLogo( wxListEvent& event )
3141 long longSelected = -1;
3142 int intSelectedData = 0;
3144 if (!GetSelectedItem(lboLogos,
3150 std::string base64dec;
3152 std::map<int,std::string>::iterator initier;
3154 initier = LogosList.find(intSelectedData);
3156 base64dec = base64_decode(initier->second);
3159 wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size());
3161 //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size());
3163 if (!photo.LoadFile(istream, wxBITMAP_TYPE_ANY)){
3170 LogoImage = (wxBitmap)photo;
3171 imgLogo->SetBitmap(LogoImage);
3175 void frmContactEditor::AddLogo( wxCommandEvent& event )
3179 frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this );
3180 frameCELogo->SetEditorMode(FALSE);
3181 intResult = GetLastInt(&LogosList);
3182 frameCELogo->SetupPointers(&LogosList,
3186 &LogosListPicEncType,
3187 &LogosListPictureType,
3189 &LogosListMediatype,
3193 frameCELogo->ShowModal();
3198 void frmContactEditor::ModifyLogo( wxCommandEvent& event )
3200 long longSelected = -1;
3201 int intSelectedData = 0;
3203 if (!GetSelectedItem(lboLogos,
3209 frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this );
3210 frameCELogo->SetupPointers(&LogosList,
3214 &LogosListPicEncType,
3215 &LogosListPictureType,
3217 &LogosListMediatype,
3221 frameCELogo->SetEditorMode(TRUE);
3222 frameCELogo->ShowModal();
3227 void frmContactEditor::DeleteLogo( wxCommandEvent& event )
3229 long longSelected = -1;
3230 int intSelectedData = 0;
3232 if (!GetSelectedItem(lboLogos,
3238 lboLogos->DeleteItem(longSelected);
3240 DeleteMapData(intSelectedData,
3241 &LogosList, &LogosListAltID, &LogosListPID, &LogosListType,
3242 &LogosListPicEncType, &LogosListPictureType, &LogosListTokens,
3243 &LogosListMediatype, &LogosListPref);
3245 wxMemoryInputStream istream(misc_emptyimage_png, sizeof(misc_emptyimage_png));
3246 wxImage misc_emptyimage_png(istream, wxBITMAP_TYPE_PNG);
3247 LogoImage = (wxBitmap)misc_emptyimage_png;
3249 imgLogo->SetBitmap(LogoImage);
3252 void frmContactEditor::AddSound( wxCommandEvent& event )
3256 frmContactEditorSound *frameCESound = new frmContactEditorSound ( this );
3257 frameCESound->SetEditorMode(FALSE);
3258 intResult = GetLastInt(&SoundsList);
3259 frameCESound->SetupPointers(&SoundsList,
3263 &SoundsListAudioType,
3264 &SoundsListAudioEncType,
3266 &SoundsListMediatype,
3270 frameCESound->ShowModal();
3271 delete frameCESound;
3272 frameCESound = NULL;
3275 void frmContactEditor::ModifySound( wxCommandEvent& event )
3277 long longSelected = -1;
3278 int intSelectedData = 0;
3280 if (!GetSelectedItem(lboSounds,
3286 frmContactEditorSound *frameCESound = new frmContactEditorSound ( this );
3287 frameCESound->SetupPointers(&SoundsList,
3291 &SoundsListAudioType,
3292 &SoundsListAudioEncType,
3294 &SoundsListMediatype,
3298 frameCESound->SetEditorMode(TRUE);
3299 frameCESound->ShowModal();
3300 delete frameCESound;
3301 frameCESound = NULL;
3304 void frmContactEditor::DeleteSound( wxCommandEvent& event )
3306 long longSelected = -1;
3307 int intSelectedData = 0;
3309 if (!GetSelectedItem(lboSounds,
3315 lboSounds->DeleteItem(longSelected);
3317 DeleteMapData(intSelectedData, &SoundsList, &SoundsListAltID,
3318 &SoundsListPID, &SoundsListType, &SoundsListAudioType,
3319 &SoundsListAudioEncType, &SoundsListTokens, &SoundsListMediatype,
3324 void frmContactEditor::PlaySoundDetach()
3327 if (!AudioStreamPlayback.openFromMemory(base64dec.c_str(), base64declen)){
3329 // Can't load file. We must flee...
3330 // Also show an error message too.
3332 wxMessageBox(_("This file is in an audio format that is unsupported or is not an audio file."), _("Error opening audio file"), wxICON_ERROR);
3340 //AudioStreamPlayback.setbuffer(AudioBuffer);
3341 AudioStreamPlayback.play();
3346 n1.tv_nsec = 100000000L;*/
3348 //while (TimeA != TimeB){
3349 while (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3351 // We poll this every 100ms in order to conserve CPU usage.
3353 SleepFor(100000000);
3361 void frmContactEditor::PlaySound( wxCommandEvent& event )
3364 //sf::Music *AudioPlayback = new sf::Music;
3365 //AudioStream *AudioStreamPlayback = new AudioStream;
3366 //sf::SoundBuffer *AudioBuffer = new sf::SoundBuffer;
3368 //sf::Sound *AudioPlayback = new sf::Sound;
3370 //delete(AudioPlayback);
3372 //delete(AudioPlayback);
3373 //delete(AudioStreamPlayback);
3374 //delete(AudioBuffer);
3376 //AudioPlayback = NULL;
3377 //AudioStreamPlayback = NULL;
3378 //AudioBuffer = NULL;
3382 long longSelected = -1;
3383 int intSelectedData = 0;
3385 // Check if sound is still being played and if it is, stop it.
3387 if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3389 AudioStreamPlayback.stop();
3393 if (!GetSelectedItem(lboSounds,
3399 std::map<int, std::string>::iterator initier;
3401 initier = SoundsList.find(intSelectedData);
3403 base64dec = base64_decode(initier->second);
3404 base64declen = base64dec.size();
3406 std::thread AudioPlaybackThread(&frmContactEditor::PlaySoundDetach, this);
3407 AudioPlaybackThread.detach();
3413 void frmContactEditor::StopSound( wxCommandEvent& event )
3416 if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3418 AudioStreamPlayback.stop();
3428 void frmContactEditor::AddCalendarAddress( wxCommandEvent& event )
3432 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3433 frameCECalAdr->SetEditorMode(FALSE);
3434 intResult = GetLastInt(&CalendarList);
3435 frameCECalAdr->SetupPointers(&CalendarList,
3439 &CalendarListTokens,
3441 lboCalendarAddresses,
3443 frameCECalAdr->ShowModal();
3444 delete frameCECalAdr;
3445 frameCECalAdr = NULL;
3448 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
3450 long longSelected = -1;
3451 int intSelectedData = 0;
3453 if (!GetSelectedItem(lboCalendarAddresses,
3459 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3460 frameCECalAdr->SetupPointers(&CalendarList,
3464 &CalendarListTokens,
3466 lboCalendarAddresses,
3468 frameCECalAdr->SetEditorMode(TRUE);
3469 frameCECalAdr->ShowModal();
3470 delete frameCECalAdr;
3471 frameCECalAdr = NULL;
3474 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
3476 long longSelected = -1;
3477 int intSelectedData = 0;
3479 if (!GetSelectedItem(lboCalendarAddresses,
3485 lboCalendarAddresses->DeleteItem(longSelected);
3487 DeleteMapData(intSelectedData, &CalendarList, &CalendarListAltID,
3488 &CalendarListPID, &CalendarListType, &CalendarListTokens,
3493 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
3497 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3498 frameCECalAdr->SetEditorMode(FALSE);
3499 intResult = GetLastInt(&CalendarRequestList);
3500 frameCECalAdr->SetupPointers(&CalendarRequestList,
3501 &CalendarRequestListAltID,
3502 &CalendarRequestListPID,
3503 &CalendarRequestListType,
3504 &CalendarRequestListTokens,
3505 &CalendarRequestListPref,
3506 lboCalendarRequestAddress,
3508 frameCECalAdr->ShowModal();
3509 delete frameCECalAdr;
3510 frameCECalAdr = NULL;
3513 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
3515 long longSelected = -1;
3516 int intSelectedData = 0;
3518 if (!GetSelectedItem(lboCalendarRequestAddress,
3524 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3525 frameCECalAdr->SetupPointers(&CalendarList,
3526 &CalendarRequestListAltID,
3527 &CalendarRequestListPID,
3528 &CalendarRequestListType,
3529 &CalendarRequestListTokens,
3530 &CalendarRequestListPref,
3531 lboCalendarRequestAddress,
3533 frameCECalAdr->SetEditorMode(TRUE);
3534 frameCECalAdr->ShowModal();
3535 delete frameCECalAdr;
3536 frameCECalAdr = NULL;
3539 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
3541 long longSelected = -1;
3542 int intSelectedData = 0;
3544 if (!GetSelectedItem(lboCalendarRequestAddress,
3550 lboCalendarRequestAddress->DeleteItem(longSelected);
3552 DeleteMapData(intSelectedData, &CalendarRequestList,
3553 &CalendarRequestListAltID, &CalendarRequestListPID,
3554 &CalendarRequestListType, &CalendarRequestListTokens,
3555 &CalendarRequestListPref);
3558 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
3562 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3563 frameCECalAdr->SetEditorMode(FALSE);
3564 intResult = GetLastInt(&FreeBusyList);
3565 frameCECalAdr->SetupPointers(&FreeBusyList,
3569 &FreeBusyListTokens,
3571 lboFreeBusyAddresses,
3573 frameCECalAdr->ShowModal();
3574 delete frameCECalAdr;
3575 frameCECalAdr = NULL;
3578 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
3580 long longSelected = -1;
3581 int intSelectedData = 0;
3583 if (!GetSelectedItem(lboFreeBusyAddresses,
3589 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3590 frameCECalAdr->SetupPointers(&FreeBusyList,
3594 &FreeBusyListTokens,
3596 lboFreeBusyAddresses,
3598 frameCECalAdr->SetEditorMode(TRUE);
3599 frameCECalAdr->ShowModal();
3600 delete frameCECalAdr;
3601 frameCECalAdr = NULL;
3604 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
3606 long longSelected = -1;
3607 int intSelectedData = 0;
3609 if (!GetSelectedItem(lboFreeBusyAddresses,
3615 lboFreeBusyAddresses->DeleteItem(longSelected);
3617 DeleteMapData(intSelectedData, &FreeBusyList, &FreeBusyListAltID,
3618 &FreeBusyListPID, &FreeBusyListType, &FreeBusyListTokens,
3623 void frmContactEditor::AddKey( wxCommandEvent& event )
3627 frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
3628 frameCEKey->SetEditorMode(FALSE);
3629 intResult = GetLastInt(&KeyList);
3630 frameCEKey->SetupPointers(&KeyList,
3640 frameCEKey->ShowModal();
3645 void frmContactEditor::ModifyKey( wxCommandEvent& event )
3647 long longSelected = -1;
3648 int intSelectedData = 0;
3650 if (!GetSelectedItem(lboKeys,
3656 frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
3657 frameCEKey->SetupPointers(&KeyList,
3667 frameCEKey->SetEditorMode(TRUE);
3668 frameCEKey->ShowModal();
3673 void frmContactEditor::DeleteKey( wxCommandEvent& event )
3675 long longSelected = -1;
3676 int intSelectedData = 0;
3678 if (!GetSelectedItem(lboKeys,
3684 lboKeys->DeleteItem(longSelected);
3686 DeleteMapData(intSelectedData, &KeyList, &KeyListAltID,
3687 &KeyListPID, &KeyListKeyType, &KeyListDataType, &KeyListType,
3688 &KeyListTokens, &KeyListPref);
3692 void frmContactEditor::AddVendorNamespace( wxCommandEvent& event )
3696 frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
3697 frameCEVen->SetEditorMode(FALSE);
3698 intResult = GetLastInt(&VendorList);
3699 frameCEVen->SetupPointers(&VendorList,
3704 frameCEVen->ShowModal();
3709 void frmContactEditor::ModifyVendorNamespace( wxCommandEvent& event )
3711 long longSelected = -1;
3712 int intSelectedData = 0;
3714 if (!GetSelectedItem(lboVendorNamespace,
3720 frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
3721 frameCEVen->SetupPointers(&VendorList,
3726 frameCEVen->SetEditorMode(TRUE);
3727 frameCEVen->ShowModal();
3732 void frmContactEditor::DeleteVendorNamespace( wxCommandEvent& event )
3734 long longSelected = -1;
3735 int intSelectedData = 0;
3737 if (!GetSelectedItem(lboVendorNamespace,
3743 lboVendorNamespace->DeleteItem(longSelected);
3745 DeleteMapData(intSelectedData, &VendorList, &VendorListPEN,
3746 &VendorListElement);
3750 void frmContactEditor::AddXToken( wxCommandEvent& event )
3754 frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
3755 frameCEXT->SetEditorMode(FALSE);
3756 intResult = GetLastInt(&XTokenList);
3757 frameCEXT->SetupPointers(&XTokenList,
3761 frameCEXT->ShowModal();
3766 void frmContactEditor::ModifyXToken( wxCommandEvent& event )
3768 long longSelected = -1;
3769 int intSelectedData = 0;
3771 if (!GetSelectedItem(lboXToken,
3777 frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
3778 frameCEXT->SetupPointers(&XTokenList,
3782 frameCEXT->SetEditorMode(TRUE);
3783 frameCEXT->ShowModal();
3788 void frmContactEditor::DeleteXToken( wxCommandEvent& event )
3790 long longSelected = -1;
3791 int intSelectedData = 0;
3793 if (!GetSelectedItem(lboXToken,
3799 lboXToken->DeleteItem(longSelected);
3801 DeleteMapData(intSelectedData, &XTokenList, &XTokenListTokens);
3805 void frmContactEditor::SaveContact( wxCommandEvent& event )
3808 // Check if Display As combo box has a value in it.
3809 // Do not go any further if there is no value.
3811 wxString cmbDisplayAsValue = cmbDisplayAs->GetValue();
3813 if (cmbDisplayAsValue.IsEmpty()){
3815 wxMessageBox(_("Display As value cannot be left blank."), _("Display As value empty"), wxICON_ERROR);
3820 // Save the updated contact data.
3823 wxString FilenameFinal;
3824 bool ReplaceContact = FALSE;
3826 if (cmbType->GetCurrentSelection() == 1 ||
3827 cmbType->GetCurrentSelection() == 3 ||
3828 cmbType->GetCurrentSelection() == 4){
3830 if (IsGroup == TRUE){
3832 // Mark contact for replacing.
3834 ReplaceContact = TRUE;
3838 } else if (cmbType->GetCurrentSelection() == 2){
3840 if (IsGroup == TRUE){
3842 // Mark contact for replacing.
3844 ReplaceContact = TRUE;
3850 if (ReplaceContact == TRUE){
3852 wxString wxDelSplitFilename;
3853 wxString wxDelFinalFilename;
3854 wxString wxSDelDataURL;
3855 wxStringTokenizer wSTDelFilename(wxSContactFilename, wxT("/"));
3856 while(wSTDelFilename.HasMoreTokens()){
3858 wxDelSplitFilename = wSTDelFilename.GetNextToken();
3862 wxSDelDataURL = wxDelSplitFilename;
3864 // Delete the contact from the server as it will be useless in certain
3865 // address book clients.
3867 ActMgrPtr->AddTask(2, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDelDataURL, wxDelSplitFilename, wxSContactFilename, wxT(""));
3869 // Clear the filename so the trigger to recreate the UID is done.
3871 wxSContactFilename.Clear();
3876 if (wxSContactFilename.IsEmpty()){
3878 // Generate a random UUID.
3880 UIDToken = GenerateUUID();
3881 UIDToken = UIDToken.MakeUpper();
3883 // Setup the filename.
3885 FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3887 #if defined(__HAIKU__)
3889 //preffilename = wxT("noo");
3891 #elif defined(__WIN32__)
3893 FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3894 FilenameFinal.Append(UIDToken);
3895 FilenameFinal.Append(wxT(".vcf"));
3896 wxSContactFilename = FilenameFinal;
3900 FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3901 FilenameFinal.Append(UIDToken);
3902 FilenameFinal.Append(wxT(".vcf"));
3903 wxSContactFilename = FilenameFinal;
3909 if (UIDToken.IsEmpty()){
3911 // UID Token is empty. (Shouldn't be).
3912 // Generate a new UID Token.
3914 /*boost::uuids::uuid ContactUUID = boost::uuids::random_generator()();
3915 std::string sstContactUUID = boost::uuids::to_string(ContactUUID);
3916 wxString strContactUUID(sstContactUUID.c_str(), wxConvUTF8);
3917 UIDToken = strContactUUID;*/
3918 UIDToken = GenerateUUID();
3919 UIDToken = UIDToken.MakeUpper();
3922 FilenameFinal = wxSContactFilename;
3926 // Setup the data and write it into the account folder.
3928 // Begin preperations to write the contact to a file.
3930 bool boolValue = FALSE;
3931 bool boolValue2 = FALSE;
3932 bool FNFirst = TRUE;
3933 bool NNGeneralFirst = TRUE;
3934 bool NNHomeFirst = TRUE;
3935 bool NNWorkFirst = TRUE;
3937 std::map<int,int>::iterator intiter;
3938 std::map<int,wxString>::iterator striter;
3940 ContactData.Add(wxT("BEGIN"), wxT("VCARD"), FALSE);
3941 ContactData.Add(wxT("VERSION"), wxT("4.0"), FALSE);
3943 // Setup the version string.
3945 strValue.Append(wxT("-//Xestia//Address Book Version "));
3946 strValue.Append(wxT(XSDAB_VERSION));
3947 strValue.Append(wxT("//KW"));
3949 ContactData.Add(wxT("PRODID"), strValue, FALSE);
3955 // Setup the name field.
3957 strValue = txtSurname->GetValue() + wxT(";") +
3958 txtForename->GetValue() + wxT(";") +
3959 txtOtherNames->GetValue() + wxT(";") +
3960 txtTitle->GetValue() + wxT(";") +
3961 txtSuffix->GetValue();
3963 strValue2 = ContactData.Convert(cmbDisplayAs->GetValue(), FALSE);
3966 if (NameTokens.IsEmpty()){
3967 ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\""), strValue, FALSE);
3969 ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\";") + NameTokens, strValue, FALSE);
3972 if (cmbType->GetCurrentSelection() == 1){
3974 ContactData.AddRaw(wxT("KIND"), wxT("individual"));
3976 } else if (cmbType->GetCurrentSelection() == 2){
3978 ContactData.AddRaw(wxT("KIND"), wxT("group"));
3980 // Go through each of the members and write them out.
3982 for (std::map<int, wxString>::iterator itemiter = GroupsList.begin();
3983 itemiter != GroupsList.end(); ++itemiter){
3985 ContactData.Add(wxT("MEMBER:urn:uuid"), itemiter->second, FALSE);
3989 } else if (cmbType->GetCurrentSelection() == 3){
3991 ContactData.AddRaw(wxT("KIND"), wxT("org"));
3993 } else if (cmbType->GetCurrentSelection() == 4){
3995 ContactData.AddRaw(wxT("KIND"), wxT("location"));
4000 // Setup the nicknames (General, Home & Business).
4011 // Setup the gender.
4013 if (cmbGender->GetCurrentSelection() != 0){
4015 switch(cmbGender->GetCurrentSelection()){
4019 strValue = wxT("M");
4024 strValue = wxT("F");
4029 strValue = wxT("O");
4034 strValue = wxT("N");
4039 strValue = wxT("U");
4046 if (!txtGenderDescription->IsEmpty()){
4048 strValue2 = txtGenderDescription->GetValue();
4052 if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4054 EscapeString(&strValue2, FALSE);
4056 if (!GenderTokens.IsEmpty()){
4058 if (!strValue2.IsEmpty()){
4060 ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue + wxT(";") + strValue2);
4064 ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue);
4070 if (!strValue2.IsEmpty()){
4072 ContactData.AddRaw(wxT("GENDER"), strValue + wxT(";") + strValue2);
4076 ContactData.AddRaw(wxT("GENDER"), strValue);
4095 strValue3 = BirthdayAltID;
4097 if (!strValue3.IsEmpty()){
4102 strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\""));
4108 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4111 // Process Language.
4113 strValue3 = BirthdayCalScale;
4115 if (!strValue3.IsEmpty()){
4120 if (boolValue2 == TRUE){
4122 strValue2.Append(wxT(";"));
4130 strValue2.Append(wxT("CALSCALE=") + strValue3);
4138 strValue2 = BirthdayTokens;
4140 // Get the birthday and write it.
4142 ResetSaveProcessData();
4144 if (!txtBirthday->IsEmpty()){
4146 strValue = txtBirthday->GetValue();
4148 if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4150 if (!strValue2.IsEmpty()){
4152 EscapeString(&strValue2, FALSE);
4153 EscapeString(&strValue, FALSE);
4155 ContactData.AddRaw(wxT("BDAY;VALUE=text;") + strValue2 + wxT(";"), strValue);
4159 EscapeString(&strValue, FALSE);
4161 ContactData.AddRaw(wxT("BDAY;VALUE=text"), strValue);
4171 // Get Day, Month & Year.
4173 wxDateTime BirthdayDate;
4174 wxDateTime::Month BirthdayMonth;
4177 wxString DataBeforeT;
4178 wxString DataAfterT;
4179 wxString FinalBirthdayString;
4180 bool ProcessDataAfterT = FALSE;
4182 BirthdayDate = dapBirthday->GetValue();
4184 if (BirthdayDate.IsValid()){
4186 BirthdayDay = BirthdayDate.GetDay();
4187 BirthdayMonth = BirthdayDate.GetMonth();
4188 BirthdayYear = BirthdayDate.GetYear();
4190 // Look for T and replace data before this.
4192 wxStringTokenizer wSTDate(Birthday, wxT("T"));
4194 while (wSTDate.HasMoreTokens()){
4196 if (ProcessDataAfterT == FALSE){
4198 DataBeforeT = wSTDate.GetNextToken();
4199 ProcessDataAfterT = TRUE;
4203 DataAfterT = wSTDate.GetNextToken();
4210 // If there is not T then replace altogether.
4212 wxString FinalBirthdayDay;
4213 wxString FinalBirthdayMonth;
4214 wxString FinalBirthdayYear;
4216 if (BirthdayDay < 10){
4218 FinalBirthdayDay = wxT("0") + wxString::Format(wxT("%i"), BirthdayDay);
4222 FinalBirthdayDay = wxString::Format(wxT("%i"), BirthdayDay);
4226 if (((int)BirthdayMonth + 1) < 10){
4228 FinalBirthdayMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1));
4232 FinalBirthdayMonth = wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1));
4236 if (BirthdayYear == 0){
4238 FinalBirthdayYear = wxT("--");
4242 FinalBirthdayYear = wxString::Format(wxT("%i"), BirthdayYear);
4246 if (!DataAfterT.IsEmpty()){
4248 FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay + wxT("T") + DataAfterT;
4252 FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay;
4256 if (!FinalBirthdayString.IsEmpty() || !strValue2.IsEmpty()){
4258 if (!strValue2.IsEmpty()){
4260 EscapeString(&strValue2, FALSE);
4261 EscapeString(&strValue, FALSE);
4263 ContactData.AddRaw(wxT("BDAY") + strValue2 + wxT(";"), FinalBirthdayString);
4267 EscapeString(&strValue, FALSE);
4269 ContactData.AddRaw(wxT("BDAY"), FinalBirthdayString);
4279 ResetSaveProcessData();
4283 strValue3 = AnniversaryAltID;
4285 if (!strValue3.IsEmpty()){
4290 strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\""));
4296 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4299 // Process Language.
4301 strValue3 = AnniversaryCalScale;
4303 if (!strValue3.IsEmpty()){
4308 if (boolValue2 == TRUE){
4310 strValue2.Append(wxT(";"));
4318 strValue2.Append(wxT("CALSCALE=") + strValue3);
4326 strValue2 = AnniversaryTokens;
4328 // Deal with ANNIVERSARY.
4330 if (!txtAnniversary->IsEmpty()){
4332 strValue = txtAnniversary->GetValue();
4334 if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4336 if (!strValue2.IsEmpty()){
4338 EscapeString(&strValue2, FALSE);
4339 EscapeString(&strValue, FALSE);
4341 ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text;") + strValue2 + wxT(";"), strValue);
4345 EscapeString(&strValue, FALSE);
4347 ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text"), strValue);
4355 // Look for T and replace data before this.
4357 // Get Day, Month & Year.
4359 wxDateTime AnniversaryDate;
4360 wxDateTime::Month AnniversaryMonth;
4362 int AnniversaryYear;
4363 wxString DataBeforeT;
4364 wxString DataAfterT;
4365 wxString FinalAnniversaryString;
4366 bool ProcessDataAfterT = FALSE;
4368 AnniversaryDate = dapAnniversary->GetValue();
4370 if (AnniversaryDate.IsValid()){
4372 AnniversaryDay = AnniversaryDate.GetDay();
4373 AnniversaryMonth = AnniversaryDate.GetMonth();
4374 AnniversaryYear = AnniversaryDate.GetYear();
4376 // Look for T and replace data before this.
4378 wxStringTokenizer wSTDate(Anniversary, wxT("T"));
4380 while (wSTDate.HasMoreTokens()){
4382 if (ProcessDataAfterT == FALSE){
4384 DataBeforeT = wSTDate.GetNextToken();
4385 ProcessDataAfterT = TRUE;
4389 DataAfterT = wSTDate.GetNextToken();
4396 // If there is not T then replace altogether.
4398 wxString FinalAnniversaryDay;
4399 wxString FinalAnniversaryMonth;
4400 wxString FinalAnniversaryYear;
4402 if (AnniversaryDay < 10){
4404 FinalAnniversaryDay = wxT("0") + wxString::Format(wxT("%i"), AnniversaryDay);
4408 FinalAnniversaryDay = wxString::Format(wxT("%i"), AnniversaryDay);
4412 if (((int)AnniversaryMonth + 1) < 10){
4414 FinalAnniversaryMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1));
4418 FinalAnniversaryMonth = wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1));
4422 if (AnniversaryYear == 0){
4424 FinalAnniversaryYear = wxT("--");
4428 FinalAnniversaryYear = wxString::Format(wxT("%i"), AnniversaryYear);
4432 if (!DataAfterT.IsEmpty()){
4434 FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay + wxT("T") + DataAfterT;
4438 FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay;
4442 if (!FinalAnniversaryString.IsEmpty() || !strValue2.IsEmpty()){
4444 if (!strValue2.IsEmpty()){
4446 EscapeString(&strValue2, FALSE);
4447 EscapeString(&strValue, FALSE);
4449 ContactData.AddRaw(wxT("ANNIVERSARY") + strValue2 + wxT(";"), FinalAnniversaryString);
4453 EscapeString(&strValue, FALSE);
4455 ContactData.AddRaw(wxT("ANNIVERSARY"), FinalAnniversaryString);
4465 // Setup the addresses (General, Home, Business).
4467 //intValue = GeneralAddressList.size();
4468 ResetSaveProcessData();
4470 for (std::map<int,wxString>::iterator iter = GeneralAddressList.begin();
4471 iter != GeneralAddressList.end(); ++iter){
4473 int intSeekValue = iter->first;
4475 wxString strAddressString;
4476 wxString strAddressFinalValue;
4477 std::map<int, wxString>::iterator iterValue;
4479 strAddressString.Append(wxT(";;"));
4483 iterValue = GeneralAddressList.find(intSeekValue);
4484 strAddressFinalValue = iterValue->second;
4485 ProcessCaptureStrings(&strAddressFinalValue);
4486 strAddressString.Append(strAddressFinalValue + wxT(";"));
4487 strAddressFinalValue.Clear();
4491 iterValue = GeneralAddressListTown.find(intSeekValue);
4492 strAddressFinalValue = iterValue->second;
4493 ProcessCaptureStrings(&strAddressFinalValue);
4494 strAddressString.Append(strAddressFinalValue + wxT(";"));
4495 strAddressFinalValue.Clear();
4499 iterValue = GeneralAddressListCounty.find(intSeekValue);
4500 strAddressFinalValue = iterValue->second;
4501 ProcessCaptureStrings(&strAddressFinalValue);
4502 strAddressString.Append(strAddressFinalValue + wxT(";"));
4503 strAddressFinalValue.Clear();
4507 iterValue = GeneralAddressListPostCode.find(intSeekValue);
4508 strAddressFinalValue = iterValue->second;
4509 ProcessCaptureStrings(&strAddressFinalValue);
4510 strAddressString.Append(strAddressFinalValue + wxT(";"));
4511 strAddressFinalValue.Clear();
4515 iterValue = GeneralAddressListCountry.find(intSeekValue);
4516 strAddressFinalValue = iterValue->second;
4517 ProcessCaptureStrings(&strAddressFinalValue);
4518 strAddressString.Append(strAddressFinalValue);
4519 strAddressFinalValue.Clear();
4521 ProcessSaveData(wxT("ADR"), &strValue2, &boolValue2, &boolValue,
4522 &iter, &strAddressString, &ContactData,
4523 wxT("LABEL"), &GeneralAddressListLabel,
4524 wxT("LANGUAGE"), &GeneralAddressListLang,
4525 wxT("ALTID"), &GeneralAddressListAltID,
4526 wxT("PID"), &GeneralAddressListPID,
4527 wxT("GEO"), &GeneralAddressListGeo,
4528 wxT("TZ"), &GeneralAddressListTimezone,
4529 wxT("MEDIATYPE"), &GeneralAddressListMediatype,
4530 wxT("PREF"), &GeneralAddressListPref,
4531 wxT(""), &GeneralAddressListTokens );
4533 ResetSaveProcessData();
4537 ResetSaveProcessData();
4539 for (std::map<int,wxString>::iterator iter = HomeAddressList.begin();
4540 iter != HomeAddressList.end(); ++iter){
4542 int intSeekValue = iter->first;
4544 wxString strAddressString;
4545 wxString strAddressFinalValue;
4546 std::map<int, wxString>::iterator iterValue;
4548 strAddressString.Append(wxT(";;"));
4552 iterValue = HomeAddressList.find(intSeekValue);
4553 strAddressFinalValue = iterValue->second;
4554 ProcessCaptureStrings(&strAddressFinalValue);
4556 strAddressString.Append(strAddressFinalValue + wxT(";"));
4560 iterValue = HomeAddressListTown.find(intSeekValue);
4561 strAddressFinalValue = iterValue->second;
4562 ProcessCaptureStrings(&strAddressFinalValue);
4564 strAddressString.Append(strAddressFinalValue + wxT(";"));
4568 iterValue = HomeAddressListCounty.find(intSeekValue);
4569 strAddressFinalValue = iterValue->second;
4570 ProcessCaptureStrings(&strAddressFinalValue);
4572 strAddressString.Append(strAddressFinalValue + wxT(";"));
4576 iterValue = HomeAddressListPostCode.find(intSeekValue);
4577 strAddressFinalValue = iterValue->second;
4578 ProcessCaptureStrings(&strAddressFinalValue);
4580 strAddressString.Append(strAddressFinalValue + wxT(";"));
4584 iterValue = HomeAddressListCountry.find(intSeekValue);
4585 strAddressFinalValue = iterValue->second;
4586 ProcessCaptureStrings(&strAddressFinalValue);
4588 strAddressString.Append(strAddressFinalValue);
4590 ProcessSaveData(wxT("ADR;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4591 &iter, &strAddressString, &ContactData,
4592 wxT("LABEL"), &HomeAddressListLabel,
4593 wxT("LANGUAGE"), &HomeAddressListLang,
4594 wxT("ALTID"), &HomeAddressListAltID,
4595 wxT("PID"), &HomeAddressListPID,
4596 wxT("GEO"), &HomeAddressListGeo,
4597 wxT("TZ"), &HomeAddressListTimezone,
4598 wxT("MEDIATYPE"), &HomeAddressListMediatype,
4599 wxT("PREF"), &HomeAddressListPref,
4600 wxT(""), &HomeAddressListTokens );
4602 ResetSaveProcessData();
4606 ResetSaveProcessData();
4608 for (std::map<int,wxString>::iterator iter = BusinessAddressList.begin();
4609 iter != BusinessAddressList.end(); ++iter){
4611 int intSeekValue = iter->first;
4613 wxString strAddressString;
4614 wxString strAddressFinalValue;
4615 std::map<int, wxString>::iterator iterValue;
4617 strAddressString.Append(wxT(";;"));
4621 iterValue = BusinessAddressList.find(intSeekValue);
4622 strAddressFinalValue = iterValue->second;
4623 ProcessCaptureStrings(&strAddressFinalValue);
4625 strAddressString.Append(strAddressFinalValue + wxT(";"));
4629 iterValue = BusinessAddressListTown.find(intSeekValue);
4630 strAddressFinalValue = iterValue->second;
4631 ProcessCaptureStrings(&strAddressFinalValue);
4633 strAddressString.Append(strAddressFinalValue + wxT(";"));
4637 iterValue = BusinessAddressListCounty.find(intSeekValue);
4638 strAddressFinalValue = iterValue->second;
4639 ProcessCaptureStrings(&strAddressFinalValue);
4641 strAddressString.Append(strAddressFinalValue + wxT(";"));
4645 iterValue = BusinessAddressListPostCode.find(intSeekValue);
4646 strAddressFinalValue = iterValue->second;
4647 ProcessCaptureStrings(&strAddressFinalValue);
4649 strAddressString.Append(strAddressFinalValue + wxT(";"));
4653 iterValue = BusinessAddressListCountry.find(intSeekValue);
4654 strAddressFinalValue = iterValue->second;
4655 ProcessCaptureStrings(&strAddressFinalValue);
4657 strAddressString.Append(strAddressFinalValue);
4659 ProcessSaveData(wxT("ADR;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4660 &iter, &strAddressString, &ContactData,
4661 wxT("LABEL"), &BusinessAddressListLabel,
4662 wxT("LANGUAGE"), &BusinessAddressListLang,
4663 wxT("ALTID"), &BusinessAddressListAltID,
4664 wxT("PID"), &BusinessAddressListPID,
4665 wxT("GEO"), &BusinessAddressListGeo,
4666 wxT("TZ"), &BusinessAddressListTimezone,
4667 wxT("MEDIATYPE"), &BusinessAddressListMediatype,
4668 wxT("PREF"), &BusinessAddressListPref,
4669 wxT(""), &BusinessAddressListTokens );
4671 ResetSaveProcessData();
4675 // Sort out nicknames (if any).
4677 for (std::map<int,wxString>::iterator iter = GeneralNicknamesList.begin();
4678 iter != GeneralNicknamesList.end(); ++iter){
4680 intValue2 = iter->first;
4682 // Process Alternative ID.
4684 ProcessSaveData(wxT("NICKNAME"), &strValue2, &boolValue2, &boolValue,
4685 &iter, &GeneralNicknamesList, &ContactData,
4686 wxT("LANGUAGE"), &GeneralNicknamesListLanguage,
4687 wxT("ALTID"), &GeneralNicknamesListAltID,
4688 wxT("PID"), &GeneralNicknamesListPID,
4689 wxT("PREF"), &GeneralNicknamesListPref,
4690 wxT(""), &GeneralNicknamesListTokens );
4692 ResetSaveProcessData();
4696 ResetSaveProcessData();
4698 for (std::map<int,wxString>::iterator iter = HomeNicknamesList.begin();
4699 iter != HomeNicknamesList.end(); ++iter){
4701 ProcessSaveData(wxT("NICKNAME;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4702 &iter, &HomeNicknamesList, &ContactData,
4703 wxT("LANGUAGE"), &HomeNicknamesListLanguage,
4704 wxT("ALTID"), &HomeNicknamesListAltID,
4705 wxT("PID"), &HomeNicknamesListPID,
4706 wxT("PREF"), &HomeNicknamesListPref,
4707 wxT(""), &HomeNicknamesListTokens );
4709 ResetSaveProcessData();
4713 ResetSaveProcessData();
4715 for (std::map<int,wxString>::iterator iter = BusinessNicknamesList.begin();
4716 iter != BusinessNicknamesList.end(); ++iter){
4718 ProcessSaveData(wxT("NICKNAME;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4719 &iter, &BusinessNicknamesList, &ContactData,
4720 wxT("LANGUAGE"), &BusinessNicknamesListLanguage,
4721 wxT("ALTID"), &BusinessNicknamesListAltID,
4722 wxT("PID"), &BusinessNicknamesListPID,
4723 wxT("PREF"), &BusinessNicknamesListPref,
4724 wxT(""), &BusinessNicknamesListTokens );
4726 ResetSaveProcessData();
4730 ResetSaveProcessData();
4732 // Sort out email (general, home and business).
4734 for (std::map<int,wxString>::iterator iter = GeneralEmailList.begin();
4735 iter != GeneralEmailList.end(); ++iter){
4737 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4740 wxString strAddressFinalValue;
4741 std::map<int, wxString>::iterator iterValue;
4743 ProcessSaveData(wxT("EMAIL"), &strValue2, &boolValue2, &boolValue,
4744 &iter, &GeneralEmailList, &ContactData,
4745 wxT("ALTID"), &GeneralEmailListAltID,
4746 wxT("PID"), &GeneralEmailListPID,
4747 wxT("PREF"), &GeneralEmailListPref,
4748 wxT(""), &GeneralEmailListTokens );
4750 ResetSaveProcessData();
4754 ResetSaveProcessData();
4756 for (std::map<int,wxString>::iterator iter = HomeEmailList.begin();
4757 iter != HomeEmailList.end(); ++iter){
4759 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4762 ProcessSaveData(wxT("EMAIL;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4763 &iter, &HomeEmailList, &ContactData,
4764 wxT("ALTID"), &HomeEmailListAltID,
4765 wxT("PID"), &HomeEmailListPID,
4766 wxT("PREF"), &HomeEmailListPref,
4767 wxT(""), &HomeEmailListTokens );
4769 ResetSaveProcessData();
4773 ResetSaveProcessData();
4775 for (std::map<int,wxString>::iterator iter = BusinessEmailList.begin();
4776 iter != BusinessEmailList.end(); ++iter){
4778 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4781 ProcessSaveData(wxT("EMAIL;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4782 &iter, &BusinessEmailList, &ContactData,
4783 wxT("ALTID"), &BusinessEmailListAltID,
4784 wxT("PID"), &BusinessEmailListPID,
4785 wxT("PREF"), &BusinessEmailListPref,
4786 wxT(""), &BusinessEmailListTokens );
4788 ResetSaveProcessData();
4792 ResetSaveProcessData();
4794 for (std::map<int,wxString>::iterator iter = GeneralIMList.begin();
4795 iter != GeneralIMList.end(); ++iter){
4797 intValue2 = iter->first;
4799 // Process Alternative ID.
4801 ProcessSaveData(wxT("IMPP"), &strValue2, &boolValue2, &boolValue,
4802 &iter, &GeneralIMList, &ContactData,
4803 wxT("ALTID"), &GeneralIMListAltID,
4804 wxT("PID"), &GeneralIMListPID,
4805 wxT("MEDIATYPE"), &GeneralIMListMediatype,
4806 wxT("PREF"), &GeneralIMListPref,
4807 wxT(""), &GeneralIMListTokens );
4809 ResetSaveProcessData();
4813 ResetSaveProcessData();
4815 for (std::map<int,wxString>::iterator iter = HomeIMList.begin();
4816 iter != HomeIMList.end(); ++iter){
4818 ProcessSaveData(wxT("IMPP;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4819 &iter, &HomeIMList, &ContactData,
4820 wxT("ALTID"), &HomeIMListAltID,
4821 wxT("PID"), &HomeIMListPID,
4822 wxT("MEDIATYPE"), &HomeIMListMediatype,
4823 wxT("PREF"), &HomeIMListPref,
4824 wxT(""), &HomeIMListTokens );
4826 ResetSaveProcessData();
4830 ResetSaveProcessData();
4832 for (std::map<int,wxString>::iterator iter = BusinessIMList.begin();
4833 iter != BusinessIMList.end(); ++iter){
4835 ProcessSaveData(wxT("IMPP;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4836 &iter, &BusinessIMList, &ContactData,
4837 wxT("ALTID"), &BusinessIMListAltID,
4838 wxT("PID"), &BusinessIMListPID,
4839 wxT("MEDIATYPE"), &BusinessIMListMediatype,
4840 wxT("PREF"), &BusinessIMListPref,
4841 wxT(""), &BusinessIMListTokens );
4843 ResetSaveProcessData();
4847 ResetSaveProcessData();
4849 for (std::map<int,wxString>::iterator iter = GeneralTelephoneList.begin();
4850 iter != GeneralTelephoneList.end(); ++iter){
4852 wxString strAddressFinalValue = iter->second;
4854 ProcessCaptureStrings(&strAddressFinalValue);
4856 strAddressFinalValue.insert(0, wxT("tel:"));
4858 ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4859 &iter, &strAddressFinalValue, &ContactData,
4860 wxT("ALTID"), &GeneralTelephoneListAltID,
4861 wxT("PID"), &GeneralTelephoneListPID,
4862 wxT("TYPE"), &GeneralTelephoneListType,
4863 wxT("PREF"), &GeneralTelephoneListPref,
4864 wxT(""), &GeneralTelephoneListTokens );
4866 ResetSaveProcessData();
4870 ResetSaveProcessData();
4872 for (std::map<int,wxString>::iterator iter = HomeTelephoneList.begin();
4873 iter != HomeTelephoneList.end(); ++iter){
4875 wxString strAddressFinalValue = iter->second;
4877 ProcessCaptureStrings(&strAddressFinalValue);
4879 strAddressFinalValue.insert(0, wxT("tel:"));
4881 ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4882 &iter, &strAddressFinalValue, &ContactData,
4883 wxT("ALTID"), &HomeTelephoneListAltID,
4884 wxT("PID"), &HomeTelephoneListPID,
4885 wxT("TYPE"), &HomeTelephoneListType,
4886 wxT("PREF"), &HomeTelephoneListPref,
4887 wxT(""), &HomeTelephoneListTokens );
4889 ResetSaveProcessData();
4893 ResetSaveProcessData();
4895 for (std::map<int,wxString>::iterator iter = BusinessTelephoneList.begin();
4896 iter != BusinessTelephoneList.end(); ++iter){
4898 wxString strAddressFinalValue = iter->second;
4900 ProcessCaptureStrings(&strAddressFinalValue);
4902 strAddressFinalValue.insert(0, wxT("tel:"));
4904 ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4905 &iter, &strAddressFinalValue, &ContactData,
4906 wxT("ALTID"), &BusinessTelephoneListAltID,
4907 wxT("PID"), &BusinessTelephoneListPID,
4908 wxT("TYPE"), &BusinessTelephoneListType,
4909 wxT("PREF"), &BusinessTelephoneListPref,
4910 wxT(""), &BusinessTelephoneListTokens );
4912 ResetSaveProcessData();
4916 ResetSaveProcessData();
4918 for (std::map<int,wxString>::iterator iter = GeneralLanguageList.begin();
4919 iter != GeneralLanguageList.end(); ++iter){
4921 intValue2 = iter->first;
4923 ProcessSaveData(wxT("LANG"), &strValue2, &boolValue2, &boolValue,
4924 &iter, &GeneralLanguageList, &ContactData,
4925 wxT("ALTID"), &GeneralLanguageListAltID,
4926 wxT("PID"), &GeneralLanguageListPID,
4927 wxT("PREF"), &GeneralLanguageListPref,
4928 wxT(""), &GeneralLanguageListTokens );
4930 ResetSaveProcessData();
4934 ResetSaveProcessData();
4936 for (std::map<int,wxString>::iterator iter = HomeLanguageList.begin();
4937 iter != HomeLanguageList.end(); ++iter){
4939 ProcessSaveData(wxT("LANG;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4940 &iter, &HomeLanguageList, &ContactData,
4941 wxT("ALTID"), &HomeLanguageListAltID,
4942 wxT("PID"), &HomeLanguageListPID,
4943 wxT("PREF"), &HomeLanguageListPref,
4944 wxT(""), &HomeLanguageListTokens );
4946 ResetSaveProcessData();
4950 ResetSaveProcessData();
4952 for (std::map<int,wxString>::iterator iter = BusinessLanguageList.begin();
4953 iter != BusinessLanguageList.end(); ++iter){
4955 ProcessSaveData(wxT("LANG;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4956 &iter, &BusinessLanguageList, &ContactData,
4957 wxT("ALTID"), &BusinessLanguageListAltID,
4958 wxT("PID"), &BusinessLanguageListPID,
4959 wxT("PREF"), &BusinessLanguageListPref,
4960 wxT(""), &BusinessLanguageListTokens );
4962 ResetSaveProcessData();
4966 ResetSaveProcessData();
4968 for (std::map<int,wxString>::iterator iter = GeneralTZList.begin();
4969 iter != GeneralTZList.end(); ++iter){
4971 ProcessSaveData(wxT("TZ"), &strValue2, &boolValue2, &boolValue,
4972 &iter, &GeneralTZList, &ContactData,
4973 wxT("ALTID"), &GeneralTZListAltID,
4974 wxT("PID"), &GeneralTZListPID,
4975 wxT("MEDIATYPE"), &GeneralTZListMediatype,
4976 wxT("PREF"), &GeneralTZListPref,
4977 wxT(""), &GeneralTZListTokens );
4979 ResetSaveProcessData();
4983 ResetSaveProcessData();
4985 for (std::map<int,wxString>::iterator iter = HomeTZList.begin();
4986 iter != HomeTZList.end(); ++iter){
4988 ProcessSaveData(wxT("TZ;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4989 &iter, &HomeTZList, &ContactData,
4990 wxT("ALTID"), &HomeTZListAltID,
4991 wxT("PID"), &HomeTZListPID,
4992 wxT("MEDIATYPE"), &HomeTZListMediatype,
4993 wxT("PREF"), &HomeTZListPref,
4994 wxT(""), &HomeTZListTokens );
4996 ResetSaveProcessData();
5000 ResetSaveProcessData();
5002 for (std::map<int,wxString>::iterator iter = BusinessTZList.begin();
5003 iter != BusinessTZList.end(); ++iter){
5005 ProcessSaveData(wxT("TZ;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5006 &iter, &BusinessTZList, &ContactData,
5007 wxT("ALTID"), &BusinessTZListAltID,
5008 wxT("PID"), &BusinessTZListPID,
5009 wxT("MEDIATYPE"), &BusinessTZListMediatype,
5010 wxT("PREF"), &BusinessTZListPref,
5011 wxT(""), &BusinessTZListTokens );
5013 ResetSaveProcessData();
5017 ResetSaveProcessData();
5019 for (std::map<int,wxString>::iterator iter = GeneralGeographyList.begin();
5020 iter != GeneralGeographyList.end(); ++iter){
5022 wxString strAddressFinalValue = iter->second;
5024 ProcessCaptureStrings(&strAddressFinalValue);
5026 strAddressFinalValue.insert(0, wxT("geo:"));
5028 ProcessSaveData(wxT("GEO"), &strValue2, &boolValue2, &boolValue,
5029 &iter, &strAddressFinalValue, &ContactData,
5030 wxT("ALTID"), &GeneralGeographyListAltID,
5031 wxT("PID"), &GeneralGeographyListPID,
5032 wxT("MEDIATYPE"), &GeneralGeographyListMediatype,
5033 wxT("PREF"), &GeneralGeographyListPref,
5034 wxT(""), &GeneralGeographyListTokens );
5036 ResetSaveProcessData();
5040 ResetSaveProcessData();
5042 for (std::map<int,wxString>::iterator iter = HomeGeographyList.begin();
5043 iter != HomeGeographyList.end(); ++iter){
5045 wxString strAddressFinalValue = iter->second;
5047 ProcessCaptureStrings(&strAddressFinalValue);
5049 strAddressFinalValue.insert(0, wxT("geo:"));
5051 ProcessSaveData(wxT("GEO;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5052 &iter, &HomeGeographyList, &ContactData,
5053 wxT("ALTID"), &HomeGeographyListAltID,
5054 wxT("PID"), &HomeGeographyListPID,
5055 wxT("MEDIATYPE"), &HomeGeographyListMediatype,
5056 wxT("PREF"), &HomeGeographyListPref,
5057 wxT(""), &HomeGeographyListTokens );
5059 ResetSaveProcessData();
5063 ResetSaveProcessData();
5065 for (std::map<int,wxString>::iterator iter = BusinessGeographyList.begin();
5066 iter != BusinessGeographyList.end(); ++iter){
5068 wxString strAddressFinalValue = iter->second;
5070 ProcessCaptureStrings(&strAddressFinalValue);
5072 strAddressFinalValue.insert(0, wxT("geo:"));
5074 ProcessSaveData(wxT("GEO;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5075 &iter, &BusinessGeographyList, &ContactData,
5076 wxT("ALTID"), &BusinessGeographyListAltID,
5077 wxT("PID"), &BusinessGeographyListPID,
5078 wxT("MEDIATYPE"), &BusinessGeographyListMediatype,
5079 wxT("PREF"), &BusinessGeographyListPref,
5080 wxT(""), &BusinessGeographyListTokens );
5082 ResetSaveProcessData();
5086 ResetSaveProcessData();
5088 for (std::map<int,wxString>::iterator iter = GeneralRelatedList.begin();
5089 iter != GeneralRelatedList.end(); ++iter){
5091 ProcessSaveData(wxT("RELATED"), &strValue2, &boolValue2, &boolValue,
5092 &iter, &GeneralRelatedList, &ContactData,
5093 wxT("ALTID"), &GeneralRelatedListAltID,
5094 wxT("PID"), &GeneralRelatedListPID,
5095 wxT("LANGUAGE"), &GeneralRelatedListLanguage,
5096 wxT("TYPE"), &GeneralRelatedListRelType,
5097 wxT("PREF"), &GeneralRelatedListPref,
5098 wxT(""), &GeneralRelatedListTokens );
5100 ResetSaveProcessData();
5104 ResetSaveProcessData();
5106 for (std::map<int,wxString>::iterator iter = GeneralWebsiteList.begin();
5107 iter != GeneralWebsiteList.end(); ++iter){
5109 ProcessSaveData(wxT("URL"), &strValue2, &boolValue2, &boolValue,
5110 &iter, &GeneralWebsiteList, &ContactData,
5111 wxT("ALTID"), &GeneralWebsiteListAltID,
5112 wxT("PID"), &GeneralWebsiteListPID,
5113 wxT("MEDIATYPE"), &GeneralWebsiteListMediatype,
5114 wxT("PREF"), &GeneralWebsiteListPref,
5115 wxT(""), &GeneralWebsiteListTokens );
5117 ResetSaveProcessData();
5121 ResetSaveProcessData();
5123 for (std::map<int,wxString>::iterator iter = HomeWebsiteList.begin();
5124 iter != HomeWebsiteList.end(); ++iter){
5126 ProcessSaveData(wxT("URL;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5127 &iter, &HomeWebsiteList, &ContactData,
5128 wxT("ALTID"), &HomeWebsiteListAltID,
5129 wxT("PID"), &HomeWebsiteListPID,
5130 wxT("MEDIATYPE"), &HomeWebsiteListMediatype,
5131 wxT("PREF"), &HomeWebsiteListPref,
5132 wxT(""), &HomeWebsiteListTokens );
5134 ResetSaveProcessData();
5138 ResetSaveProcessData();
5140 for (std::map<int,wxString>::iterator iter = BusinessWebsiteList.begin();
5141 iter != BusinessWebsiteList.end(); ++iter){
5143 ProcessSaveData(wxT("URL;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5144 &iter, &BusinessWebsiteList, &ContactData,
5145 wxT("ALTID"), &BusinessWebsiteListAltID,
5146 wxT("PID"), &BusinessWebsiteListPID,
5147 wxT("MEDIATYPE"), &BusinessWebsiteListMediatype,
5148 wxT("PREF"), &BusinessWebsiteListPref,
5149 wxT(""), &BusinessWebsiteListTokens );
5151 ResetSaveProcessData();
5155 ResetSaveProcessData();
5157 for (std::map<int,wxString>::iterator iter = GeneralTitleList.begin();
5158 iter != GeneralTitleList.end(); ++iter){
5160 ProcessSaveData(wxT("TITLE"), &strValue2, &boolValue2, &boolValue,
5161 &iter, &GeneralTitleList, &ContactData,
5162 wxT("ALTID"), &GeneralTitleListAltID,
5163 wxT("PID"), &GeneralTitleListPID,
5164 wxT("LANGUAGE"), &GeneralTitleListLanguage,
5165 wxT("PREF"), &GeneralTitleListPref,
5166 wxT(""), &GeneralTitleListTokens );
5168 ResetSaveProcessData();
5172 ResetSaveProcessData();
5174 for (std::map<int,wxString>::iterator iter = HomeTitleList.begin();
5175 iter != HomeTitleList.end(); ++iter){
5177 ProcessSaveData(wxT("TITLE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5178 &iter, &HomeTitleList, &ContactData,
5179 wxT("ALTID"), &HomeTitleListAltID,
5180 wxT("PID"), &HomeTitleListPID,
5181 wxT("LANGUAGE"), &HomeTitleListLanguage,
5182 wxT("PREF"), &HomeTitleListPref,
5183 wxT(""), &HomeTitleListTokens );
5185 ResetSaveProcessData();
5189 ResetSaveProcessData();
5191 for (std::map<int,wxString>::iterator iter = BusinessTitleList.begin();
5192 iter != BusinessTitleList.end(); ++iter){
5194 ProcessSaveData(wxT("TITLE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5195 &iter, &BusinessTitleList, &ContactData,
5196 wxT("ALTID"), &BusinessTitleListAltID,
5197 wxT("PID"), &BusinessTitleListPID,
5198 wxT("LANGUAGE"), &BusinessTitleListLanguage,
5199 wxT("PREF"), &BusinessTitleListPref,
5200 wxT(""), &BusinessTitleListTokens );
5202 ResetSaveProcessData();
5206 ResetSaveProcessData();
5208 for (std::map<int,wxString>::iterator iter = GeneralRoleList.begin();
5209 iter != GeneralRoleList.end(); ++iter){
5211 ProcessSaveData(wxT("ROLE"), &strValue2, &boolValue2, &boolValue,
5212 &iter, &GeneralRoleList, &ContactData,
5213 wxT("ALTID"), &GeneralRoleListAltID,
5214 wxT("PID"), &GeneralRoleListPID,
5215 wxT("LANGUAGE"), &GeneralRoleListLanguage,
5216 wxT("PREF"), &GeneralRoleListPref,
5217 wxT(""), &GeneralRoleListTokens );
5219 ResetSaveProcessData();
5223 ResetSaveProcessData();
5225 for (std::map<int,wxString>::iterator iter = HomeRoleList.begin();
5226 iter != HomeRoleList.end(); ++iter){
5228 ProcessSaveData(wxT("ROLE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5229 &iter, &HomeRoleList, &ContactData,
5230 wxT("ALTID"), &HomeRoleListAltID,
5231 wxT("PID"), &HomeRoleListPID,
5232 wxT("LANGUAGE"), &HomeRoleListLanguage,
5233 wxT("PREF"), &HomeRoleListPref,
5234 wxT(""), &HomeRoleListTokens );
5236 ResetSaveProcessData();
5240 ResetSaveProcessData();
5242 for (std::map<int,wxString>::iterator iter = BusinessRoleList.begin();
5243 iter != BusinessRoleList.end(); ++iter){
5245 ProcessSaveData(wxT("ROLE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5246 &iter, &BusinessRoleList, &ContactData,
5247 wxT("ALTID"), &BusinessRoleListAltID,
5248 wxT("PID"), &BusinessRoleListPID,
5249 wxT("LANGUAGE"), &BusinessRoleListLanguage,
5250 wxT("PREF"), &BusinessRoleListPref,
5251 wxT(""), &BusinessRoleListTokens );
5253 ResetSaveProcessData();
5257 ResetSaveProcessData();
5259 for (std::map<int,wxString>::iterator iter = GeneralOrganisationsList.begin();
5260 iter != GeneralOrganisationsList.end(); ++iter){
5262 ProcessSaveData(wxT("ORG"), &strValue2, &boolValue2, &boolValue,
5263 &iter, &GeneralOrganisationsList, &ContactData,
5264 wxT("ALTID"), &GeneralOrganisationsListAltID,
5265 wxT("PID"), &GeneralOrganisationsListPID,
5266 wxT("LANGUAGE"), &GeneralOrganisationsListLanguage,
5267 wxT("SORT-AS"), &GeneralOrganisationsListSortAs,
5268 wxT("PREF"), &GeneralOrganisationsListPref,
5269 wxT(""), &GeneralOrganisationsListTokens );
5271 ResetSaveProcessData();
5275 ResetSaveProcessData();
5277 for (std::map<int,wxString>::iterator iter = HomeOrganisationsList.begin();
5278 iter != HomeOrganisationsList.end(); ++iter){
5280 ProcessSaveData(wxT("ORG;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5281 &iter, &HomeOrganisationsList, &ContactData,
5282 wxT("ALTID"), &HomeOrganisationsListAltID,
5283 wxT("PID"), &HomeOrganisationsListPID,
5284 wxT("LANGUAGE"), &HomeOrganisationsListLanguage,
5285 wxT("SORT-AS"), &HomeOrganisationsListSortAs,
5286 wxT("PREF"), &HomeOrganisationsListPref,
5287 wxT(""), &HomeOrganisationsListTokens );
5289 ResetSaveProcessData();
5293 ResetSaveProcessData();
5295 for (std::map<int,wxString>::iterator iter = BusinessOrganisationsList.begin();
5296 iter != BusinessOrganisationsList.end(); ++iter){
5298 ProcessSaveData(wxT("ORG;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5299 &iter, &BusinessOrganisationsList, &ContactData,
5300 wxT("ALTID"), &BusinessOrganisationsListAltID,
5301 wxT("PID"), &BusinessOrganisationsListPID,
5302 wxT("LANGUAGE"), &BusinessOrganisationsListLanguage,
5303 wxT("SORT-AS"), &BusinessOrganisationsListSortAs,
5304 wxT("PREF"), &BusinessOrganisationsListPref,
5305 wxT(""), &BusinessOrganisationsListTokens );
5307 ResetSaveProcessData();
5311 ResetSaveProcessData();
5313 for (std::map<int,wxString>::iterator iter = GeneralNoteList.begin();
5314 iter != GeneralNoteList.end(); ++iter){
5316 ProcessSaveData(wxT("NOTE"), &strValue2, &boolValue2, &boolValue,
5317 &iter, &GeneralNoteList, &ContactData,
5318 wxT("ALTID"), &GeneralNoteListAltID,
5319 wxT("PID"), &GeneralNoteListPID,
5320 wxT("LANGUAGE"), &GeneralNoteListLanguage,
5321 wxT("PREF"), &GeneralNoteListPref,
5322 wxT(""), &GeneralNoteListTokens );
5324 ResetSaveProcessData();
5328 ResetSaveProcessData();
5330 for (std::map<int,wxString>::iterator iter = HomeNoteList.begin();
5331 iter != HomeNoteList.end(); ++iter){
5333 ProcessSaveData(wxT("NOTE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5334 &iter, &HomeNoteList, &ContactData,
5335 wxT("ALTID"), &HomeNoteListAltID,
5336 wxT("PID"), &HomeNoteListPID,
5337 wxT("LANGUAGE"), &HomeNoteListLanguage,
5338 wxT("PREF"), &HomeNoteListPref,
5339 wxT(""), &HomeNoteListTokens );
5341 ResetSaveProcessData();
5345 ResetSaveProcessData();
5347 for (std::map<int,wxString>::iterator iter = BusinessNoteList.begin();
5348 iter != BusinessNoteList.end(); ++iter){
5350 ProcessSaveData(wxT("NOTE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5351 &iter, &BusinessNoteList, &ContactData,
5352 wxT("ALTID"), &BusinessNoteListAltID,
5353 wxT("PID"), &BusinessNoteListPID,
5354 wxT("LANGUAGE"), &BusinessNoteListLanguage,
5355 wxT("PREF"), &BusinessNoteListPref,
5356 wxT(""), &BusinessNoteListTokens );
5358 ResetSaveProcessData();
5362 ResetSaveProcessData();
5364 for (std::map<int,wxString>::iterator iter = CategoriesList.begin();
5365 iter != CategoriesList.end(); ++iter){
5367 ProcessSaveData(wxT("CATEGORIES"), &strValue2, &boolValue2, &boolValue,
5368 &iter, &CategoriesList, &ContactData,
5369 wxT("ALTID"), &CategoriesListAltID,
5370 wxT("PID"), &CategoriesListPID,
5371 wxT("TYPE"), &CategoriesListType,
5372 wxT("PREF"), &CategoriesListPref,
5373 wxT(""), &CategoriesListTokens );
5375 ResetSaveProcessData();
5381 for (std::map<int, std::string>::iterator iter = PicturesList.begin();
5382 iter != PicturesList.end(); ++iter){
5384 int intValueIndex = iter->first;
5386 std::map<int, std::string>::iterator stdstriter;
5387 std::map<int, wxString>::iterator enciter;
5389 striter = PicturesListPictureType.find(intValueIndex);
5390 enciter = PicturesListPicEncType.find(intValueIndex);
5392 ProcessSaveData(wxT("PHOTO"), &strValue2, &boolValue2, &boolValue,
5393 &iter, &PicturesList, &striter,
5394 &enciter, &ContactData,
5395 wxT("ALTID"), &PicturesListAltID,
5396 wxT("PID"), &PicturesListPID,
5397 wxT("TYPE"), &PicturesListType,
5398 wxT("PREF"), &PicturesListPref,
5399 wxT(""), &PicturesListTokens);
5401 ResetSaveProcessData();
5405 ResetSaveProcessData();
5409 for (std::map<int, std::string>::iterator iter = LogosList.begin();
5410 iter != LogosList.end(); ++iter){
5412 int intValueIndex = iter->first;
5414 std::map<int, std::string>::iterator stdstriter;
5415 std::map<int, wxString>::iterator enciter;
5417 striter = LogosListPictureType.find(intValueIndex);
5418 enciter = LogosListPicEncType.find(intValueIndex);
5420 ProcessSaveData(wxT("LOGO"), &strValue2, &boolValue2, &boolValue,
5421 &iter, &LogosList, &striter,
5422 &enciter, &ContactData,
5423 wxT("ALTID"), &LogosListAltID,
5424 wxT("PID"), &LogosListPID,
5425 wxT("TYPE"), &LogosListType,
5426 wxT("PREF"), &LogosListPref,
5427 wxT(""), &LogosListTokens );
5429 ResetSaveProcessData();
5433 ResetSaveProcessData();
5437 for (std::map<int, std::string>::iterator iter = SoundsList.begin();
5438 iter != SoundsList.end(); ++iter){
5440 int intValueIndex = iter->first;
5442 std::map<int, std::string>::iterator stdstriter;
5443 std::map<int, wxString>::iterator enciter;
5445 striter = SoundsListAudioType.find(intValueIndex);
5446 enciter = SoundsListAudioEncType.find(intValueIndex);
5448 ProcessSaveData(wxT("SOUND"), &strValue2, &boolValue2, &boolValue,
5449 &iter, &SoundsList, &striter,
5450 &enciter, &ContactData,
5451 wxT("ALTID"), &SoundsListAltID,
5452 wxT("PID"), &SoundsListPID,
5453 wxT("TYPE"), &SoundsListType,
5454 wxT("PREF"), &SoundsListPref,
5455 wxT(""), &SoundsListTokens );
5457 ResetSaveProcessData();
5461 ResetSaveProcessData();
5463 for (std::map<int,wxString>::iterator iter = CalendarList.begin();
5464 iter != CalendarList.end(); ++iter){
5466 ProcessSaveData(wxT("CALURI"), &strValue2, &boolValue2, &boolValue,
5467 &iter, &CalendarList, &ContactData,
5468 wxT("ALTID"), &CalendarListAltID,
5469 wxT("PID"), &CalendarListPID,
5470 wxT("MEDIATYPE"), &CalendarListMediatype,
5471 wxT("TYPE"), &CalendarListType,
5472 wxT("PREF"), &CalendarListPref,
5473 wxT(""), &CalendarListTokens );
5475 ResetSaveProcessData();
5479 ResetSaveProcessData();
5481 for (std::map<int,wxString>::iterator iter = CalendarRequestList.begin();
5482 iter != CalendarRequestList.end(); ++iter){
5484 ProcessSaveData(wxT("CALADRURI"), &strValue2, &boolValue2, &boolValue,
5485 &iter, &CalendarRequestList, &ContactData,
5486 wxT("ALTID"), &CalendarRequestListAltID,
5487 wxT("PID"), &CalendarRequestListPID,
5488 wxT("MEDIATYPE"), &CalendarRequestListMediatype,
5489 wxT("TYPE"), &CalendarRequestListType,
5490 wxT("PREF"), &CalendarRequestListPref,
5491 wxT(""), &CalendarRequestListTokens );
5493 ResetSaveProcessData();
5497 ResetSaveProcessData();
5499 for (std::map<int,wxString>::iterator iter = FreeBusyList.begin();
5500 iter != FreeBusyList.end(); ++iter){
5502 ProcessSaveData(wxT("FBURL"), &strValue2, &boolValue2, &boolValue,
5503 &iter, &FreeBusyList, &ContactData,
5504 wxT("ALTID"), &FreeBusyListAltID,
5505 wxT("PID"), &FreeBusyListPID,
5506 wxT("MEDIATYPE"), &FreeBusyListMediatype,
5507 wxT("TYPE"), &FreeBusyListType,
5508 wxT("PREF"), &FreeBusyListPref,
5509 wxT(""), &FreeBusyListTokens );
5511 ResetSaveProcessData();
5515 for (std::map<int, wxString>::iterator iter = KeyList.begin();
5516 iter != KeyList.end(); ++iter){
5518 intValue2 = iter->first;
5520 // Process Alternative ID.
5522 striter = KeyListAltID.find(intValue2);
5524 if (striter->first == intValue2){
5526 strValue3 = striter->second;
5528 if (!strValue3.IsEmpty()){
5533 if (boolValue2 == TRUE){
5535 strValue2.Append(wxT(";"));
5543 strValue2.Append(wxT("ALTID=") + strValue3);
5553 striter = KeyListPID.find(intValue2);
5555 if (striter->first == intValue2){
5557 strValue3 = striter->second;
5559 if (!strValue3.IsEmpty()){
5564 if (boolValue2 == TRUE){
5566 strValue2.Append(wxT(";"));
5574 strValue2.Append(wxT("PID=") + strValue3);
5584 striter = KeyListType.find(intValue2);
5586 if (striter->first == intValue2){
5588 strValue3 = striter->second;
5590 if (!strValue3.IsEmpty()){
5595 if (boolValue2 == TRUE){
5597 strValue2.Append(wxT(";"));
5605 strValue2.Append(wxT("TYPE=") + strValue3);
5613 intiter = KeyListPref.find(intValue2);
5615 if (intiter->first == intValue2){
5617 intValue3 = intiter->second;
5621 if (boolValue2 == TRUE){
5623 strValue2.Append(wxT(";"));
5631 strValue2.Append(wxT("PREF=") + wxString::Format(wxT("%i"), intValue3));
5641 striter = KeyListTokens.find(intValue2);
5643 if (striter->first == intValue2){
5645 strValue3 = striter->second;
5647 if (!strValue3.IsEmpty()){
5652 if (boolValue2 == TRUE){
5654 strValue2.Append(wxT(";"));
5662 strValue2.Append(strValue3);
5670 // Get the key information.
5672 std::map<int, wxString>::iterator enciter;
5674 striter = KeyListDataType.find(intValue2);
5675 //enciter = KeyListAudioEncType.find(intValue2);
5677 wxString strValueData;
5679 strValueData = iter->second;
5680 //strValueData.insert(0, wxT("data:") + striter->second + wxT(";") + enciter->second + wxT(","));
5681 strValueData.insert(0, wxT("data:") + striter->second + wxT(";base64,"));
5684 // Add to the vCard.
5686 if (boolValue == TRUE){
5688 ContactData.AddRaw(wxT("KEY;") + strValue2, strValueData);
5692 ContactData.Add(wxT("KEY"), strValueData, TRUE);
5696 ResetSaveProcessData();
5700 // Vendor specific items.
5702 ResetSaveProcessData();
5704 for (std::map<int,wxString>::iterator iter = VendorList.begin();
5705 iter != VendorList.end(); ++iter){
5707 intValue2 = iter->first;
5709 // Get the IANA PEN number.
5711 striter = VendorListPEN.find(intValue2);
5713 if (striter->first == intValue2){
5715 strValue2 = striter->second;
5719 // Get the element name.
5721 striter = VendorListElement.find(intValue2);
5723 if (striter->first == intValue2){
5725 strValue3 = striter->second;
5731 striter = VendorList.find(intValue2);
5733 if (striter->first == intValue2){
5735 strValue = striter->second;
5739 // Add to the vCard.
5741 if (boolValue == TRUE){
5743 ContactData.AddRaw(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue);
5747 ContactData.Add(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue, FALSE);
5751 ResetSaveProcessData();
5755 ResetSaveProcessData();
5759 for (std::map<int,wxString>::iterator iter = XTokenList.begin();
5760 iter != XTokenList.end(); ++iter){
5762 intValue2 = iter->first;
5764 // Get the element name.
5766 striter = XTokenListTokens.find(intValue2);
5768 if (striter->first == intValue2){
5770 strValue2 = striter->second;
5776 striter = XTokenList.find(intValue2);
5778 if (striter->first == intValue2){
5780 strValue = striter->second;
5784 // Add to the vCard.
5786 if (boolValue == TRUE){
5788 ContactData.AddRaw(wxT("X-") + strValue2, strValue);
5792 ContactData.Add(wxT("X-") + strValue2, strValue, FALSE);
5796 ResetSaveProcessData();
5800 ResetSaveProcessData();
5802 if (FullNamesList.size() == 0){
5804 wxString FullName = cmbDisplayAs->GetValue();
5805 FullNamesList.insert(std::make_pair(0, FullName));
5806 FullNamesListAltID.insert(std::make_pair(0, wxT("")));
5807 FullNamesListPID.insert(std::make_pair(0, wxT("")));
5808 FullNamesListType.insert(std::make_pair(0, wxT("")));
5809 FullNamesListLanguage.insert(std::make_pair(0, wxT("")));
5810 FullNamesListPref.insert(std::make_pair(0, 0));
5811 FullNamesListTokens.insert(std::make_pair(0, wxT("")));
5816 for (std::map<int, wxString>::iterator iter = FullNamesList.begin();
5817 iter != FullNamesList.end(); ++iter){
5819 if (FNFirst == TRUE){
5821 iter->second = cmbDisplayAs->GetValue();
5826 std::map<int,wxString>::iterator mapS;
5828 mapS = FullNamesListTokens.find(iter->first);
5830 ProcessSaveData(wxT("FN"), &strValue2, &boolValue2, &boolValue,
5831 &iter, &FullNamesList, &ContactData,
5832 wxT("ALTID"), &FullNamesListAltID,
5833 wxT("PID"), &FullNamesListPID,
5834 wxT("TYPE"), &FullNamesListType,
5835 wxT("LANGUAGE"), &FullNamesListLanguage,
5836 wxT("PREF"), &FullNamesListPref,
5837 wxT(""), &FullNamesListTokens );
5841 ResetSaveProcessData();
5845 //ContactData.Add(wxT("FN"), cmbDisplayAs->GetValue(), FALSE);
5847 // Insert revision (REV) date.
5849 // Get today's date and time.
5851 wxDateTime DateTimeNow = wxDateTime::Now();
5855 // Set year, month and date.
5857 int intYear = DateTimeNow.GetYear();
5858 int intMonth = DateTimeNow.GetMonth();
5859 int intDay = DateTimeNow.GetDay();
5861 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intYear));
5865 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMonth));
5869 DateRev.Append(wxString::Format(wxT("%i"), intMonth));
5875 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intDay));
5879 DateRev.Append(wxString::Format(wxT("%i"), intDay));
5883 //DateRev.Append(wx);
5884 //DateRev.Append(wx);
5885 //DateRev.Append(wx);
5886 DateRev.Append(wxT("T"));
5888 // Set hour, minute and second.
5890 int intHour = DateTimeNow.GetHour();
5891 int intMinute = DateTimeNow.GetMinute();
5892 int intSecond = DateTimeNow.GetSecond();
5896 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intHour));
5900 DateRev.Append(wxString::Format(wxT("%i"), intHour));
5904 if (intMinute < 10){
5906 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMinute));
5910 DateRev.Append(wxString::Format(wxT("%i"), intMinute));
5914 if (intSecond < 10){
5916 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intSecond));
5920 DateRev.Append(wxString::Format(wxT("%i"), intSecond));
5924 // DateRev.Append(wx);
5925 // DateRev.Append(wx);
5926 // DateRev.Append(wxString DateTimeNow->);
5927 DateRev.Append(wxT("Z"));
5929 ContactData.Add(wxT("UID"), UIDToken, FALSE);
5931 // Generate ETag data for the contact if it does not exist.
5932 // If X-XAB-ETAG-ORIG exists, leave alone and update X-XAB-ETAG.
5936 ContactData.Add(wxT("END"), wxT("VCARD"), FALSE);
5939 ContactData.WriteFile(FilenameFinal);
5941 vCard34Conv ConvFileFun;
5945 ConvFileFun.ConvertToV3(FilenameFinal, &wxSData);
5947 wxString AccountDirPrefix;
5948 wxString AccountDir;
5951 #if defined(__HAIKU__)
5953 //preffilename = wxT("noo");
5955 #elif defined(__WIN32__)
5957 PrefDir = GetUserPrefDir();
5959 wxStringTokenizer wSTFilename(wxSContactFilename, wxT("\\"));
5963 PrefDir = GetUserPrefDir();
5965 wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/"));
5969 XABPreferences PrefData(PrefDir);
5971 wxString AccountType;
5973 for (int i = 0; i < PrefData.accounts.GetCount(); i++){
5975 AccountDir = PrefData.accounts.GetAccountDirectory(i) + wxT(".carddav");
5977 if (AccountDir == wxSContactAccount){
5979 AccountDirPrefix = PrefData.accounts.GetAccountDirPrefix(i);
5980 AccountDirPrefix.Trim();
5981 AccountType = PrefData.accounts.GetAccountType(i);
5988 wxString wxSplitFilename;
5989 wxString wxSDataURL;
5991 while(wSTFilename.HasMoreTokens()){
5993 wxSplitFilename = wSTFilename.GetNextToken();
5997 wxSDataURL = wxSplitFilename;
5998 //wxSDataURL.Append(wxSplitFilename);
6000 // Find out if the filename exists in the table.
6002 if (AccountType == wxT("CardDAV") || AccountType == wxT("carddav")){
6004 wxString ETagResult;
6005 wxString ETagOriginal;
6007 ETagDB *ETagDBPtr = NULL;
6009 ETagDBPtr = ETagTmrPtr->GetPointer(wxSContactAccount);
6011 wxString wxSETag = ETagDBPtr->GetETag(wxSplitFilename);
6012 wxString wxSETagOrig = ETagDBPtr->GetETagOriginal(wxSplitFilename);
6014 if (wxSETagOrig.IsEmpty()){
6016 // Generate the ETag.
6018 wxSETagOrig = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024);
6022 if (wxSETag.IsEmpty()){
6024 // Update empty ETag.
6026 wxSETag = wxSETagOrig;
6027 ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag, wxSETagOrig);
6032 // Don't change original ETag.
6034 wxSETag = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024);
6035 ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag);
6039 if (EditMode == FALSE){
6041 ActMgrPtr->AddTask(0, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
6043 FMTimer.SetFilename(FilenameFinal);
6044 FMTimer.UpdateTimestamp();
6045 FMTimer.Start(10000, FALSE);
6050 ActMgrPtr->AddTask(1, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
6051 FMTimer.UpdateTimestamp();
6052 FMTimer.Start(10000, FALSE);
6058 // Send a notification to update the main window
6059 // with the new details.
6064 // TODO: Workout nickname settings by priority and
6067 ucd->ContactAccount = wxSContactAccount;
6068 ucd->ContactFilename = FilenameFinal;
6069 ucd->ContactName = cmbDisplayAs->GetValue();
6070 ucd->ContactNameArray = ContactData.GetName();
6072 for (std::map<int,wxString>::iterator gniter = GeneralNicknamesList.begin();
6073 gniter != GeneralNicknamesList.end(); gniter++){
6075 ucd->ContactNickname = gniter->second;
6080 wxCommandEvent event2(CE_UPDATECONTACTLIST);
6081 event2.SetClientData(ucd);
6082 wxPostEvent(MainPtr, event2);
6086 void frmContactEditor::SaveCloseContact( wxCommandEvent& event )
6089 // Save the updated contact data and close the form.
6093 void frmContactEditor::CloseContact( wxCommandEvent& event )
6100 void frmContactEditor::CloseWindow( wxCloseEvent& event )
6103 // TODO: Check if any changes have been made,
6104 // ask if the changes should be made, process
6105 // action based on question and then close.
6107 WindowData *WData = new WindowData;
6109 WData->DataType = 1;
6110 WData->WindowPointer = this;
6111 WData->WindowID = ContactEditorUID;
6113 wxCommandEvent delevent(WINDOW_CLOSE);
6114 delevent.SetClientData(WData);
6115 wxPostEvent(GetParent(), delevent);
6122 void frmContactEditor::CutText( wxCommandEvent& event )
6124 // This function left empty for future implementation.
6127 void frmContactEditor::CopyText( wxCommandEvent& event )
6129 // This function left empty for future implementation.
6132 void frmContactEditor::PasteText( wxCommandEvent& event )
6134 // This function left empty for future implementation.
6137 void frmContactEditor::SetupContact( wxString AccountName )
6140 wxSContactAccount = AccountName;
6144 bool frmContactEditor::ProcessEvent(wxEvent& event)
6147 // This section has been taken from the wxWidgets sample code of richtext.cpp
6148 // so that simple Cut/Copy/Paste code can be made.
6150 // As this code comes from the samples of the wxWidgets library, this is licenced
6151 // under the wxWindows Library Licence and is compatable with the LGPL and is
6152 // compatable with Xestia Address Book's licence.
6154 if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxChildFocusEvent)))
6156 // Problem: we can get infinite recursion because the events
6157 // climb back up to this frame, and repeat.
6158 // Assume that command events don't cause another command event
6159 // to be called, so we can rely on inCommand not being overwritten
6161 static int s_eventType = 0;
6162 static wxWindowID s_id = 0;
6164 if (s_id != event.GetId() && s_eventType != event.GetEventType())
6166 s_eventType = event.GetEventType();
6167 s_id = event.GetId();
6169 wxWindow* focusWin = wxFindFocusDescendant(this);
6170 if (focusWin && focusWin->GetEventHandler()->ProcessEvent(event))
6186 return wxFrame::ProcessEvent(event);
6189 void frmContactEditor::SetupHeaders()
6192 /* Items for the General Tab */
6194 SetupColumn(CE_NICKNAME, lboNicknames);
6195 SetupColumn(CE_ADDRESS, lboAddresses);
6196 SetupColumn(CE_EMAIL, lboEmails);
6197 SetupColumn(CE_IM, lboIM);
6198 SetupColumn(CE_TELEPHONE, lboTelephone);
6199 SetupColumn(CE_LANG, lboLanguages);
6200 SetupColumn(CE_TZ, lboTimezones);
6201 SetupColumn(CE_GEOPOSITION, lboGeoposition);
6202 SetupColumn(CE_RELATED, lboRelated);
6203 SetupColumn(CE_WEBSITE, lboWebsites);
6204 SetupColumn(CE_TITLE, lboTitles);
6205 SetupColumn(CE_ROLE, lboRoles);
6206 SetupColumn(CE_ORG, lboOrganisations);
6207 SetupColumn(CE_NOTE, lboNotes);
6209 /* Items for the Home Tab */
6211 SetupColumn(CE_NICKNAME, lboHomeNicknames);
6212 SetupColumn(CE_ADDRESS, lboHomeAddresses);
6213 SetupColumn(CE_EMAIL, lboHomeEmails);
6214 SetupColumn(CE_IM, lboHomeIM);
6215 SetupColumn(CE_TELEPHONE, lboHomeTelephone);
6216 SetupColumn(CE_LANG, lboHomeLanguages);
6217 SetupColumn(CE_TZ, lboHomeTimezones);
6218 SetupColumn(CE_GEOPOSITION, lboHomeGeoposition);
6219 SetupColumn(CE_WEBSITE, lboHomeWebsites);
6220 SetupColumn(CE_TITLE, lboHomeTitles);
6221 SetupColumn(CE_ROLE, lboHomeRoles);
6222 SetupColumn(CE_ORG, lboHomeOrganisations);
6223 SetupColumn(CE_NOTE, lboHomeNotes);
6225 /* Items for the Business Tab */
6227 SetupColumn(CE_NICKNAME, lboBusinessNicknames);
6228 SetupColumn(CE_ADDRESS, lboBusinessAddresses);
6229 SetupColumn(CE_EMAIL, lboBusinessEmail);
6230 SetupColumn(CE_IM, lboBusinessIM);
6231 SetupColumn(CE_TELEPHONE, lboBusinessTelephone);
6232 SetupColumn(CE_LANG, lboBusinessLanguages);
6233 SetupColumn(CE_TZ, lboBusinessTimezones);
6234 SetupColumn(CE_GEOPOSITION, lboBusinessGeoposition);
6235 SetupColumn(CE_WEBSITE, lboBusinessWebsites);
6236 SetupColumn(CE_TITLE, lboBusinessTitles);
6237 SetupColumn(CE_ROLE, lboBusinessRoles);
6238 SetupColumn(CE_ORG, lboBusinessOrganisations);
6239 SetupColumn(CE_NOTE, lboBusinessNotes);
6241 /* Items for the Categories Tab */
6243 SetupColumn(CE_CATEGORIES, lboCategories);
6245 /* Items for the Groups Tab */
6247 SetupColumn(CE_GROUPS, lboGroups);
6249 /* Items for the Pictures and Logos Tab */
6251 SetupColumn(CE_PICTURES, lboPictures);
6252 SetupColumn(CE_PICTURES, lboLogos);
6254 /* Items for the Sounds Tab */
6256 SetupColumn(CE_SOUNDS, lboSounds);
6258 /* Items for the Calendaring Tab */
6260 SetupColumn(CE_CALENDAR, lboCalendarAddresses);
6261 SetupColumn(CE_CALENDAR, lboCalendarRequestAddress);
6262 SetupColumn(CE_CALENDAR, lboFreeBusyAddresses);
6264 /* Items for the Security Tab */
6266 SetupColumn(CE_KEY, lboKeys);
6268 /* Items for the Other Tab */
6270 SetupColumn(CE_TOKEN, lboVendorNamespace);
6271 SetupColumn(CE_TOKEN, lboXToken);
6275 void frmContactEditor::SetupColumn(wxString ColumnType, wxListCtrl *ListCtrl)
6280 if (ColumnType == CE_NICKNAME){
6283 coldata.SetText(_("Nickname"));
6284 coldata.SetWidth(128);
6285 ListCtrl->InsertColumn(0, coldata);
6288 coldata.SetText(_("Pri."));
6289 coldata.SetWidth(32);
6290 ListCtrl->InsertColumn(1, coldata);
6292 } else if (ColumnType == CE_ADDRESS){
6295 coldata.SetText(_("Address"));
6296 coldata.SetWidth(128);
6297 ListCtrl->InsertColumn(0, coldata);
6300 coldata.SetText(_("Town"));
6301 coldata.SetWidth(64);
6302 ListCtrl->InsertColumn(1, coldata);
6305 coldata.SetText(_("County"));
6306 coldata.SetWidth(64);
6307 ListCtrl->InsertColumn(2, coldata);
6310 coldata.SetText(_("Post code"));
6311 coldata.SetWidth(48);
6312 ListCtrl->InsertColumn(3, coldata);
6315 coldata.SetText(_("Pri."));
6316 coldata.SetWidth(32);
6317 ListCtrl->InsertColumn(4, coldata);
6319 } else if (ColumnType == CE_EMAIL){
6322 coldata.SetText(_("Email address"));
6323 coldata.SetWidth(304);
6324 ListCtrl->InsertColumn(0, coldata);
6327 coldata.SetText(_("Pri."));
6328 coldata.SetWidth(32);
6329 ListCtrl->InsertColumn(1, coldata);
6331 } else if (ColumnType == CE_IM){
6334 coldata.SetText(_("Type"));
6335 coldata.SetWidth(64);
6336 ListCtrl->InsertColumn(0, coldata);
6339 coldata.SetText(_("Address"));
6340 coldata.SetWidth(240);
6341 ListCtrl->InsertColumn(1, coldata);
6344 coldata.SetText(_("Pri."));
6345 coldata.SetWidth(32);
6346 ListCtrl->InsertColumn(2, coldata);
6348 } else if (ColumnType == CE_TELEPHONE){
6351 coldata.SetText(_("Telephone number"));
6352 coldata.SetWidth(128);
6353 ListCtrl->InsertColumn(0, coldata);
6356 coldata.SetText(_("Type"));
6357 coldata.SetWidth(64);
6358 ListCtrl->InsertColumn(1, coldata);
6361 coldata.SetText(_("Pri."));
6362 coldata.SetWidth(32);
6363 ListCtrl->InsertColumn(2, coldata);
6365 } else if (ColumnType == CE_LANG){
6368 coldata.SetText(_("Language"));
6369 coldata.SetWidth(128);
6370 ListCtrl->InsertColumn(0, coldata);
6373 coldata.SetText(_("Pri."));
6374 coldata.SetWidth(32);
6375 ListCtrl->InsertColumn(1, coldata);
6377 } else if (ColumnType == CE_TZ){
6380 coldata.SetText(_("Timezone"));
6381 coldata.SetWidth(192);
6382 ListCtrl->InsertColumn(0, coldata);
6385 coldata.SetText(_("Pri."));
6386 coldata.SetWidth(32);
6387 ListCtrl->InsertColumn(1, coldata);
6389 } else if (ColumnType == CE_RELATED){
6392 coldata.SetText(_("Type"));
6393 coldata.SetWidth(64);
6394 ListCtrl->InsertColumn(0, coldata);
6397 coldata.SetText(_("Name/Description"));
6398 coldata.SetWidth(192);
6399 ListCtrl->InsertColumn(1, coldata);
6402 coldata.SetText(_("Pri."));
6403 coldata.SetWidth(32);
6404 ListCtrl->InsertColumn(2, coldata);
6406 } else if (ColumnType == CE_WEBSITE){
6409 coldata.SetText(_("Website"));
6410 coldata.SetWidth(288);
6411 ListCtrl->InsertColumn(0, coldata);
6414 coldata.SetText(_("Pri."));
6415 coldata.SetWidth(32);
6416 ListCtrl->InsertColumn(1, coldata);
6418 } else if (ColumnType == CE_TITLE){
6421 coldata.SetText(_("Title"));
6422 coldata.SetWidth(288);
6423 ListCtrl->InsertColumn(0, coldata);
6426 coldata.SetText(_("Pri."));
6427 coldata.SetWidth(32);
6428 ListCtrl->InsertColumn(1, coldata);
6430 } else if (ColumnType == CE_ROLE){
6433 coldata.SetText(_("Role"));
6434 coldata.SetWidth(288);
6435 ListCtrl->InsertColumn(0, coldata);
6438 coldata.SetText(_("Pri."));
6439 coldata.SetWidth(32);
6440 ListCtrl->InsertColumn(1, coldata);
6442 } else if (ColumnType == CE_ORG){
6445 coldata.SetText(_("Organisation"));
6446 coldata.SetWidth(288);
6447 ListCtrl->InsertColumn(0, coldata);
6450 coldata.SetText(_("Pri."));
6451 coldata.SetWidth(32);
6452 ListCtrl->InsertColumn(1, coldata);
6454 } else if (ColumnType == CE_NOTE){
6457 coldata.SetText(_("Notes"));
6458 coldata.SetWidth(288);
6459 ListCtrl->InsertColumn(0, coldata);
6462 coldata.SetText(_("Pri."));
6463 coldata.SetWidth(32);
6464 ListCtrl->InsertColumn(1, coldata);
6466 } else if (ColumnType == CE_CATEGORIES){
6469 coldata.SetText(_("Category"));
6470 coldata.SetWidth(320);
6471 ListCtrl->InsertColumn(0, coldata);
6474 coldata.SetText(_("Pri."));
6475 coldata.SetWidth(32);
6476 ListCtrl->InsertColumn(1, coldata);
6478 } else if (ColumnType == CE_GROUPS){
6481 coldata.SetText(_("Member"));
6482 coldata.SetWidth(320);
6483 ListCtrl->InsertColumn(0, coldata);
6485 } else if (ColumnType == CE_GEOPOSITION){
6488 coldata.SetText(_("Geoposition"));
6489 coldata.SetWidth(320);
6490 ListCtrl->InsertColumn(0, coldata);
6493 coldata.SetText(_("Pri."));
6494 coldata.SetWidth(32);
6495 ListCtrl->InsertColumn(1, coldata);
6497 } else if (ColumnType == CE_PICTURES){
6500 coldata.SetText(_("Pictures"));
6501 coldata.SetWidth(128);
6502 ListCtrl->InsertColumn(0, coldata);
6505 coldata.SetText(_("Type"));
6506 coldata.SetWidth(64);
6507 ListCtrl->InsertColumn(1, coldata);
6510 coldata.SetText(_("Pri."));
6511 coldata.SetWidth(32);
6512 ListCtrl->InsertColumn(2, coldata);
6514 } else if (ColumnType == CE_SOUNDS){
6517 coldata.SetText(_("Sounds"));
6518 coldata.SetWidth(128);
6519 ListCtrl->InsertColumn(0, coldata);
6522 coldata.SetText(_("Type"));
6523 coldata.SetWidth(64);
6524 ListCtrl->InsertColumn(1, coldata);
6527 coldata.SetText(_("Pri."));
6528 coldata.SetWidth(32);
6529 ListCtrl->InsertColumn(2, coldata);
6531 } else if (ColumnType == CE_CALENDAR){
6534 coldata.SetText(_("Calendar Address"));
6535 coldata.SetWidth(224);
6536 ListCtrl->InsertColumn(0, coldata);
6539 coldata.SetText(_("Type"));
6540 coldata.SetWidth(64);
6541 ListCtrl->InsertColumn(1, coldata);
6544 coldata.SetText(_("Pri."));
6545 coldata.SetWidth(32);
6546 ListCtrl->InsertColumn(2, coldata);
6548 } else if (ColumnType == CE_KEY){
6551 coldata.SetText(_("Key information"));
6552 coldata.SetWidth(224);
6553 ListCtrl->InsertColumn(0, coldata);
6556 coldata.SetText(_("Type"));
6557 coldata.SetWidth(64);
6558 ListCtrl->InsertColumn(1, coldata);
6561 coldata.SetText(_("Pri."));
6562 coldata.SetWidth(32);
6563 ListCtrl->InsertColumn(2, coldata);
6565 } else if (ColumnType == CE_TOKEN){
6568 coldata.SetText(_("Token"));
6569 coldata.SetWidth(320);
6570 ListCtrl->InsertColumn(0, coldata);
6576 int frmContactEditor::GetLastInt(std::map<int, wxString> *MapData){
6581 std::map<int,wxString>::iterator iwxsit;
6583 for( iwxsit=(*MapData).begin(); iwxsit != (*MapData).end(); iwxsit++){
6584 intResult = (*iwxsit).first;
6591 return intValueSeek;
6595 int frmContactEditor::GetLastInt(std::map<int, std::string> *MapData){
6597 /* int intResult = 0;
6599 std::map<int,std::string>::iterator iwxsit;
6601 for( iwxsit=(*MapData).begin(); iwxsit != (*MapData).end(); iwxsit++){
6602 intResult = (*iwxsit).first;
6606 return intValueSeek;
6610 bool frmContactEditor::GetSelectedItem(wxListCtrl *ListCtrlPtr,
6612 int *intSelectedData){
6615 *intSelectedData = 0;
6617 *longSelected = ListCtrlPtr->GetNextItem(*longSelected,
6619 wxLIST_STATE_SELECTED);
6621 if (*longSelected == -1){
6628 *intSelectedData = ListCtrlPtr->GetItemData(*longSelected);
6632 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, std::string>* MapData){
6633 MapData->erase(IndexNum);
6636 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, wxString>* MapData){
6637 MapData->erase(IndexNum);
6640 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, int>* MapData){
6641 MapData->erase(IndexNum);
6644 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, bool>* MapData){
6645 MapData->erase(IndexNum);
6648 void frmContactEditor::ProcessSaveDataProc( wxString PropName,
6649 std::map<int,int>* MapData){
6651 int intIterVal = (*iterDataPtr)->first;
6653 std::map<int,int>::iterator intIter;
6655 intIter = MapData->find(intIterVal);
6659 if (intIter->first == intIterVal){
6661 intPropValue = intIter->second;
6665 if (*boolAdditionalPtr == TRUE){
6667 strPropertyPtr->Append(wxT(";"));
6671 *boolAdditionalPtr = TRUE;
6675 strPropertyPtr->Append(PropName + wxT("=") + wxString::Format(wxT("%i"), intPropValue));
6677 *boolExtraPtr = TRUE;
6685 void frmContactEditor::ProcessSaveDataProc( wxString PropName,
6686 std::map<int,wxString>* MapData){
6690 intIterVal = (*iterDataPtr)->first;
6692 std::map<int,wxString>::iterator strIter;
6694 strIter = MapData->find(intIterVal);
6696 if (strIter == MapData->end()){
6702 wxString strPropValue;
6704 if (strIter->first == intIterVal){
6706 strPropValue = strIter->second;
6708 if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6710 strPropValue.Trim();
6711 strPropValue.Trim();
6713 if (*boolAdditionalPtr == TRUE){
6715 strPropertyPtr->Append(wxT(";"));
6719 *boolAdditionalPtr = TRUE;
6723 strPropertyPtr->Append(strPropValue);
6725 *boolExtraPtr = TRUE;
6731 if (!strPropValue.IsEmpty()){
6733 strPropValue.Trim();
6734 strPropValue.Trim();
6736 if (*boolAdditionalPtr == TRUE){
6738 strPropertyPtr->Append(wxT(";"));
6742 *boolAdditionalPtr = TRUE;
6746 // Look for semi-colon in property name and if there is then
6749 if (PropName != wxT("TYPE")){
6751 EscapeString(&strPropValue, FALSE);
6755 if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6756 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6758 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6762 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6766 *boolExtraPtr = TRUE;
6774 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6775 std::map<int,std::string>* MapData){
6777 int intIterVal = (*iterDataStringPtr)->first;
6779 //std::map<int,wxString>::iterator strIter;
6781 std::map<int,std::string>::iterator stdstrIter;
6783 stdstrIter = MapData->find(intIterVal);
6785 if (stdstrIter->first == intIterVal){
6787 wxString strPropValue(stdstrIter->second.c_str(), wxConvUTF8);
6789 if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6791 strPropValue.Trim();
6792 strPropValue.Trim();
6794 if (*boolAdditionalPtr == TRUE){
6796 strPropertyPtr->Append(wxT(";"));
6800 *boolAdditionalPtr = TRUE;
6804 strPropertyPtr->Append(strPropValue);
6806 *boolExtraPtr = TRUE;
6812 if (!strPropValue.IsEmpty()){
6814 strPropValue.Trim();
6815 strPropValue.Trim();
6817 if (*boolAdditionalPtr == TRUE){
6819 strPropertyPtr->Append(wxT(";"));
6823 *boolAdditionalPtr = TRUE;
6827 // Look for semi-colon in property name and if there is then
6830 if (PropName != wxT("TYPE")){
6832 EscapeString(&strPropValue, FALSE);
6836 if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6837 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6839 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6843 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6847 *boolExtraPtr = TRUE;
6856 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6857 std::map<int,int>* MapData){
6859 int intIterVal = (*iterDataStringPtr)->first;
6861 std::map<int,int>::iterator intIter;
6863 intIter = MapData->find(intIterVal);
6867 if (intIter->first == intIterVal){
6869 intPropValue = intIter->second;
6873 if (*boolAdditionalPtr == TRUE){
6875 strPropertyPtr->Append(wxT(";"));
6879 *boolAdditionalPtr = TRUE;
6883 strPropertyPtr->Append(PropName + wxT("=") + wxString::Format(wxT("%i"), intPropValue));
6885 *boolExtraPtr = TRUE;
6893 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6894 std::map<int,wxString>* MapData){
6898 intIterVal = (*iterDataStringPtr)->first;
6900 std::map<int,wxString>::iterator strIter;
6902 strIter = MapData->find(intIterVal);
6904 wxString strPropValue;
6906 if (strIter->first == intIterVal){
6908 strPropValue = strIter->second;
6910 if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6912 strPropValue.Trim();
6913 strPropValue.Trim();
6915 if (*boolAdditionalPtr == TRUE){
6917 strPropertyPtr->Append(wxT(";"));
6921 *boolAdditionalPtr = TRUE;
6925 strPropertyPtr->Append(strPropValue);
6927 *boolExtraPtr = TRUE;
6933 if (!strPropValue.IsEmpty()){
6935 strPropValue.Trim();
6936 strPropValue.Trim();
6938 if (*boolAdditionalPtr == TRUE){
6940 strPropertyPtr->Append(wxT(";"));
6944 *boolAdditionalPtr = TRUE;
6948 // Look for semi-colon in property name and if there is then
6951 if (PropName != wxT("TYPE")){
6953 EscapeString(&strPropValue, FALSE);
6957 if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6958 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6960 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6964 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6968 *boolExtraPtr = TRUE;
6976 void frmContactEditor::ProcessCaptureStringsProc(wxString *strCapture){
6978 CaptureString(strCapture, FALSE);
6982 void frmContactEditor::ResetSaveProcessData(){
6995 void frmContactEditor::SetupPointers(frmActivityMgr *ActMgr, wxETagProcessTimer *ETagProc,
6996 frmMain *MainPtrInc){
6999 ETagTmrPtr = ETagProc;
7000 MainPtr = MainPtrInc;
7004 void frmContactEditor::ClearContact(){
7006 // Clear out the GUI and values.
7011 txtForename->Clear();
7012 txtSurname->Clear();
7013 txtOtherNames->Clear();
7015 cmbDisplayAs->Clear();
7016 cmbDisplayAs->SetValue(wxT(""));
7017 wxDateTime EmptyDate;
7018 wxBitmap EmptyBitmap;
7019 dapAnniversary->SetValue(EmptyDate);
7020 dapBirthday->SetValue(EmptyDate);
7021 txtBirthday->Clear();
7022 txtAnniversary->Clear();
7023 cmbGender->Select(0);
7024 txtGenderDescription->Clear();
7026 lboNicknames->DeleteAllItems();
7027 lboHomeNicknames->DeleteAllItems();
7028 lboBusinessNicknames->DeleteAllItems();
7030 lboAddresses->DeleteAllItems();
7031 lboHomeAddresses->DeleteAllItems();
7032 lboBusinessAddresses->DeleteAllItems();
7034 lboEmails->DeleteAllItems();
7035 lboHomeEmails->DeleteAllItems();
7036 lboBusinessEmail->DeleteAllItems();
7038 lboIM->DeleteAllItems();
7039 lboHomeIM->DeleteAllItems();
7040 lboBusinessIM->DeleteAllItems();
7042 lboTelephone->DeleteAllItems();
7043 lboHomeTelephone->DeleteAllItems();
7044 lboBusinessTelephone->DeleteAllItems();
7046 lboLanguages->DeleteAllItems();
7047 lboHomeLanguages->DeleteAllItems();
7048 lboBusinessLanguages->DeleteAllItems();
7050 lboTimezones->DeleteAllItems();
7051 lboHomeTimezones->DeleteAllItems();
7052 lboBusinessTimezones->DeleteAllItems();
7054 lboGeoposition->DeleteAllItems();
7055 lboHomeGeoposition->DeleteAllItems();
7056 lboBusinessGeoposition->DeleteAllItems();
7058 lboRelated->DeleteAllItems();
7060 lboWebsites->DeleteAllItems();
7061 lboHomeWebsites->DeleteAllItems();
7062 lboBusinessWebsites->DeleteAllItems();
7064 lboTitles->DeleteAllItems();
7065 lboHomeTitles->DeleteAllItems();
7066 lboBusinessTitles->DeleteAllItems();
7068 lboRoles->DeleteAllItems();
7069 lboHomeRoles->DeleteAllItems();
7070 lboBusinessRoles->DeleteAllItems();
7072 lboOrganisations->DeleteAllItems();
7073 lboHomeOrganisations->DeleteAllItems();
7074 lboBusinessOrganisations->DeleteAllItems();
7076 lboNotes->DeleteAllItems();
7077 lboHomeNotes->DeleteAllItems();
7078 lboBusinessNotes->DeleteAllItems();
7080 lboCategories->DeleteAllItems();
7082 lboGroups->DeleteAllItems();
7085 lboPictures->DeleteAllItems();
7086 imgPicture->SetBitmap(EmptyBitmap);
7089 lboLogos->DeleteAllItems();
7090 imgLogo->SetBitmap(EmptyBitmap);
7092 lboSounds->DeleteAllItems();
7094 lboCalendarAddresses->DeleteAllItems();
7095 lboCalendarRequestAddress->DeleteAllItems();
7096 lboFreeBusyAddresses->DeleteAllItems();
7098 lboKeys->DeleteAllItems();
7100 lboVendorNamespace->DeleteAllItems();
7101 lboXToken->DeleteAllItems();
7103 // Clear values out.
7106 wxString NameForename;
7107 wxString NameSurname;
7108 wxString NameOtherNames;
7109 wxString NameSuffix;
7110 wxString NameNickname;
7111 wxString NameDisplayAs;
7112 wxString NameLanguage;
7114 wxString NameTokens;
7117 wxString BirthdayAltID;
7118 wxString BirthdayCalScale;
7119 wxString BirthdayTokens;
7120 wxString Anniversary;
7121 wxString AnniversaryAltID;
7122 wxString AnniversaryCalScale;
7123 wxString AnniversaryTokens;
7126 wxString GenderDetails;
7127 wxString GenderTokens;
7131 /* We don't use these at the moment but we want to keep
7132 them for compatability reasons */
7134 /*std::map<int, wxString> ExtraFullNames;*/
7135 /*std::map<int, wxString> ExtraNicknames;*/
7137 FullNamesList.clear();
7138 FullNamesListType.clear();
7139 FullNamesListLanguage.clear();
7140 FullNamesListAltID.clear();
7141 FullNamesListPID.clear();
7142 FullNamesListTokens.clear();
7143 FullNamesListPref.clear();
7145 GeneralNicknamesList.clear();
7146 GeneralNicknamesListType.clear();
7147 GeneralNicknamesListLanguage.clear();
7148 GeneralNicknamesListAltID.clear();
7149 GeneralNicknamesListPID.clear();
7150 GeneralNicknamesListTokens.clear();
7151 GeneralNicknamesListPref.clear();
7153 GeneralAddressList.clear();
7154 GeneralAddressListTown.clear();
7155 GeneralAddressListCounty.clear();
7156 GeneralAddressListPostCode.clear();
7157 GeneralAddressListCountry.clear();
7158 GeneralAddressListLabel.clear();
7159 GeneralAddressListLang.clear();
7160 GeneralAddressListAltID.clear();
7161 GeneralAddressListPID.clear();
7162 GeneralAddressListTokens.clear();
7163 GeneralAddressListGeo.clear();
7164 GeneralAddressListTimezone.clear();
7165 GeneralAddressListType.clear();
7166 GeneralAddressListMediatype.clear();
7167 GeneralAddressListPref.clear();
7169 GeneralEmailList.clear();
7170 GeneralEmailListAltID.clear();
7171 GeneralEmailListPID.clear();
7172 GeneralEmailListType.clear();
7173 GeneralEmailListTokens.clear();
7174 GeneralEmailListPref.clear();
7176 GeneralIMList.clear();
7177 GeneralIMListAltID.clear();
7178 GeneralIMListPID.clear();
7179 GeneralIMListType.clear();
7180 GeneralIMListTokens.clear();
7181 GeneralIMListMediatype.clear();
7182 GeneralIMListPref.clear();
7184 GeneralTelephoneList.clear();
7185 GeneralTelephoneListAltID.clear();
7186 GeneralTelephoneListPID.clear();
7187 GeneralTelephoneListType.clear();
7188 GeneralTelephoneListTokens.clear();
7189 GeneralTelephoneListPref.clear();
7191 GeneralLanguageList.clear();
7192 GeneralLanguageListAltID.clear();
7193 GeneralLanguageListPID.clear();
7194 GeneralLanguageListType.clear();
7195 GeneralLanguageListTokens.clear();
7196 GeneralLanguageListPref.clear();
7198 GeneralTZList.clear();
7199 GeneralTZListAltID.clear();
7200 GeneralTZListPID.clear();
7201 GeneralTZListType.clear();
7202 GeneralTZListTokens.clear();
7203 GeneralTZListMediatype.clear();
7204 GeneralTZListPref.clear();
7206 GeneralGeographyList.clear();
7207 GeneralGeographyListAltID.clear();
7208 GeneralGeographyListPID.clear();
7209 GeneralGeographyListType.clear();
7210 GeneralGeographyListTokens.clear();
7211 GeneralGeographyListMediatype.clear();
7212 GeneralGeographyListPref.clear();
7214 GeneralRelatedList.clear();
7215 GeneralRelatedListRelType.clear();
7216 GeneralRelatedListLanguage.clear();
7217 GeneralRelatedListAltID.clear();
7218 GeneralRelatedListPID.clear();
7219 GeneralRelatedListType.clear();
7220 GeneralRelatedListTokens.clear();
7221 GeneralRelatedListPref.clear();
7223 GeneralWebsiteList.clear();
7224 GeneralWebsiteListAltID.clear();
7225 GeneralWebsiteListPID.clear();
7226 GeneralWebsiteListType.clear();
7227 GeneralWebsiteListTokens.clear();
7228 GeneralWebsiteListMediatype.clear();
7229 GeneralWebsiteListPref.clear();
7231 GeneralTitleList.clear();
7232 GeneralTitleListLanguage.clear();
7233 GeneralTitleListAltID.clear();
7234 GeneralTitleListPID.clear();
7235 GeneralTitleListType.clear();
7236 GeneralTitleListTokens.clear();
7237 GeneralTitleListPref.clear();
7239 GeneralRoleList.clear();
7240 GeneralRoleListLanguage.clear();
7241 GeneralRoleListAltID.clear();
7242 GeneralRoleListPID.clear();
7243 GeneralRoleListType.clear();
7244 GeneralRoleListTokens.clear();
7245 GeneralRoleListPref.clear();
7247 GeneralOrganisationsList.clear();
7248 GeneralOrganisationsListLanguage.clear();
7249 GeneralOrganisationsListAltID.clear();
7250 GeneralOrganisationsListPID.clear();
7251 GeneralOrganisationsListType.clear();
7252 GeneralOrganisationsListTokens.clear();
7253 GeneralOrganisationsListSortAs.clear();
7254 GeneralOrganisationsListPref.clear();
7256 GeneralNoteList.clear();
7257 GeneralNoteListLanguage.clear();
7258 GeneralNoteListAltID.clear();
7259 GeneralNoteListPID.clear();
7260 GeneralNoteListType.clear();
7261 GeneralNoteListTokens.clear();
7262 GeneralNoteListPref.clear();
7264 /* Items on Home Tab */
7266 HomeNicknamesList.clear();
7267 HomeNicknamesListType.clear();
7268 HomeNicknamesListLanguage.clear();
7269 HomeNicknamesListAltID.clear();
7270 HomeNicknamesListPID.clear();
7271 HomeNicknamesListTokens.clear();
7272 HomeNicknamesListPref.clear();
7274 HomeAddressList.clear();
7275 HomeAddressListTown.clear();
7276 HomeAddressListCounty.clear();
7277 HomeAddressListPostCode.clear();
7278 HomeAddressListCountry.clear();
7279 HomeAddressListLabel.clear();
7280 HomeAddressListLang.clear();
7281 HomeAddressListAltID.clear();
7282 HomeAddressListPID.clear();
7283 HomeAddressListTokens.clear();
7284 HomeAddressListGeo.clear();
7285 HomeAddressListTimezone.clear();
7286 HomeAddressListType.clear();
7287 HomeAddressListMediatype.clear();
7288 HomeAddressListPref.clear();
7290 HomeEmailList.clear();
7291 HomeEmailListAltID.clear();
7292 HomeEmailListPID.clear();
7293 HomeEmailListType.clear();
7294 HomeEmailListTokens.clear();
7295 HomeEmailListPref.clear();
7298 HomeIMListAltID.clear();
7299 HomeIMListPID.clear();
7300 HomeIMListType.clear();
7301 HomeIMListTokens.clear();
7302 HomeIMListMediatype.clear();
7303 HomeIMListPref.clear();
7305 HomeTelephoneList.clear();
7306 HomeTelephoneListAltID.clear();
7307 HomeTelephoneListPID.clear();
7308 HomeTelephoneListType.clear();
7309 HomeTelephoneListTokens.clear();
7310 HomeTelephoneListPref.clear();
7312 HomeLanguageList.clear();
7313 HomeLanguageListAltID.clear();
7314 HomeLanguageListPID.clear();
7315 HomeLanguageListType.clear();
7316 HomeLanguageListTokens.clear();
7317 HomeLanguageListPref.clear();
7320 HomeTZListAltID.clear();
7321 HomeTZListPID.clear();
7322 HomeTZListType.clear();
7323 HomeTZListTokens.clear();
7324 HomeTZListMediatype.clear();
7325 HomeTZListPref.clear();
7327 HomeGeographyList.clear();
7328 HomeGeographyListAltID.clear();
7329 HomeGeographyListPID.clear();
7330 HomeGeographyListType.clear();
7331 HomeGeographyListTokens.clear();
7332 HomeGeographyListMediatype.clear();
7333 HomeGeographyListPref.clear();
7335 HomeRelatedList.clear();
7336 HomeRelatedListRelType.clear();
7337 HomeRelatedListLanguage.clear();
7338 HomeRelatedListAltID.clear();
7339 HomeRelatedListPID.clear();
7340 HomeRelatedListType.clear();
7341 HomeRelatedListTokens.clear();
7342 HomeRelatedListPref.clear();
7344 HomeWebsiteList.clear();
7345 HomeWebsiteListAltID.clear();
7346 HomeWebsiteListPID.clear();
7347 HomeWebsiteListType.clear();
7348 HomeWebsiteListTokens.clear();
7349 HomeWebsiteListMediatype.clear();
7350 HomeWebsiteListPref.clear();
7352 HomeTitleList.clear();
7353 HomeTitleListLanguage.clear();
7354 HomeTitleListAltID.clear();
7355 HomeTitleListPID.clear();
7356 HomeTitleListType.clear();
7357 HomeTitleListTokens.clear();
7358 HomeTitleListPref.clear();
7360 HomeRoleList.clear();
7361 HomeRoleListLanguage.clear();
7362 HomeRoleListAltID.clear();
7363 HomeRoleListPID.clear();
7364 HomeRoleListType.clear();
7365 HomeRoleListTokens.clear();
7366 HomeRoleListPref.clear();
7368 HomeOrganisationsList.clear();
7369 HomeOrganisationsListLanguage.clear();
7370 HomeOrganisationsListAltID.clear();
7371 HomeOrganisationsListPID.clear();
7372 HomeOrganisationsListType.clear();
7373 HomeOrganisationsListTokens.clear();
7374 HomeOrganisationsListSortAs.clear();
7375 HomeOrganisationsListPref.clear();
7377 HomeNoteList.clear();
7378 HomeNoteListLanguage.clear();
7379 HomeNoteListAltID.clear();
7380 HomeNoteListPID.clear();
7381 HomeNoteListType.clear();
7382 HomeNoteListTokens.clear();
7383 HomeNoteListPref.clear();
7385 /* Items on the Business tab */
7387 BusinessNicknamesList.clear();
7388 BusinessNicknamesListType.clear();
7389 BusinessNicknamesListLanguage.clear();
7390 BusinessNicknamesListAltID.clear();
7391 BusinessNicknamesListPID.clear();
7392 BusinessNicknamesListTokens.clear();
7393 BusinessNicknamesListPref.clear();
7395 BusinessAddressList.clear();
7396 BusinessAddressListTown.clear();
7397 BusinessAddressListCounty.clear();
7398 BusinessAddressListPostCode.clear();
7399 BusinessAddressListCountry.clear();
7400 BusinessAddressListLabel.clear();
7401 BusinessAddressListLang.clear();
7402 BusinessAddressListAltID.clear();
7403 BusinessAddressListPID.clear();
7404 BusinessAddressListTokens.clear();
7405 BusinessAddressListGeo.clear();
7406 BusinessAddressListTimezone.clear();
7407 BusinessAddressListType.clear();
7408 BusinessAddressListMediatype.clear();
7409 BusinessAddressListPref.clear();
7411 BusinessEmailList.clear();
7412 BusinessEmailListAltID.clear();
7413 BusinessEmailListPID.clear();
7414 BusinessEmailListType.clear();
7415 BusinessEmailListTokens.clear();
7416 BusinessEmailListPref.clear();
7418 BusinessIMList.clear();
7419 BusinessIMListAltID.clear();
7420 BusinessIMListPID.clear();
7421 BusinessIMListType.clear();
7422 BusinessIMListTokens.clear();
7423 BusinessIMListMediatype.clear();
7424 BusinessIMListPref.clear();
7426 BusinessTelephoneList.clear();
7427 BusinessTelephoneListAltID.clear();
7428 BusinessTelephoneListPID.clear();
7429 BusinessTelephoneListType.clear();
7430 BusinessTelephoneListTokens.clear();
7431 BusinessTelephoneListPref.clear();
7433 BusinessLanguageList.clear();
7434 BusinessLanguageListAltID.clear();
7435 BusinessLanguageListPID.clear();
7436 BusinessLanguageListType.clear();
7437 BusinessLanguageListTokens.clear();
7438 BusinessLanguageListPref.clear();
7440 BusinessTZList.clear();
7441 BusinessTZListAltID.clear();
7442 BusinessTZListPID.clear();
7443 BusinessTZListType.clear();
7444 BusinessTZListTokens.clear();
7445 BusinessTZListMediatype.clear();
7446 BusinessTZListPref.clear();
7448 BusinessGeographyList.clear();
7449 BusinessGeographyListAltID.clear();
7450 BusinessGeographyListPID.clear();
7451 BusinessGeographyListType.clear();
7452 BusinessGeographyListTokens.clear();
7453 BusinessGeographyListMediatype.clear();
7454 BusinessGeographyListPref.clear();
7456 BusinessRelatedList.clear();
7457 BusinessRelatedListRelType.clear();
7458 BusinessRelatedListLanguage.clear();
7459 BusinessRelatedListAltID.clear();
7460 BusinessRelatedListPID.clear();
7461 BusinessRelatedListType.clear();
7462 BusinessRelatedListTokens.clear();
7463 BusinessRelatedListPref.clear();
7465 BusinessWebsiteList.clear();
7466 BusinessWebsiteListAltID.clear();
7467 BusinessWebsiteListPID.clear();
7468 BusinessWebsiteListType.clear();
7469 BusinessWebsiteListTokens.clear();
7470 BusinessWebsiteListMediatype.clear();
7471 BusinessWebsiteListPref.clear();
7473 BusinessTitleList.clear();
7474 BusinessTitleListLanguage.clear();
7475 BusinessTitleListAltID.clear();
7476 BusinessTitleListPID.clear();
7477 BusinessTitleListType.clear();
7478 BusinessTitleListTokens.clear();
7479 BusinessTitleListPref.clear();
7481 BusinessRoleList.clear();
7482 BusinessRoleListLanguage.clear();
7483 BusinessRoleListAltID.clear();
7484 BusinessRoleListPID.clear();
7485 BusinessRoleListType.clear();
7486 BusinessRoleListTokens.clear();
7487 BusinessRoleListPref.clear();
7489 BusinessOrganisationsList.clear();
7490 BusinessOrganisationsListLanguage.clear();
7491 BusinessOrganisationsListAltID.clear();
7492 BusinessOrganisationsListPID.clear();
7493 BusinessOrganisationsListType.clear();
7494 BusinessOrganisationsListTokens.clear();
7495 BusinessOrganisationsListSortAs.clear();
7496 BusinessOrganisationsListPref.clear();
7498 BusinessNoteList.clear();
7499 BusinessNoteListLanguage.clear();
7500 BusinessNoteListAltID.clear();
7501 BusinessNoteListPID.clear();
7502 BusinessNoteListType.clear();
7503 BusinessNoteListTokens.clear();
7504 BusinessNoteListPref.clear();
7506 /* Items on the Categories tab */
7508 CategoriesList.clear();
7509 CategoriesListAltID.clear();
7510 CategoriesListPID.clear();
7511 CategoriesListType.clear();
7512 CategoriesListTokens.clear();
7513 CategoriesListPref.clear();
7515 /* Items on the Groups tab */
7518 GroupsListAltID.clear();
7519 GroupsListPID.clear();
7520 GroupsListType.clear();
7521 GroupsListTokens.clear();
7522 GroupsListPref.clear();
7524 /* Items on the Pictures tab */
7526 PicturesList.clear();
7527 PicturesListAltID.clear();
7528 PicturesListPID.clear();
7529 PicturesListType.clear();
7530 PicturesListPicEncType.clear();
7531 PicturesListPictureType.clear();
7532 PicturesListTokens.clear();
7533 PicturesListMediatype.clear();
7534 PicturesListPref.clear();
7536 /* Items on the Logos tab */
7539 LogosListAltID.clear();
7540 LogosListPID.clear();
7541 LogosListType.clear();
7542 LogosListPicEncType.clear();
7543 LogosListPictureType.clear();
7544 LogosListTokens.clear();
7545 LogosListMediatype.clear();
7546 LogosListPref.clear();
7548 /* Items on the Sounds tab */
7551 SoundsListAltID.clear();
7552 SoundsListPID.clear();
7553 SoundsListType.clear();
7554 SoundsListAudioEncType.clear();
7555 SoundsListAudioType.clear();
7556 SoundsListTokens.clear();
7557 SoundsListMediatype.clear();
7558 SoundsListPref.clear();
7560 /* Items on the Calendaring tab */
7562 CalendarList.clear();
7563 CalendarListAltID.clear();
7564 CalendarListPID.clear();
7565 CalendarListType.clear();
7566 CalendarListTokens.clear();
7567 CalendarListMediatype.clear();
7568 CalendarListPref.clear();
7570 CalendarRequestList.clear();
7571 CalendarRequestListAltID.clear();
7572 CalendarRequestListPID.clear();
7573 CalendarRequestListType.clear();
7574 CalendarRequestListTokens.clear();
7575 CalendarRequestListMediatype.clear();
7576 CalendarRequestListPref.clear();
7578 FreeBusyList.clear();
7579 FreeBusyListAltID.clear();
7580 FreeBusyListPID.clear();
7581 FreeBusyListType.clear();
7582 FreeBusyListTokens.clear();
7583 FreeBusyListMediatype.clear();
7584 FreeBusyListPref.clear();
7586 /* Items on the Security tab */
7589 KeyListAltID.clear();
7591 KeyListKeyType.clear();
7592 KeyListDataType.clear();
7593 KeyListDataEncType.clear();
7594 KeyListType.clear();
7595 KeyListTokens.clear();
7596 KeyListPref.clear();
7598 /* Items on the Other tab */
7601 VendorListPEN.clear();
7602 VendorListElement.clear();
7605 XTokenListTokens.clear();
7607 wxSContactFilename.Clear();
7608 boolContactModified = FALSE;
7609 intSeekSelectedData = 0;
7611 /* Section for saving/loading data */
7614 ETagOriginal.Clear();
7625 BinaryDataProc = FALSE;
7629 PictureImage = wxNullBitmap;
7630 LogoImage = wxNullBitmap;
7634 void frmContactEditor::ContactFileChanged( wxCommandEvent &event ){
7640 // Check if a dialog is already open.
7642 if (DialogOpen == TRUE){
7644 FMTimer.Start(1000, FALSE);
7649 // Bring up a Yes/No modal dialog asking if the changed file should be reloaded.
7651 int QuestionResponse;
7653 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);
7655 if (QuestionResponse == wxYES){
7657 // Reload the contact.
7658 wxString wxSReloadContactName = wxSContactFilename;
7660 LoadContact(wxSReloadContactName);
7664 // Do nothing other than update the timestamp so this message
7665 // doesn't appear until the next time it changes.
7667 FMTimer.UpdateTimestamp();
7677 void frmContactEditor::UpdateMembersTab( wxCommandEvent &event ){
7679 if (cmbType->GetCurrentSelection() == 2){
7691 void frmContactEditor::SetUID(int UID){
7693 ContactEditorUID = UID;
7697 void frmContactEditor::UpdateDisplayAs( wxCommandEvent &event ){
7699 // Generate a drop down list of common names to use for the display as drop down box.
7701 wxString SetValue = cmbDisplayAs->GetValue();
7703 cmbDisplayAs->Clear();
7704 cmbDisplayAs->Append(txtForename->GetValue() + wxT(" ") + txtSurname->GetValue());
7705 if (!txtOtherNames->GetValue().IsEmpty()){
7707 cmbDisplayAs->Append(txtForename->GetValue() + wxT(" ") + txtOtherNames->GetValue() + wxT(" ") + txtForename->GetValue());
7710 cmbDisplayAs->Append(txtSurname->GetValue() + wxT(", ") + txtForename->GetValue());
7711 if (!txtOtherNames->GetValue().IsEmpty()){
7713 cmbDisplayAs->Append(txtForename->GetValue() + wxT(", ") + wxT(" ") + txtForename->GetValue() + wxT(" ") + txtOtherNames->GetValue());
7716 if (!txtTitle->GetValue().IsEmpty()){
7717 cmbDisplayAs->Append(txtTitle->GetValue() + wxT(" ") + txtSurname->GetValue() + wxT(" ") + txtForename->GetValue());
7720 cmbDisplayAs->SetValue(SetValue);
7722 this->SetTitle(cmbDisplayAs->GetValue());
7726 void frmContactEditor::UpdateName( wxCommandEvent &event ){
7728 this->SetTitle(cmbDisplayAs->GetValue());
7730 WindowData *WData = new WindowData;
7732 WData->DataType = 1;
7733 WData->WindowPointer = this;
7734 WData->WindowID = ContactEditorUID;
7736 wxCommandEvent editevent(WINDOW_EDIT);
7737 editevent.SetClientData(WData);
7738 wxPostEvent(GetParent(), editevent);