&BusinessAddressListMediatype, &BusinessAddressListPref,
&BusinessAddressListTokens, SaveData, "work");
+ // Process EMAIL.
+
+ SaveEmail(&GeneralEmailList, &GeneralEmailListAltID,
+ &GeneralEmailListPID, &GeneralEmailListType,
+ &GeneralEmailListPref, &GeneralEmailListTokens,
+ SaveData, "");
+ SaveEmail(&HomeEmailList, &HomeEmailListAltID,
+ &HomeEmailListPID, &HomeEmailListType,
+ &HomeEmailListPref, &HomeEmailListTokens,
+ SaveData, "home");
+ SaveEmail(&BusinessEmailList, &BusinessEmailListAltID,
+ &BusinessEmailListPID, &BusinessEmailListType,
+ &BusinessEmailListPref, &BusinessEmailListTokens,
+ SaveData, "work");
+
// Write the end part of the vCard data file.
SaveData->Append("END:VCARD");
}
+}
+
+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();
+
+ }
+
}
\ No newline at end of file
map<int, wxString> *AddressListTimezone, map<int, wxString> *AddressListType,
map<int, wxString> *AddressListMediatype, map<int, int> *AddressListPref,
map<int, wxString> *AddressListTokens, wxString *SaveData, wxString DataType);
+ void 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);
public: