Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added CALURI to the SaveString function of ContactDataObject
[xestiaab/.git] / source / contacteditor / cdo / ContactDataObject-Save.cpp
index 7fdb87c..642ea5c 100644 (file)
@@ -585,6 +585,20 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
        
        // Process SOUND.
 
+       SaveSound(&SoundsList, &SoundsListAltID, 
+               &SoundsListPID, &SoundsListType,
+               &SoundsListAudioEncType, &SoundsListAudioType,
+               &SoundsListMediatype, &SoundsListLanguage, 
+               &SoundsListPref, &SoundsListTokens, 
+               SaveData);
+
+       // Process CALURI.
+       
+       SaveCalendarURI(&CalendarList, &CalendarListMediatype,
+               &CalendarListAltID, &CalendarListPID,
+               &CalendarListType, &CalendarListPref,
+               &CalendarListTokens, SaveData);
+
        // Write the end part of the vCard data file.
        
        SaveData->Append("END:VCARD");
@@ -1841,4 +1855,177 @@ void ContactDataObject::SaveLogo(map<int, string> *LogosList, map<int, wxString>
                        
        }
                
+}
+
+void ContactDataObject::SaveSound(map<int, string> *SoundsList, map<int, wxString> *SoundsListAltID, 
+       map<int, wxString> *SoundsListPID, map<int, wxString> *SoundsListType,
+       map<int, wxString> *SoundsListAudioEncType, map<int, wxString> *SoundsListAudioType,
+       map<int, wxString> *SoundsListMediatype, map<int, wxString> *SoundsListLanguage, 
+       map<int, int> *SoundsListPref, map<int, wxString> *SoundsListTokens, 
+       wxString *SaveData){
+
+       wxString ProcessData = "";
+               
+       for (std::map<int, string>::iterator SoundsIter = SoundsList->begin();
+               SoundsIter != SoundsList->end(); SoundsIter++){
+
+               ProcessData.Append("SOUND");
+                       
+               // Check if there is a value for TYPE.
+               
+               if ((*SoundsListType)[SoundsIter->first].size() > 0){
+               
+                       ProcessData.Append(";TYPE=");
+                       ProcessData.Append((*SoundsListType)[SoundsIter->first]);
+                       
+               }
+               
+               // Check if there is a value for ALTID.
+               
+               if ((*SoundsListAltID)[SoundsIter->first].size() > 0){
+               
+                       ProcessData.Append(";ALTID=");
+                       ProcessData.Append((*SoundsListAltID)[SoundsIter->first]);
+                       
+               }
+
+               // Check if there is a value for LANGUAGE.
+               
+               if ((*SoundsListLanguage)[SoundsIter->first].size() > 0){
+               
+                       ProcessData.Append(";LANGUAGE=");
+                       ProcessData.Append((*SoundsListLanguage)[SoundsIter->first]);
+                       
+               }
+               
+               // Check if there is a value for MEDIATYPE.
+               
+               if ((*SoundsListMediatype)[SoundsIter->first].size() > 0){
+               
+                       ProcessData.Append(";MEDIATYPE=");
+                       ProcessData.Append((*SoundsListMediatype)[SoundsIter->first]);
+                       
+               }
+               
+               // Check if there is a value for PID.
+
+               if ((*SoundsListPID)[SoundsIter->first].size() > 0){
+               
+                       ProcessData.Append(";PID=");
+                       ProcessData.Append((*SoundsListPID)[SoundsIter->first]);
+                       
+               }
+
+               // Check if there is a value for PREF.
+
+               if ((*SoundsListPref)[SoundsIter->first] > 0){
+               
+                       ProcessData.Append(";PREF=");
+                       ProcessData.Append(wxString::Format("%i", (*SoundsListPref)[SoundsIter->first]));
+                       
+               }
+
+               // Check if there is a value for tokens.
+
+               if ((*SoundsListTokens)[SoundsIter->first].size() > 0){
+               
+                       ProcessData.Append(";");
+                       ProcessData.Append((*SoundsListTokens)[SoundsIter->first]);
+                       
+               }
+               
+               ProcessData.Append(":data:");
+               ProcessData.Append((*SoundsListAudioType)[SoundsIter->first]);
+               ProcessData.Append(";");
+               ProcessData.Append((*SoundsListAudioEncType)[SoundsIter->first]);
+               ProcessData.Append(",");
+               ProcessData.Append(SoundsIter->second);
+               ProcessData.Append("\n");
+
+               ProcessData = OutputText(&ProcessData);
+               
+               SaveData->Append(ProcessData);
+               ProcessData.clear();
+                       
+       }
+               
+}
+
+void ContactDataObject::SaveCalendarURI(map<int, wxString> *CalendarList, map<int, wxString> *CalendarListMediatype,
+       map<int, wxString> *CalendarListAltID, map<int, wxString> *CalendarListPID,
+       map<int, wxString> *CalendarListType, map<int, int> *CalendarListPref,
+       map<int, wxString> *CalendarListTokens, wxString *SaveData){
+
+       wxString ProcessData = "";
+               
+       for (std::map<int, wxString>::iterator CalendarIter = CalendarList->begin();
+               CalendarIter != CalendarList->end(); CalendarIter++){
+
+               ProcessData.Append("CALURI");
+                       
+               // Check if there is a value for TYPE.
+               
+               if ((*CalendarListType)[CalendarIter->first].size() > 0){
+               
+                       ProcessData.Append(";TYPE=");
+                       ProcessData.Append((*CalendarListType)[CalendarIter->first]);
+                       
+               }
+               
+               // Check if there is a value for ALTID.
+               
+               if ((*CalendarListAltID)[CalendarIter->first].size() > 0){
+               
+                       ProcessData.Append(";ALTID=");
+                       ProcessData.Append((*CalendarListAltID)[CalendarIter->first]);
+                       
+               }
+
+               // Check if there is a value for MEDIATYPE.
+               
+               if ((*CalendarListMediatype)[CalendarIter->first].size() > 0){
+               
+                       ProcessData.Append(";MEDIATYPE=");
+                       ProcessData.Append((*CalendarListMediatype)[CalendarIter->first]);
+                       
+               }
+               
+               // Check if there is a value for PID.
+
+               if ((*CalendarListPID)[CalendarIter->first].size() > 0){
+               
+                       ProcessData.Append(";PID=");
+                       ProcessData.Append((*CalendarListPID)[CalendarIter->first]);
+                       
+               }
+
+               // Check if there is a value for PREF.
+
+               if ((*CalendarListPref)[CalendarIter->first] > 0){
+               
+                       ProcessData.Append(";PREF=");
+                       ProcessData.Append(wxString::Format("%i", (*CalendarListPref)[CalendarIter->first]));
+                       
+               }
+
+               // Check if there is a value for tokens.
+
+               if ((*CalendarListTokens)[CalendarIter->first].size() > 0){
+               
+                       ProcessData.Append(";");
+                       ProcessData.Append((*CalendarListTokens)[CalendarIter->first]);
+                       
+               }
+                       
+               ProcessData.Append(":");
+               ProcessData.Append(CalendarIter->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