&BusinessTZListMediatype, &BusinessTZListPref,
&BusinessTZListTokens, SaveData, "work");
+ // Process ADR.
+
+ SaveAddress(&GeneralAddressList, &GeneralAddressListTown,
+ &GeneralAddressListCounty, &GeneralAddressListPostCode,
+ &GeneralAddressListCountry, &GeneralAddressListLabel,
+ &GeneralAddressListLang, &GeneralAddressListAltID,
+ &GeneralAddressListPID, &GeneralAddressListGeo,
+ &GeneralAddressListTimezone, &GeneralAddressListType,
+ &GeneralAddressListMediatype, &GeneralAddressListPref,
+ &GeneralAddressListTokens, SaveData, "");
+ SaveAddress(&HomeAddressList, &HomeAddressListTown,
+ &HomeAddressListCounty, &HomeAddressListPostCode,
+ &HomeAddressListCountry, &HomeAddressListLabel,
+ &HomeAddressListLang, &HomeAddressListAltID,
+ &HomeAddressListPID, &HomeAddressListGeo,
+ &HomeAddressListTimezone, &HomeAddressListType,
+ &HomeAddressListMediatype, &HomeAddressListPref,
+ &HomeAddressListTokens, SaveData, "home");
+ SaveAddress(&BusinessAddressList, &BusinessAddressListTown,
+ &BusinessAddressListCounty, &BusinessAddressListPostCode,
+ &BusinessAddressListCountry, &BusinessAddressListLabel,
+ &BusinessAddressListLang, &BusinessAddressListAltID,
+ &BusinessAddressListPID, &BusinessAddressListGeo,
+ &BusinessAddressListTimezone, &BusinessAddressListType,
+ &BusinessAddressListMediatype, &BusinessAddressListPref,
+ &BusinessAddressListTokens, SaveData, "work");
+
// Write the end part of the vCard data file.
SaveData->Append("END:VCARD");
}
+}
+
+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();
+
+ }
+
}
\ No newline at end of file
map<int, wxString> *TZListPID, map<int, wxString> *TZListType,
map<int, wxString> *TZListMediatype, map<int, int> *TZListPref,
map<int, wxString> *TZListTokens, wxString *SaveData, wxString DataType);
+ void 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);
public: