- for (std::map<int,wxString>::iterator iter = GeneralNicknamesList.begin();
- iter != GeneralNicknamesList.end(); ++iter){
-
- intValue2 = iter->first;
-
- // Process Alternative ID.
-
- ProcessSaveData(wxT("NICKNAME"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralNicknamesList, &ContactData,
- wxT("LANGUAGE"), &GeneralNicknamesListLanguage,
- wxT("ALTID"), &GeneralNicknamesListAltID,
- wxT("PID"), &GeneralNicknamesListPID,
- wxT("PREF"), &GeneralNicknamesListPref,
- wxT(""), &GeneralNicknamesListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeNicknamesList.begin();
- iter != HomeNicknamesList.end(); ++iter){
-
- ProcessSaveData(wxT("NICKNAME;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeNicknamesList, &ContactData,
- wxT("LANGUAGE"), &HomeNicknamesListLanguage,
- wxT("ALTID"), &HomeNicknamesListAltID,
- wxT("PID"), &HomeNicknamesListPID,
- wxT("PREF"), &HomeNicknamesListPref,
- wxT(""), &HomeNicknamesListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessNicknamesList.begin();
- iter != BusinessNicknamesList.end(); ++iter){
-
- ProcessSaveData(wxT("NICKNAME;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessNicknamesList, &ContactData,
- wxT("LANGUAGE"), &BusinessNicknamesListLanguage,
- wxT("ALTID"), &BusinessNicknamesListAltID,
- wxT("PID"), &BusinessNicknamesListPID,
- wxT("PREF"), &BusinessNicknamesListPref,
- wxT(""), &BusinessNicknamesListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- // Sort out email (general, home and business).
-
- for (std::map<int,wxString>::iterator iter = GeneralEmailList.begin();
- iter != GeneralEmailList.end(); ++iter){
-
- //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
- //strValue2 =
-
- wxString strAddressFinalValue;
- std::map<int, wxString>::iterator iterValue;
-
- ProcessSaveData(wxT("EMAIL"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralEmailList, &ContactData,
- wxT("ALTID"), &GeneralEmailListAltID,
- wxT("PID"), &GeneralEmailListPID,
- wxT("PREF"), &GeneralEmailListPref,
- wxT(""), &GeneralEmailListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeEmailList.begin();
- iter != HomeEmailList.end(); ++iter){
-
- //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
- //strValue2 =
-
- ProcessSaveData(wxT("EMAIL;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeEmailList, &ContactData,
- wxT("ALTID"), &HomeEmailListAltID,
- wxT("PID"), &HomeEmailListPID,
- wxT("PREF"), &HomeEmailListPref,
- wxT(""), &HomeEmailListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessEmailList.begin();
- iter != BusinessEmailList.end(); ++iter){
-
- //strValue3 = ContactData.Convert(GeneralAddressList, FALSE);
- //strValue2 =
-
- ProcessSaveData(wxT("EMAIL;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessEmailList, &ContactData,
- wxT("ALTID"), &BusinessEmailListAltID,
- wxT("PID"), &BusinessEmailListPID,
- wxT("PREF"), &BusinessEmailListPref,
- wxT(""), &BusinessEmailListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralIMList.begin();
- iter != GeneralIMList.end(); ++iter){
-
- intValue2 = iter->first;
-
- // Process Alternative ID.
-
- ProcessSaveData(wxT("IMPP"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralIMList, &ContactData,
- wxT("ALTID"), &GeneralIMListAltID,
- wxT("PID"), &GeneralIMListPID,
- wxT("MEDIATYPE"), &GeneralIMListMediatype,
- wxT("PREF"), &GeneralIMListPref,
- wxT(""), &GeneralIMListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeIMList.begin();
- iter != HomeIMList.end(); ++iter){
-
- ProcessSaveData(wxT("IMPP;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeIMList, &ContactData,
- wxT("ALTID"), &HomeIMListAltID,
- wxT("PID"), &HomeIMListPID,
- wxT("MEDIATYPE"), &HomeIMListMediatype,
- wxT("PREF"), &HomeIMListPref,
- wxT(""), &HomeIMListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessIMList.begin();
- iter != BusinessIMList.end(); ++iter){
-
- ProcessSaveData(wxT("IMPP;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessIMList, &ContactData,
- wxT("ALTID"), &BusinessIMListAltID,
- wxT("PID"), &BusinessIMListPID,
- wxT("MEDIATYPE"), &BusinessIMListMediatype,
- wxT("PREF"), &BusinessIMListPref,
- wxT(""), &BusinessIMListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralTelephoneList.begin();
- iter != GeneralTelephoneList.end(); ++iter){
-
- wxString strAddressFinalValue = iter->second;
-
- ProcessCaptureStrings(&strAddressFinalValue);
-
- strAddressFinalValue.insert(0, wxT("tel:"));
-
- ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
- &iter, &strAddressFinalValue, &ContactData,
- wxT("ALTID"), &GeneralTelephoneListAltID,
- wxT("PID"), &GeneralTelephoneListPID,
- wxT("TYPE"), &GeneralTelephoneListType,
- wxT("PREF"), &GeneralTelephoneListPref,
- wxT(""), &GeneralTelephoneListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeTelephoneList.begin();
- iter != HomeTelephoneList.end(); ++iter){
-
- wxString strAddressFinalValue = iter->second;
-
- ProcessCaptureStrings(&strAddressFinalValue);
-
- strAddressFinalValue.insert(0, wxT("tel:"));
-
- ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
- &iter, &strAddressFinalValue, &ContactData,
- wxT("ALTID"), &HomeTelephoneListAltID,
- wxT("PID"), &HomeTelephoneListPID,
- wxT("TYPE"), &HomeTelephoneListType,
- wxT("PREF"), &HomeTelephoneListPref,
- wxT(""), &HomeTelephoneListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessTelephoneList.begin();
- iter != BusinessTelephoneList.end(); ++iter){
-
- wxString strAddressFinalValue = iter->second;
-
- ProcessCaptureStrings(&strAddressFinalValue);
-
- strAddressFinalValue.insert(0, wxT("tel:"));
-
- ProcessSaveData(wxT("TEL"), &strValue2, &boolValue2, &boolValue,
- &iter, &strAddressFinalValue, &ContactData,
- wxT("ALTID"), &BusinessTelephoneListAltID,
- wxT("PID"), &BusinessTelephoneListPID,
- wxT("TYPE"), &BusinessTelephoneListType,
- wxT("PREF"), &BusinessTelephoneListPref,
- wxT(""), &BusinessTelephoneListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralLanguageList.begin();
- iter != GeneralLanguageList.end(); ++iter){
-
- intValue2 = iter->first;
-
- ProcessSaveData(wxT("LANG"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralLanguageList, &ContactData,
- wxT("ALTID"), &GeneralLanguageListAltID,
- wxT("PID"), &GeneralLanguageListPID,
- wxT("PREF"), &GeneralLanguageListPref,
- wxT(""), &GeneralLanguageListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeLanguageList.begin();
- iter != HomeLanguageList.end(); ++iter){
-
- ProcessSaveData(wxT("LANG;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeLanguageList, &ContactData,
- wxT("ALTID"), &HomeLanguageListAltID,
- wxT("PID"), &HomeLanguageListPID,
- wxT("PREF"), &HomeLanguageListPref,
- wxT(""), &HomeLanguageListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessLanguageList.begin();
- iter != BusinessLanguageList.end(); ++iter){
-
- ProcessSaveData(wxT("LANG;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessLanguageList, &ContactData,
- wxT("ALTID"), &BusinessLanguageListAltID,
- wxT("PID"), &BusinessLanguageListPID,
- wxT("PREF"), &BusinessLanguageListPref,
- wxT(""), &BusinessLanguageListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralTZList.begin();
- iter != GeneralTZList.end(); ++iter){
-
- ProcessSaveData(wxT("TZ"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralTZList, &ContactData,
- wxT("ALTID"), &GeneralTZListAltID,
- wxT("PID"), &GeneralTZListPID,
- wxT("MEDIATYPE"), &GeneralTZListMediatype,
- wxT("PREF"), &GeneralTZListPref,
- wxT(""), &GeneralTZListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeTZList.begin();
- iter != HomeTZList.end(); ++iter){
-
- ProcessSaveData(wxT("TZ;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeTZList, &ContactData,
- wxT("ALTID"), &HomeTZListAltID,
- wxT("PID"), &HomeTZListPID,
- wxT("MEDIATYPE"), &HomeTZListMediatype,
- wxT("PREF"), &HomeTZListPref,
- wxT(""), &HomeTZListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessTZList.begin();
- iter != BusinessTZList.end(); ++iter){
-
- ProcessSaveData(wxT("TZ;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessTZList, &ContactData,
- wxT("ALTID"), &BusinessTZListAltID,
- wxT("PID"), &BusinessTZListPID,
- wxT("MEDIATYPE"), &BusinessTZListMediatype,
- wxT("PREF"), &BusinessTZListPref,
- wxT(""), &BusinessTZListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralGeographyList.begin();
- iter != GeneralGeographyList.end(); ++iter){
-
- wxString strAddressFinalValue = iter->second;
-
- ProcessCaptureStrings(&strAddressFinalValue);
-
- strAddressFinalValue.insert(0, wxT("geo:"));
-
- ProcessSaveData(wxT("GEO"), &strValue2, &boolValue2, &boolValue,
- &iter, &strAddressFinalValue, &ContactData,
- wxT("ALTID"), &GeneralGeographyListAltID,
- wxT("PID"), &GeneralGeographyListPID,
- wxT("MEDIATYPE"), &GeneralGeographyListMediatype,
- wxT("PREF"), &GeneralGeographyListPref,
- wxT(""), &GeneralGeographyListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeGeographyList.begin();
- iter != HomeGeographyList.end(); ++iter){
-
- wxString strAddressFinalValue = iter->second;
-
- ProcessCaptureStrings(&strAddressFinalValue);
-
- strAddressFinalValue.insert(0, wxT("geo:"));
-
- ProcessSaveData(wxT("GEO;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeGeographyList, &ContactData,
- wxT("ALTID"), &HomeGeographyListAltID,
- wxT("PID"), &HomeGeographyListPID,
- wxT("MEDIATYPE"), &HomeGeographyListMediatype,
- wxT("PREF"), &HomeGeographyListPref,
- wxT(""), &HomeGeographyListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessGeographyList.begin();
- iter != BusinessGeographyList.end(); ++iter){
-
- wxString strAddressFinalValue = iter->second;
-
- ProcessCaptureStrings(&strAddressFinalValue);
-
- strAddressFinalValue.insert(0, wxT("geo:"));
-
- ProcessSaveData(wxT("GEO;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessGeographyList, &ContactData,
- wxT("ALTID"), &BusinessGeographyListAltID,
- wxT("PID"), &BusinessGeographyListPID,
- wxT("MEDIATYPE"), &BusinessGeographyListMediatype,
- wxT("PREF"), &BusinessGeographyListPref,
- wxT(""), &BusinessGeographyListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralRelatedList.begin();
- iter != GeneralRelatedList.end(); ++iter){
-
- ProcessSaveData(wxT("RELATED"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralRelatedList, &ContactData,
- wxT("ALTID"), &GeneralRelatedListAltID,
- wxT("PID"), &GeneralRelatedListPID,
- wxT("LANGUAGE"), &GeneralRelatedListLanguage,
- wxT("TYPE"), &GeneralRelatedListRelType,
- wxT("PREF"), &GeneralRelatedListPref,
- wxT(""), &GeneralRelatedListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralWebsiteList.begin();
- iter != GeneralWebsiteList.end(); ++iter){
-
- ProcessSaveData(wxT("URL"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralWebsiteList, &ContactData,
- wxT("ALTID"), &GeneralWebsiteListAltID,
- wxT("PID"), &GeneralWebsiteListPID,
- wxT("MEDIATYPE"), &GeneralWebsiteListMediatype,
- wxT("PREF"), &GeneralWebsiteListPref,
- wxT(""), &GeneralWebsiteListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeWebsiteList.begin();
- iter != HomeWebsiteList.end(); ++iter){
-
- ProcessSaveData(wxT("URL;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeWebsiteList, &ContactData,
- wxT("ALTID"), &HomeWebsiteListAltID,
- wxT("PID"), &HomeWebsiteListPID,
- wxT("MEDIATYPE"), &HomeWebsiteListMediatype,
- wxT("PREF"), &HomeWebsiteListPref,
- wxT(""), &HomeWebsiteListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessWebsiteList.begin();
- iter != BusinessWebsiteList.end(); ++iter){
-
- ProcessSaveData(wxT("URL;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessWebsiteList, &ContactData,
- wxT("ALTID"), &BusinessWebsiteListAltID,
- wxT("PID"), &BusinessWebsiteListPID,
- wxT("MEDIATYPE"), &BusinessWebsiteListMediatype,
- wxT("PREF"), &BusinessWebsiteListPref,
- wxT(""), &BusinessWebsiteListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralTitleList.begin();
- iter != GeneralTitleList.end(); ++iter){
-
- ProcessSaveData(wxT("TITLE"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralTitleList, &ContactData,
- wxT("ALTID"), &GeneralTitleListAltID,
- wxT("PID"), &GeneralTitleListPID,
- wxT("LANGUAGE"), &GeneralTitleListLanguage,
- wxT("PREF"), &GeneralTitleListPref,
- wxT(""), &GeneralTitleListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeTitleList.begin();
- iter != HomeTitleList.end(); ++iter){
-
- ProcessSaveData(wxT("TITLE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeTitleList, &ContactData,
- wxT("ALTID"), &HomeTitleListAltID,
- wxT("PID"), &HomeTitleListPID,
- wxT("LANGUAGE"), &HomeTitleListLanguage,
- wxT("PREF"), &HomeTitleListPref,
- wxT(""), &HomeTitleListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessTitleList.begin();
- iter != BusinessTitleList.end(); ++iter){
-
- ProcessSaveData(wxT("TITLE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessTitleList, &ContactData,
- wxT("ALTID"), &BusinessTitleListAltID,
- wxT("PID"), &BusinessTitleListPID,
- wxT("LANGUAGE"), &BusinessTitleListLanguage,
- wxT("PREF"), &BusinessTitleListPref,
- wxT(""), &BusinessTitleListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralRoleList.begin();
- iter != GeneralRoleList.end(); ++iter){
-
- ProcessSaveData(wxT("ROLE"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralRoleList, &ContactData,
- wxT("ALTID"), &GeneralRoleListAltID,
- wxT("PID"), &GeneralRoleListPID,
- wxT("LANGUAGE"), &GeneralRoleListLanguage,
- wxT("PREF"), &GeneralRoleListPref,
- wxT(""), &GeneralRoleListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeRoleList.begin();
- iter != HomeRoleList.end(); ++iter){
-
- ProcessSaveData(wxT("ROLE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeRoleList, &ContactData,
- wxT("ALTID"), &HomeRoleListAltID,
- wxT("PID"), &HomeRoleListPID,
- wxT("LANGUAGE"), &HomeRoleListLanguage,
- wxT("PREF"), &HomeRoleListPref,
- wxT(""), &HomeRoleListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessRoleList.begin();
- iter != BusinessRoleList.end(); ++iter){
-
- ProcessSaveData(wxT("ROLE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessRoleList, &ContactData,
- wxT("ALTID"), &BusinessRoleListAltID,
- wxT("PID"), &BusinessRoleListPID,
- wxT("LANGUAGE"), &BusinessRoleListLanguage,
- wxT("PREF"), &BusinessRoleListPref,
- wxT(""), &BusinessRoleListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralOrganisationsList.begin();
- iter != GeneralOrganisationsList.end(); ++iter){
-
- ProcessSaveData(wxT("ORG"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralOrganisationsList, &ContactData,
- wxT("ALTID"), &GeneralOrganisationsListAltID,
- wxT("PID"), &GeneralOrganisationsListPID,
- wxT("LANGUAGE"), &GeneralOrganisationsListLanguage,
- wxT("SORT-AS"), &GeneralOrganisationsListSortAs,
- wxT("PREF"), &GeneralOrganisationsListPref,
- wxT(""), &GeneralOrganisationsListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeOrganisationsList.begin();
- iter != HomeOrganisationsList.end(); ++iter){
-
- ProcessSaveData(wxT("ORG;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeOrganisationsList, &ContactData,
- wxT("ALTID"), &HomeOrganisationsListAltID,
- wxT("PID"), &HomeOrganisationsListPID,
- wxT("LANGUAGE"), &HomeOrganisationsListLanguage,
- wxT("SORT-AS"), &HomeOrganisationsListSortAs,
- wxT("PREF"), &HomeOrganisationsListPref,
- wxT(""), &HomeOrganisationsListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessOrganisationsList.begin();
- iter != BusinessOrganisationsList.end(); ++iter){
-
- ProcessSaveData(wxT("ORG;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessOrganisationsList, &ContactData,
- wxT("ALTID"), &BusinessOrganisationsListAltID,
- wxT("PID"), &BusinessOrganisationsListPID,
- wxT("LANGUAGE"), &BusinessOrganisationsListLanguage,
- wxT("SORT-AS"), &BusinessOrganisationsListSortAs,
- wxT("PREF"), &BusinessOrganisationsListPref,
- wxT(""), &BusinessOrganisationsListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = GeneralNoteList.begin();
- iter != GeneralNoteList.end(); ++iter){
-
- ProcessSaveData(wxT("NOTE"), &strValue2, &boolValue2, &boolValue,
- &iter, &GeneralNoteList, &ContactData,
- wxT("ALTID"), &GeneralNoteListAltID,
- wxT("PID"), &GeneralNoteListPID,
- wxT("LANGUAGE"), &GeneralNoteListLanguage,
- wxT("PREF"), &GeneralNoteListPref,
- wxT(""), &GeneralNoteListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = HomeNoteList.begin();
- iter != HomeNoteList.end(); ++iter){
-
- ProcessSaveData(wxT("NOTE;TYPE=home"), &strValue2, &boolValue2, &boolValue,
- &iter, &HomeNoteList, &ContactData,
- wxT("ALTID"), &HomeNoteListAltID,
- wxT("PID"), &HomeNoteListPID,
- wxT("LANGUAGE"), &HomeNoteListLanguage,
- wxT("PREF"), &HomeNoteListPref,
- wxT(""), &HomeNoteListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = BusinessNoteList.begin();
- iter != BusinessNoteList.end(); ++iter){
-
- ProcessSaveData(wxT("NOTE;TYPE=work"), &strValue2, &boolValue2, &boolValue,
- &iter, &BusinessNoteList, &ContactData,
- wxT("ALTID"), &BusinessNoteListAltID,
- wxT("PID"), &BusinessNoteListPID,
- wxT("LANGUAGE"), &BusinessNoteListLanguage,
- wxT("PREF"), &BusinessNoteListPref,
- wxT(""), &BusinessNoteListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = CategoriesList.begin();
- iter != CategoriesList.end(); ++iter){
-
- ProcessSaveData(wxT("CATEGORIES"), &strValue2, &boolValue2, &boolValue,
- &iter, &CategoriesList, &ContactData,
- wxT("ALTID"), &CategoriesListAltID,
- wxT("PID"), &CategoriesListPID,
- wxT("TYPE"), &CategoriesListType,
- wxT("PREF"), &CategoriesListPref,
- wxT(""), &CategoriesListTokens );
-
- ResetSaveProcessData();
-
- }
-
- // Pictures.
-
- for (std::map<int, std::string>::iterator iter = PicturesList.begin();
- iter != PicturesList.end(); ++iter){
-
- int intValueIndex = iter->first;
-
- std::map<int, std::string>::iterator stdstriter;
- std::map<int, wxString>::iterator enciter;
-
- striter = PicturesListPictureType.find(intValueIndex);
- enciter = PicturesListPicEncType.find(intValueIndex);
-
- ProcessSaveData(wxT("PHOTO"), &strValue2, &boolValue2, &boolValue,
- &iter, &PicturesList, &striter,
- &enciter, &ContactData,
- wxT("ALTID"), &PicturesListAltID,
- wxT("PID"), &PicturesListPID,
- wxT("TYPE"), &PicturesListType,
- wxT("PREF"), &PicturesListPref,
- wxT(""), &PicturesListTokens);
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- // Logos.
-
- for (std::map<int, std::string>::iterator iter = LogosList.begin();
- iter != LogosList.end(); ++iter){
-
- int intValueIndex = iter->first;
-
- std::map<int, std::string>::iterator stdstriter;
- std::map<int, wxString>::iterator enciter;
-
- striter = LogosListPictureType.find(intValueIndex);
- enciter = LogosListPicEncType.find(intValueIndex);
-
- ProcessSaveData(wxT("LOGO"), &strValue2, &boolValue2, &boolValue,
- &iter, &LogosList, &striter,
- &enciter, &ContactData,
- wxT("ALTID"), &LogosListAltID,
- wxT("PID"), &LogosListPID,
- wxT("TYPE"), &LogosListType,
- wxT("PREF"), &LogosListPref,
- wxT(""), &LogosListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- // Sounds.
-
- for (std::map<int, std::string>::iterator iter = SoundsList.begin();
- iter != SoundsList.end(); ++iter){
-
- int intValueIndex = iter->first;
-
- std::map<int, std::string>::iterator stdstriter;
- std::map<int, wxString>::iterator enciter;
-
- striter = SoundsListAudioType.find(intValueIndex);
- enciter = SoundsListAudioEncType.find(intValueIndex);
-
- ProcessSaveData(wxT("SOUND"), &strValue2, &boolValue2, &boolValue,
- &iter, &SoundsList, &striter,
- &enciter, &ContactData,
- wxT("ALTID"), &SoundsListAltID,
- wxT("PID"), &SoundsListPID,
- wxT("TYPE"), &SoundsListType,
- wxT("PREF"), &SoundsListPref,
- wxT(""), &SoundsListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = CalendarList.begin();
- iter != CalendarList.end(); ++iter){
-
- ProcessSaveData(wxT("CALURI"), &strValue2, &boolValue2, &boolValue,
- &iter, &CalendarList, &ContactData,
- wxT("ALTID"), &CalendarListAltID,
- wxT("PID"), &CalendarListPID,
- wxT("MEDIATYPE"), &CalendarListMediatype,
- wxT("TYPE"), &CalendarListType,
- wxT("PREF"), &CalendarListPref,
- wxT(""), &CalendarListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = CalendarRequestList.begin();
- iter != CalendarRequestList.end(); ++iter){
-
- ProcessSaveData(wxT("CALADRURI"), &strValue2, &boolValue2, &boolValue,
- &iter, &CalendarRequestList, &ContactData,
- wxT("ALTID"), &CalendarRequestListAltID,
- wxT("PID"), &CalendarRequestListPID,
- wxT("MEDIATYPE"), &CalendarRequestListMediatype,
- wxT("TYPE"), &CalendarRequestListType,
- wxT("PREF"), &CalendarRequestListPref,
- wxT(""), &CalendarRequestListTokens );
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = FreeBusyList.begin();
- iter != FreeBusyList.end(); ++iter){
-
- ProcessSaveData(wxT("FBURL"), &strValue2, &boolValue2, &boolValue,
- &iter, &FreeBusyList, &ContactData,
- wxT("ALTID"), &FreeBusyListAltID,
- wxT("PID"), &FreeBusyListPID,
- wxT("MEDIATYPE"), &FreeBusyListMediatype,
- wxT("TYPE"), &FreeBusyListType,
- wxT("PREF"), &FreeBusyListPref,
- wxT(""), &FreeBusyListTokens );
-
- ResetSaveProcessData();
-
- }
-
- for (std::map<int, wxString>::iterator iter = KeyList.begin();
- iter != KeyList.end(); ++iter){
-
- intValue2 = iter->first;
-
- // Process Alternative ID.
-
- striter = KeyListAltID.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue3 = striter->second;
-
- if (!strValue3.IsEmpty()){
-
- strValue3.Trim();
- strValue3.Trim();
-
- if (boolValue2 == TRUE){
-
- strValue2.Append(wxT(";"));
-
- } else {
-
- boolValue2 = TRUE;
-
- }
-
- strValue2.Append(wxT("ALTID=") + strValue3);
-
- boolValue = TRUE;
-
- }
-
- }
-
- // Process PID.
-
- striter = KeyListPID.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue3 = striter->second;
-
- if (!strValue3.IsEmpty()){
-
- strValue3.Trim();
- strValue3.Trim();
-
- if (boolValue2 == TRUE){
-
- strValue2.Append(wxT(";"));
-
- } else {
-
- boolValue2 = TRUE;
-
- }
-
- strValue2.Append(wxT("PID=") + strValue3);
-
- boolValue = TRUE;
-
- }
-
- }
-
- // Process Type.
-
- striter = KeyListType.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue3 = striter->second;
-
- if (!strValue3.IsEmpty()){
-
- strValue3.Trim();
- strValue3.Trim();
-
- if (boolValue2 == TRUE){
-
- strValue2.Append(wxT(";"));
-
- } else {
-
- boolValue2 = TRUE;
-
- }
-
- strValue2.Append(wxT("TYPE=") + strValue3);
-
- boolValue = TRUE;
-
- }
-
- }
-
- intiter = KeyListPref.find(intValue2);
-
- if (intiter->first == intValue2){
-
- intValue3 = intiter->second;
-
- if (intValue3){
-
- if (boolValue2 == TRUE){
-
- strValue2.Append(wxT(";"));
-
- } else {
-
- boolValue2 = TRUE;
-
- }
-
- strValue2.Append(wxT("PREF=") + wxString::Format(wxT("%i"), intValue3));
-
- boolValue = TRUE;
-
- }
-
- }
-
- // Process Tokens.
-
- striter = KeyListTokens.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue3 = striter->second;
-
- if (!strValue3.IsEmpty()){
-
- strValue3.Trim();
- strValue3.Trim();
-
- if (boolValue2 == TRUE){
-
- strValue2.Append(wxT(";"));
-
- } else {
-
- boolValue2 = TRUE;
-
- }
-
- strValue2.Append(strValue3);
-
- boolValue = TRUE;
-
- }
-
- }
-
- // Get the key information.
-
- std::map<int, wxString>::iterator enciter;
-
- striter = KeyListDataType.find(intValue2);
- //enciter = KeyListAudioEncType.find(intValue2);
-
- wxString strValueData;
-
- strValueData = iter->second;
- //strValueData.insert(0, wxT("data:") + striter->second + wxT(";") + enciter->second + wxT(","));
- strValueData.insert(0, wxT("data:") + striter->second + wxT(";base64,"));
-
-
- // Add to the vCard.
-
- if (boolValue == TRUE){
-
- ContactData.AddRaw(wxT("KEY;") + strValue2, strValueData);
-
- } else {
-
- ContactData.Add(wxT("KEY"), strValueData, TRUE);
-
- }
-
- ResetSaveProcessData();
-
- }
-
- // Vendor specific items.
-
- ResetSaveProcessData();
-
- for (std::map<int,wxString>::iterator iter = VendorList.begin();
- iter != VendorList.end(); ++iter){
-
- intValue2 = iter->first;
-
- // Get the IANA PEN number.
-
- striter = VendorListPEN.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue2 = striter->second;
-
- }
-
- // Get the element name.
-
- striter = VendorListElement.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue3 = striter->second;
-
- }
-
- // Get the address.
-
- striter = VendorList.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue = striter->second;
-
- }
-
- // Add to the vCard.
-
- if (boolValue == TRUE){
-
- ContactData.AddRaw(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue);
-
- } else {
-
- ContactData.Add(wxT("VND-") + strValue2 + wxT("-") + strValue3, strValue, FALSE);
-
- }
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- // X-Tokens.
-
- for (std::map<int,wxString>::iterator iter = XTokenList.begin();
- iter != XTokenList.end(); ++iter){
-
- intValue2 = iter->first;
-
- // Get the element name.
-
- striter = XTokenListTokens.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue2 = striter->second;
-
- }
-
- // Get the address.
-
- striter = XTokenList.find(intValue2);
-
- if (striter->first == intValue2){
-
- strValue = striter->second;
-
- }
-
- // Add to the vCard.
-
- if (boolValue == TRUE){
-
- ContactData.AddRaw(wxT("X-") + strValue2, strValue);
-
- } else {
-
- ContactData.Add(wxT("X-") + strValue2, strValue, FALSE);
-
- }
-
- ResetSaveProcessData();
-
- }
-
- ResetSaveProcessData();
-
- if (FullNamesList.size() == 0){
-
- wxString FullName = cmbDisplayAs->GetValue();
- FullNamesList.insert(std::make_pair(0, FullName));
- FullNamesListAltID.insert(std::make_pair(0, wxT("")));
- FullNamesListPID.insert(std::make_pair(0, wxT("")));
- FullNamesListType.insert(std::make_pair(0, wxT("")));
- FullNamesListLanguage.insert(std::make_pair(0, wxT("")));
- FullNamesListPref.insert(std::make_pair(0, 0));
- FullNamesListTokens.insert(std::make_pair(0, wxT("")));
- FNFirst = FALSE;
-
- }
-
- for (std::map<int, wxString>::iterator iter = FullNamesList.begin();
- iter != FullNamesList.end(); ++iter){
-
- if (FNFirst == TRUE){
-
- iter->second = cmbDisplayAs->GetValue();
- FNFirst = FALSE;
-
- }
-
- std::map<int,wxString>::iterator mapS;
-
- mapS = FullNamesListTokens.find(iter->first);
-
- ProcessSaveData(wxT("FN"), &strValue2, &boolValue2, &boolValue,
- &iter, &FullNamesList, &ContactData,
- wxT("ALTID"), &FullNamesListAltID,
- wxT("PID"), &FullNamesListPID,
- wxT("TYPE"), &FullNamesListType,
- wxT("LANGUAGE"), &FullNamesListLanguage,
- wxT("PREF"), &FullNamesListPref,
- wxT(""), &FullNamesListTokens );
-
- // Get the address.
-
- ResetSaveProcessData();
-
- }
-
- //ContactData.Add(wxT("FN"), cmbDisplayAs->GetValue(), FALSE);
-
- // Insert revision (REV) date.
-
- // Get today's date and time.
-
- wxDateTime DateTimeNow = wxDateTime::Now();
-
- wxString DateRev;
-
- // Set year, month and date.
-
- int intYear = DateTimeNow.GetYear();
- int intMonth = DateTimeNow.GetMonth();
- int intDay = DateTimeNow.GetDay();
-
- DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intYear));
-
- if (intMonth < 10){
-
- DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMonth));
-
- } else {
-
- DateRev.Append(wxString::Format(wxT("%i"), intMonth));
-
- }
-
- if (intDay < 10){
-
- DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intDay));
-
- } else {
-
- DateRev.Append(wxString::Format(wxT("%i"), intDay));
-
- }
-
- //DateRev.Append(wx);
- //DateRev.Append(wx);
- //DateRev.Append(wx);
- DateRev.Append(wxT("T"));
-
- // Set hour, minute and second.
-
- int intHour = DateTimeNow.GetHour();
- int intMinute = DateTimeNow.GetMinute();
- int intSecond = DateTimeNow.GetSecond();
-
- if (intHour < 10){
-
- DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intHour));
-
- } else {
-
- DateRev.Append(wxString::Format(wxT("%i"), intHour));
-
- }
-
- if (intMinute < 10){
-
- DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intMinute));
-
- } else {
-
- DateRev.Append(wxString::Format(wxT("%i"), intMinute));
-
- }
-
- if (intSecond < 10){
-
- DateRev.Append(wxT("0") + wxString::Format(wxT("%i"), intSecond));
-
- } else {
-
- DateRev.Append(wxString::Format(wxT("%i"), intSecond));
-
- }
-
- // DateRev.Append(wx);
- // DateRev.Append(wx);
- // DateRev.Append(wxString DateTimeNow->);
- DateRev.Append(wxT("Z"));
-
- ContactData.Add(wxT("UID"), UIDToken, FALSE);
-
- // End the vCard File.
-
- ContactData.Add(wxT("END"), wxT("VCARD"), FALSE);
-
- FMTimer.Stop();
- ContactData.WriteFile(FilenameFinal);
-
- vCard34Conv ConvFileFun;
-
- wxString wxSData;
-
- ConvFileFun.ConvertToV3(FilenameFinal, &wxSData);
-
- wxString AccountDirPrefix;
- wxString AccountDir;
- wxString PrefDir;
-
-#if defined(__HAIKU__)
-
- //preffilename = wxT("noo");
-
-#elif defined(__APPLE__)
-
- PrefDir = GetUserPrefDir();
-
- wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/"));
-
-#elif defined(__WIN32__)
-
- PrefDir = GetUserPrefDir();
-
- wxStringTokenizer wSTFilename(wxSContactFilename, wxT("\\"));
-
-#else
-
- PrefDir = GetUserPrefDir();
-
- wxStringTokenizer wSTFilename(wxSContactFilename, wxT("/"));
-
-#endif
-
- XABPreferences PrefData(PrefDir);
-
- wxString AccountType;
-
- for (int i = 0; i < PrefData.accounts.GetCount(); i++){
-
- AccountDir = PrefData.accounts.GetAccountDirectory(i) + wxT(".carddav");
-
- if (AccountDir == wxSContactAccount){
-
- AccountDirPrefix = PrefData.accounts.GetAccountDirPrefix(i);
- AccountDirPrefix.Trim();
- AccountType = PrefData.accounts.GetAccountType(i);
- break;
-
- }
-
- }
-
- wxString wxSplitFilename;
- wxString wxSDataURL;
-
- while(wSTFilename.HasMoreTokens()){
-
- wxSplitFilename = wSTFilename.GetNextToken();
-
- }
-
- wxSDataURL = wxSplitFilename;
- //wxSDataURL.Append(wxSplitFilename);
-
- // Find out if the filename exists in the table.
-
- if (AccountType == wxT("CardDAV") || AccountType == wxT("carddav")){
-
- wxString ETagResult;
- wxString ETagOriginal;
-
- ETagDB *ETagDBPtr = NULL;
-
- ETagDBPtr = ETagTmrPtr->GetPointer(wxSContactAccount);
-
- wxString wxSETag = ETagDBPtr->GetETag(wxSplitFilename);
- wxString wxSETagOrig = ETagDBPtr->GetETagOriginal(wxSplitFilename);
-
- if (wxSETagOrig.IsEmpty()){
-
- // Generate the ETag.
-
- wxSETagOrig = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024);
-
- }
-
- if (wxSETag.IsEmpty()){
-
- // Update empty ETag.
-
- wxSETag = wxSETagOrig;
- ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag, wxSETagOrig);
-
- }
- else {
-
- // Don't change original ETag.
-
- wxSETag = wxString::Format(wxT("%X%X%X%X"), rand() % 1024, rand() % 1024, rand() % 1024, rand() % 1024);
- ETagDBPtr->UpdateETag(wxSplitFilename, wxSETag);
-
- }
-
- if (EditMode == FALSE){
-
- ActMgrPtr->AddTask(0, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
- EditMode = TRUE;
- FMTimer.SetFilename(FilenameFinal);
- FMTimer.UpdateTimestamp();
- FMTimer.Start(10000, FALSE);
-
- wxCommandEvent reloadevent(RELOADCONTACTLIST);
- reloadevent.SetString(wxSContactAccount);
- wxPostEvent(this->GetParent(), reloadevent);
-
- }
- else {
-
- ActMgrPtr->AddTask(1, cmbDisplayAs->GetValue(), wxSContactAccount, wxSDataURL, wxSplitFilename, FilenameFinal, wxSData);
- FMTimer.UpdateTimestamp();
- FMTimer.Start(10000, FALSE);
-
- }
-
- }
-
- // Send a notification to update the main window
- // with the new details.
-
- UCNotif *ucd;
- ucd = new UCNotif;
-
- // TODO: Workout nickname settings by priority and
- // type.
-
- ucd->ContactAccount = wxSContactAccount;
- ucd->ContactFilename = FilenameFinal;
- ucd->ContactName = cmbDisplayAs->GetValue();
- ucd->ContactNameArray = ContactData.GetName();
-
- for (std::map<int,wxString>::iterator gniter = GeneralNicknamesList.begin();
- gniter != GeneralNicknamesList.end(); gniter++){
-
- ucd->ContactNickname = gniter->second;
- break;
-
- }
-
- wxCommandEvent event2(CE_UPDATECONTACTLIST);
- event2.SetClientData(ucd);
- wxPostEvent(MainPtr, event2);
-
-}
-
-void frmContactEditor::SaveCloseContact( wxCommandEvent& event )
-{
-
- // Save the updated contact data and close the form.
-
- wxCommandEvent NullEvent;
- this->SaveContact(NullEvent);
- this->Close();