+ ProcessData.Append("SOURCE");
+
+ // Check if there is a value for TYPE.
+
+ if ((*SourceListType)[SourceIter->first].size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append((*SourceListType)[SourceIter->first]);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*SourceListAltID)[SourceIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*SourceListAltID)[SourceIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE.
+
+ if ((*SourceListMediatype)[SourceIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*SourceListMediatype)[SourceIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*SourceListPID)[SourceIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*SourceListPID)[SourceIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*SourceListPref)[SourceIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*SourceListPref)[SourceIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*SourceListTokens)[SourceIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*SourceListTokens)[SourceIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(SourceIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveMember(std::map<int, wxString> *GroupsList, std::map<int, wxString> *GroupsListAltID,
+ std::map<int, wxString> *GroupsListPID, std::map<int, wxString> *GroupsListType,
+ std::map<int, wxString> *GroupsListMediaType, std::map<int, int> *GroupsListPref,
+ std::map<int, wxString> *GroupsListTokens, wxString *SaveData){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator GroupsIter = GroupsList->begin();
+ GroupsIter != GroupsList->end(); GroupsIter++){
+
+ ProcessData.Append("MEMBER");
+
+ // Check if there is a value for TYPE.
+
+ if ((*GroupsListType)[GroupsIter->first].size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append((*GroupsListType)[GroupsIter->first]);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*GroupsListAltID)[GroupsIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*GroupsListAltID)[GroupsIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE.
+
+ if ((*GroupsListMediaType)[GroupsIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*GroupsListMediaType)[GroupsIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*GroupsListPID)[GroupsIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*GroupsListPID)[GroupsIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*GroupsListPref)[GroupsIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*GroupsListPref)[GroupsIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*GroupsListTokens)[GroupsIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*GroupsListTokens)[GroupsIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(GroupsIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID,
+ map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
+ map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref,
+ map<int, wxString> *NicknameListTokens, wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator NicknameIter = NicknameList->begin();
+ NicknameIter != NicknameList->end(); NicknameIter++){
+
+ ProcessData.Append("NICKNAME");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*NicknameListAltID)[NicknameIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*NicknameListAltID)[NicknameIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE.
+
+ if ((*NicknameListLanguage)[NicknameIter->first].size() > 0){
+
+ ProcessData.Append(";LANGUAGE=");
+ ProcessData.Append((*NicknameListLanguage)[NicknameIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*NicknameListPID)[NicknameIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*NicknameListPID)[NicknameIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*NicknameListPref)[NicknameIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*NicknameListPref)[NicknameIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*NicknameListTokens)[NicknameIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*NicknameListTokens)[NicknameIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(NicknameIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveTimezone(map<int, wxString> *TZList, map<int, wxString> *TZListAltID,
+ map<int, wxString> *TZListPID, map<int, wxString> *TZListType,
+ map<int, wxString> *TZListMediatype, map<int, int> *TZListPref,
+ map<int, wxString> *TZListTokens, wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator TZIter = TZList->begin();
+ TZIter != TZList->end(); TZIter++){
+
+ ProcessData.Append("TZ");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*TZListAltID)[TZIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*TZListAltID)[TZIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE.
+
+ if ((*TZListMediatype)[TZIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*TZListMediatype)[TZIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*TZListPID)[TZIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*TZListPID)[TZIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*TZListPref)[TZIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*TZListPref)[TZIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*TZListTokens)[TZIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*TZListTokens)[TZIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(TZIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveAddress(map<int, wxString> *AddressList, map<int, wxString> *AddressListTown,
+ map<int, wxString> *AddressListCounty, map<int, wxString> *AddressListPostCode,
+ map<int, wxString> *AddressListCountry, map<int, wxString> *AddressListLabel,
+ map<int, wxString> *AddressListLang, map<int, wxString> *AddressListAltID,
+ map<int, wxString> *AddressListPID, map<int, wxString> *AddressListGeo,
+ map<int, wxString> *AddressListTimezone, map<int, wxString> *AddressListType,
+ map<int, wxString> *AddressListMediatype, map<int, int> *AddressListPref,
+ map<int, wxString> *AddressListTokens, wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator AddressIter = AddressList->begin();
+ AddressIter != AddressList->end(); AddressIter++){
+
+ ProcessData.Append("ADR");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*AddressListAltID)[AddressIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*AddressListAltID)[AddressIter->first]);
+
+ }
+
+ // Check if there is a value for GEO.
+
+ if ((*AddressListGeo)[AddressIter->first].size() > 0){
+
+ ProcessData.Append(";GEO=\"");
+ ProcessData.Append((*AddressListGeo)[AddressIter->first]);
+ ProcessData.Append("\"");
+
+ }
+
+ // Check if there is a value for LABEL.
+
+ if ((*AddressListLabel)[AddressIter->first].size() > 0){
+
+ wxString AddressProcessed = "";
+ AddressProcessed = (*AddressListLabel)[AddressIter->first];
+
+ AddressProcessed.Replace("\n", "\\n", true);
+
+ ProcessData.Append(";LABEL=");
+ ProcessData.Append(AddressProcessed);
+
+ }
+
+ // Check if there is a value for LANGUAGE.
+
+ if ((*AddressListLang)[AddressIter->first].size() > 0){
+
+ ProcessData.Append(";LANGUAGE=");
+ ProcessData.Append((*AddressListLang)[AddressIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE.
+
+ if ((*AddressListMediatype)[AddressIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*AddressListMediatype)[AddressIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*AddressListPID)[AddressIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*AddressListPID)[AddressIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*AddressListPref)[AddressIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*AddressListPref)[AddressIter->first]));
+
+ }
+
+ // Check if there is a value for TZ.
+
+ if ((*AddressListTimezone)[AddressIter->first].size() > 0){
+
+ ProcessData.Append(";TZ=");
+ ProcessData.Append((*AddressListTimezone)[AddressIter->first]);
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*AddressListTokens)[AddressIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*AddressListTokens)[AddressIter->first]);
+
+ }
+
+ // Build the address.
+
+ ProcessData.Append(":;;");
+ ProcessData.Append((*AddressList)[AddressIter->first]);
+ ProcessData.Append(";");
+ ProcessData.Append((*AddressListTown)[AddressIter->first]);
+ ProcessData.Append(";");
+ ProcessData.Append((*AddressListCounty)[AddressIter->first]);
+ ProcessData.Append(";");
+ ProcessData.Append((*AddressListPostCode)[AddressIter->first]);
+ ProcessData.Append(";");
+ ProcessData.Append((*AddressListCountry)[AddressIter->first]);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveEmail(map<int, wxString> *EmailList, map<int, wxString> *EmailListAltID,
+ map<int, wxString> *EmailListPID, map<int, wxString> *EmailListType,
+ map<int, int> *EmailListPref, map<int, wxString> *EmailListTokens,
+ wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator EmailIter = EmailList->begin();
+ EmailIter != EmailList->end(); EmailIter++){
+
+ ProcessData.Append("EMAIL");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*EmailListAltID)[EmailIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*EmailListAltID)[EmailIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*EmailListPID)[EmailIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*EmailListPID)[EmailIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*EmailListPref)[EmailIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*EmailListPref)[EmailIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*EmailListTokens)[EmailIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*EmailListTokens)[EmailIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(EmailIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveIMPP(map<int, wxString> *IMList, map<int, wxString> *IMListAltID,
+ map<int, wxString> *IMListPID, map<int, wxString> *IMListType,
+ map<int, wxString> *IMListTypeInfo, map<int, wxString> *IMListMediatype,
+ map<int, int> *IMListPref, map<int, wxString> *IMListTokens,
+ wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator IMIter = IMList->begin();
+ IMIter != IMList->end(); IMIter++){
+
+ ProcessData.Append("IMPP");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*IMListAltID)[IMIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*IMListAltID)[IMIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE.
+
+ if ((*IMListMediatype)[IMIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*IMListMediatype)[IMIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*IMListPID)[IMIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*IMListPID)[IMIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*IMListPref)[IMIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*IMListPref)[IMIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*IMListTokens)[IMIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*IMListTokens)[IMIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append((*IMListTypeInfo)[IMIter->first]);
+ ProcessData.Append(":");
+ ProcessData.Append(IMIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveTelephone(map<int, wxString> *TelephoneList, map<int, wxString> *TelephoneListAltID,
+ map<int, wxString> *TelephoneListPID, map<int, wxString> *TelephoneListType,
+ map<int, wxString> *TelephoneListTypeInfo, map<int, wxString> *TelephoneListDataType,
+ map<int, int> *TelephoneListPref, map<int, wxString> *TelephoneListTokens,
+ wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator TelephoneIter = TelephoneList->begin();
+ TelephoneIter != TelephoneList->end(); TelephoneIter++){
+
+ ProcessData.Append("TEL");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0 || (*TelephoneListAltID)[TelephoneIter->first].size() > 0){
+
+ ProcessData.Append(";TYPE=\"");
+
+ bool ProcessedType = false;
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(DataType);
+ ProcessedType = true;
+
+ }
+
+ if ((*TelephoneListAltID)[TelephoneIter->first].size() > 0){
+
+ if (ProcessedType == true){
+ ProcessData.Append(",");
+ }
+ ProcessData.Append((*TelephoneListTypeInfo)[TelephoneIter->first]);
+
+ }
+
+ ProcessData.Append("\"");
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*TelephoneListAltID)[TelephoneIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*TelephoneListAltID)[TelephoneIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*TelephoneListPID)[TelephoneIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*TelephoneListPID)[TelephoneIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*TelephoneListPref)[TelephoneIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*TelephoneListPref)[TelephoneIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*TelephoneListTokens)[TelephoneIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*TelephoneListTokens)[TelephoneIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append((*TelephoneListDataType)[TelephoneIter->first]);
+ ProcessData.Append(":");
+ ProcessData.Append(TelephoneIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveLanguage(map<int, wxString> *LanguageList, map<int, wxString> *LanguageListAltID,
+ map<int, wxString> *LanguageListPID, map<int, wxString> *LanguageListType,
+ map<int, int> *LangaugeListPref, map<int, wxString> *LanguageListTokens,
+ wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator LanguageIter = LanguageList->begin();
+ LanguageIter != LanguageList->end(); LanguageIter++){
+
+ ProcessData.Append("LANG");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*LanguageListAltID)[LanguageIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*LanguageListAltID)[LanguageIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*LanguageListPID)[LanguageIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*LanguageListPID)[LanguageIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*LangaugeListPref)[LanguageIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*LangaugeListPref)[LanguageIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*LanguageListTokens)[LanguageIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*LanguageListTokens)[LanguageIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(LanguageIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveGeoposition(map<int, wxString> *GeographyList, map<int, wxString> *GeographyListAltID,
+ map<int, wxString> *GeographyListPID, map<int, wxString> *GeographyListType,
+ map<int, wxString> *GeographyListMediatype, map<int, wxString> *GeographyListDataType,
+ map<int, int> *GeographyListPref, map<int, wxString> *GeographyListTokens,
+ wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator GeographyIter = GeographyList->begin();
+ GeographyIter != GeographyList->end(); GeographyIter++){
+
+ ProcessData.Append("GEO");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*GeographyListAltID)[GeographyIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*GeographyListAltID)[GeographyIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE.
+
+ if ((*GeographyListMediatype)[GeographyIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*GeographyListMediatype)[GeographyIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*GeographyListPID)[GeographyIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*GeographyListPID)[GeographyIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*GeographyListPref)[GeographyIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*GeographyListPref)[GeographyIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*GeographyListTokens)[GeographyIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*GeographyListTokens)[GeographyIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append((*GeographyListDataType)[GeographyIter->first]);
+ ProcessData.Append(":");
+ ProcessData.Append(GeographyIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveURL(map<int, wxString> *WebsiteList, map<int, wxString> *WebsiteListAltID,
+ map<int, wxString> *WebsiteListPID, map<int, wxString> *WebsiteListType,
+ map<int, wxString> *WebsiteListMediatype, map<int, int> *WebsiteListPref,
+ map<int, wxString> *WebsiteListTokens, wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator WebsiteIter = WebsiteList->begin();
+ WebsiteIter != WebsiteList->end(); WebsiteIter++){
+
+ ProcessData.Append("URL");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*WebsiteListAltID)[WebsiteIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*WebsiteListAltID)[WebsiteIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE.
+
+ if ((*WebsiteListMediatype)[WebsiteIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*WebsiteListMediatype)[WebsiteIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*WebsiteListPID)[WebsiteIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*WebsiteListPID)[WebsiteIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*WebsiteListPref)[WebsiteIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*WebsiteListPref)[WebsiteIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*WebsiteListTokens)[WebsiteIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*WebsiteListTokens)[WebsiteIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(WebsiteIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveRole(map<int, wxString> *RoleList, map<int, wxString> *RoleListLanguage,
+ map<int, wxString> *RoleListAltID, map<int, wxString> *RoleListPID,
+ map<int, wxString> *RoleListType, map<int, int> *RoleListPref,
+ map<int, wxString> *RoleListTokens, wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator RoleIter = RoleList->begin();
+ RoleIter != RoleList->end(); RoleIter++){
+
+ ProcessData.Append("ROLE");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*RoleListAltID)[RoleIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*RoleListAltID)[RoleIter->first]);
+
+ }
+
+ // Check if there is a value for LANGUAGE.
+
+ if ((*RoleListLanguage)[RoleIter->first].size() > 0){
+
+ ProcessData.Append(";LANGUAGE=");
+ ProcessData.Append((*RoleListLanguage)[RoleIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*RoleListPID)[RoleIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*RoleListPID)[RoleIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*RoleListPref)[RoleIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*RoleListPref)[RoleIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*RoleListTokens)[RoleIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*RoleListTokens)[RoleIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(RoleIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveOrganisation(map<int, wxString> *OrganisationList, map<int, wxString> *OrganisationListAltID,
+ map<int, wxString> *OrganisationListPID, map<int, wxString> *OrganisationListLanguage,
+ map<int, wxString> *OrganisationListSortAs, map<int, wxString> *OrganisationListType,
+ map<int, int> *OrganisationListPref, map<int, wxString> *OrganisationListTokens,
+ wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator OrganisationIter = OrganisationList->begin();
+ OrganisationIter != OrganisationList->end(); OrganisationIter++){
+
+ ProcessData.Append("ORG");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*OrganisationListAltID)[OrganisationIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*OrganisationListAltID)[OrganisationIter->first]);
+
+ }
+
+ // Check if there is a value for LANGUAGE.
+
+ if ((*OrganisationListLanguage)[OrganisationIter->first].size() > 0){
+
+ ProcessData.Append(";LANGUAGE=");
+ ProcessData.Append((*OrganisationListLanguage)[OrganisationIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*OrganisationListPID)[OrganisationIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*OrganisationListPID)[OrganisationIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*OrganisationListPref)[OrganisationIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*OrganisationListPref)[OrganisationIter->first]));
+
+ }
+
+ // Check if there is a value for SORT-AS.
+
+ if ((*OrganisationListSortAs)[OrganisationIter->first].size() > 0){
+
+ ProcessData.Append(";SORT-AS=\"");
+ ProcessData.Append((*OrganisationListSortAs)[OrganisationIter->first]);
+ ProcessData.Append("\"");
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*OrganisationListTokens)[OrganisationIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*OrganisationListTokens)[OrganisationIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(OrganisationIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveNote(map<int, wxString> *NoteList, map<int, wxString> *NoteListLanguage,
+ map<int, wxString> *NoteListAltID, map<int, wxString> *NoteListPID,
+ map<int, wxString> *NoteListType, map<int, int> *NoteListPref,
+ map<int, wxString> *NoteListTokens, wxString *SaveData, wxString DataType){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator NoteIter = NoteList->begin();
+ NoteIter != NoteList->end(); NoteIter++){
+
+ ProcessData.Append("NOTE");
+
+ // Check if there is a value for TYPE.
+
+ if (DataType.size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append(DataType);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*NoteListAltID)[NoteIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*NoteListAltID)[NoteIter->first]);
+
+ }
+
+ // Check if there is a value for LANGUAGE.
+
+ if ((*NoteListLanguage)[NoteIter->first].size() > 0){
+
+ ProcessData.Append(";LANGUAGE=");
+ ProcessData.Append((*NoteListLanguage)[NoteIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*NoteListPID)[NoteIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*NoteListPID)[NoteIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*NoteListPref)[NoteIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*NoteListPref)[NoteIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*NoteListTokens)[NoteIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*NoteListTokens)[NoteIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(NoteIter->second);
+ ProcessData.Replace("\n", "\\n", true);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveCategory(map<int, wxString> *CategoryList, map<int, wxString> *CategoryListLanguage,
+ map<int, wxString> *CategoryListAltID, map<int, wxString> *CategoryListPID,
+ map<int, wxString> *CategoryListType, map<int, int> *CategoryListPref,
+ map<int, wxString> *CategoryListTokens, wxString *SaveData){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, wxString>::iterator CategoryIter = CategoryList->begin();
+ CategoryIter != CategoryList->end(); CategoryIter++){
+
+ ProcessData.Append("CATEGORIES");
+
+ // Check if there is a value for TYPE.
+
+ if ((*CategoryListType)[CategoryIter->first].size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append((*CategoryListType)[CategoryIter->first]);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*CategoryListAltID)[CategoryIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*CategoryListAltID)[CategoryIter->first]);
+
+ }
+
+ // Check if there is a value for LANGUAGE.
+
+ if ((*CategoryListLanguage)[CategoryIter->first].size() > 0){
+
+ ProcessData.Append(";LANGUAGE=");
+ ProcessData.Append((*CategoryListLanguage)[CategoryIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*CategoryListPID)[CategoryIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*CategoryListPID)[CategoryIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*CategoryListPref)[CategoryIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*CategoryListPref)[CategoryIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*CategoryListTokens)[CategoryIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*CategoryListTokens)[CategoryIter->first]);
+
+ }
+
+ ProcessData.Append(":");
+ ProcessData.Append(CategoryIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SavePhoto(map<int, string> *PicturesList, map<int, wxString> *PicturesListAltID,
+ map<int, wxString> *PicturesListPID, map<int, wxString> *PicturesListType,
+ map<int, wxString> *PicturesListPicEncType, map<int, wxString> *PicturesListPictureType,
+ map<int, wxString> *PicturesListMediatype, map<int, int> *PicturesListPref,
+ map<int, wxString> *PicturesListTokens, wxString *SaveData){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, string>::iterator PicturesIter = PicturesList->begin();
+ PicturesIter != PicturesList->end(); PicturesIter++){
+
+ ProcessData.Append("PHOTO");
+
+ // Check if there is a value for TYPE.
+
+ if ((*PicturesListType)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";TYPE=");
+ ProcessData.Append((*PicturesListType)[PicturesIter->first]);
+
+ }
+
+ // Check if there is a value for ALTID.
+
+ if ((*PicturesListAltID)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";ALTID=");
+ ProcessData.Append((*PicturesListAltID)[PicturesIter->first]);
+
+ }
+
+ // Check if there is a value for MEDIATYPE..
+
+ if ((*PicturesListMediatype)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";MEDIATYPE=");
+ ProcessData.Append((*PicturesListMediatype)[PicturesIter->first]);
+
+ }
+
+ // Check if there is a value for PID.
+
+ if ((*PicturesListPID)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";PID=");
+ ProcessData.Append((*PicturesListPID)[PicturesIter->first]);
+
+ }
+
+ // Check if there is a value for PREF.
+
+ if ((*PicturesListPref)[PicturesIter->first] > 0){
+
+ ProcessData.Append(";PREF=");
+ ProcessData.Append(wxString::Format("%i", (*PicturesListPref)[PicturesIter->first]));
+
+ }
+
+ // Check if there is a value for tokens.
+
+ if ((*PicturesListTokens)[PicturesIter->first].size() > 0){
+
+ ProcessData.Append(";");
+ ProcessData.Append((*PicturesListTokens)[PicturesIter->first]);
+
+ }
+
+ ProcessData.Append(":data:");
+ ProcessData.Append((*PicturesListPictureType)[PicturesIter->first]);
+ ProcessData.Append(";");
+ ProcessData.Append((*PicturesListPicEncType)[PicturesIter->first]);
+ ProcessData.Append(",");
+ ProcessData.Append(PicturesIter->second);
+ ProcessData.Append("\n");
+
+ ProcessData = OutputText(&ProcessData);
+
+ SaveData->Append(ProcessData);
+ ProcessData.clear();
+
+ }
+
+}
+
+void ContactDataObject::SaveLogo(map<int, string> *LogosList, map<int, wxString> *LogosListAltID,
+ map<int, wxString> *LogosListPID, map<int, wxString> *LogosListType,
+ map<int, wxString> *LogosListPicEncType, map<int, wxString> *LogosListPictureType,
+ map<int, wxString> *LogosListMediatype, map<int, int> *LogosListPref,
+ map<int, wxString> *LogosListTokens, wxString *SaveData){
+
+ wxString ProcessData = "";
+
+ for (std::map<int, string>::iterator LogosIter = LogosList->begin();
+ LogosIter != LogosList->end(); LogosIter++){
+
+ ProcessData.Append("LOGO");