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;
3116 std::map<int,wxString>::iterator pictypeiter;
3118 initier = PicturesList.find(intSelectedData);
3119 pictypeiter = PicturesListPictureType.find(intSelectedData);
3121 base64dec = base64_decode(initier->second);
3123 wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size());
3125 //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size());
3127 wxPuts(wxT("PicType:") + pictypeiter->second);
3129 if (pictypeiter->second == wxT("image/jpeg")){
3131 if (!photo.LoadFile(istream, wxBITMAP_TYPE_JPEG)){
3137 } else if (pictypeiter->second == wxT("image/png")){
3139 if (!photo.LoadFile(istream, wxBITMAP_TYPE_PNG)){
3151 PictureImage = (wxBitmap)photo;
3152 imgPicture->SetBitmap(PictureImage);
3156 void frmContactEditor::LoadLogo( wxListEvent& event )
3159 long longSelected = -1;
3160 int intSelectedData = 0;
3162 if (!GetSelectedItem(lboLogos,
3168 std::string base64dec;
3170 std::map<int,std::string>::iterator initier;
3172 initier = LogosList.find(intSelectedData);
3174 base64dec = base64_decode(initier->second);
3177 wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size());
3179 //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size());
3181 if (!photo.LoadFile(istream, wxBITMAP_TYPE_ANY)){
3188 LogoImage = (wxBitmap)photo;
3189 imgLogo->SetBitmap(LogoImage);
3193 void frmContactEditor::AddLogo( wxCommandEvent& event )
3197 frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this );
3198 frameCELogo->SetEditorMode(FALSE);
3199 intResult = GetLastInt(&LogosList);
3200 frameCELogo->SetupPointers(&LogosList,
3204 &LogosListPicEncType,
3205 &LogosListPictureType,
3207 &LogosListMediatype,
3211 frameCELogo->ShowModal();
3216 void frmContactEditor::ModifyLogo( wxCommandEvent& event )
3218 long longSelected = -1;
3219 int intSelectedData = 0;
3221 if (!GetSelectedItem(lboLogos,
3227 frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this );
3228 frameCELogo->SetupPointers(&LogosList,
3232 &LogosListPicEncType,
3233 &LogosListPictureType,
3235 &LogosListMediatype,
3239 frameCELogo->SetEditorMode(TRUE);
3240 frameCELogo->ShowModal();
3245 void frmContactEditor::DeleteLogo( wxCommandEvent& event )
3247 long longSelected = -1;
3248 int intSelectedData = 0;
3250 if (!GetSelectedItem(lboLogos,
3256 lboLogos->DeleteItem(longSelected);
3258 DeleteMapData(intSelectedData,
3259 &LogosList, &LogosListAltID, &LogosListPID, &LogosListType,
3260 &LogosListPicEncType, &LogosListPictureType, &LogosListTokens,
3261 &LogosListMediatype, &LogosListPref);
3263 wxMemoryInputStream istream(misc_emptyimage_png, sizeof(misc_emptyimage_png));
3264 wxImage misc_emptyimage_png(istream, wxBITMAP_TYPE_PNG);
3265 LogoImage = (wxBitmap)misc_emptyimage_png;
3267 imgLogo->SetBitmap(LogoImage);
3270 void frmContactEditor::AddSound( wxCommandEvent& event )
3274 frmContactEditorSound *frameCESound = new frmContactEditorSound ( this );
3275 frameCESound->SetEditorMode(FALSE);
3276 intResult = GetLastInt(&SoundsList);
3277 frameCESound->SetupPointers(&SoundsList,
3281 &SoundsListAudioType,
3282 &SoundsListAudioEncType,
3284 &SoundsListMediatype,
3288 frameCESound->ShowModal();
3289 delete frameCESound;
3290 frameCESound = NULL;
3293 void frmContactEditor::ModifySound( wxCommandEvent& event )
3295 long longSelected = -1;
3296 int intSelectedData = 0;
3298 if (!GetSelectedItem(lboSounds,
3304 frmContactEditorSound *frameCESound = new frmContactEditorSound ( this );
3305 frameCESound->SetupPointers(&SoundsList,
3309 &SoundsListAudioType,
3310 &SoundsListAudioEncType,
3312 &SoundsListMediatype,
3316 frameCESound->SetEditorMode(TRUE);
3317 frameCESound->ShowModal();
3318 delete frameCESound;
3319 frameCESound = NULL;
3322 void frmContactEditor::DeleteSound( wxCommandEvent& event )
3324 long longSelected = -1;
3325 int intSelectedData = 0;
3327 if (!GetSelectedItem(lboSounds,
3333 lboSounds->DeleteItem(longSelected);
3335 DeleteMapData(intSelectedData, &SoundsList, &SoundsListAltID,
3336 &SoundsListPID, &SoundsListType, &SoundsListAudioType,
3337 &SoundsListAudioEncType, &SoundsListTokens, &SoundsListMediatype,
3342 void frmContactEditor::PlaySoundDetach()
3345 if (!AudioStreamPlayback.openFromMemory(base64dec.c_str(), base64declen)){
3347 // Can't load file. We must flee...
3348 // Also show an error message too.
3350 wxMessageBox(_("This file is in an audio format that is unsupported or is not an audio file."), _("Error opening audio file"), wxICON_ERROR);
3358 //AudioStreamPlayback.setbuffer(AudioBuffer);
3359 AudioStreamPlayback.play();
3364 n1.tv_nsec = 100000000L;*/
3366 //while (TimeA != TimeB){
3367 while (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3369 // We poll this every 100ms in order to conserve CPU usage.
3371 SleepFor(100000000);
3379 void frmContactEditor::PlaySound( wxCommandEvent& event )
3382 //sf::Music *AudioPlayback = new sf::Music;
3383 //AudioStream *AudioStreamPlayback = new AudioStream;
3384 //sf::SoundBuffer *AudioBuffer = new sf::SoundBuffer;
3386 //sf::Sound *AudioPlayback = new sf::Sound;
3388 //delete(AudioPlayback);
3390 //delete(AudioPlayback);
3391 //delete(AudioStreamPlayback);
3392 //delete(AudioBuffer);
3394 //AudioPlayback = NULL;
3395 //AudioStreamPlayback = NULL;
3396 //AudioBuffer = NULL;
3400 long longSelected = -1;
3401 int intSelectedData = 0;
3403 // Check if sound is still being played and if it is, stop it.
3405 if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3407 AudioStreamPlayback.stop();
3411 if (!GetSelectedItem(lboSounds,
3417 std::map<int, std::string>::iterator initier;
3419 initier = SoundsList.find(intSelectedData);
3421 base64dec = base64_decode(initier->second);
3422 base64declen = base64dec.size();
3424 std::thread AudioPlaybackThread(&frmContactEditor::PlaySoundDetach, this);
3425 AudioPlaybackThread.detach();
3431 void frmContactEditor::StopSound( wxCommandEvent& event )
3434 if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
3436 AudioStreamPlayback.stop();
3446 void frmContactEditor::AddCalendarAddress( wxCommandEvent& event )
3450 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3451 frameCECalAdr->SetEditorMode(FALSE);
3452 intResult = GetLastInt(&CalendarList);
3453 frameCECalAdr->SetupPointers(&CalendarList,
3457 &CalendarListTokens,
3459 lboCalendarAddresses,
3461 frameCECalAdr->ShowModal();
3462 delete frameCECalAdr;
3463 frameCECalAdr = NULL;
3466 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
3468 long longSelected = -1;
3469 int intSelectedData = 0;
3471 if (!GetSelectedItem(lboCalendarAddresses,
3477 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3478 frameCECalAdr->SetupPointers(&CalendarList,
3482 &CalendarListTokens,
3484 lboCalendarAddresses,
3486 frameCECalAdr->SetEditorMode(TRUE);
3487 frameCECalAdr->ShowModal();
3488 delete frameCECalAdr;
3489 frameCECalAdr = NULL;
3492 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
3494 long longSelected = -1;
3495 int intSelectedData = 0;
3497 if (!GetSelectedItem(lboCalendarAddresses,
3503 lboCalendarAddresses->DeleteItem(longSelected);
3505 DeleteMapData(intSelectedData, &CalendarList, &CalendarListAltID,
3506 &CalendarListPID, &CalendarListType, &CalendarListTokens,
3511 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
3515 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3516 frameCECalAdr->SetEditorMode(FALSE);
3517 intResult = GetLastInt(&CalendarRequestList);
3518 frameCECalAdr->SetupPointers(&CalendarRequestList,
3519 &CalendarRequestListAltID,
3520 &CalendarRequestListPID,
3521 &CalendarRequestListType,
3522 &CalendarRequestListTokens,
3523 &CalendarRequestListPref,
3524 lboCalendarRequestAddress,
3526 frameCECalAdr->ShowModal();
3527 delete frameCECalAdr;
3528 frameCECalAdr = NULL;
3531 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
3533 long longSelected = -1;
3534 int intSelectedData = 0;
3536 if (!GetSelectedItem(lboCalendarRequestAddress,
3542 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3543 frameCECalAdr->SetupPointers(&CalendarList,
3544 &CalendarRequestListAltID,
3545 &CalendarRequestListPID,
3546 &CalendarRequestListType,
3547 &CalendarRequestListTokens,
3548 &CalendarRequestListPref,
3549 lboCalendarRequestAddress,
3551 frameCECalAdr->SetEditorMode(TRUE);
3552 frameCECalAdr->ShowModal();
3553 delete frameCECalAdr;
3554 frameCECalAdr = NULL;
3557 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
3559 long longSelected = -1;
3560 int intSelectedData = 0;
3562 if (!GetSelectedItem(lboCalendarRequestAddress,
3568 lboCalendarRequestAddress->DeleteItem(longSelected);
3570 DeleteMapData(intSelectedData, &CalendarRequestList,
3571 &CalendarRequestListAltID, &CalendarRequestListPID,
3572 &CalendarRequestListType, &CalendarRequestListTokens,
3573 &CalendarRequestListPref);
3576 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
3580 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3581 frameCECalAdr->SetEditorMode(FALSE);
3582 intResult = GetLastInt(&FreeBusyList);
3583 frameCECalAdr->SetupPointers(&FreeBusyList,
3587 &FreeBusyListTokens,
3589 lboFreeBusyAddresses,
3591 frameCECalAdr->ShowModal();
3592 delete frameCECalAdr;
3593 frameCECalAdr = NULL;
3596 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
3598 long longSelected = -1;
3599 int intSelectedData = 0;
3601 if (!GetSelectedItem(lboFreeBusyAddresses,
3607 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
3608 frameCECalAdr->SetupPointers(&FreeBusyList,
3612 &FreeBusyListTokens,
3614 lboFreeBusyAddresses,
3616 frameCECalAdr->SetEditorMode(TRUE);
3617 frameCECalAdr->ShowModal();
3618 delete frameCECalAdr;
3619 frameCECalAdr = NULL;
3622 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
3624 long longSelected = -1;
3625 int intSelectedData = 0;
3627 if (!GetSelectedItem(lboFreeBusyAddresses,
3633 lboFreeBusyAddresses->DeleteItem(longSelected);
3635 DeleteMapData(intSelectedData, &FreeBusyList, &FreeBusyListAltID,
3636 &FreeBusyListPID, &FreeBusyListType, &FreeBusyListTokens,
3641 void frmContactEditor::AddKey( wxCommandEvent& event )
3645 frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
3646 frameCEKey->SetEditorMode(FALSE);
3647 intResult = GetLastInt(&KeyList);
3648 frameCEKey->SetupPointers(&KeyList,
3658 frameCEKey->ShowModal();
3663 void frmContactEditor::ModifyKey( wxCommandEvent& event )
3665 long longSelected = -1;
3666 int intSelectedData = 0;
3668 if (!GetSelectedItem(lboKeys,
3674 frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
3675 frameCEKey->SetupPointers(&KeyList,
3685 frameCEKey->SetEditorMode(TRUE);
3686 frameCEKey->ShowModal();
3691 void frmContactEditor::DeleteKey( wxCommandEvent& event )
3693 long longSelected = -1;
3694 int intSelectedData = 0;
3696 if (!GetSelectedItem(lboKeys,
3702 lboKeys->DeleteItem(longSelected);
3704 DeleteMapData(intSelectedData, &KeyList, &KeyListAltID,
3705 &KeyListPID, &KeyListKeyType, &KeyListDataType, &KeyListType,
3706 &KeyListTokens, &KeyListPref);
3710 void frmContactEditor::AddVendorNamespace( wxCommandEvent& event )
3714 frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
3715 frameCEVen->SetEditorMode(FALSE);
3716 intResult = GetLastInt(&VendorList);
3717 frameCEVen->SetupPointers(&VendorList,
3722 frameCEVen->ShowModal();
3727 void frmContactEditor::ModifyVendorNamespace( wxCommandEvent& event )
3729 long longSelected = -1;
3730 int intSelectedData = 0;
3732 if (!GetSelectedItem(lboVendorNamespace,
3738 frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
3739 frameCEVen->SetupPointers(&VendorList,
3744 frameCEVen->SetEditorMode(TRUE);
3745 frameCEVen->ShowModal();
3750 void frmContactEditor::DeleteVendorNamespace( wxCommandEvent& event )
3752 long longSelected = -1;
3753 int intSelectedData = 0;
3755 if (!GetSelectedItem(lboVendorNamespace,
3761 lboVendorNamespace->DeleteItem(longSelected);
3763 DeleteMapData(intSelectedData, &VendorList, &VendorListPEN,
3764 &VendorListElement);
3768 void frmContactEditor::AddXToken( wxCommandEvent& event )
3772 frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
3773 frameCEXT->SetEditorMode(FALSE);
3774 intResult = GetLastInt(&XTokenList);
3775 frameCEXT->SetupPointers(&XTokenList,
3779 frameCEXT->ShowModal();
3784 void frmContactEditor::ModifyXToken( wxCommandEvent& event )
3786 long longSelected = -1;
3787 int intSelectedData = 0;
3789 if (!GetSelectedItem(lboXToken,
3795 frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
3796 frameCEXT->SetupPointers(&XTokenList,
3800 frameCEXT->SetEditorMode(TRUE);
3801 frameCEXT->ShowModal();
3806 void frmContactEditor::DeleteXToken( wxCommandEvent& event )
3808 long longSelected = -1;
3809 int intSelectedData = 0;
3811 if (!GetSelectedItem(lboXToken,
3817 lboXToken->DeleteItem(longSelected);
3819 DeleteMapData(intSelectedData, &XTokenList, &XTokenListTokens);
3823 void frmContactEditor::SaveContact( wxCommandEvent& event )
3826 // Check if Display As combo box has a value in it.
3827 // Do not go any further if there is no value.
3829 wxString cmbDisplayAsValue = cmbDisplayAs->GetValue();
3831 if (cmbDisplayAsValue.IsEmpty()){
3833 wxMessageBox(_("Display As value cannot be left blank."), _("Display As value empty"), wxICON_ERROR);
3838 // Save the updated contact data.
3841 wxString FilenameFinal;
3842 bool ReplaceContact = FALSE;
3844 if (cmbType->GetCurrentSelection() == 1 ||
3845 cmbType->GetCurrentSelection() == 3 ||
3846 cmbType->GetCurrentSelection() == 4){
3848 if (IsGroup == TRUE){
3850 // Mark contact for replacing.
3852 ReplaceContact = TRUE;
3856 } else if (cmbType->GetCurrentSelection() == 2){
3858 if (IsGroup == TRUE){
3860 // Mark contact for replacing.
3862 ReplaceContact = TRUE;
3868 if (ReplaceContact == TRUE){
3870 wxString wxDelSplitFilename;
3871 wxString wxDelFinalFilename;
3872 wxString wxSDelDataURL;
3873 wxStringTokenizer wSTDelFilename(wxSContactFilename, wxT("/"));
3874 while(wSTDelFilename.HasMoreTokens()){
3876 wxDelSplitFilename = wSTDelFilename.GetNextToken();
3880 wxSDelDataURL = wxDelSplitFilename;
3882 // Delete the contact from the server as it will be useless in certain
3883 // address book clients.
3885 ActMgrPtr->AddTask(2, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDelDataURL, wxDelSplitFilename, wxSContactFilename, wxT(""));
3887 // Clear the filename so the trigger to recreate the UID is done.
3889 wxSContactFilename.Clear();
3894 if (wxSContactFilename.IsEmpty()){
3896 // Generate a random UUID.
3898 UIDToken = GenerateUUID();
3899 UIDToken = UIDToken.MakeUpper();
3901 // Setup the filename.
3903 FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3905 #if defined(__HAIKU__)
3907 //preffilename = wxT("noo");
3909 #elif defined(__WIN32__)
3911 FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3912 FilenameFinal.Append(UIDToken);
3913 FilenameFinal.Append(wxT(".vcf"));
3914 wxSContactFilename = FilenameFinal;
3918 FilenameFinal = GetAccountDir(wxSContactAccount, FALSE);
3919 FilenameFinal.Append(UIDToken);
3920 FilenameFinal.Append(wxT(".vcf"));
3921 wxSContactFilename = FilenameFinal;
3927 if (UIDToken.IsEmpty()){
3929 // UID Token is empty. (Shouldn't be).
3930 // Generate a new UID Token.
3932 /*boost::uuids::uuid ContactUUID = boost::uuids::random_generator()();
3933 std::string sstContactUUID = boost::uuids::to_string(ContactUUID);
3934 wxString strContactUUID(sstContactUUID.c_str(), wxConvUTF8);
3935 UIDToken = strContactUUID;*/
3936 UIDToken = GenerateUUID();
3937 UIDToken = UIDToken.MakeUpper();
3940 FilenameFinal = wxSContactFilename;
3944 // Setup the data and write it into the account folder.
3946 // Begin preperations to write the contact to a file.
3948 bool boolValue = FALSE;
3949 bool boolValue2 = FALSE;
3950 bool FNFirst = TRUE;
3951 bool NNGeneralFirst = TRUE;
3952 bool NNHomeFirst = TRUE;
3953 bool NNWorkFirst = TRUE;
3955 std::map<int,int>::iterator intiter;
3956 std::map<int,wxString>::iterator striter;
3958 ContactData.Add(wxT("BEGIN"), wxT("VCARD"), FALSE);
3959 ContactData.Add(wxT("VERSION"), wxT("4.0"), FALSE);
3961 // Setup the version string.
3963 strValue.Append(wxT("-//Xestia//Address Book Version "));
3964 strValue.Append(wxT(XSDAB_VERSION));
3965 strValue.Append(wxT("//KW"));
3967 ContactData.Add(wxT("PRODID"), strValue, FALSE);
3973 // Setup the name field.
3975 strValue = txtSurname->GetValue() + wxT(";") +
3976 txtForename->GetValue() + wxT(";") +
3977 txtOtherNames->GetValue() + wxT(";") +
3978 txtTitle->GetValue() + wxT(";") +
3979 txtSuffix->GetValue();
3981 strValue2 = ContactData.Convert(cmbDisplayAs->GetValue(), FALSE);
3984 if (NameTokens.IsEmpty()){
3985 ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\""), strValue, FALSE);
3987 ContactData.Add(wxT("N;SORT-AS=\"") + strValue2 + wxT("\";") + NameTokens, strValue, FALSE);
3990 if (cmbType->GetCurrentSelection() == 1){
3992 ContactData.AddRaw(wxT("KIND"), wxT("individual"));
3994 } else if (cmbType->GetCurrentSelection() == 2){
3996 ContactData.AddRaw(wxT("KIND"), wxT("group"));
3998 // Go through each of the members and write them out.
4000 for (std::map<int, wxString>::iterator itemiter = GroupsList.begin();
4001 itemiter != GroupsList.end(); ++itemiter){
4003 ContactData.Add(wxT("MEMBER:urn:uuid"), itemiter->second, FALSE);
4007 } else if (cmbType->GetCurrentSelection() == 3){
4009 ContactData.AddRaw(wxT("KIND"), wxT("org"));
4011 } else if (cmbType->GetCurrentSelection() == 4){
4013 ContactData.AddRaw(wxT("KIND"), wxT("location"));
4018 // Setup the nicknames (General, Home & Business).
4029 // Setup the gender.
4031 if (cmbGender->GetCurrentSelection() != 0){
4033 switch(cmbGender->GetCurrentSelection()){
4037 strValue = wxT("M");
4042 strValue = wxT("F");
4047 strValue = wxT("O");
4052 strValue = wxT("N");
4057 strValue = wxT("U");
4064 if (!txtGenderDescription->IsEmpty()){
4066 strValue2 = txtGenderDescription->GetValue();
4070 if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4072 EscapeString(&strValue2, FALSE);
4074 if (!GenderTokens.IsEmpty()){
4076 if (!strValue2.IsEmpty()){
4078 ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue + wxT(";") + strValue2);
4082 ContactData.AddRaw(wxT("GENDER;") + GenderTokens, strValue);
4088 if (!strValue2.IsEmpty()){
4090 ContactData.AddRaw(wxT("GENDER"), strValue + wxT(";") + strValue2);
4094 ContactData.AddRaw(wxT("GENDER"), strValue);
4113 strValue3 = BirthdayAltID;
4115 if (!strValue3.IsEmpty()){
4120 strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\""));
4126 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4129 // Process Language.
4131 strValue3 = BirthdayCalScale;
4133 if (!strValue3.IsEmpty()){
4138 if (boolValue2 == TRUE){
4140 strValue2.Append(wxT(";"));
4148 strValue2.Append(wxT("CALSCALE=") + strValue3);
4156 strValue2 = BirthdayTokens;
4158 // Get the birthday and write it.
4160 ResetSaveProcessData();
4162 if (!txtBirthday->IsEmpty()){
4164 strValue = txtBirthday->GetValue();
4166 if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4168 if (!strValue2.IsEmpty()){
4170 EscapeString(&strValue2, FALSE);
4171 EscapeString(&strValue, FALSE);
4173 ContactData.AddRaw(wxT("BDAY;VALUE=text;") + strValue2 + wxT(";"), strValue);
4177 EscapeString(&strValue, FALSE);
4179 ContactData.AddRaw(wxT("BDAY;VALUE=text"), strValue);
4189 // Get Day, Month & Year.
4191 wxDateTime BirthdayDate;
4192 wxDateTime::Month BirthdayMonth;
4195 wxString DataBeforeT;
4196 wxString DataAfterT;
4197 wxString FinalBirthdayString;
4198 bool ProcessDataAfterT = FALSE;
4200 BirthdayDate = dapBirthday->GetValue();
4202 if (BirthdayDate.IsValid()){
4204 BirthdayDay = BirthdayDate.GetDay();
4205 BirthdayMonth = BirthdayDate.GetMonth();
4206 BirthdayYear = BirthdayDate.GetYear();
4208 // Look for T and replace data before this.
4210 wxStringTokenizer wSTDate(Birthday, wxT("T"));
4212 while (wSTDate.HasMoreTokens()){
4214 if (ProcessDataAfterT == FALSE){
4216 DataBeforeT = wSTDate.GetNextToken();
4217 ProcessDataAfterT = TRUE;
4221 DataAfterT = wSTDate.GetNextToken();
4228 // If there is not T then replace altogether.
4230 wxString FinalBirthdayDay;
4231 wxString FinalBirthdayMonth;
4232 wxString FinalBirthdayYear;
4234 if (BirthdayDay < 10){
4236 FinalBirthdayDay = wxT("0") + wxString::Format(wxT("%i"), BirthdayDay);
4240 FinalBirthdayDay = wxString::Format(wxT("%i"), BirthdayDay);
4244 if (((int)BirthdayMonth + 1) < 10){
4246 FinalBirthdayMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1));
4250 FinalBirthdayMonth = wxString::Format(wxT("%i"), ((int)BirthdayMonth + 1));
4254 if (BirthdayYear == 0){
4256 FinalBirthdayYear = wxT("--");
4260 FinalBirthdayYear = wxString::Format(wxT("%i"), BirthdayYear);
4264 if (!DataAfterT.IsEmpty()){
4266 FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay + wxT("T") + DataAfterT;
4270 FinalBirthdayString = FinalBirthdayYear + FinalBirthdayMonth + FinalBirthdayDay;
4274 if (!FinalBirthdayString.IsEmpty() || !strValue2.IsEmpty()){
4276 if (!strValue2.IsEmpty()){
4278 EscapeString(&strValue2, FALSE);
4279 EscapeString(&strValue, FALSE);
4281 ContactData.AddRaw(wxT("BDAY") + strValue2 + wxT(";"), FinalBirthdayString);
4285 EscapeString(&strValue, FALSE);
4287 ContactData.AddRaw(wxT("BDAY"), FinalBirthdayString);
4297 ResetSaveProcessData();
4301 strValue3 = AnniversaryAltID;
4303 if (!strValue3.IsEmpty()){
4308 strValue2.Append(wxT("ALTID=\"") + strValue3 + wxT("\""));
4314 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4317 // Process Language.
4319 strValue3 = AnniversaryCalScale;
4321 if (!strValue3.IsEmpty()){
4326 if (boolValue2 == TRUE){
4328 strValue2.Append(wxT(";"));
4336 strValue2.Append(wxT("CALSCALE=") + strValue3);
4344 strValue2 = AnniversaryTokens;
4346 // Deal with ANNIVERSARY.
4348 if (!txtAnniversary->IsEmpty()){
4350 strValue = txtAnniversary->GetValue();
4352 if (!strValue.IsEmpty() || !strValue2.IsEmpty()){
4354 if (!strValue2.IsEmpty()){
4356 EscapeString(&strValue2, FALSE);
4357 EscapeString(&strValue, FALSE);
4359 ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text;") + strValue2 + wxT(";"), strValue);
4363 EscapeString(&strValue, FALSE);
4365 ContactData.AddRaw(wxT("ANNIVERSARY;VALUE=text"), strValue);
4373 // Look for T and replace data before this.
4375 // Get Day, Month & Year.
4377 wxDateTime AnniversaryDate;
4378 wxDateTime::Month AnniversaryMonth;
4380 int AnniversaryYear;
4381 wxString DataBeforeT;
4382 wxString DataAfterT;
4383 wxString FinalAnniversaryString;
4384 bool ProcessDataAfterT = FALSE;
4386 AnniversaryDate = dapAnniversary->GetValue();
4388 if (AnniversaryDate.IsValid()){
4390 AnniversaryDay = AnniversaryDate.GetDay();
4391 AnniversaryMonth = AnniversaryDate.GetMonth();
4392 AnniversaryYear = AnniversaryDate.GetYear();
4394 // Look for T and replace data before this.
4396 wxStringTokenizer wSTDate(Anniversary, wxT("T"));
4398 while (wSTDate.HasMoreTokens()){
4400 if (ProcessDataAfterT == FALSE){
4402 DataBeforeT = wSTDate.GetNextToken();
4403 ProcessDataAfterT = TRUE;
4407 DataAfterT = wSTDate.GetNextToken();
4414 // If there is not T then replace altogether.
4416 wxString FinalAnniversaryDay;
4417 wxString FinalAnniversaryMonth;
4418 wxString FinalAnniversaryYear;
4420 if (AnniversaryDay < 10){
4422 FinalAnniversaryDay = wxT("0") + wxString::Format(wxT("%i"), AnniversaryDay);
4426 FinalAnniversaryDay = wxString::Format(wxT("%i"), AnniversaryDay);
4430 if (((int)AnniversaryMonth + 1) < 10){
4432 FinalAnniversaryMonth = wxT("0") + wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1));
4436 FinalAnniversaryMonth = wxString::Format(wxT("%i"), ((int)AnniversaryMonth + 1));
4440 if (AnniversaryYear == 0){
4442 FinalAnniversaryYear = wxT("--");
4446 FinalAnniversaryYear = wxString::Format(wxT("%i"), AnniversaryYear);
4450 if (!DataAfterT.IsEmpty()){
4452 FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay + wxT("T") + DataAfterT;
4456 FinalAnniversaryString = FinalAnniversaryYear + FinalAnniversaryMonth + FinalAnniversaryDay;
4460 if (!FinalAnniversaryString.IsEmpty() || !strValue2.IsEmpty()){
4462 if (!strValue2.IsEmpty()){
4464 EscapeString(&strValue2, FALSE);
4465 EscapeString(&strValue, FALSE);
4467 ContactData.AddRaw(wxT("ANNIVERSARY") + strValue2 + wxT(";"), FinalAnniversaryString);
4471 EscapeString(&strValue, FALSE);
4473 ContactData.AddRaw(wxT("ANNIVERSARY"), FinalAnniversaryString);
4483 // Setup the addresses (General, Home, Business).
4485 //intValue = GeneralAddressList.size();
4486 ResetSaveProcessData();
4488 for (std::map<int,wxString>::iterator iter = GeneralAddressList.begin();
4489 iter != GeneralAddressList.end(); ++iter){
4491 int intSeekValue = iter->first;
4493 wxString strAddressString;
4494 wxString strAddressFinalValue;
4495 std::map<int, wxString>::iterator iterValue;
4497 strAddressString.Append(wxT(";;"));
4501 iterValue = GeneralAddressList.find(intSeekValue);
4502 strAddressFinalValue = iterValue->second;
4503 ProcessCaptureStrings(&strAddressFinalValue);
4504 strAddressString.Append(strAddressFinalValue + wxT(";"));
4505 strAddressFinalValue.Clear();
4509 iterValue = GeneralAddressListTown.find(intSeekValue);
4510 strAddressFinalValue = iterValue->second;
4511 ProcessCaptureStrings(&strAddressFinalValue);
4512 strAddressString.Append(strAddressFinalValue + wxT(";"));
4513 strAddressFinalValue.Clear();
4517 iterValue = GeneralAddressListCounty.find(intSeekValue);
4518 strAddressFinalValue = iterValue->second;
4519 ProcessCaptureStrings(&strAddressFinalValue);
4520 strAddressString.Append(strAddressFinalValue + wxT(";"));
4521 strAddressFinalValue.Clear();
4525 iterValue = GeneralAddressListPostCode.find(intSeekValue);
4526 strAddressFinalValue = iterValue->second;
4527 ProcessCaptureStrings(&strAddressFinalValue);
4528 strAddressString.Append(strAddressFinalValue + wxT(";"));
4529 strAddressFinalValue.Clear();
4533 iterValue = GeneralAddressListCountry.find(intSeekValue);
4534 strAddressFinalValue = iterValue->second;
4535 ProcessCaptureStrings(&strAddressFinalValue);
4536 strAddressString.Append(strAddressFinalValue);
4537 strAddressFinalValue.Clear();
4539 ProcessSaveData(wxT("ADR"), &strValue2, &boolValue2, &boolValue,
4540 &iter, &strAddressString, &ContactData,
4541 wxT("LABEL"), &GeneralAddressListLabel,
4542 wxT("LANGUAGE"), &GeneralAddressListLang,
4543 wxT("ALTID"), &GeneralAddressListAltID,
4544 wxT("PID"), &GeneralAddressListPID,
4545 wxT("GEO"), &GeneralAddressListGeo,
4546 wxT("TZ"), &GeneralAddressListTimezone,
4547 wxT("MEDIATYPE"), &GeneralAddressListMediatype,
4548 wxT("PREF"), &GeneralAddressListPref,
4549 wxT(""), &GeneralAddressListTokens );
4551 ResetSaveProcessData();
4555 ResetSaveProcessData();
4557 for (std::map<int,wxString>::iterator iter = HomeAddressList.begin();
4558 iter != HomeAddressList.end(); ++iter){
4560 int intSeekValue = iter->first;
4562 wxString strAddressString;
4563 wxString strAddressFinalValue;
4564 std::map<int, wxString>::iterator iterValue;
4566 strAddressString.Append(wxT(";;"));
4570 iterValue = HomeAddressList.find(intSeekValue);
4571 strAddressFinalValue = iterValue->second;
4572 ProcessCaptureStrings(&strAddressFinalValue);
4574 strAddressString.Append(strAddressFinalValue + wxT(";"));
4578 iterValue = HomeAddressListTown.find(intSeekValue);
4579 strAddressFinalValue = iterValue->second;
4580 ProcessCaptureStrings(&strAddressFinalValue);
4582 strAddressString.Append(strAddressFinalValue + wxT(";"));
4586 iterValue = HomeAddressListCounty.find(intSeekValue);
4587 strAddressFinalValue = iterValue->second;
4588 ProcessCaptureStrings(&strAddressFinalValue);
4590 strAddressString.Append(strAddressFinalValue + wxT(";"));
4594 iterValue = HomeAddressListPostCode.find(intSeekValue);
4595 strAddressFinalValue = iterValue->second;
4596 ProcessCaptureStrings(&strAddressFinalValue);
4598 strAddressString.Append(strAddressFinalValue + wxT(";"));
4602 iterValue = HomeAddressListCountry.find(intSeekValue);
4603 strAddressFinalValue = iterValue->second;
4604 ProcessCaptureStrings(&strAddressFinalValue);
4606 strAddressString.Append(strAddressFinalValue);
4608 ProcessSaveData(wxT("ADR;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4609 &iter, &strAddressString, &ContactData,
4610 wxT("LABEL"), &HomeAddressListLabel,
4611 wxT("LANGUAGE"), &HomeAddressListLang,
4612 wxT("ALTID"), &HomeAddressListAltID,
4613 wxT("PID"), &HomeAddressListPID,
4614 wxT("GEO"), &HomeAddressListGeo,
4615 wxT("TZ"), &HomeAddressListTimezone,
4616 wxT("MEDIATYPE"), &HomeAddressListMediatype,
4617 wxT("PREF"), &HomeAddressListPref,
4618 wxT(""), &HomeAddressListTokens );
4620 ResetSaveProcessData();
4624 ResetSaveProcessData();
4626 for (std::map<int,wxString>::iterator iter = BusinessAddressList.begin();
4627 iter != BusinessAddressList.end(); ++iter){
4629 int intSeekValue = iter->first;
4631 wxString strAddressString;
4632 wxString strAddressFinalValue;
4633 std::map<int, wxString>::iterator iterValue;
4635 strAddressString.Append(wxT(";;"));
4639 iterValue = BusinessAddressList.find(intSeekValue);
4640 strAddressFinalValue = iterValue->second;
4641 ProcessCaptureStrings(&strAddressFinalValue);
4643 strAddressString.Append(strAddressFinalValue + wxT(";"));
4647 iterValue = BusinessAddressListTown.find(intSeekValue);
4648 strAddressFinalValue = iterValue->second;
4649 ProcessCaptureStrings(&strAddressFinalValue);
4651 strAddressString.Append(strAddressFinalValue + wxT(";"));
4655 iterValue = BusinessAddressListCounty.find(intSeekValue);
4656 strAddressFinalValue = iterValue->second;
4657 ProcessCaptureStrings(&strAddressFinalValue);
4659 strAddressString.Append(strAddressFinalValue + wxT(";"));
4663 iterValue = BusinessAddressListPostCode.find(intSeekValue);
4664 strAddressFinalValue = iterValue->second;
4665 ProcessCaptureStrings(&strAddressFinalValue);
4667 strAddressString.Append(strAddressFinalValue + wxT(";"));
4671 iterValue = BusinessAddressListCountry.find(intSeekValue);
4672 strAddressFinalValue = iterValue->second;
4673 ProcessCaptureStrings(&strAddressFinalValue);
4675 strAddressString.Append(strAddressFinalValue);
4677 ProcessSaveData(wxT("ADR;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4678 &iter, &strAddressString, &ContactData,
4679 wxT("LABEL"), &BusinessAddressListLabel,
4680 wxT("LANGUAGE"), &BusinessAddressListLang,
4681 wxT("ALTID"), &BusinessAddressListAltID,
4682 wxT("PID"), &BusinessAddressListPID,
4683 wxT("GEO"), &BusinessAddressListGeo,
4684 wxT("TZ"), &BusinessAddressListTimezone,
4685 wxT("MEDIATYPE"), &BusinessAddressListMediatype,
4686 wxT("PREF"), &BusinessAddressListPref,
4687 wxT(""), &BusinessAddressListTokens );
4689 ResetSaveProcessData();
4693 // Sort out nicknames (if any).
4695 for (std::map<int,wxString>::iterator iter = GeneralNicknamesList.begin();
4696 iter != GeneralNicknamesList.end(); ++iter){
4698 intValue2 = iter->first;
4700 // Process Alternative ID.
4702 ProcessSaveData(wxT("NICKNAME"), &strValue2, &boolValue2, &boolValue,
4703 &iter, &GeneralNicknamesList, &ContactData,
4704 wxT("LANGUAGE"), &GeneralNicknamesListLanguage,
4705 wxT("ALTID"), &GeneralNicknamesListAltID,
4706 wxT("PID"), &GeneralNicknamesListPID,
4707 wxT("PREF"), &GeneralNicknamesListPref,
4708 wxT(""), &GeneralNicknamesListTokens );
4710 ResetSaveProcessData();
4714 ResetSaveProcessData();
4716 for (std::map<int,wxString>::iterator iter = HomeNicknamesList.begin();
4717 iter != HomeNicknamesList.end(); ++iter){
4719 ProcessSaveData(wxT("NICKNAME;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4720 &iter, &HomeNicknamesList, &ContactData,
4721 wxT("LANGUAGE"), &HomeNicknamesListLanguage,
4722 wxT("ALTID"), &HomeNicknamesListAltID,
4723 wxT("PID"), &HomeNicknamesListPID,
4724 wxT("PREF"), &HomeNicknamesListPref,
4725 wxT(""), &HomeNicknamesListTokens );
4727 ResetSaveProcessData();
4731 ResetSaveProcessData();
4733 for (std::map<int,wxString>::iterator iter = BusinessNicknamesList.begin();
4734 iter != BusinessNicknamesList.end(); ++iter){
4736 ProcessSaveData(wxT("NICKNAME;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4737 &iter, &BusinessNicknamesList, &ContactData,
4738 wxT("LANGUAGE"), &BusinessNicknamesListLanguage,
4739 wxT("ALTID"), &BusinessNicknamesListAltID,
4740 wxT("PID"), &BusinessNicknamesListPID,
4741 wxT("PREF"), &BusinessNicknamesListPref,
4742 wxT(""), &BusinessNicknamesListTokens );
4744 ResetSaveProcessData();
4748 ResetSaveProcessData();
4750 // Sort out email (general, home and business).
4752 for (std::map<int,wxString>::iterator iter = GeneralEmailList.begin();
4753 iter != GeneralEmailList.end(); ++iter){
4755 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4758 wxString strAddressFinalValue;
4759 std::map<int, wxString>::iterator iterValue;
4761 ProcessSaveData(wxT("EMAIL"), &strValue2, &boolValue2, &boolValue,
4762 &iter, &GeneralEmailList, &ContactData,
4763 wxT("ALTID"), &GeneralEmailListAltID,
4764 wxT("PID"), &GeneralEmailListPID,
4765 wxT("PREF"), &GeneralEmailListPref,
4766 wxT(""), &GeneralEmailListTokens );
4768 ResetSaveProcessData();
4772 ResetSaveProcessData();
4774 for (std::map<int,wxString>::iterator iter = HomeEmailList.begin();
4775 iter != HomeEmailList.end(); ++iter){
4777 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4780 ProcessSaveData(wxT("EMAIL;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4781 &iter, &HomeEmailList, &ContactData,
4782 wxT("ALTID"), &HomeEmailListAltID,
4783 wxT("PID"), &HomeEmailListPID,
4784 wxT("PREF"), &HomeEmailListPref,
4785 wxT(""), &HomeEmailListTokens );
4787 ResetSaveProcessData();
4791 ResetSaveProcessData();
4793 for (std::map<int,wxString>::iterator iter = BusinessEmailList.begin();
4794 iter != BusinessEmailList.end(); ++iter){
4796 //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
4799 ProcessSaveData(wxT("EMAIL;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4800 &iter, &BusinessEmailList, &ContactData,
4801 wxT("ALTID"), &BusinessEmailListAltID,
4802 wxT("PID"), &BusinessEmailListPID,
4803 wxT("PREF"), &BusinessEmailListPref,
4804 wxT(""), &BusinessEmailListTokens );
4806 ResetSaveProcessData();
4810 ResetSaveProcessData();
4812 for (std::map<int,wxString>::iterator iter = GeneralIMList.begin();
4813 iter != GeneralIMList.end(); ++iter){
4815 intValue2 = iter->first;
4817 // Process Alternative ID.
4819 ProcessSaveData(wxT("IMPP"), &strValue2, &boolValue2, &boolValue,
4820 &iter, &GeneralIMList, &ContactData,
4821 wxT("ALTID"), &GeneralIMListAltID,
4822 wxT("PID"), &GeneralIMListPID,
4823 wxT("MEDIATYPE"), &GeneralIMListMediatype,
4824 wxT("PREF"), &GeneralIMListPref,
4825 wxT(""), &GeneralIMListTokens );
4827 ResetSaveProcessData();
4831 ResetSaveProcessData();
4833 for (std::map<int,wxString>::iterator iter = HomeIMList.begin();
4834 iter != HomeIMList.end(); ++iter){
4836 ProcessSaveData(wxT("IMPP;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4837 &iter, &HomeIMList, &ContactData,
4838 wxT("ALTID"), &HomeIMListAltID,
4839 wxT("PID"), &HomeIMListPID,
4840 wxT("MEDIATYPE"), &HomeIMListMediatype,
4841 wxT("PREF"), &HomeIMListPref,
4842 wxT(""), &HomeIMListTokens );
4844 ResetSaveProcessData();
4848 ResetSaveProcessData();
4850 for (std::map<int,wxString>::iterator iter = BusinessIMList.begin();
4851 iter != BusinessIMList.end(); ++iter){
4853 ProcessSaveData(wxT("IMPP;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4854 &iter, &BusinessIMList, &ContactData,
4855 wxT("ALTID"), &BusinessIMListAltID,
4856 wxT("PID"), &BusinessIMListPID,
4857 wxT("MEDIATYPE"), &BusinessIMListMediatype,
4858 wxT("PREF"), &BusinessIMListPref,
4859 wxT(""), &BusinessIMListTokens );
4861 ResetSaveProcessData();
4865 ResetSaveProcessData();
4867 for (std::map<int,wxString>::iterator iter = GeneralTelephoneList.begin();
4868 iter != GeneralTelephoneList.end(); ++iter){
4870 wxString strAddressFinalValue = iter->second;
4872 ProcessCaptureStrings(&strAddressFinalValue);
4874 strAddressFinalValue.insert(0, wxT("tel:"));
4876 ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4877 &iter, &strAddressFinalValue, &ContactData,
4878 wxT("ALTID"), &GeneralTelephoneListAltID,
4879 wxT("PID"), &GeneralTelephoneListPID,
4880 wxT("TYPE"), &GeneralTelephoneListType,
4881 wxT("PREF"), &GeneralTelephoneListPref,
4882 wxT(""), &GeneralTelephoneListTokens );
4884 ResetSaveProcessData();
4888 ResetSaveProcessData();
4890 for (std::map<int,wxString>::iterator iter = HomeTelephoneList.begin();
4891 iter != HomeTelephoneList.end(); ++iter){
4893 wxString strAddressFinalValue = iter->second;
4895 ProcessCaptureStrings(&strAddressFinalValue);
4897 strAddressFinalValue.insert(0, wxT("tel:"));
4899 ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4900 &iter, &strAddressFinalValue, &ContactData,
4901 wxT("ALTID"), &HomeTelephoneListAltID,
4902 wxT("PID"), &HomeTelephoneListPID,
4903 wxT("TYPE"), &HomeTelephoneListType,
4904 wxT("PREF"), &HomeTelephoneListPref,
4905 wxT(""), &HomeTelephoneListTokens );
4907 ResetSaveProcessData();
4911 ResetSaveProcessData();
4913 for (std::map<int,wxString>::iterator iter = BusinessTelephoneList.begin();
4914 iter != BusinessTelephoneList.end(); ++iter){
4916 wxString strAddressFinalValue = iter->second;
4918 ProcessCaptureStrings(&strAddressFinalValue);
4920 strAddressFinalValue.insert(0, wxT("tel:"));
4922 ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
4923 &iter, &strAddressFinalValue, &ContactData,
4924 wxT("ALTID"), &BusinessTelephoneListAltID,
4925 wxT("PID"), &BusinessTelephoneListPID,
4926 wxT("TYPE"), &BusinessTelephoneListType,
4927 wxT("PREF"), &BusinessTelephoneListPref,
4928 wxT(""), &BusinessTelephoneListTokens );
4930 ResetSaveProcessData();
4934 ResetSaveProcessData();
4936 for (std::map<int,wxString>::iterator iter = GeneralLanguageList.begin();
4937 iter != GeneralLanguageList.end(); ++iter){
4939 intValue2 = iter->first;
4941 ProcessSaveData(wxT("LANG"), &strValue2, &boolValue2, &boolValue,
4942 &iter, &GeneralLanguageList, &ContactData,
4943 wxT("ALTID"), &GeneralLanguageListAltID,
4944 wxT("PID"), &GeneralLanguageListPID,
4945 wxT("PREF"), &GeneralLanguageListPref,
4946 wxT(""), &GeneralLanguageListTokens );
4948 ResetSaveProcessData();
4952 ResetSaveProcessData();
4954 for (std::map<int,wxString>::iterator iter = HomeLanguageList.begin();
4955 iter != HomeLanguageList.end(); ++iter){
4957 ProcessSaveData(wxT("LANG;TYPE=home"), &strValue2, &boolValue2, &boolValue,
4958 &iter, &HomeLanguageList, &ContactData,
4959 wxT("ALTID"), &HomeLanguageListAltID,
4960 wxT("PID"), &HomeLanguageListPID,
4961 wxT("PREF"), &HomeLanguageListPref,
4962 wxT(""), &HomeLanguageListTokens );
4964 ResetSaveProcessData();
4968 ResetSaveProcessData();
4970 for (std::map<int,wxString>::iterator iter = BusinessLanguageList.begin();
4971 iter != BusinessLanguageList.end(); ++iter){
4973 ProcessSaveData(wxT("LANG;TYPE=work"), &strValue2, &boolValue2, &boolValue,
4974 &iter, &BusinessLanguageList, &ContactData,
4975 wxT("ALTID"), &BusinessLanguageListAltID,
4976 wxT("PID"), &BusinessLanguageListPID,
4977 wxT("PREF"), &BusinessLanguageListPref,
4978 wxT(""), &BusinessLanguageListTokens );
4980 ResetSaveProcessData();
4984 ResetSaveProcessData();
4986 for (std::map<int,wxString>::iterator iter = GeneralTZList.begin();
4987 iter != GeneralTZList.end(); ++iter){
4989 ProcessSaveData(wxT("TZ"), &strValue2, &boolValue2, &boolValue,
4990 &iter, &GeneralTZList, &ContactData,
4991 wxT("ALTID"), &GeneralTZListAltID,
4992 wxT("PID"), &GeneralTZListPID,
4993 wxT("MEDIATYPE"), &GeneralTZListMediatype,
4994 wxT("PREF"), &GeneralTZListPref,
4995 wxT(""), &GeneralTZListTokens );
4997 ResetSaveProcessData();
5001 ResetSaveProcessData();
5003 for (std::map<int,wxString>::iterator iter = HomeTZList.begin();
5004 iter != HomeTZList.end(); ++iter){
5006 ProcessSaveData(wxT("TZ;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5007 &iter, &HomeTZList, &ContactData,
5008 wxT("ALTID"), &HomeTZListAltID,
5009 wxT("PID"), &HomeTZListPID,
5010 wxT("MEDIATYPE"), &HomeTZListMediatype,
5011 wxT("PREF"), &HomeTZListPref,
5012 wxT(""), &HomeTZListTokens );
5014 ResetSaveProcessData();
5018 ResetSaveProcessData();
5020 for (std::map<int,wxString>::iterator iter = BusinessTZList.begin();
5021 iter != BusinessTZList.end(); ++iter){
5023 ProcessSaveData(wxT("TZ;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5024 &iter, &BusinessTZList, &ContactData,
5025 wxT("ALTID"), &BusinessTZListAltID,
5026 wxT("PID"), &BusinessTZListPID,
5027 wxT("MEDIATYPE"), &BusinessTZListMediatype,
5028 wxT("PREF"), &BusinessTZListPref,
5029 wxT(""), &BusinessTZListTokens );
5031 ResetSaveProcessData();
5035 ResetSaveProcessData();
5037 for (std::map<int,wxString>::iterator iter = GeneralGeographyList.begin();
5038 iter != GeneralGeographyList.end(); ++iter){
5040 wxString strAddressFinalValue = iter->second;
5042 ProcessCaptureStrings(&strAddressFinalValue);
5044 strAddressFinalValue.insert(0, wxT("geo:"));
5046 ProcessSaveData(wxT("GEO"), &strValue2, &boolValue2, &boolValue,
5047 &iter, &strAddressFinalValue, &ContactData,
5048 wxT("ALTID"), &GeneralGeographyListAltID,
5049 wxT("PID"), &GeneralGeographyListPID,
5050 wxT("MEDIATYPE"), &GeneralGeographyListMediatype,
5051 wxT("PREF"), &GeneralGeographyListPref,
5052 wxT(""), &GeneralGeographyListTokens );
5054 ResetSaveProcessData();
5058 ResetSaveProcessData();
5060 for (std::map<int,wxString>::iterator iter = HomeGeographyList.begin();
5061 iter != HomeGeographyList.end(); ++iter){
5063 wxString strAddressFinalValue = iter->second;
5065 ProcessCaptureStrings(&strAddressFinalValue);
5067 strAddressFinalValue.insert(0, wxT("geo:"));
5069 ProcessSaveData(wxT("GEO;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5070 &iter, &HomeGeographyList, &ContactData,
5071 wxT("ALTID"), &HomeGeographyListAltID,
5072 wxT("PID"), &HomeGeographyListPID,
5073 wxT("MEDIATYPE"), &HomeGeographyListMediatype,
5074 wxT("PREF"), &HomeGeographyListPref,
5075 wxT(""), &HomeGeographyListTokens );
5077 ResetSaveProcessData();
5081 ResetSaveProcessData();
5083 for (std::map<int,wxString>::iterator iter = BusinessGeographyList.begin();
5084 iter != BusinessGeographyList.end(); ++iter){
5086 wxString strAddressFinalValue = iter->second;
5088 ProcessCaptureStrings(&strAddressFinalValue);
5090 strAddressFinalValue.insert(0, wxT("geo:"));
5092 ProcessSaveData(wxT("GEO;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5093 &iter, &BusinessGeographyList, &ContactData,
5094 wxT("ALTID"), &BusinessGeographyListAltID,
5095 wxT("PID"), &BusinessGeographyListPID,
5096 wxT("MEDIATYPE"), &BusinessGeographyListMediatype,
5097 wxT("PREF"), &BusinessGeographyListPref,
5098 wxT(""), &BusinessGeographyListTokens );
5100 ResetSaveProcessData();
5104 ResetSaveProcessData();
5106 for (std::map<int,wxString>::iterator iter = GeneralRelatedList.begin();
5107 iter != GeneralRelatedList.end(); ++iter){
5109 ProcessSaveData(wxT("RELATED"), &strValue2, &boolValue2, &boolValue,
5110 &iter, &GeneralRelatedList, &ContactData,
5111 wxT("ALTID"), &GeneralRelatedListAltID,
5112 wxT("PID"), &GeneralRelatedListPID,
5113 wxT("LANGUAGE"), &GeneralRelatedListLanguage,
5114 wxT("TYPE"), &GeneralRelatedListRelType,
5115 wxT("PREF"), &GeneralRelatedListPref,
5116 wxT(""), &GeneralRelatedListTokens );
5118 ResetSaveProcessData();
5122 ResetSaveProcessData();
5124 for (std::map<int,wxString>::iterator iter = GeneralWebsiteList.begin();
5125 iter != GeneralWebsiteList.end(); ++iter){
5127 ProcessSaveData(wxT("URL"), &strValue2, &boolValue2, &boolValue,
5128 &iter, &GeneralWebsiteList, &ContactData,
5129 wxT("ALTID"), &GeneralWebsiteListAltID,
5130 wxT("PID"), &GeneralWebsiteListPID,
5131 wxT("MEDIATYPE"), &GeneralWebsiteListMediatype,
5132 wxT("PREF"), &GeneralWebsiteListPref,
5133 wxT(""), &GeneralWebsiteListTokens );
5135 ResetSaveProcessData();
5139 ResetSaveProcessData();
5141 for (std::map<int,wxString>::iterator iter = HomeWebsiteList.begin();
5142 iter != HomeWebsiteList.end(); ++iter){
5144 ProcessSaveData(wxT("URL;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5145 &iter, &HomeWebsiteList, &ContactData,
5146 wxT("ALTID"), &HomeWebsiteListAltID,
5147 wxT("PID"), &HomeWebsiteListPID,
5148 wxT("MEDIATYPE"), &HomeWebsiteListMediatype,
5149 wxT("PREF"), &HomeWebsiteListPref,
5150 wxT(""), &HomeWebsiteListTokens );
5152 ResetSaveProcessData();
5156 ResetSaveProcessData();
5158 for (std::map<int,wxString>::iterator iter = BusinessWebsiteList.begin();
5159 iter != BusinessWebsiteList.end(); ++iter){
5161 ProcessSaveData(wxT("URL;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5162 &iter, &BusinessWebsiteList, &ContactData,
5163 wxT("ALTID"), &BusinessWebsiteListAltID,
5164 wxT("PID"), &BusinessWebsiteListPID,
5165 wxT("MEDIATYPE"), &BusinessWebsiteListMediatype,
5166 wxT("PREF"), &BusinessWebsiteListPref,
5167 wxT(""), &BusinessWebsiteListTokens );
5169 ResetSaveProcessData();
5173 ResetSaveProcessData();
5175 for (std::map<int,wxString>::iterator iter = GeneralTitleList.begin();
5176 iter != GeneralTitleList.end(); ++iter){
5178 ProcessSaveData(wxT("TITLE"), &strValue2, &boolValue2, &boolValue,
5179 &iter, &GeneralTitleList, &ContactData,
5180 wxT("ALTID"), &GeneralTitleListAltID,
5181 wxT("PID"), &GeneralTitleListPID,
5182 wxT("LANGUAGE"), &GeneralTitleListLanguage,
5183 wxT("PREF"), &GeneralTitleListPref,
5184 wxT(""), &GeneralTitleListTokens );
5186 ResetSaveProcessData();
5190 ResetSaveProcessData();
5192 for (std::map<int,wxString>::iterator iter = HomeTitleList.begin();
5193 iter != HomeTitleList.end(); ++iter){
5195 ProcessSaveData(wxT("TITLE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5196 &iter, &HomeTitleList, &ContactData,
5197 wxT("ALTID"), &HomeTitleListAltID,
5198 wxT("PID"), &HomeTitleListPID,
5199 wxT("LANGUAGE"), &HomeTitleListLanguage,
5200 wxT("PREF"), &HomeTitleListPref,
5201 wxT(""), &HomeTitleListTokens );
5203 ResetSaveProcessData();
5207 ResetSaveProcessData();
5209 for (std::map<int,wxString>::iterator iter = BusinessTitleList.begin();
5210 iter != BusinessTitleList.end(); ++iter){
5212 ProcessSaveData(wxT("TITLE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5213 &iter, &BusinessTitleList, &ContactData,
5214 wxT("ALTID"), &BusinessTitleListAltID,
5215 wxT("PID"), &BusinessTitleListPID,
5216 wxT("LANGUAGE"), &BusinessTitleListLanguage,
5217 wxT("PREF"), &BusinessTitleListPref,
5218 wxT(""), &BusinessTitleListTokens );
5220 ResetSaveProcessData();
5224 ResetSaveProcessData();
5226 for (std::map<int,wxString>::iterator iter = GeneralRoleList.begin();
5227 iter != GeneralRoleList.end(); ++iter){
5229 ProcessSaveData(wxT("ROLE"), &strValue2, &boolValue2, &boolValue,
5230 &iter, &GeneralRoleList, &ContactData,
5231 wxT("ALTID"), &GeneralRoleListAltID,
5232 wxT("PID"), &GeneralRoleListPID,
5233 wxT("LANGUAGE"), &GeneralRoleListLanguage,
5234 wxT("PREF"), &GeneralRoleListPref,
5235 wxT(""), &GeneralRoleListTokens );
5237 ResetSaveProcessData();
5241 ResetSaveProcessData();
5243 for (std::map<int,wxString>::iterator iter = HomeRoleList.begin();
5244 iter != HomeRoleList.end(); ++iter){
5246 ProcessSaveData(wxT("ROLE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5247 &iter, &HomeRoleList, &ContactData,
5248 wxT("ALTID"), &HomeRoleListAltID,
5249 wxT("PID"), &HomeRoleListPID,
5250 wxT("LANGUAGE"), &HomeRoleListLanguage,
5251 wxT("PREF"), &HomeRoleListPref,
5252 wxT(""), &HomeRoleListTokens );
5254 ResetSaveProcessData();
5258 ResetSaveProcessData();
5260 for (std::map<int,wxString>::iterator iter = BusinessRoleList.begin();
5261 iter != BusinessRoleList.end(); ++iter){
5263 ProcessSaveData(wxT("ROLE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5264 &iter, &BusinessRoleList, &ContactData,
5265 wxT("ALTID"), &BusinessRoleListAltID,
5266 wxT("PID"), &BusinessRoleListPID,
5267 wxT("LANGUAGE"), &BusinessRoleListLanguage,
5268 wxT("PREF"), &BusinessRoleListPref,
5269 wxT(""), &BusinessRoleListTokens );
5271 ResetSaveProcessData();
5275 ResetSaveProcessData();
5277 for (std::map<int,wxString>::iterator iter = GeneralOrganisationsList.begin();
5278 iter != GeneralOrganisationsList.end(); ++iter){
5280 ProcessSaveData(wxT("ORG"), &strValue2, &boolValue2, &boolValue,
5281 &iter, &GeneralOrganisationsList, &ContactData,
5282 wxT("ALTID"), &GeneralOrganisationsListAltID,
5283 wxT("PID"), &GeneralOrganisationsListPID,
5284 wxT("LANGUAGE"), &GeneralOrganisationsListLanguage,
5285 wxT("SORT-AS"), &GeneralOrganisationsListSortAs,
5286 wxT("PREF"), &GeneralOrganisationsListPref,
5287 wxT(""), &GeneralOrganisationsListTokens );
5289 ResetSaveProcessData();
5293 ResetSaveProcessData();
5295 for (std::map<int,wxString>::iterator iter = HomeOrganisationsList.begin();
5296 iter != HomeOrganisationsList.end(); ++iter){
5298 ProcessSaveData(wxT("ORG;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5299 &iter, &HomeOrganisationsList, &ContactData,
5300 wxT("ALTID"), &HomeOrganisationsListAltID,
5301 wxT("PID"), &HomeOrganisationsListPID,
5302 wxT("LANGUAGE"), &HomeOrganisationsListLanguage,
5303 wxT("SORT-AS"), &HomeOrganisationsListSortAs,
5304 wxT("PREF"), &HomeOrganisationsListPref,
5305 wxT(""), &HomeOrganisationsListTokens );
5307 ResetSaveProcessData();
5311 ResetSaveProcessData();
5313 for (std::map<int,wxString>::iterator iter = BusinessOrganisationsList.begin();
5314 iter != BusinessOrganisationsList.end(); ++iter){
5316 ProcessSaveData(wxT("ORG;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5317 &iter, &BusinessOrganisationsList, &ContactData,
5318 wxT("ALTID"), &BusinessOrganisationsListAltID,
5319 wxT("PID"), &BusinessOrganisationsListPID,
5320 wxT("LANGUAGE"), &BusinessOrganisationsListLanguage,
5321 wxT("SORT-AS"), &BusinessOrganisationsListSortAs,
5322 wxT("PREF"), &BusinessOrganisationsListPref,
5323 wxT(""), &BusinessOrganisationsListTokens );
5325 ResetSaveProcessData();
5329 ResetSaveProcessData();
5331 for (std::map<int,wxString>::iterator iter = GeneralNoteList.begin();
5332 iter != GeneralNoteList.end(); ++iter){
5334 ProcessSaveData(wxT("NOTE"), &strValue2, &boolValue2, &boolValue,
5335 &iter, &GeneralNoteList, &ContactData,
5336 wxT("ALTID"), &GeneralNoteListAltID,
5337 wxT("PID"), &GeneralNoteListPID,
5338 wxT("LANGUAGE"), &GeneralNoteListLanguage,
5339 wxT("PREF"), &GeneralNoteListPref,
5340 wxT(""), &GeneralNoteListTokens );
5342 ResetSaveProcessData();
5346 ResetSaveProcessData();
5348 for (std::map<int,wxString>::iterator iter = HomeNoteList.begin();
5349 iter != HomeNoteList.end(); ++iter){
5351 ProcessSaveData(wxT("NOTE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
5352 &iter, &HomeNoteList, &ContactData,
5353 wxT("ALTID"), &HomeNoteListAltID,
5354 wxT("PID"), &HomeNoteListPID,
5355 wxT("LANGUAGE"), &HomeNoteListLanguage,
5356 wxT("PREF"), &HomeNoteListPref,
5357 wxT(""), &HomeNoteListTokens );
5359 ResetSaveProcessData();
5363 ResetSaveProcessData();
5365 for (std::map<int,wxString>::iterator iter = BusinessNoteList.begin();
5366 iter != BusinessNoteList.end(); ++iter){
5368 ProcessSaveData(wxT("NOTE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
5369 &iter, &BusinessNoteList, &ContactData,
5370 wxT("ALTID"), &BusinessNoteListAltID,
5371 wxT("PID"), &BusinessNoteListPID,
5372 wxT("LANGUAGE"), &BusinessNoteListLanguage,
5373 wxT("PREF"), &BusinessNoteListPref,
5374 wxT(""), &BusinessNoteListTokens );
5376 ResetSaveProcessData();
5380 ResetSaveProcessData();
5382 for (std::map<int,wxString>::iterator iter = CategoriesList.begin();
5383 iter != CategoriesList.end(); ++iter){
5385 ProcessSaveData(wxT("CATEGORIES"), &strValue2, &boolValue2, &boolValue,
5386 &iter, &CategoriesList, &ContactData,
5387 wxT("ALTID"), &CategoriesListAltID,
5388 wxT("PID"), &CategoriesListPID,
5389 wxT("TYPE"), &CategoriesListType,
5390 wxT("PREF"), &CategoriesListPref,
5391 wxT(""), &CategoriesListTokens );
5393 ResetSaveProcessData();
5399 for (std::map<int, std::string>::iterator iter = PicturesList.begin();
5400 iter != PicturesList.end(); ++iter){
5402 int intValueIndex = iter->first;
5404 std::map<int, std::string>::iterator stdstriter;
5405 std::map<int, wxString>::iterator enciter;
5407 striter = PicturesListPictureType.find(intValueIndex);
5408 enciter = PicturesListPicEncType.find(intValueIndex);
5410 ProcessSaveData(wxT("PHOTO"), &strValue2, &boolValue2, &boolValue,
5411 &iter, &PicturesList, &striter,
5412 &enciter, &ContactData,
5413 wxT("ALTID"), &PicturesListAltID,
5414 wxT("PID"), &PicturesListPID,
5415 wxT("TYPE"), &PicturesListType,
5416 wxT("PREF"), &PicturesListPref,
5417 wxT(""), &PicturesListTokens);
5419 ResetSaveProcessData();
5423 ResetSaveProcessData();
5427 for (std::map<int, std::string>::iterator iter = LogosList.begin();
5428 iter != LogosList.end(); ++iter){
5430 int intValueIndex = iter->first;
5432 std::map<int, std::string>::iterator stdstriter;
5433 std::map<int, wxString>::iterator enciter;
5435 striter = LogosListPictureType.find(intValueIndex);
5436 enciter = LogosListPicEncType.find(intValueIndex);
5438 ProcessSaveData(wxT("LOGO"), &strValue2, &boolValue2, &boolValue,
5439 &iter, &LogosList, &striter,
5440 &enciter, &ContactData,
5441 wxT("ALTID"), &LogosListAltID,
5442 wxT("PID"), &LogosListPID,
5443 wxT("TYPE"), &LogosListType,
5444 wxT("PREF"), &LogosListPref,
5445 wxT(""), &LogosListTokens );
5447 ResetSaveProcessData();
5451 ResetSaveProcessData();
5455 for (std::map<int, std::string>::iterator iter = SoundsList.begin();
5456 iter != SoundsList.end(); ++iter){
5458 int intValueIndex = iter->first;
5460 std::map<int, std::string>::iterator stdstriter;
5461 std::map<int, wxString>::iterator enciter;
5463 striter = SoundsListAudioType.find(intValueIndex);
5464 enciter = SoundsListAudioEncType.find(intValueIndex);
5466 ProcessSaveData(wxT("SOUND"), &strValue2, &boolValue2, &boolValue,
5467 &iter, &SoundsList, &striter,
5468 &enciter, &ContactData,
5469 wxT("ALTID"), &SoundsListAltID,
5470 wxT("PID"), &SoundsListPID,
5471 wxT("TYPE"), &SoundsListType,
5472 wxT("PREF"), &SoundsListPref,
5473 wxT(""), &SoundsListTokens );
5475 ResetSaveProcessData();
5479 ResetSaveProcessData();
5481 for (std::map<int,wxString>::iterator iter = CalendarList.begin();
5482 iter != CalendarList.end(); ++iter){
5484 ProcessSaveData(wxT("CALURI"), &strValue2, &boolValue2, &boolValue,
5485 &iter, &CalendarList, &ContactData,
5486 wxT("ALTID"), &CalendarListAltID,
5487 wxT("PID"), &CalendarListPID,
5488 wxT("MEDIATYPE"), &CalendarListMediatype,
5489 wxT("TYPE"), &CalendarListType,
5490 wxT("PREF"), &CalendarListPref,
5491 wxT(""), &CalendarListTokens );
5493 ResetSaveProcessData();
5497 ResetSaveProcessData();
5499 for (std::map<int,wxString>::iterator iter = CalendarRequestList.begin();
5500 iter != CalendarRequestList.end(); ++iter){
5502 ProcessSaveData(wxT("CALADRURI"), &strValue2, &boolValue2, &boolValue,
5503 &iter, &CalendarRequestList, &ContactData,
5504 wxT("ALTID"), &CalendarRequestListAltID,
5505 wxT("PID"), &CalendarRequestListPID,
5506 wxT("MEDIATYPE"), &CalendarRequestListMediatype,
5507 wxT("TYPE"), &CalendarRequestListType,
5508 wxT("PREF"), &CalendarRequestListPref,
5509 wxT(""), &CalendarRequestListTokens );
5511 ResetSaveProcessData();
5515 ResetSaveProcessData();
5517 for (std::map<int,wxString>::iterator iter = FreeBusyList.begin();
5518 iter != FreeBusyList.end(); ++iter){
5520 ProcessSaveData(wxT("FBURL"), &strValue2, &boolValue2, &boolValue,
5521 &iter, &FreeBusyList, &ContactData,
5522 wxT("ALTID"), &FreeBusyListAltID,
5523 wxT("PID"), &FreeBusyListPID,
5524 wxT("MEDIATYPE"), &FreeBusyListMediatype,
5525 wxT("TYPE"), &FreeBusyListType,
5526 wxT("PREF"), &FreeBusyListPref,
5527 wxT(""), &FreeBusyListTokens );
5529 ResetSaveProcessData();
5533 for (std::map<int, wxString>::iterator iter = KeyList.begin();
5534 iter != KeyList.end(); ++iter){
5536 intValue2 = iter->first;
5538 // Process Alternative ID.
5540 striter = KeyListAltID.find(intValue2);
5542 if (striter->first == intValue2){
5544 strValue3 = striter->second;
5546 if (!strValue3.IsEmpty()){
5551 if (boolValue2 == TRUE){
5553 strValue2.Append(wxT(";"));
5561 strValue2.Append(wxT("ALTID=") + strValue3);
5571 striter = KeyListPID.find(intValue2);
5573 if (striter->first == intValue2){
5575 strValue3 = striter->second;
5577 if (!strValue3.IsEmpty()){
5582 if (boolValue2 == TRUE){
5584 strValue2.Append(wxT(";"));
5592 strValue2.Append(wxT("PID=") + strValue3);
5602 striter = KeyListType.find(intValue2);
5604 if (striter->first == intValue2){
5606 strValue3 = striter->second;
5608 if (!strValue3.IsEmpty()){
5613 if (boolValue2 == TRUE){
5615 strValue2.Append(wxT(";"));
5623 strValue2.Append(wxT("TYPE=") + strValue3);
5631 intiter = KeyListPref.find(intValue2);
5633 if (intiter->first == intValue2){
5635 intValue3 = intiter->second;
5639 if (boolValue2 == TRUE){
5641 strValue2.Append(wxT(";"));
5649 strValue2.Append(wxT("PREF=") + wxString::Format(wxT("%i"), intValue3));
5659 striter = KeyListTokens.find(intValue2);
5661 if (striter->first == intValue2){
5663 strValue3 = striter->second;
5665 if (!strValue3.IsEmpty()){
5670 if (boolValue2 == TRUE){
5672 strValue2.Append(wxT(";"));
5680 strValue2.Append(strValue3);
5688 // Get the key information.
5690 std::map<int, wxString>::iterator enciter;
5692 striter = KeyListDataType.find(intValue2);
5693 //enciter = KeyListAudioEncType.find(intValue2);
5695 wxString strValueData;
5697 strValueData = iter->second;
5698 //strValueData.insert(0, wxT("data:") + striter->second + wxT(";") + enciter->second + wxT(","));
5699 strValueData.insert(0, wxT("data:") + striter->second + wxT(";base64,"));
5702 // Add to the vCard.
5704 if (boolValue == TRUE){
5706 ContactData.AddRaw(wxT("KEY;") + strValue2, strValueData);
5710 ContactData.Add(wxT("KEY"), strValueData, TRUE);
5714 ResetSaveProcessData();
5718 // Vendor specific items.
5720 ResetSaveProcessData();
5722 for (std::map<int,wxString>::iterator iter = VendorList.begin();
5723 iter != VendorList.end(); ++iter){
5725 intValue2 = iter->first;
5727 // Get the IANA PEN number.
5729 striter = VendorListPEN.find(intValue2);
5731 if (striter->first == intValue2){
5733 strValue2 = striter->second;
5737 // Get the element name.
5739 striter = VendorListElement.find(intValue2);
5741 if (striter->first == intValue2){
5743 strValue3 = striter->second;
5749 striter = VendorList.find(intValue2);
5751 if (striter->first == intValue2){
5753 strValue = striter->second;
5757 // Add to the vCard.
5759 if (boolValue == TRUE){
5761 ContactData.AddRaw(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue);
5765 ContactData.Add(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue, FALSE);
5769 ResetSaveProcessData();
5773 ResetSaveProcessData();
5777 for (std::map<int,wxString>::iterator iter = XTokenList.begin();
5778 iter != XTokenList.end(); ++iter){
5780 intValue2 = iter->first;
5782 // Get the element name.
5784 striter = XTokenListTokens.find(intValue2);
5786 if (striter->first == intValue2){
5788 strValue2 = striter->second;
5794 striter = XTokenList.find(intValue2);
5796 if (striter->first == intValue2){
5798 strValue = striter->second;
5802 // Add to the vCard.
5804 if (boolValue == TRUE){
5806 ContactData.AddRaw(wxT("X-") + strValue2, strValue);
5810 ContactData.Add(wxT("X-") + strValue2, strValue, FALSE);
5814 ResetSaveProcessData();
5818 ResetSaveProcessData();
5820 if (FullNamesList.size() == 0){
5822 wxString FullName = cmbDisplayAs->GetValue();
5823 FullNamesList.insert(std::make_pair(0, FullName));
5824 FullNamesListAltID.insert(std::make_pair(0, wxT("")));
5825 FullNamesListPID.insert(std::make_pair(0, wxT("")));
5826 FullNamesListType.insert(std::make_pair(0, wxT("")));
5827 FullNamesListLanguage.insert(std::make_pair(0, wxT("")));
5828 FullNamesListPref.insert(std::make_pair(0, 0));
5829 FullNamesListTokens.insert(std::make_pair(0, wxT("")));
5834 for (std::map<int, wxString>::iterator iter = FullNamesList.begin();
5835 iter != FullNamesList.end(); ++iter){
5837 if (FNFirst == TRUE){
5839 iter->second = cmbDisplayAs->GetValue();
5844 std::map<int,wxString>::iterator mapS;
5846 mapS = FullNamesListTokens.find(iter->first);
5848 ProcessSaveData(wxT("FN"), &strValue2, &boolValue2, &boolValue,
5849 &iter, &FullNamesList, &ContactData,
5850 wxT("ALTID"), &FullNamesListAltID,
5851 wxT("PID"), &FullNamesListPID,
5852 wxT("TYPE"), &FullNamesListType,
5853 wxT("LANGUAGE"), &FullNamesListLanguage,
5854 wxT("PREF"), &FullNamesListPref,
5855 wxT(""), &FullNamesListTokens );
5859 ResetSaveProcessData();
5863 //ContactData.Add(wxT("FN"), cmbDisplayAs->GetValue(), FALSE);
5865 // Insert revision (REV) date.
5867 // Get today's date and time.
5869 wxDateTime DateTimeNow = wxDateTime::Now();
5873 // Set year, month and date.
5875 int intYear = DateTimeNow.GetYear();
5876 int intMonth = DateTimeNow.GetMonth();
5877 int intDay = DateTimeNow.GetDay();
5879 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intYear));
5883 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMonth));
5887 DateRev.Append(wxString::Format(wxT("%i"), intMonth));
5893 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intDay));
5897 DateRev.Append(wxString::Format(wxT("%i"), intDay));
5901 //DateRev.Append(wx);
5902 //DateRev.Append(wx);
5903 //DateRev.Append(wx);
5904 DateRev.Append(wxT("T"));
5906 // Set hour, minute and second.
5908 int intHour = DateTimeNow.GetHour();
5909 int intMinute = DateTimeNow.GetMinute();
5910 int intSecond = DateTimeNow.GetSecond();
5914 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intHour));
5918 DateRev.Append(wxString::Format(wxT("%i"), intHour));
5922 if (intMinute < 10){
5924 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMinute));
5928 DateRev.Append(wxString::Format(wxT("%i"), intMinute));
5932 if (intSecond < 10){
5934 DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intSecond));
5938 DateRev.Append(wxString::Format(wxT("%i"), intSecond));
5942 // DateRev.Append(wx);
5943 // DateRev.Append(wx);
5944 // DateRev.Append(wxString DateTimeNow->);
5945 DateRev.Append(wxT("Z"));
5947 ContactData.Add(wxT("UID"), UIDToken, FALSE);
5949 // End the vCard File.
5951 ContactData.Add(wxT("END"), wxT("VCARD"), FALSE);
5954 ContactData.WriteFile(FilenameFinal);
5956 vCard34Conv ConvFileFun;
5960 ConvFileFun.ConvertToV3(FilenameFinal, &wxSData);
5962 wxString AccountDirPrefix;
5963 wxString AccountDir;
5966 #if defined(__HAIKU__)
5968 //preffilename = wxT("noo");
5970 #elif defined(__APPLE__)
5972 PrefDir = GetUserPrefDir();
5974 wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/"));
5976 #elif defined(__WIN32__)
5978 PrefDir = GetUserPrefDir();
5980 wxStringTokenizer wSTFilename(wxSContactFilename, wxT("\\"));
5984 PrefDir = GetUserPrefDir();
5986 wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/"));
5990 XABPreferences PrefData(PrefDir);
5992 wxString AccountType;
5994 for (int i = 0; i < PrefData.accounts.GetCount(); i++){
5996 AccountDir = PrefData.accounts.GetAccountDirectory(i) + wxT(".carddav");
5998 if (AccountDir == wxSContactAccount){
6000 AccountDirPrefix = PrefData.accounts.GetAccountDirPrefix(i);
6001 AccountDirPrefix.Trim();
6002 AccountType = PrefData.accounts.GetAccountType(i);
6009 wxString wxSplitFilename;
6010 wxString wxSDataURL;
6012 while(wSTFilename.HasMoreTokens()){
6014 wxSplitFilename = wSTFilename.GetNextToken();
6018 wxSDataURL = wxSplitFilename;
6019 //wxSDataURL.Append(wxSplitFilename);
6021 // Find out if the filename exists in the table.
6023 if (AccountType == wxT("CardDAV") || AccountType == wxT("carddav")){
6025 wxString ETagResult;
6026 wxString ETagOriginal;
6028 ETagDB *ETagDBPtr = NULL;
6030 ETagDBPtr = ETagTmrPtr->GetPointer(wxSContactAccount);
6032 wxString wxSETag = ETagDBPtr->GetETag(wxSplitFilename);
6033 wxString wxSETagOrig = ETagDBPtr->GetETagOriginal(wxSplitFilename);
6035 if (wxSETagOrig.IsEmpty()){
6037 // Generate the ETag.
6039 wxSETagOrig = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024);
6043 if (wxSETag.IsEmpty()){
6045 // Update empty ETag.
6047 wxSETag = wxSETagOrig;
6048 ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag, wxSETagOrig);
6053 // Don't change original ETag.
6055 wxSETag = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024);
6056 ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag);
6060 if (EditMode == FALSE){
6062 ActMgrPtr->AddTask(0, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
6064 FMTimer.SetFilename(FilenameFinal);
6065 FMTimer.UpdateTimestamp();
6066 FMTimer.Start(10000, FALSE);
6071 ActMgrPtr->AddTask(1, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
6072 FMTimer.UpdateTimestamp();
6073 FMTimer.Start(10000, FALSE);
6079 // Send a notification to update the main window
6080 // with the new details.
6085 // TODO: Workout nickname settings by priority and
6088 ucd->ContactAccount = wxSContactAccount;
6089 ucd->ContactFilename = FilenameFinal;
6090 ucd->ContactName = cmbDisplayAs->GetValue();
6091 ucd->ContactNameArray = ContactData.GetName();
6093 for (std::map<int,wxString>::iterator gniter = GeneralNicknamesList.begin();
6094 gniter != GeneralNicknamesList.end(); gniter++){
6096 ucd->ContactNickname = gniter->second;
6101 wxCommandEvent event2(CE_UPDATECONTACTLIST);
6102 event2.SetClientData(ucd);
6103 wxPostEvent(MainPtr, event2);
6107 void frmContactEditor::SaveCloseContact( wxCommandEvent& event )
6110 // Save the updated contact data and close the form.
6114 void frmContactEditor::CloseContact( wxCommandEvent& event )
6121 void frmContactEditor::CloseWindow( wxCloseEvent& event )
6124 // TODO: Check if any changes have been made,
6125 // ask if the changes should be made, process
6126 // action based on question and then close.
6128 WindowData *WData = new WindowData;
6130 WData->DataType = 1;
6131 WData->WindowPointer = this;
6132 WData->WindowID = ContactEditorUID;
6134 wxCommandEvent delevent(WINDOW_CLOSE);
6135 delevent.SetClientData(WData);
6136 wxPostEvent(GetParent(), delevent);
6143 void frmContactEditor::CutText( wxCommandEvent& event )
6145 // This function left empty for future implementation.
6148 void frmContactEditor::CopyText( wxCommandEvent& event )
6150 // This function left empty for future implementation.
6153 void frmContactEditor::PasteText( wxCommandEvent& event )
6155 // This function left empty for future implementation.
6158 void frmContactEditor::SetupContact( wxString AccountName )
6161 wxSContactAccount = AccountName;
6165 bool frmContactEditor::ProcessEvent(wxEvent& event)
6168 // This section has been taken from the wxWidgets sample code of richtext.cpp
6169 // so that simple Cut/Copy/Paste code can be made.
6171 // As this code comes from the samples of the wxWidgets library, this is licenced
6172 // under the wxWindows Library Licence and is compatable with the LGPL and is
6173 // compatable with Xestia Address Book's licence.
6175 if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxChildFocusEvent)))
6177 // Problem: we can get infinite recursion because the events
6178 // climb back up to this frame, and repeat.
6179 // Assume that command events don't cause another command event
6180 // to be called, so we can rely on inCommand not being overwritten
6182 static int s_eventType = 0;
6183 static wxWindowID s_id = 0;
6185 if (s_id != event.GetId() && s_eventType != event.GetEventType())
6187 s_eventType = event.GetEventType();
6188 s_id = event.GetId();
6190 wxWindow* focusWin = wxFindFocusDescendant(this);
6191 if (focusWin && focusWin->GetEventHandler()->ProcessEvent(event))
6207 return wxFrame::ProcessEvent(event);
6210 void frmContactEditor::SetupHeaders()
6213 /* Items for the General Tab */
6215 SetupColumn(CE_NICKNAME, lboNicknames);
6216 SetupColumn(CE_ADDRESS, lboAddresses);
6217 SetupColumn(CE_EMAIL, lboEmails);
6218 SetupColumn(CE_IM, lboIM);
6219 SetupColumn(CE_TELEPHONE, lboTelephone);
6220 SetupColumn(CE_LANG, lboLanguages);
6221 SetupColumn(CE_TZ, lboTimezones);
6222 SetupColumn(CE_GEOPOSITION, lboGeoposition);
6223 SetupColumn(CE_RELATED, lboRelated);
6224 SetupColumn(CE_WEBSITE, lboWebsites);
6225 SetupColumn(CE_TITLE, lboTitles);
6226 SetupColumn(CE_ROLE, lboRoles);
6227 SetupColumn(CE_ORG, lboOrganisations);
6228 SetupColumn(CE_NOTE, lboNotes);
6230 /* Items for the Home Tab */
6232 SetupColumn(CE_NICKNAME, lboHomeNicknames);
6233 SetupColumn(CE_ADDRESS, lboHomeAddresses);
6234 SetupColumn(CE_EMAIL, lboHomeEmails);
6235 SetupColumn(CE_IM, lboHomeIM);
6236 SetupColumn(CE_TELEPHONE, lboHomeTelephone);
6237 SetupColumn(CE_LANG, lboHomeLanguages);
6238 SetupColumn(CE_TZ, lboHomeTimezones);
6239 SetupColumn(CE_GEOPOSITION, lboHomeGeoposition);
6240 SetupColumn(CE_WEBSITE, lboHomeWebsites);
6241 SetupColumn(CE_TITLE, lboHomeTitles);
6242 SetupColumn(CE_ROLE, lboHomeRoles);
6243 SetupColumn(CE_ORG, lboHomeOrganisations);
6244 SetupColumn(CE_NOTE, lboHomeNotes);
6246 /* Items for the Business Tab */
6248 SetupColumn(CE_NICKNAME, lboBusinessNicknames);
6249 SetupColumn(CE_ADDRESS, lboBusinessAddresses);
6250 SetupColumn(CE_EMAIL, lboBusinessEmail);
6251 SetupColumn(CE_IM, lboBusinessIM);
6252 SetupColumn(CE_TELEPHONE, lboBusinessTelephone);
6253 SetupColumn(CE_LANG, lboBusinessLanguages);
6254 SetupColumn(CE_TZ, lboBusinessTimezones);
6255 SetupColumn(CE_GEOPOSITION, lboBusinessGeoposition);
6256 SetupColumn(CE_WEBSITE, lboBusinessWebsites);
6257 SetupColumn(CE_TITLE, lboBusinessTitles);
6258 SetupColumn(CE_ROLE, lboBusinessRoles);
6259 SetupColumn(CE_ORG, lboBusinessOrganisations);
6260 SetupColumn(CE_NOTE, lboBusinessNotes);
6262 /* Items for the Categories Tab */
6264 SetupColumn(CE_CATEGORIES, lboCategories);
6266 /* Items for the Groups Tab */
6268 SetupColumn(CE_GROUPS, lboGroups);
6270 /* Items for the Pictures and Logos Tab */
6272 SetupColumn(CE_PICTURES, lboPictures);
6273 SetupColumn(CE_PICTURES, lboLogos);
6275 /* Items for the Sounds Tab */
6277 SetupColumn(CE_SOUNDS, lboSounds);
6279 /* Items for the Calendaring Tab */
6281 SetupColumn(CE_CALENDAR, lboCalendarAddresses);
6282 SetupColumn(CE_CALENDAR, lboCalendarRequestAddress);
6283 SetupColumn(CE_CALENDAR, lboFreeBusyAddresses);
6285 /* Items for the Security Tab */
6287 SetupColumn(CE_KEY, lboKeys);
6289 /* Items for the Other Tab */
6291 SetupColumn(CE_TOKEN, lboVendorNamespace);
6292 SetupColumn(CE_TOKEN, lboXToken);
6296 void frmContactEditor::SetupColumn(wxString ColumnType, wxListCtrl *ListCtrl)
6301 if (ColumnType == CE_NICKNAME){
6304 coldata.SetText(_("Nickname"));
6305 coldata.SetWidth(128);
6306 ListCtrl->InsertColumn(0, coldata);
6309 coldata.SetText(_("Pri."));
6310 coldata.SetWidth(32);
6311 ListCtrl->InsertColumn(1, coldata);
6313 } else if (ColumnType == CE_ADDRESS){
6316 coldata.SetText(_("Address"));
6317 coldata.SetWidth(128);
6318 ListCtrl->InsertColumn(0, coldata);
6321 coldata.SetText(_("Town"));
6322 coldata.SetWidth(64);
6323 ListCtrl->InsertColumn(1, coldata);
6326 coldata.SetText(_("County"));
6327 coldata.SetWidth(64);
6328 ListCtrl->InsertColumn(2, coldata);
6331 coldata.SetText(_("Post code"));
6332 coldata.SetWidth(48);
6333 ListCtrl->InsertColumn(3, coldata);
6336 coldata.SetText(_("Pri."));
6337 coldata.SetWidth(32);
6338 ListCtrl->InsertColumn(4, coldata);
6340 } else if (ColumnType == CE_EMAIL){
6343 coldata.SetText(_("Email address"));
6344 coldata.SetWidth(304);
6345 ListCtrl->InsertColumn(0, coldata);
6348 coldata.SetText(_("Pri."));
6349 coldata.SetWidth(32);
6350 ListCtrl->InsertColumn(1, coldata);
6352 } else if (ColumnType == CE_IM){
6355 coldata.SetText(_("Type"));
6356 coldata.SetWidth(64);
6357 ListCtrl->InsertColumn(0, coldata);
6360 coldata.SetText(_("Address"));
6361 coldata.SetWidth(240);
6362 ListCtrl->InsertColumn(1, coldata);
6365 coldata.SetText(_("Pri."));
6366 coldata.SetWidth(32);
6367 ListCtrl->InsertColumn(2, coldata);
6369 } else if (ColumnType == CE_TELEPHONE){
6372 coldata.SetText(_("Telephone number"));
6373 coldata.SetWidth(128);
6374 ListCtrl->InsertColumn(0, coldata);
6377 coldata.SetText(_("Type"));
6378 coldata.SetWidth(64);
6379 ListCtrl->InsertColumn(1, coldata);
6382 coldata.SetText(_("Pri."));
6383 coldata.SetWidth(32);
6384 ListCtrl->InsertColumn(2, coldata);
6386 } else if (ColumnType == CE_LANG){
6389 coldata.SetText(_("Language"));
6390 coldata.SetWidth(128);
6391 ListCtrl->InsertColumn(0, coldata);
6394 coldata.SetText(_("Pri."));
6395 coldata.SetWidth(32);
6396 ListCtrl->InsertColumn(1, coldata);
6398 } else if (ColumnType == CE_TZ){
6401 coldata.SetText(_("Timezone"));
6402 coldata.SetWidth(192);
6403 ListCtrl->InsertColumn(0, coldata);
6406 coldata.SetText(_("Pri."));
6407 coldata.SetWidth(32);
6408 ListCtrl->InsertColumn(1, coldata);
6410 } else if (ColumnType == CE_RELATED){
6413 coldata.SetText(_("Type"));
6414 coldata.SetWidth(64);
6415 ListCtrl->InsertColumn(0, coldata);
6418 coldata.SetText(_("Name/Description"));
6419 coldata.SetWidth(192);
6420 ListCtrl->InsertColumn(1, coldata);
6423 coldata.SetText(_("Pri."));
6424 coldata.SetWidth(32);
6425 ListCtrl->InsertColumn(2, coldata);
6427 } else if (ColumnType == CE_WEBSITE){
6430 coldata.SetText(_("Website"));
6431 coldata.SetWidth(288);
6432 ListCtrl->InsertColumn(0, coldata);
6435 coldata.SetText(_("Pri."));
6436 coldata.SetWidth(32);
6437 ListCtrl->InsertColumn(1, coldata);
6439 } else if (ColumnType == CE_TITLE){
6442 coldata.SetText(_("Title"));
6443 coldata.SetWidth(288);
6444 ListCtrl->InsertColumn(0, coldata);
6447 coldata.SetText(_("Pri."));
6448 coldata.SetWidth(32);
6449 ListCtrl->InsertColumn(1, coldata);
6451 } else if (ColumnType == CE_ROLE){
6454 coldata.SetText(_("Role"));
6455 coldata.SetWidth(288);
6456 ListCtrl->InsertColumn(0, coldata);
6459 coldata.SetText(_("Pri."));
6460 coldata.SetWidth(32);
6461 ListCtrl->InsertColumn(1, coldata);
6463 } else if (ColumnType == CE_ORG){
6466 coldata.SetText(_("Organisation"));
6467 coldata.SetWidth(288);
6468 ListCtrl->InsertColumn(0, coldata);
6471 coldata.SetText(_("Pri."));
6472 coldata.SetWidth(32);
6473 ListCtrl->InsertColumn(1, coldata);
6475 } else if (ColumnType == CE_NOTE){
6478 coldata.SetText(_("Notes"));
6479 coldata.SetWidth(288);
6480 ListCtrl->InsertColumn(0, coldata);
6483 coldata.SetText(_("Pri."));
6484 coldata.SetWidth(32);
6485 ListCtrl->InsertColumn(1, coldata);
6487 } else if (ColumnType == CE_CATEGORIES){
6490 coldata.SetText(_("Category"));
6491 coldata.SetWidth(320);
6492 ListCtrl->InsertColumn(0, coldata);
6495 coldata.SetText(_("Pri."));
6496 coldata.SetWidth(32);
6497 ListCtrl->InsertColumn(1, coldata);
6499 } else if (ColumnType == CE_GROUPS){
6502 coldata.SetText(_("Member"));
6503 coldata.SetWidth(320);
6504 ListCtrl->InsertColumn(0, coldata);
6506 } else if (ColumnType == CE_GEOPOSITION){
6509 coldata.SetText(_("Geoposition"));
6510 coldata.SetWidth(320);
6511 ListCtrl->InsertColumn(0, coldata);
6514 coldata.SetText(_("Pri."));
6515 coldata.SetWidth(32);
6516 ListCtrl->InsertColumn(1, coldata);
6518 } else if (ColumnType == CE_PICTURES){
6521 coldata.SetText(_("Pictures"));
6522 coldata.SetWidth(128);
6523 ListCtrl->InsertColumn(0, coldata);
6526 coldata.SetText(_("Type"));
6527 coldata.SetWidth(64);
6528 ListCtrl->InsertColumn(1, coldata);
6531 coldata.SetText(_("Pri."));
6532 coldata.SetWidth(32);
6533 ListCtrl->InsertColumn(2, coldata);
6535 } else if (ColumnType == CE_SOUNDS){
6538 coldata.SetText(_("Sounds"));
6539 coldata.SetWidth(128);
6540 ListCtrl->InsertColumn(0, coldata);
6543 coldata.SetText(_("Type"));
6544 coldata.SetWidth(64);
6545 ListCtrl->InsertColumn(1, coldata);
6548 coldata.SetText(_("Pri."));
6549 coldata.SetWidth(32);
6550 ListCtrl->InsertColumn(2, coldata);
6552 } else if (ColumnType == CE_CALENDAR){
6555 coldata.SetText(_("Calendar Address"));
6556 coldata.SetWidth(224);
6557 ListCtrl->InsertColumn(0, coldata);
6560 coldata.SetText(_("Type"));
6561 coldata.SetWidth(64);
6562 ListCtrl->InsertColumn(1, coldata);
6565 coldata.SetText(_("Pri."));
6566 coldata.SetWidth(32);
6567 ListCtrl->InsertColumn(2, coldata);
6569 } else if (ColumnType == CE_KEY){
6572 coldata.SetText(_("Key information"));
6573 coldata.SetWidth(224);
6574 ListCtrl->InsertColumn(0, coldata);
6577 coldata.SetText(_("Type"));
6578 coldata.SetWidth(64);
6579 ListCtrl->InsertColumn(1, coldata);
6582 coldata.SetText(_("Pri."));
6583 coldata.SetWidth(32);
6584 ListCtrl->InsertColumn(2, coldata);
6586 } else if (ColumnType == CE_TOKEN){
6589 coldata.SetText(_("Token"));
6590 coldata.SetWidth(320);
6591 ListCtrl->InsertColumn(0, coldata);
6597 int frmContactEditor::GetLastInt(std::map<int, wxString> *MapData){
6602 std::map<int,wxString>::iterator iwxsit;
6604 for( iwxsit=(*MapData).begin(); iwxsit != (*MapData).end(); iwxsit++){
6605 intResult = (*iwxsit).first;
6612 return intValueSeek;
6616 int frmContactEditor::GetLastInt(std::map<int, std::string> *MapData){
6618 /* int intResult = 0;
6620 std::map<int,std::string>::iterator iwxsit;
6622 for( iwxsit=(*MapData).begin(); iwxsit != (*MapData).end(); iwxsit++){
6623 intResult = (*iwxsit).first;
6627 return intValueSeek;
6631 bool frmContactEditor::GetSelectedItem(wxListCtrl *ListCtrlPtr,
6633 int *intSelectedData){
6636 *intSelectedData = 0;
6638 *longSelected = ListCtrlPtr->GetNextItem(*longSelected,
6640 wxLIST_STATE_SELECTED);
6642 *intSelectedData = (int)ListCtrlPtr->GetItemData(*longSelected);
6644 if (*longSelected == -1){
6653 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, std::string>* MapData){
6654 MapData->erase(IndexNum);
6657 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, wxString>* MapData){
6658 MapData->erase(IndexNum);
6661 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, int>* MapData){
6662 MapData->erase(IndexNum);
6665 void frmContactEditor::DeleteMapDataProcess(int IndexNum, std::map<int, bool>* MapData){
6666 MapData->erase(IndexNum);
6669 void frmContactEditor::ProcessSaveDataProc( wxString PropName,
6670 std::map<int,int>* MapData){
6672 int intIterVal = (*iterDataPtr)->first;
6674 std::map<int,int>::iterator intIter;
6676 intIter = MapData->find(intIterVal);
6680 if (intIter->first == intIterVal){
6682 intPropValue = intIter->second;
6686 if (*boolAdditionalPtr == TRUE){
6688 strPropertyPtr->Append(wxT(";"));
6692 *boolAdditionalPtr = TRUE;
6696 strPropertyPtr->Append(PropName + wxT("=") + wxString::Format(wxT("%i"), intPropValue));
6698 *boolExtraPtr = TRUE;
6706 void frmContactEditor::ProcessSaveDataProc( wxString PropName,
6707 std::map<int,wxString>* MapData){
6711 intIterVal = (*iterDataPtr)->first;
6713 std::map<int,wxString>::iterator strIter;
6715 strIter = MapData->find(intIterVal);
6717 if (strIter == MapData->end()){
6723 wxString strPropValue;
6725 if (strIter->first == intIterVal){
6727 strPropValue = strIter->second;
6729 if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6731 strPropValue.Trim();
6732 strPropValue.Trim();
6734 if (*boolAdditionalPtr == TRUE){
6736 strPropertyPtr->Append(wxT(";"));
6740 *boolAdditionalPtr = TRUE;
6744 strPropertyPtr->Append(strPropValue);
6746 *boolExtraPtr = TRUE;
6752 if (!strPropValue.IsEmpty()){
6754 strPropValue.Trim();
6755 strPropValue.Trim();
6757 if (*boolAdditionalPtr == TRUE){
6759 strPropertyPtr->Append(wxT(";"));
6763 *boolAdditionalPtr = TRUE;
6767 // Look for semi-colon in property name and if there is then
6770 if (PropName != wxT("TYPE")){
6772 EscapeString(&strPropValue, FALSE);
6776 if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6777 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6779 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6783 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6787 *boolExtraPtr = TRUE;
6795 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6796 std::map<int,std::string>* MapData){
6798 int intIterVal = (*iterDataStringPtr)->first;
6800 //std::map<int,wxString>::iterator strIter;
6802 std::map<int,std::string>::iterator stdstrIter;
6804 stdstrIter = MapData->find(intIterVal);
6806 if (stdstrIter->first == intIterVal){
6808 wxString strPropValue(stdstrIter->second.c_str(), wxConvUTF8);
6810 if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6812 strPropValue.Trim();
6813 strPropValue.Trim();
6815 if (*boolAdditionalPtr == TRUE){
6817 strPropertyPtr->Append(wxT(";"));
6821 *boolAdditionalPtr = TRUE;
6825 strPropertyPtr->Append(strPropValue);
6827 *boolExtraPtr = TRUE;
6833 if (!strPropValue.IsEmpty()){
6835 strPropValue.Trim();
6836 strPropValue.Trim();
6838 if (*boolAdditionalPtr == TRUE){
6840 strPropertyPtr->Append(wxT(";"));
6844 *boolAdditionalPtr = TRUE;
6848 // Look for semi-colon in property name and if there is then
6851 if (PropName != wxT("TYPE")){
6853 EscapeString(&strPropValue, FALSE);
6857 if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6858 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6860 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6864 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6868 *boolExtraPtr = TRUE;
6877 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6878 std::map<int,int>* MapData){
6880 int intIterVal = (*iterDataStringPtr)->first;
6882 std::map<int,int>::iterator intIter;
6884 intIter = MapData->find(intIterVal);
6888 if (intIter->first == intIterVal){
6890 intPropValue = intIter->second;
6894 if (*boolAdditionalPtr == TRUE){
6896 strPropertyPtr->Append(wxT(";"));
6900 *boolAdditionalPtr = TRUE;
6904 strPropertyPtr->Append(PropName + wxT("=") + wxString::Format(wxT("%i"), intPropValue));
6906 *boolExtraPtr = TRUE;
6914 void frmContactEditor::ProcessSaveDataStrProc( wxString PropName,
6915 std::map<int,wxString>* MapData){
6919 intIterVal = (*iterDataStringPtr)->first;
6921 std::map<int,wxString>::iterator strIter;
6923 strIter = MapData->find(intIterVal);
6925 wxString strPropValue;
6927 if (strIter->first == intIterVal){
6929 strPropValue = strIter->second;
6931 if (!strPropValue.IsEmpty() && PropName.IsEmpty()){
6933 strPropValue.Trim();
6934 strPropValue.Trim();
6936 if (*boolAdditionalPtr == TRUE){
6938 strPropertyPtr->Append(wxT(";"));
6942 *boolAdditionalPtr = TRUE;
6946 strPropertyPtr->Append(strPropValue);
6948 *boolExtraPtr = TRUE;
6954 if (!strPropValue.IsEmpty()){
6956 strPropValue.Trim();
6957 strPropValue.Trim();
6959 if (*boolAdditionalPtr == TRUE){
6961 strPropertyPtr->Append(wxT(";"));
6965 *boolAdditionalPtr = TRUE;
6969 // Look for semi-colon in property name and if there is then
6972 if (PropName != wxT("TYPE")){
6974 EscapeString(&strPropValue, FALSE);
6978 if (strPropValue.find(wxT(";")) == wxNOT_FOUND && strPropValue.find(wxT(":")) == wxNOT_FOUND &&
6979 strPropValue.find(wxT(",")) == wxNOT_FOUND){
6981 strPropertyPtr->Append(PropName + wxT("=") + strPropValue);
6985 strPropertyPtr->Append(PropName + wxT("=\"") + strPropValue + wxT("\""));
6989 *boolExtraPtr = TRUE;
6997 void frmContactEditor::ProcessCaptureStringsProc(wxString *strCapture){
6999 CaptureString(strCapture, FALSE);
7003 void frmContactEditor::ResetSaveProcessData(){
7016 void frmContactEditor::SetupPointers(frmActivityMgr *ActMgr, wxETagProcessTimer *ETagProc,
7017 frmMain *MainPtrInc){
7020 ETagTmrPtr = ETagProc;
7021 MainPtr = MainPtrInc;
7025 void frmContactEditor::ClearContact(){
7027 // Clear out the GUI and values.
7032 txtForename->Clear();
7033 txtSurname->Clear();
7034 txtOtherNames->Clear();
7036 cmbDisplayAs->Clear();
7037 cmbDisplayAs->SetValue(wxT(""));
7038 wxDateTime EmptyDate;
7039 wxBitmap EmptyBitmap;
7040 dapAnniversary->SetValue(EmptyDate);
7041 dapBirthday->SetValue(EmptyDate);
7042 txtBirthday->Clear();
7043 txtAnniversary->Clear();
7044 cmbGender->Select(0);
7045 txtGenderDescription->Clear();
7047 lboNicknames->DeleteAllItems();
7048 lboHomeNicknames->DeleteAllItems();
7049 lboBusinessNicknames->DeleteAllItems();
7051 lboAddresses->DeleteAllItems();
7052 lboHomeAddresses->DeleteAllItems();
7053 lboBusinessAddresses->DeleteAllItems();
7055 lboEmails->DeleteAllItems();
7056 lboHomeEmails->DeleteAllItems();
7057 lboBusinessEmail->DeleteAllItems();
7059 lboIM->DeleteAllItems();
7060 lboHomeIM->DeleteAllItems();
7061 lboBusinessIM->DeleteAllItems();
7063 lboTelephone->DeleteAllItems();
7064 lboHomeTelephone->DeleteAllItems();
7065 lboBusinessTelephone->DeleteAllItems();
7067 lboLanguages->DeleteAllItems();
7068 lboHomeLanguages->DeleteAllItems();
7069 lboBusinessLanguages->DeleteAllItems();
7071 lboTimezones->DeleteAllItems();
7072 lboHomeTimezones->DeleteAllItems();
7073 lboBusinessTimezones->DeleteAllItems();
7075 lboGeoposition->DeleteAllItems();
7076 lboHomeGeoposition->DeleteAllItems();
7077 lboBusinessGeoposition->DeleteAllItems();
7079 lboRelated->DeleteAllItems();
7081 lboWebsites->DeleteAllItems();
7082 lboHomeWebsites->DeleteAllItems();
7083 lboBusinessWebsites->DeleteAllItems();
7085 lboTitles->DeleteAllItems();
7086 lboHomeTitles->DeleteAllItems();
7087 lboBusinessTitles->DeleteAllItems();
7089 lboRoles->DeleteAllItems();
7090 lboHomeRoles->DeleteAllItems();
7091 lboBusinessRoles->DeleteAllItems();
7093 lboOrganisations->DeleteAllItems();
7094 lboHomeOrganisations->DeleteAllItems();
7095 lboBusinessOrganisations->DeleteAllItems();
7097 lboNotes->DeleteAllItems();
7098 lboHomeNotes->DeleteAllItems();
7099 lboBusinessNotes->DeleteAllItems();
7101 lboCategories->DeleteAllItems();
7103 lboGroups->DeleteAllItems();
7106 lboPictures->DeleteAllItems();
7107 imgPicture->SetBitmap(EmptyBitmap);
7110 lboLogos->DeleteAllItems();
7111 imgLogo->SetBitmap(EmptyBitmap);
7113 lboSounds->DeleteAllItems();
7115 lboCalendarAddresses->DeleteAllItems();
7116 lboCalendarRequestAddress->DeleteAllItems();
7117 lboFreeBusyAddresses->DeleteAllItems();
7119 lboKeys->DeleteAllItems();
7121 lboVendorNamespace->DeleteAllItems();
7122 lboXToken->DeleteAllItems();
7124 // Clear values out.
7127 wxString NameForename;
7128 wxString NameSurname;
7129 wxString NameOtherNames;
7130 wxString NameSuffix;
7131 wxString NameNickname;
7132 wxString NameDisplayAs;
7133 wxString NameLanguage;
7135 wxString NameTokens;
7138 wxString BirthdayAltID;
7139 wxString BirthdayCalScale;
7140 wxString BirthdayTokens;
7141 wxString Anniversary;
7142 wxString AnniversaryAltID;
7143 wxString AnniversaryCalScale;
7144 wxString AnniversaryTokens;
7147 wxString GenderDetails;
7148 wxString GenderTokens;
7152 /* We don't use these at the moment but we want to keep
7153 them for compatability reasons */
7155 /*std::map<int, wxString> ExtraFullNames;*/
7156 /*std::map<int, wxString> ExtraNicknames;*/
7158 FullNamesList.clear();
7159 FullNamesListType.clear();
7160 FullNamesListLanguage.clear();
7161 FullNamesListAltID.clear();
7162 FullNamesListPID.clear();
7163 FullNamesListTokens.clear();
7164 FullNamesListPref.clear();
7166 GeneralNicknamesList.clear();
7167 GeneralNicknamesListType.clear();
7168 GeneralNicknamesListLanguage.clear();
7169 GeneralNicknamesListAltID.clear();
7170 GeneralNicknamesListPID.clear();
7171 GeneralNicknamesListTokens.clear();
7172 GeneralNicknamesListPref.clear();
7174 GeneralAddressList.clear();
7175 GeneralAddressListTown.clear();
7176 GeneralAddressListCounty.clear();
7177 GeneralAddressListPostCode.clear();
7178 GeneralAddressListCountry.clear();
7179 GeneralAddressListLabel.clear();
7180 GeneralAddressListLang.clear();
7181 GeneralAddressListAltID.clear();
7182 GeneralAddressListPID.clear();
7183 GeneralAddressListTokens.clear();
7184 GeneralAddressListGeo.clear();
7185 GeneralAddressListTimezone.clear();
7186 GeneralAddressListType.clear();
7187 GeneralAddressListMediatype.clear();
7188 GeneralAddressListPref.clear();
7190 GeneralEmailList.clear();
7191 GeneralEmailListAltID.clear();
7192 GeneralEmailListPID.clear();
7193 GeneralEmailListType.clear();
7194 GeneralEmailListTokens.clear();
7195 GeneralEmailListPref.clear();
7197 GeneralIMList.clear();
7198 GeneralIMListAltID.clear();
7199 GeneralIMListPID.clear();
7200 GeneralIMListType.clear();
7201 GeneralIMListTokens.clear();
7202 GeneralIMListMediatype.clear();
7203 GeneralIMListPref.clear();
7205 GeneralTelephoneList.clear();
7206 GeneralTelephoneListAltID.clear();
7207 GeneralTelephoneListPID.clear();
7208 GeneralTelephoneListType.clear();
7209 GeneralTelephoneListTokens.clear();
7210 GeneralTelephoneListPref.clear();
7212 GeneralLanguageList.clear();
7213 GeneralLanguageListAltID.clear();
7214 GeneralLanguageListPID.clear();
7215 GeneralLanguageListType.clear();
7216 GeneralLanguageListTokens.clear();
7217 GeneralLanguageListPref.clear();
7219 GeneralTZList.clear();
7220 GeneralTZListAltID.clear();
7221 GeneralTZListPID.clear();
7222 GeneralTZListType.clear();
7223 GeneralTZListTokens.clear();
7224 GeneralTZListMediatype.clear();
7225 GeneralTZListPref.clear();
7227 GeneralGeographyList.clear();
7228 GeneralGeographyListAltID.clear();
7229 GeneralGeographyListPID.clear();
7230 GeneralGeographyListType.clear();
7231 GeneralGeographyListTokens.clear();
7232 GeneralGeographyListMediatype.clear();
7233 GeneralGeographyListPref.clear();
7235 GeneralRelatedList.clear();
7236 GeneralRelatedListRelType.clear();
7237 GeneralRelatedListLanguage.clear();
7238 GeneralRelatedListAltID.clear();
7239 GeneralRelatedListPID.clear();
7240 GeneralRelatedListType.clear();
7241 GeneralRelatedListTokens.clear();
7242 GeneralRelatedListPref.clear();
7244 GeneralWebsiteList.clear();
7245 GeneralWebsiteListAltID.clear();
7246 GeneralWebsiteListPID.clear();
7247 GeneralWebsiteListType.clear();
7248 GeneralWebsiteListTokens.clear();
7249 GeneralWebsiteListMediatype.clear();
7250 GeneralWebsiteListPref.clear();
7252 GeneralTitleList.clear();
7253 GeneralTitleListLanguage.clear();
7254 GeneralTitleListAltID.clear();
7255 GeneralTitleListPID.clear();
7256 GeneralTitleListType.clear();
7257 GeneralTitleListTokens.clear();
7258 GeneralTitleListPref.clear();
7260 GeneralRoleList.clear();
7261 GeneralRoleListLanguage.clear();
7262 GeneralRoleListAltID.clear();
7263 GeneralRoleListPID.clear();
7264 GeneralRoleListType.clear();
7265 GeneralRoleListTokens.clear();
7266 GeneralRoleListPref.clear();
7268 GeneralOrganisationsList.clear();
7269 GeneralOrganisationsListLanguage.clear();
7270 GeneralOrganisationsListAltID.clear();
7271 GeneralOrganisationsListPID.clear();
7272 GeneralOrganisationsListType.clear();
7273 GeneralOrganisationsListTokens.clear();
7274 GeneralOrganisationsListSortAs.clear();
7275 GeneralOrganisationsListPref.clear();
7277 GeneralNoteList.clear();
7278 GeneralNoteListLanguage.clear();
7279 GeneralNoteListAltID.clear();
7280 GeneralNoteListPID.clear();
7281 GeneralNoteListType.clear();
7282 GeneralNoteListTokens.clear();
7283 GeneralNoteListPref.clear();
7285 /* Items on Home Tab */
7287 HomeNicknamesList.clear();
7288 HomeNicknamesListType.clear();
7289 HomeNicknamesListLanguage.clear();
7290 HomeNicknamesListAltID.clear();
7291 HomeNicknamesListPID.clear();
7292 HomeNicknamesListTokens.clear();
7293 HomeNicknamesListPref.clear();
7295 HomeAddressList.clear();
7296 HomeAddressListTown.clear();
7297 HomeAddressListCounty.clear();
7298 HomeAddressListPostCode.clear();
7299 HomeAddressListCountry.clear();
7300 HomeAddressListLabel.clear();
7301 HomeAddressListLang.clear();
7302 HomeAddressListAltID.clear();
7303 HomeAddressListPID.clear();
7304 HomeAddressListTokens.clear();
7305 HomeAddressListGeo.clear();
7306 HomeAddressListTimezone.clear();
7307 HomeAddressListType.clear();
7308 HomeAddressListMediatype.clear();
7309 HomeAddressListPref.clear();
7311 HomeEmailList.clear();
7312 HomeEmailListAltID.clear();
7313 HomeEmailListPID.clear();
7314 HomeEmailListType.clear();
7315 HomeEmailListTokens.clear();
7316 HomeEmailListPref.clear();
7319 HomeIMListAltID.clear();
7320 HomeIMListPID.clear();
7321 HomeIMListType.clear();
7322 HomeIMListTokens.clear();
7323 HomeIMListMediatype.clear();
7324 HomeIMListPref.clear();
7326 HomeTelephoneList.clear();
7327 HomeTelephoneListAltID.clear();
7328 HomeTelephoneListPID.clear();
7329 HomeTelephoneListType.clear();
7330 HomeTelephoneListTokens.clear();
7331 HomeTelephoneListPref.clear();
7333 HomeLanguageList.clear();
7334 HomeLanguageListAltID.clear();
7335 HomeLanguageListPID.clear();
7336 HomeLanguageListType.clear();
7337 HomeLanguageListTokens.clear();
7338 HomeLanguageListPref.clear();
7341 HomeTZListAltID.clear();
7342 HomeTZListPID.clear();
7343 HomeTZListType.clear();
7344 HomeTZListTokens.clear();
7345 HomeTZListMediatype.clear();
7346 HomeTZListPref.clear();
7348 HomeGeographyList.clear();
7349 HomeGeographyListAltID.clear();
7350 HomeGeographyListPID.clear();
7351 HomeGeographyListType.clear();
7352 HomeGeographyListTokens.clear();
7353 HomeGeographyListMediatype.clear();
7354 HomeGeographyListPref.clear();
7356 HomeRelatedList.clear();
7357 HomeRelatedListRelType.clear();
7358 HomeRelatedListLanguage.clear();
7359 HomeRelatedListAltID.clear();
7360 HomeRelatedListPID.clear();
7361 HomeRelatedListType.clear();
7362 HomeRelatedListTokens.clear();
7363 HomeRelatedListPref.clear();
7365 HomeWebsiteList.clear();
7366 HomeWebsiteListAltID.clear();
7367 HomeWebsiteListPID.clear();
7368 HomeWebsiteListType.clear();
7369 HomeWebsiteListTokens.clear();
7370 HomeWebsiteListMediatype.clear();
7371 HomeWebsiteListPref.clear();
7373 HomeTitleList.clear();
7374 HomeTitleListLanguage.clear();
7375 HomeTitleListAltID.clear();
7376 HomeTitleListPID.clear();
7377 HomeTitleListType.clear();
7378 HomeTitleListTokens.clear();
7379 HomeTitleListPref.clear();
7381 HomeRoleList.clear();
7382 HomeRoleListLanguage.clear();
7383 HomeRoleListAltID.clear();
7384 HomeRoleListPID.clear();
7385 HomeRoleListType.clear();
7386 HomeRoleListTokens.clear();
7387 HomeRoleListPref.clear();
7389 HomeOrganisationsList.clear();
7390 HomeOrganisationsListLanguage.clear();
7391 HomeOrganisationsListAltID.clear();
7392 HomeOrganisationsListPID.clear();
7393 HomeOrganisationsListType.clear();
7394 HomeOrganisationsListTokens.clear();
7395 HomeOrganisationsListSortAs.clear();
7396 HomeOrganisationsListPref.clear();
7398 HomeNoteList.clear();
7399 HomeNoteListLanguage.clear();
7400 HomeNoteListAltID.clear();
7401 HomeNoteListPID.clear();
7402 HomeNoteListType.clear();
7403 HomeNoteListTokens.clear();
7404 HomeNoteListPref.clear();
7406 /* Items on the Business tab */
7408 BusinessNicknamesList.clear();
7409 BusinessNicknamesListType.clear();
7410 BusinessNicknamesListLanguage.clear();
7411 BusinessNicknamesListAltID.clear();
7412 BusinessNicknamesListPID.clear();
7413 BusinessNicknamesListTokens.clear();
7414 BusinessNicknamesListPref.clear();
7416 BusinessAddressList.clear();
7417 BusinessAddressListTown.clear();
7418 BusinessAddressListCounty.clear();
7419 BusinessAddressListPostCode.clear();
7420 BusinessAddressListCountry.clear();
7421 BusinessAddressListLabel.clear();
7422 BusinessAddressListLang.clear();
7423 BusinessAddressListAltID.clear();
7424 BusinessAddressListPID.clear();
7425 BusinessAddressListTokens.clear();
7426 BusinessAddressListGeo.clear();
7427 BusinessAddressListTimezone.clear();
7428 BusinessAddressListType.clear();
7429 BusinessAddressListMediatype.clear();
7430 BusinessAddressListPref.clear();
7432 BusinessEmailList.clear();
7433 BusinessEmailListAltID.clear();
7434 BusinessEmailListPID.clear();
7435 BusinessEmailListType.clear();
7436 BusinessEmailListTokens.clear();
7437 BusinessEmailListPref.clear();
7439 BusinessIMList.clear();
7440 BusinessIMListAltID.clear();
7441 BusinessIMListPID.clear();
7442 BusinessIMListType.clear();
7443 BusinessIMListTokens.clear();
7444 BusinessIMListMediatype.clear();
7445 BusinessIMListPref.clear();
7447 BusinessTelephoneList.clear();
7448 BusinessTelephoneListAltID.clear();
7449 BusinessTelephoneListPID.clear();
7450 BusinessTelephoneListType.clear();
7451 BusinessTelephoneListTokens.clear();
7452 BusinessTelephoneListPref.clear();
7454 BusinessLanguageList.clear();
7455 BusinessLanguageListAltID.clear();
7456 BusinessLanguageListPID.clear();
7457 BusinessLanguageListType.clear();
7458 BusinessLanguageListTokens.clear();
7459 BusinessLanguageListPref.clear();
7461 BusinessTZList.clear();
7462 BusinessTZListAltID.clear();
7463 BusinessTZListPID.clear();
7464 BusinessTZListType.clear();
7465 BusinessTZListTokens.clear();
7466 BusinessTZListMediatype.clear();
7467 BusinessTZListPref.clear();
7469 BusinessGeographyList.clear();
7470 BusinessGeographyListAltID.clear();
7471 BusinessGeographyListPID.clear();
7472 BusinessGeographyListType.clear();
7473 BusinessGeographyListTokens.clear();
7474 BusinessGeographyListMediatype.clear();
7475 BusinessGeographyListPref.clear();
7477 BusinessRelatedList.clear();
7478 BusinessRelatedListRelType.clear();
7479 BusinessRelatedListLanguage.clear();
7480 BusinessRelatedListAltID.clear();
7481 BusinessRelatedListPID.clear();
7482 BusinessRelatedListType.clear();
7483 BusinessRelatedListTokens.clear();
7484 BusinessRelatedListPref.clear();
7486 BusinessWebsiteList.clear();
7487 BusinessWebsiteListAltID.clear();
7488 BusinessWebsiteListPID.clear();
7489 BusinessWebsiteListType.clear();
7490 BusinessWebsiteListTokens.clear();
7491 BusinessWebsiteListMediatype.clear();
7492 BusinessWebsiteListPref.clear();
7494 BusinessTitleList.clear();
7495 BusinessTitleListLanguage.clear();
7496 BusinessTitleListAltID.clear();
7497 BusinessTitleListPID.clear();
7498 BusinessTitleListType.clear();
7499 BusinessTitleListTokens.clear();
7500 BusinessTitleListPref.clear();
7502 BusinessRoleList.clear();
7503 BusinessRoleListLanguage.clear();
7504 BusinessRoleListAltID.clear();
7505 BusinessRoleListPID.clear();
7506 BusinessRoleListType.clear();
7507 BusinessRoleListTokens.clear();
7508 BusinessRoleListPref.clear();
7510 BusinessOrganisationsList.clear();
7511 BusinessOrganisationsListLanguage.clear();
7512 BusinessOrganisationsListAltID.clear();
7513 BusinessOrganisationsListPID.clear();
7514 BusinessOrganisationsListType.clear();
7515 BusinessOrganisationsListTokens.clear();
7516 BusinessOrganisationsListSortAs.clear();
7517 BusinessOrganisationsListPref.clear();
7519 BusinessNoteList.clear();
7520 BusinessNoteListLanguage.clear();
7521 BusinessNoteListAltID.clear();
7522 BusinessNoteListPID.clear();
7523 BusinessNoteListType.clear();
7524 BusinessNoteListTokens.clear();
7525 BusinessNoteListPref.clear();
7527 /* Items on the Categories tab */
7529 CategoriesList.clear();
7530 CategoriesListAltID.clear();
7531 CategoriesListPID.clear();
7532 CategoriesListType.clear();
7533 CategoriesListTokens.clear();
7534 CategoriesListPref.clear();
7536 /* Items on the Groups tab */
7539 GroupsListAltID.clear();
7540 GroupsListPID.clear();
7541 GroupsListType.clear();
7542 GroupsListTokens.clear();
7543 GroupsListPref.clear();
7545 /* Items on the Pictures tab */
7547 PicturesList.clear();
7548 PicturesListAltID.clear();
7549 PicturesListPID.clear();
7550 PicturesListType.clear();
7551 PicturesListPicEncType.clear();
7552 PicturesListPictureType.clear();
7553 PicturesListTokens.clear();
7554 PicturesListMediatype.clear();
7555 PicturesListPref.clear();
7557 /* Items on the Logos tab */
7560 LogosListAltID.clear();
7561 LogosListPID.clear();
7562 LogosListType.clear();
7563 LogosListPicEncType.clear();
7564 LogosListPictureType.clear();
7565 LogosListTokens.clear();
7566 LogosListMediatype.clear();
7567 LogosListPref.clear();
7569 /* Items on the Sounds tab */
7572 SoundsListAltID.clear();
7573 SoundsListPID.clear();
7574 SoundsListType.clear();
7575 SoundsListAudioEncType.clear();
7576 SoundsListAudioType.clear();
7577 SoundsListTokens.clear();
7578 SoundsListMediatype.clear();
7579 SoundsListPref.clear();
7581 /* Items on the Calendaring tab */
7583 CalendarList.clear();
7584 CalendarListAltID.clear();
7585 CalendarListPID.clear();
7586 CalendarListType.clear();
7587 CalendarListTokens.clear();
7588 CalendarListMediatype.clear();
7589 CalendarListPref.clear();
7591 CalendarRequestList.clear();
7592 CalendarRequestListAltID.clear();
7593 CalendarRequestListPID.clear();
7594 CalendarRequestListType.clear();
7595 CalendarRequestListTokens.clear();
7596 CalendarRequestListMediatype.clear();
7597 CalendarRequestListPref.clear();
7599 FreeBusyList.clear();
7600 FreeBusyListAltID.clear();
7601 FreeBusyListPID.clear();
7602 FreeBusyListType.clear();
7603 FreeBusyListTokens.clear();
7604 FreeBusyListMediatype.clear();
7605 FreeBusyListPref.clear();
7607 /* Items on the Security tab */
7610 KeyListAltID.clear();
7612 KeyListKeyType.clear();
7613 KeyListDataType.clear();
7614 KeyListDataEncType.clear();
7615 KeyListType.clear();
7616 KeyListTokens.clear();
7617 KeyListPref.clear();
7619 /* Items on the Other tab */
7622 VendorListPEN.clear();
7623 VendorListElement.clear();
7626 XTokenListTokens.clear();
7628 wxSContactFilename.Clear();
7629 boolContactModified = FALSE;
7630 intSeekSelectedData = 0;
7632 /* Section for saving/loading data */
7635 ETagOriginal.Clear();
7646 BinaryDataProc = FALSE;
7650 PictureImage = wxNullBitmap;
7651 LogoImage = wxNullBitmap;
7655 void frmContactEditor::ContactFileChanged( wxCommandEvent &event ){
7661 // Check if a dialog is already open.
7663 if (DialogOpen == TRUE){
7665 FMTimer.Start(1000, FALSE);
7670 // Bring up a Yes/No modal dialog asking if the changed file should be reloaded.
7672 int QuestionResponse;
7674 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);
7676 if (QuestionResponse == wxYES){
7678 // Reload the contact.
7679 wxString wxSReloadContactName = wxSContactFilename;
7681 LoadContact(wxSReloadContactName);
7685 // Do nothing other than update the timestamp so this message
7686 // doesn't appear until the next time it changes.
7688 FMTimer.UpdateTimestamp();
7698 void frmContactEditor::UpdateMembersTab( wxCommandEvent &event ){
7700 if (cmbType->GetCurrentSelection() == 2){
7712 void frmContactEditor::SetUID(int UID){
7714 ContactEditorUID = UID;
7718 void frmContactEditor::UpdateDisplayAs( wxCommandEvent &event ){
7720 // Generate a drop down list of common names to use for the display as drop down box.
7722 wxString SetValue = cmbDisplayAs->GetValue();
7724 cmbDisplayAs->Clear();
7725 cmbDisplayAs->Append(txtForename->GetValue() + wxT(" ") + txtSurname->GetValue());
7726 if (!txtOtherNames->GetValue().IsEmpty()){
7728 cmbDisplayAs->Append(txtForename->GetValue() + wxT(" ") + txtOtherNames->GetValue() + wxT(" ") + txtForename->GetValue());
7731 cmbDisplayAs->Append(txtSurname->GetValue() + wxT(", ") + txtForename->GetValue());
7732 if (!txtOtherNames->GetValue().IsEmpty()){
7734 cmbDisplayAs->Append(txtForename->GetValue() + wxT(", ") + wxT(" ") + txtForename->GetValue() + wxT(" ") + txtOtherNames->GetValue());
7737 if (!txtTitle->GetValue().IsEmpty()){
7738 cmbDisplayAs->Append(txtTitle->GetValue() + wxT(" ") + txtSurname->GetValue() + wxT(" ") + txtForename->GetValue());
7741 cmbDisplayAs->SetValue(SetValue);
7743 this->SetTitle(cmbDisplayAs->GetValue());
7747 void frmContactEditor::UpdateName( wxCommandEvent &event ){
7749 this->SetTitle(cmbDisplayAs->GetValue());
7751 WindowData *WData = new WindowData;
7753 WData->DataType = 1;
7754 WData->WindowPointer = this;
7755 WData->WindowID = ContactEditorUID;
7757 wxCommandEvent editevent(WINDOW_EDIT);
7758 editevent.SetClientData(WData);
7759 wxPostEvent(GetParent(), editevent);