Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added KEY to the SaveString function of ContactDataObject
[xestiaab/.git] / source / contacteditor / cdo / ContactDataObject-Save.cpp
index 39f4a2a..f88d9ee 100644 (file)
@@ -613,6 +613,14 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
                &FreeBusyListMediatype, &FreeBusyListPref, 
                &FreeBusyListTokens, SaveData);
 
+       // Process KEY.
+       
+       SaveKey(&KeyList, &KeyListAltID, 
+               &KeyListPID, &KeyListType,
+               &KeyListKeyType, &KeyListDataEncType, 
+               &KeyListDataType, &KeyListPref, 
+               &KeyListTokens, SaveData);
+
        // Write the end part of the vCard data file.
        
        SaveData->Append("END:VCARD");
@@ -2200,4 +2208,79 @@ void ContactDataObject::SaveFreeBusyURI(std::map<int, wxString> *FreeBusyList, s
                        
        }
                
+}
+
+void ContactDataObject::SaveKey(map<int, wxString> *KeyList, map<int, wxString> *KeyListAltID, 
+       map<int, wxString> *KeyListPID, map<int, wxString> *KeyListType,
+       map<int, bool> *KeyListKeyType, map<int, wxString> *KeyListDataEncType, 
+       map<int, wxString> *KeyListDataType, map<int, int> *KeyListPref, 
+       map<int, wxString> *KeyListTokens, wxString *SaveData){
+
+       wxString ProcessData = "";
+               
+       for (std::map<int, wxString>::iterator KeyIter = KeyList->begin();
+               KeyIter != KeyList->end(); KeyIter++){
+
+               ProcessData.Append("KEY");
+                       
+               // Check if there is a value for TYPE.
+               
+               if ((*KeyListType)[KeyIter->first].size() > 0){
+               
+                       ProcessData.Append(";TYPE=");
+                       ProcessData.Append((*KeyListType)[KeyIter->first]);
+                       
+               }
+               
+               // Check if there is a value for ALTID.
+               
+               if ((*KeyListAltID)[KeyIter->first].size() > 0){
+               
+                       ProcessData.Append(";ALTID=");
+                       ProcessData.Append((*KeyListAltID)[KeyIter->first]);
+                       
+               }
+               
+               // Check if there is a value for PID.
+
+               if ((*KeyListPID)[KeyIter->first].size() > 0){
+               
+                       ProcessData.Append(";PID=");
+                       ProcessData.Append((*KeyListPID)[KeyIter->first]);
+                       
+               }
+
+               // Check if there is a value for PREF.
+
+               if ((*KeyListPref)[KeyIter->first] > 0){
+               
+                       ProcessData.Append(";PREF=");
+                       ProcessData.Append(wxString::Format("%i", (*KeyListPref)[KeyIter->first]));
+                       
+               }
+
+               // Check if there is a value for tokens.
+
+               if ((*KeyListTokens)[KeyIter->first].size() > 0){
+               
+                       ProcessData.Append(";");
+                       ProcessData.Append((*KeyListTokens)[KeyIter->first]);
+                       
+               }
+                       
+               ProcessData.Append(":data:");
+               ProcessData.Append((*KeyListDataType)[KeyIter->first]);
+               ProcessData.Append(";");
+               ProcessData.Append((*KeyListDataEncType)[KeyIter->first]);
+               ProcessData.Append(",");
+               ProcessData.Append(KeyIter->second);
+               ProcessData.Append("\n");
+
+               ProcessData = OutputText(&ProcessData);
+               
+               SaveData->Append(ProcessData);
+               ProcessData.clear();
+                       
+       }
+               
 }
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy