// ContactDataObject.h - Client Data Object header. // // (c) 2012-2015 Xestia Software Development. // // This file is part of Xestia Address Book. // // Xestia Address Book is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by the // Free Software Foundation, version 3 of the license. // // Xestia Address Book is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with Xestia Address Book. If not, see #ifndef __CLIENTDATAOBJECT_H__ #define __CLIENTDATAOBJECT_H__ #include #include #include #include #include "../vcard/vcard.h" #include "../common/textprocessing.h" enum ContactLoadStatus{ CONTACTLOAD_UNITTESTFAIL = -1, CONTACTLOAD_OK, CONTACTLOAD_FILEMISSING, CONTACTLOAD_FILEERROR, CONTACTLOAD_FILEINVALIDFORMAT, CONTACTLOAD_FILEBASESPECFAIL }; enum ContactKindType{ CONTACTKIND_NONE, CONTACTKIND_INDIVIDUAL, CONTACTKIND_GROUP, CONTACTKIND_ORGANISATION, CONTACTKIND_LOCATION }; enum PropertyType{ PROPERTY_NONE, PROPERTY_HOME, PROPERTY_WORK }; class ContactDataObject{ private: void ProcessKind(wxString KindData); void ProcessMember(wxString PropertySeg1, wxString PropertySeg2, int *GroupCount); void ProcessFN(wxString PropertySeg1, wxString PropertySeg2, int *FNCount); void ProcessN(wxString PropertySeg1, wxString PropertySeg2); void ProcessNickname(wxString PropertySeg1, wxString PropertySeg2, int *NicknameCount); void ProcessGender(wxString PropertySeg1, wxString PropertySeg2); void ProcessBirthday(wxString PropertySeg1, wxString PropertySeg2); void ProcessAnniversary(wxString PropertySeg1, wxString PropertySeg2); void ProcessTimeZone(wxString PropertySeg1, wxString PropertySeg2, int *TimeZoneCount); void ProcessAddress(wxString PropertySeg1, wxString PropertySeg2, int *AddressCount); void ProcessEmail(wxString PropertySeg1, wxString PropertySeg2, int *EmailCount); void ProcessIM(wxString PropertySeg1, wxString PropertySeg2, int *IMCount); void ProcessTelephone(wxString PropertySeg1, wxString PropertySeg2, int *TelephoneCount); void ProcessLanguage(wxString PropertySeg1, wxString PropertySeg2, int *LanguageCount); void ProcessGeographic(wxString PropertySeg1, wxString PropertySeg2, int *GeographicCount); void ProcessRelated(wxString PropertySeg1, wxString PropertySeg2, int *RelatedCount); void ProcessURL(wxString PropertySeg1, wxString PropertySeg2, int *URLCount); void ProcessTitle(wxString PropertySeg1, wxString PropertySeg2, int *TitleCount); void ProcessRole(wxString PropertySeg1, wxString PropertySeg2, int *RoleCount); void ProcessOrganisation(wxString PropertySeg1, wxString PropertySeg2, int *OrganisationCount); void ProcessNote(wxString PropertySeg1, wxString PropertySeg2, int *NoteCount); void ProcessCategory(wxString PropertySeg1, wxString PropertySeg2, int *CategoryCount); void ProcessPhoto(wxString PropertySeg1, wxString PropertySeg2, int *PhotoCount); public: ContactKindType ContactKind = CONTACTKIND_NONE; /* Items on General Tab */ wxString NameTitle; wxString NameForename; wxString NameSurname; wxString NameOtherNames; wxString NameSuffix; wxString NameNickname; wxString NameDisplayAs; wxString NameLanguage; wxString NameAltID; wxString NameTokens; wxString Birthday; wxString BirthdayAltID; wxString BirthdayCalScale; wxString BirthdayTokens; wxString Anniversary; wxString AnniversaryAltID; wxString AnniversaryCalScale; wxString AnniversaryTokens; wxString Gender; wxString GenderDetails; wxString GenderTokens; wxString UIDToken; /* 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; std::map FullNamesListAltID; std::map FullNamesListPID; std::map FullNamesListTokens; std::map FullNamesListPref; std::map GeneralNicknamesList; std::map GeneralNicknamesListType; std::map GeneralNicknamesListLanguage; std::map GeneralNicknamesListAltID; std::map GeneralNicknamesListPID; std::map GeneralNicknamesListTokens; std::map GeneralNicknamesListPref; std::map GeneralAddressList; std::map GeneralAddressListTown; std::map GeneralAddressListCounty; std::map GeneralAddressListPostCode; std::map GeneralAddressListCountry; std::map GeneralAddressListLabel; std::map GeneralAddressListLang; std::map GeneralAddressListAltID; std::map GeneralAddressListPID; std::map GeneralAddressListTokens; std::map GeneralAddressListGeo; std::map GeneralAddressListTimezone; std::map GeneralAddressListType; std::map GeneralAddressListMediatype; std::map GeneralAddressListPref; std::map GeneralEmailList; std::map GeneralEmailListAltID; std::map GeneralEmailListPID; std::map GeneralEmailListType; std::map GeneralEmailListTokens; std::map GeneralEmailListPref; std::map GeneralIMList; std::map GeneralIMListAltID; std::map GeneralIMListPID; std::map GeneralIMListType; std::map GeneralIMListTokens; std::map GeneralIMListMediatype; std::map GeneralIMListPref; std::map GeneralTelephoneList; std::map GeneralTelephoneListAltID; std::map GeneralTelephoneListPID; std::map GeneralTelephoneListType; std::map GeneralTelephoneListTokens; std::map GeneralTelephoneListTypeInfo; std::map GeneralTelephoneListPref; std::map GeneralLanguageList; std::map GeneralLanguageListAltID; std::map GeneralLanguageListPID; std::map GeneralLanguageListType; std::map GeneralLanguageListTokens; std::map GeneralLanguageListPref; std::map GeneralTZList; std::map GeneralTZListAltID; std::map GeneralTZListPID; std::map GeneralTZListType; std::map GeneralTZListTokens; std::map GeneralTZListMediatype; std::map GeneralTZListPref; std::map GeneralGeographyList; std::map GeneralGeographyListAltID; std::map GeneralGeographyListPID; std::map GeneralGeographyListType; std::map GeneralGeographyListTokens; std::map GeneralGeographyListMediatype; std::map GeneralGeographyListPref; std::map GeneralRelatedList; std::map GeneralRelatedListRelType; std::map GeneralRelatedListLanguage; std::map GeneralRelatedListAltID; std::map GeneralRelatedListPID; std::map GeneralRelatedListType; std::map GeneralRelatedListTokens; std::map GeneralRelatedListPref; std::map GeneralWebsiteList; std::map GeneralWebsiteListAltID; std::map GeneralWebsiteListPID; std::map GeneralWebsiteListType; std::map GeneralWebsiteListTokens; std::map GeneralWebsiteListMediatype; std::map GeneralWebsiteListPref; std::map GeneralTitleList; std::map GeneralTitleListLanguage; std::map GeneralTitleListAltID; std::map GeneralTitleListPID; std::map GeneralTitleListType; std::map GeneralTitleListTokens; std::map GeneralTitleListPref; std::map GeneralRoleList; std::map GeneralRoleListLanguage; std::map GeneralRoleListAltID; std::map GeneralRoleListPID; std::map GeneralRoleListType; std::map GeneralRoleListTokens; std::map GeneralRoleListPref; std::map GeneralOrganisationsList; std::map GeneralOrganisationsListLanguage; std::map GeneralOrganisationsListAltID; std::map GeneralOrganisationsListPID; std::map GeneralOrganisationsListType; std::map GeneralOrganisationsListTokens; std::map GeneralOrganisationsListSortAs; std::map GeneralOrganisationsListPref; std::map GeneralNoteList; std::map GeneralNoteListLanguage; std::map GeneralNoteListAltID; std::map GeneralNoteListPID; std::map GeneralNoteListType; std::map GeneralNoteListTokens; std::map GeneralNoteListPref; /* Items on Home Tab */ std::map HomeNicknamesList; std::map HomeNicknamesListType; std::map HomeNicknamesListLanguage; std::map HomeNicknamesListAltID; std::map HomeNicknamesListPID; std::map HomeNicknamesListTokens; std::map HomeNicknamesListPref; std::map HomeAddressList; std::map HomeAddressListTown; std::map HomeAddressListCounty; std::map HomeAddressListPostCode; std::map HomeAddressListCountry; std::map HomeAddressListLabel; std::map HomeAddressListLang; std::map HomeAddressListAltID; std::map HomeAddressListPID; std::map HomeAddressListTokens; std::map HomeAddressListGeo; std::map HomeAddressListTimezone; std::map HomeAddressListType; std::map HomeAddressListMediatype; std::map HomeAddressListPref; std::map HomeEmailList; std::map HomeEmailListAltID; std::map HomeEmailListPID; std::map HomeEmailListType; std::map HomeEmailListTokens; std::map HomeEmailListPref; std::map HomeIMList; std::map HomeIMListAltID; std::map HomeIMListPID; std::map HomeIMListType; std::map HomeIMListTokens; std::map HomeIMListMediatype; std::map HomeIMListPref; std::map HomeTelephoneList; std::map HomeTelephoneListAltID; std::map HomeTelephoneListPID; std::map HomeTelephoneListType; std::map HomeTelephoneListTokens; std::map HomeTelephoneListTypeInfo; std::map HomeTelephoneListPref; std::map HomeLanguageList; std::map HomeLanguageListAltID; std::map HomeLanguageListPID; std::map HomeLanguageListType; std::map HomeLanguageListTokens; std::map HomeLanguageListPref; std::map HomeTZList; std::map HomeTZListAltID; std::map HomeTZListPID; std::map HomeTZListType; std::map HomeTZListTokens; std::map HomeTZListMediatype; std::map HomeTZListPref; std::map HomeGeographyList; std::map HomeGeographyListAltID; std::map HomeGeographyListPID; std::map HomeGeographyListType; std::map HomeGeographyListTokens; std::map HomeGeographyListMediatype; std::map HomeGeographyListPref; std::map HomeWebsiteList; std::map HomeWebsiteListAltID; std::map HomeWebsiteListPID; std::map HomeWebsiteListType; std::map HomeWebsiteListTokens; std::map HomeWebsiteListMediatype; std::map HomeWebsiteListPref; std::map HomeTitleList; std::map HomeTitleListLanguage; std::map HomeTitleListAltID; std::map HomeTitleListPID; std::map HomeTitleListType; std::map HomeTitleListTokens; std::map HomeTitleListPref; std::map HomeRoleList; std::map HomeRoleListLanguage; std::map HomeRoleListAltID; std::map HomeRoleListPID; std::map HomeRoleListType; std::map HomeRoleListTokens; std::map HomeRoleListPref; std::map HomeOrganisationsList; std::map HomeOrganisationsListLanguage; std::map HomeOrganisationsListAltID; std::map HomeOrganisationsListPID; std::map HomeOrganisationsListType; std::map HomeOrganisationsListTokens; std::map HomeOrganisationsListSortAs; std::map HomeOrganisationsListPref; std::map HomeNoteList; std::map HomeNoteListLanguage; std::map HomeNoteListAltID; std::map HomeNoteListPID; std::map HomeNoteListType; std::map HomeNoteListTokens; std::map HomeNoteListPref; /* Items on the Business tab */ std::map BusinessNicknamesList; std::map BusinessNicknamesListType; std::map BusinessNicknamesListLanguage; std::map BusinessNicknamesListAltID; std::map BusinessNicknamesListPID; std::map BusinessNicknamesListTokens; std::map BusinessNicknamesListPref; std::map BusinessAddressList; std::map BusinessAddressListTown; std::map BusinessAddressListCounty; std::map BusinessAddressListPostCode; std::map BusinessAddressListCountry; std::map BusinessAddressListLabel; std::map BusinessAddressListLang; std::map BusinessAddressListAltID; std::map BusinessAddressListPID; std::map BusinessAddressListTokens; std::map BusinessAddressListGeo; std::map BusinessAddressListTimezone; std::map BusinessAddressListType; std::map BusinessAddressListMediatype; std::map BusinessAddressListPref; std::map BusinessEmailList; std::map BusinessEmailListAltID; std::map BusinessEmailListPID; std::map BusinessEmailListType; std::map BusinessEmailListTokens; std::map BusinessEmailListPref; std::map BusinessIMList; std::map BusinessIMListAltID; std::map BusinessIMListPID; std::map BusinessIMListType; std::map BusinessIMListTokens; std::map BusinessIMListMediatype; std::map BusinessIMListPref; std::map BusinessTelephoneList; std::map BusinessTelephoneListAltID; std::map BusinessTelephoneListPID; std::map BusinessTelephoneListType; std::map BusinessTelephoneListTypeInfo; std::map BusinessTelephoneListTokens; std::map BusinessTelephoneListPref; std::map BusinessLanguageList; std::map BusinessLanguageListAltID; std::map BusinessLanguageListPID; std::map BusinessLanguageListType; std::map BusinessLanguageListTokens; std::map BusinessLanguageListPref; std::map BusinessTZList; std::map BusinessTZListAltID; std::map BusinessTZListPID; std::map BusinessTZListType; std::map BusinessTZListTokens; std::map BusinessTZListMediatype; std::map BusinessTZListPref; std::map BusinessGeographyList; std::map BusinessGeographyListAltID; std::map BusinessGeographyListPID; std::map BusinessGeographyListType; std::map BusinessGeographyListTokens; std::map BusinessGeographyListMediatype; std::map BusinessGeographyListPref; std::map BusinessWebsiteList; std::map BusinessWebsiteListAltID; std::map BusinessWebsiteListPID; std::map BusinessWebsiteListType; std::map BusinessWebsiteListTokens; std::map BusinessWebsiteListMediatype; std::map BusinessWebsiteListPref; std::map BusinessTitleList; std::map BusinessTitleListLanguage; std::map BusinessTitleListAltID; std::map BusinessTitleListPID; std::map BusinessTitleListType; std::map BusinessTitleListTokens; std::map BusinessTitleListPref; std::map BusinessRoleList; std::map BusinessRoleListLanguage; std::map BusinessRoleListAltID; std::map BusinessRoleListPID; std::map BusinessRoleListType; std::map BusinessRoleListTokens; std::map BusinessRoleListPref; std::map BusinessOrganisationsList; std::map BusinessOrganisationsListLanguage; std::map BusinessOrganisationsListAltID; std::map BusinessOrganisationsListPID; std::map BusinessOrganisationsListType; std::map BusinessOrganisationsListTokens; std::map BusinessOrganisationsListSortAs; std::map BusinessOrganisationsListPref; std::map BusinessNoteList; std::map BusinessNoteListLanguage; std::map BusinessNoteListAltID; std::map BusinessNoteListPID; std::map BusinessNoteListType; std::map BusinessNoteListTokens; std::map BusinessNoteListPref; /* Items on the Categories tab */ std::map CategoriesList; std::map CategoriesListAltID; std::map CategoriesListPID; std::map CategoriesListType; std::map CategoriesListTokens; std::map CategoriesListLanguage; std::map CategoriesListPref; /* Items on the Groups tab */ std::map GroupsList; std::map GroupsListAltID; std::map GroupsListPID; std::map GroupsListType; std::map GroupsListMediaType; std::map GroupsListTokens; std::map GroupsListPref; /* Items on the Pictures tab */ std::map PicturesList; std::map PicturesListAltID; std::map PicturesListPID; std::map PicturesListType; std::map PicturesListPicEncType; std::map PicturesListPictureType; std::map PicturesListTokens; std::map PicturesListMediatype; std::map PicturesListPref; /* Items on the Logos tab */ std::map LogosList; std::map LogosListAltID; std::map LogosListPID; std::map LogosListType; std::map LogosListPicEncType; std::map LogosListPictureType; std::map LogosListTokens; std::map LogosListMediatype; std::map LogosListPref; /* Items on the Sounds tab */ std::map SoundsList; std::map SoundsListAltID; std::map SoundsListPID; std::map SoundsListType; std::map SoundsListAudioEncType; std::map SoundsListAudioType; std::map SoundsListTokens; std::map SoundsListMediatype; std::map SoundsListPref; /* Items on the Calendaring tab */ std::map CalendarList; std::map CalendarListAltID; std::map CalendarListPID; std::map CalendarListType; std::map CalendarListTokens; std::map CalendarListMediatype; std::map CalendarListPref; std::map CalendarRequestList; std::map CalendarRequestListAltID; std::map CalendarRequestListPID; std::map CalendarRequestListType; std::map CalendarRequestListTokens; std::map CalendarRequestListMediatype; std::map CalendarRequestListPref; std::map FreeBusyList; std::map FreeBusyListAltID; std::map FreeBusyListPID; std::map FreeBusyListType; std::map FreeBusyListTokens; std::map FreeBusyListMediatype; std::map FreeBusyListPref; /* Items on the Security tab */ std::map KeyList; std::map KeyListAltID; std::map KeyListPID; std::map KeyListKeyType; std::map KeyListDataType; std::map KeyListDataEncType; std::map KeyListType; std::map KeyListTokens; std::map KeyListPref; /* Items on the Other tab */ std::map VendorList; std::map VendorListPEN; std::map VendorListElement; std::map XTokenList; std::map XTokenListTokens; // Subroutines. ContactLoadStatus LoadFile(wxString Filename); }; void SplitValues(wxString *PropertyLine, std::map *SplitPoints, std::map *SplitLength, int intSize); void CheckType(wxString *PropertySeg1, std::map *SplitPoints, std::map *SplitLength, int *intPrevValue, PropertyType *intType); #endif