Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added GEO to the SaveString function of ContactDataObject
[xestiaab/.git] / source / contacteditor / cdo / ContactDataObject-Save.cpp
index fbcfc1c..b7d2688 100644 (file)
@@ -316,6 +316,24 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
                &BusinessLanguageListPref, &BusinessLanguageListTokens, 
                SaveData, "work");
 
+       // Process GEO.
+       
+       SaveGeoposition(&GeneralGeographyList, &GeneralGeographyListAltID, 
+               &GeneralGeographyListPID, &GeneralGeographyListType,
+               &GeneralGeographyListMediatype, &GeneralGeographyListDataType,
+               &GeneralGeographyListPref, &GeneralGeographyListTokens, 
+               SaveData, "");
+       SaveGeoposition(&HomeGeographyList, &HomeGeographyListAltID, 
+               &HomeGeographyListPID, &HomeGeographyListType,
+               &HomeGeographyListMediatype, &HomeGeographyListDataType,
+               &HomeGeographyListPref, &HomeGeographyListTokens, 
+               SaveData, "home");
+       SaveGeoposition(&BusinessGeographyList, &BusinessGeographyListAltID, 
+               &BusinessGeographyListPID, &BusinessGeographyListType,
+               &BusinessGeographyListMediatype, &BusinessGeographyListDataType,
+               &BusinessGeographyListPref, &BusinessGeographyListTokens, 
+               SaveData, "work");
+
        // Write the end part of the vCard data file.
        
        SaveData->Append("END:VCARD");
@@ -915,4 +933,86 @@ void ContactDataObject::SaveLanguage(map<int, wxString> *LanguageList, map<int,
                        
        }
                
+}
+
+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();
+                       
+       }
+               
 }
\ 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