X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2Fcdo%2FContactDataObject.h;h=733aa1f86751f64d778ad1abfaf2a1c87287fecf;hp=6317312b16d576d9728704834f10210d1a664964;hb=45cb2270fa3df3cc855fc5e039f44c8bae993a35;hpb=e84fab463acd898067e17d83b748dc365fd9a8d0 diff --git a/source/contacteditor/cdo/ContactDataObject.h b/source/contacteditor/cdo/ContactDataObject.h index 6317312..733aa1f 100644 --- a/source/contacteditor/cdo/ContactDataObject.h +++ b/source/contacteditor/cdo/ContactDataObject.h @@ -1,6 +1,6 @@ // ContactDataObject.h - Client Data Object header. // -// (c) 2012-2015 Xestia Software Development. +// (c) 2012-2016 Xestia Software Development. // // This file is part of Xestia Address Book. // @@ -23,9 +23,12 @@ #include #include #include +#include -#include "../vcard/vcard.h" -#include "../common/textprocessing.h" +#include "../../vcard/vcard.h" +#include "../../common/textprocessing.h" + +using namespace std; enum ContactLoadStatus{ CONTACTLOAD_UNITTESTFAIL = -1, @@ -36,6 +39,13 @@ enum ContactLoadStatus{ CONTACTLOAD_FILEBASESPECFAIL }; +enum ContactSaveStatus{ + CONTACTSAVE_UNITTESTFAIL = -1, + CONTACTSAVE_OK, + CONTACTSAVE_FILEERROR, + CONTACTSAVE_WRITEERROR +}; + enum ContactKindType{ CONTACTKIND_NONE, CONTACTKIND_INDIVIDUAL, @@ -88,6 +98,118 @@ class ContactDataObject{ void ProcessCalendarFreeBusy(wxString PropertySeg1, wxString PropertySeg2, int *FreeBusyAddressCount); void ProcessKey(wxString PropertySeg1, wxString PropertySeg2, int *KeyCount); void ProcessVendor(wxString PropertySeg1, wxString PropertySeg2, int *VendorCount); + + // Save functions + + void SaveTitle(map *TitleList, map *TitleListLanguage, + map *TitleListAltID, map *TitleListPID, + map *TitleListType, map *TitleListPref, + map *TitleListTokens, wxString *SaveData, wxString DataType); + void SaveSource(map *SourceList, map *SourceListAltID, + map *SourceListPID, map *SourceListType, + map *SourceListMediatype, map *SourceListPref, + map *SourceListTokens, wxString *SaveData); + void SaveMember(std::map *GroupsList, std::map *GroupsListAltID, + std::map *GroupsListPID, std::map *GroupsListType, + std::map *GroupsListMediatype, std::map *GroupsListPref, + std::map *GroupsListTokens, wxString *SaveData); + void SaveNickname(map *NicknameList, map *NicknameListAltID, + map *NicknameListPID, map *NicknameListType, + map *NicknameListLanguage, map *NicknameListPref, + map *NicknameListTokens, wxString *SaveData, wxString DataType); + void SaveTimezone(map *TZList, map *TZListAltID, + map *TZListPID, map *TZListType, + map *TZListMediatype, map *TZListPref, + map *TZListTokens, wxString *SaveData, wxString DataType); + void SaveAddress(map *AddressList, map *AddressListTown, + map *AddressListCounty, map *AddressListPostCode, + map *AddressListCountry, map *AddressListLabel, + map *AddressListLang, map *AddressListAltID, + map *AddressListPID, map *AddressListGeo, + map *AddressListTimezone, map *AddressListType, + map *AddressListMediatype, map *AddressListPref, + map *AddressListTokens, wxString *SaveData, wxString DataType); + void SaveEmail(map *EmailList, map *EmailListAltID, + map *EmailListPID, map *EmailListType, + map *EmailListPref, map *EmailListTokens, + wxString *SaveData, wxString DataType); + void SaveIMPP(map *IMList, map *IMListAltID, + map *IMListPID, map *IMListType, + map *IMListTypeInfo, map *IMListDataType, + map *IMListPref, map *IMListTokens, + wxString *SaveData, wxString DataType); + void SaveTelephone(map *TelephoneList, map *TelephoneListAltID, + map *TelephoneListPID, map *TelephoneListType, + map *TelephoneListTypeInfo, map *TelephoneListMediatype, + map *TelephoneListPref, map *TelephoneListTokens, + wxString *SaveData, wxString DataType); + void SaveLanguage(map *LanguageList, map *LanguageListAltID, + map *LanguageListPID, map *LanguageListType, + map *LangaugeListPref, map *LanguageListTokens, + wxString *SaveData, wxString DataType); + void SaveGeoposition(map *GeographyList, map *GeographyListAltID, + map *GeographyListPID, map *GeographyListType, + map *GeographyListMediatype, map *GeographyListDataType, + map *GeographyListPref, map *GeographyListTokens, + wxString *SaveData, wxString DataType); + void SaveURL(map *WebsiteList, map *WebsiteListAltID, + map *WebsiteListPID, map *WebsiteListType, + map *WebsiteListMediatype, map *WebsiteListPref, + map *WebsiteListTokens, wxString *SaveData, wxString DataType); + void SaveRole(map *RoleList, map *RoleListLanguage, + map *RoleListAltID, map *RoleListPID, + map *RoleListType, map *RoleListPref, + map *RoleListTokens, wxString *SaveData, wxString DataType); + void SaveOrganisation(map *OrganisationList, map *OrganisationListLanguage, + map *OrganisationListAltID, map *OrganisationListPID, + map *OrganisationListSortAs, map *OrganisationListType, + map *OrganisationListPref, map *OrganisationListTokens, + wxString *SaveData, wxString DataType); + void SaveNote(map *NoteList, map *NoteListLanguage, + map *NoteListAltID, map *NoteListPID, + map *NoteListType, map *NoteListPref, + map *NoteListTokens, wxString *SaveData, wxString DataType); + void SaveCategory(map *CategoryList, map *CategoryListLanguage, + map *CategoryListAltID, map *CategoryListPID, + map *CategoryListType, map *CategoryListPref, + map *CategoryListTokens, wxString *SaveData); + void SavePhoto(map *PicturesList, map *PicturesListAltID, + map *PicturesListPID, map *PicturesListType, + map *PicturesListPicEncType, map *PicturesListPictureType, + map *PicturesListMediatype, map *PicturesListPref, + map *PicturesListTokens, wxString *SaveData); + void SaveLogo(map *LogosList, map *LogosListAltID, + map *LogosListPID, map *LogosListType, + map *LogosListPicEncType, map *LogosListPictureType, + map *LogosListMediatype, map *LogosListPref, + map *LogosListTokens, wxString *SaveData); + void SaveSound(map *SoundsList, map *SoundsListAltID, + map *SoundsListPID, map *SoundsListType, + map *SoundsListAudioEncType, map *SoundsListAudioType, + map *SoundsListMediatype, map *SoundsListLanguage, + map *SoundsListPref, map *SoundsListTokens, + wxString *SaveData); + void SaveCalendarURI(std::map *CalendarList, std::map *CalendarListAltID, + std::map *CalendarListPID, std::map *CalendarListType, + std::map *CalendarListMediatype, std::map *CalendarListPref, + std::map *CalendarListTokens, wxString *SaveData); + void SaveCalendarRequestURI(std::map *CalendarRequestList, std::map *CalendarRequestListAltID, + std::map *CalendarRequestListPID, std::map *CalendarRequestListType, + std::map *CalendarRequestListMediatype, std::map *CalendarRequestListPref, + std::map *CalendarRequestListTokens, wxString *SaveData); + void SaveFreeBusyURI(std::map *FreeBusyList, std::map *FreeBusyListAltID, + std::map *FreeBusyListPID, std::map *FreeBusyListType, + std::map *FreeBusyListMediatype, std::map *FreeBusyListPref, + std::map *FreeBusyListTokens, wxString *SaveData); + void SaveKey(map *KeyList, map *KeyListAltID, + map *KeyListPID, map *KeyListType, + map *KeyListKeyType, map *KeyListDataEncType, + map *KeyListDataType, map *KeyListPref, + map *KeyListTokens, wxString *SaveData); + void SaveVendor(map *VendorList, map *VendorListPEN, + map *VendorListElement, wxString *SaveData); + void SaveXToken(map *XTokenList, map *XTokenListTokens, + wxString *SaveData); public: @@ -110,10 +232,13 @@ class ContactDataObject{ wxString BirthdayAltID; wxString BirthdayCalScale; wxString BirthdayTokens; + bool BirthdayText = FALSE; + wxString Anniversary; wxString AnniversaryAltID; wxString AnniversaryCalScale; wxString AnniversaryTokens; + bool AnniversaryText = FALSE; wxString Gender; wxString GenderDetails; @@ -137,12 +262,6 @@ class ContactDataObject{ std::map ClientPIDList; std::map ClientPIDListTokens; - /* We don't use these at the moment but we want to keep - them for compatability reasons */ - - /*std::map ExtraFullNames;*/ - /*std::map ExtraNicknames;*/ - std::map FullNamesList; std::map FullNamesListType; std::map FullNamesListLanguage; @@ -186,6 +305,7 @@ class ContactDataObject{ std::map GeneralIMListAltID; std::map GeneralIMListPID; std::map GeneralIMListType; + std::map GeneralIMListTypeInfo; std::map GeneralIMListTokens; std::map GeneralIMListMediatype; std::map GeneralIMListPref; @@ -196,6 +316,7 @@ class ContactDataObject{ std::map GeneralTelephoneListType; std::map GeneralTelephoneListTokens; std::map GeneralTelephoneListTypeInfo; + std::map GeneralTelephoneListDataType; std::map GeneralTelephoneListPref; std::map GeneralLanguageList; @@ -219,6 +340,7 @@ class ContactDataObject{ std::map GeneralGeographyListType; std::map GeneralGeographyListTokens; std::map GeneralGeographyListMediatype; + std::map GeneralGeographyListDataType; std::map GeneralGeographyListPref; std::map GeneralRelatedList; @@ -308,6 +430,7 @@ class ContactDataObject{ std::map HomeIMListAltID; std::map HomeIMListPID; std::map HomeIMListType; + std::map HomeIMListTypeInfo; std::map HomeIMListTokens; std::map HomeIMListMediatype; std::map HomeIMListPref; @@ -318,6 +441,7 @@ class ContactDataObject{ std::map HomeTelephoneListType; std::map HomeTelephoneListTokens; std::map HomeTelephoneListTypeInfo; + std::map HomeTelephoneListDataType; std::map HomeTelephoneListPref; std::map HomeLanguageList; @@ -341,6 +465,7 @@ class ContactDataObject{ std::map HomeGeographyListType; std::map HomeGeographyListTokens; std::map HomeGeographyListMediatype; + std::map HomeGeographyListDataType; std::map HomeGeographyListPref; std::map HomeWebsiteList; @@ -421,6 +546,7 @@ class ContactDataObject{ std::map BusinessIMListAltID; std::map BusinessIMListPID; std::map BusinessIMListType; + std::map BusinessIMListTypeInfo; std::map BusinessIMListTokens; std::map BusinessIMListMediatype; std::map BusinessIMListPref; @@ -431,6 +557,7 @@ class ContactDataObject{ std::map BusinessTelephoneListType; std::map BusinessTelephoneListTypeInfo; std::map BusinessTelephoneListTokens; + std::map BusinessTelephoneListDataType; std::map BusinessTelephoneListPref; std::map BusinessLanguageList; @@ -454,6 +581,7 @@ class ContactDataObject{ std::map BusinessGeographyListType; std::map BusinessGeographyListTokens; std::map BusinessGeographyListMediatype; + std::map BusinessGeographyListDataType; std::map BusinessGeographyListPref; std::map BusinessWebsiteList; @@ -604,6 +732,9 @@ class ContactDataObject{ // Subroutines. ContactLoadStatus LoadFile(wxString Filename); + ContactSaveStatus SaveFile(wxString Filename); + ContactSaveStatus SaveString(wxString *Data); + void ClearData(); };