#define __CLIENTDATAOBJECT_H__
#include <wx/wx.h>
+#include <wx/file.h>
#include <map>
+#include <wx/tokenzr.h>
+
+#include "../vcard/vcard.h"
+#include "../common/textprocessing.h"
enum ContactLoadStatus{
CONTACTLOAD_UNITTESTFAIL = -1,
- CONTACTLOAD_FILEMISSING
+ 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 ProcessRevision(wxString PropertySeg1, wxString PropertySeg2);
+ void ProcessSource(wxString PropertySeg1, wxString PropertySeg2, int *SourceCount);
+ void ProcessXML(wxString PropertySeg1, wxString PropertySeg2, int *XMLCount);
+ void ProcessMember(wxString PropertySeg1, wxString PropertySeg2, int *GroupCount);
+ void ProcessFN(wxString PropertySeg1, wxString PropertySeg2, int *FNCount);
+ void ProcessN(wxString PropertySeg1, wxString PropertySeg2);
+ void ProcessClientPIDMap(wxString PropertySeg1, wxString PropertySeg2, int *ClientPIDCount);
+ 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);
+ void ProcessLogo(wxString PropertySeg1, wxString PropertySeg2, int *LogoCount);
+ void ProcessSound(wxString PropertySeg1, wxString PropertySeg2, int *SoundCount);
+ void ProcessCalendarURI(wxString PropertySeg1, wxString PropertySeg2, int *CalAdrCount);
+ void ProcessCalendarAddressURI(wxString PropertySeg1, wxString PropertySeg2, int *CalAdrURICount);
+ void ProcessCalendarFreeBusy(wxString PropertySeg1, wxString PropertySeg2, int *FreeBusyAddressCount);
+ void ProcessKey(wxString PropertySeg1, wxString PropertySeg2, int *KeyCount);
+ void ProcessVendor(wxString PropertySeg1, wxString PropertySeg2, int *VendorCount);
+
public:
+ ContactKindType ContactKind = CONTACTKIND_NONE;
+
/* Items on General Tab */
wxString NameTitle;
wxString GenderTokens;
wxString UIDToken;
+ wxString Revision;
+ wxString RevisionTokens;
+
+ std::map<int, wxString> SourceList;
+ std::map<int, wxString> SourceListAltID;
+ std::map<int, wxString> SourceListPID;
+ std::map<int, wxString> SourceListType;
+ std::map<int, wxString> SourceListTokens;
+ std::map<int, wxString> SourceListMediatype;
+ std::map<int, int> SourceListPref;
+
+ std::map<int, wxString> XMLList;
+ std::map<int, wxString> XMLListAltID;
+
+ std::map<int, wxString> ClientPIDList;
+ std::map<int, wxString> ClientPIDListTokens;
/* We don't use these at the moment but we want to keep
them for compatability reasons */
std::map<int, wxString> GeneralTelephoneListPID;
std::map<int, wxString> GeneralTelephoneListType;
std::map<int, wxString> GeneralTelephoneListTokens;
+ std::map<int, wxString> GeneralTelephoneListTypeInfo;
std::map<int, int> GeneralTelephoneListPref;
std::map<int, wxString> GeneralLanguageList;
std::map<int, wxString> HomeTelephoneListPID;
std::map<int, wxString> HomeTelephoneListType;
std::map<int, wxString> HomeTelephoneListTokens;
+ std::map<int, wxString> HomeTelephoneListTypeInfo;
std::map<int, int> HomeTelephoneListPref;
std::map<int, wxString> HomeLanguageList;
std::map<int, wxString> HomeGeographyListMediatype;
std::map<int, int> HomeGeographyListPref;
- std::map<int, wxString> HomeRelatedList;
- std::map<int, wxString> HomeRelatedListRelType;
- std::map<int, wxString> HomeRelatedListLanguage;
- std::map<int, wxString> HomeRelatedListAltID;
- std::map<int, wxString> HomeRelatedListPID;
- std::map<int, wxString> HomeRelatedListType;
- std::map<int, wxString> HomeRelatedListTokens;
- std::map<int, int> HomeRelatedListPref;
-
std::map<int, wxString> HomeWebsiteList;
std::map<int, wxString> HomeWebsiteListAltID;
std::map<int, wxString> HomeWebsiteListPID;
std::map<int, wxString> BusinessTelephoneListAltID;
std::map<int, wxString> BusinessTelephoneListPID;
std::map<int, wxString> BusinessTelephoneListType;
+ std::map<int, wxString> BusinessTelephoneListTypeInfo;
std::map<int, wxString> BusinessTelephoneListTokens;
std::map<int, int> BusinessTelephoneListPref;
std::map<int, wxString> BusinessGeographyListType;
std::map<int, wxString> BusinessGeographyListTokens;
std::map<int, wxString> BusinessGeographyListMediatype;
- std::map<int, int> BusinessGeographyListPref;
-
- std::map<int, wxString> BusinessRelatedList;
- std::map<int, wxString> BusinessRelatedListRelType;
- std::map<int, wxString> BusinessRelatedListLanguage;
- std::map<int, wxString> BusinessRelatedListAltID;
- std::map<int, wxString> BusinessRelatedListPID;
- std::map<int, wxString> BusinessRelatedListType;
- std::map<int, wxString> BusinessRelatedListTokens;
- std::map<int, int> BusinessRelatedListPref;
+ std::map<int, int> BusinessGeographyListPref;
std::map<int, wxString> BusinessWebsiteList;
std::map<int, wxString> BusinessWebsiteListAltID;
std::map<int, wxString> CategoriesListPID;
std::map<int, wxString> CategoriesListType;
std::map<int, wxString> CategoriesListTokens;
+ std::map<int, wxString> CategoriesListLanguage;
std::map<int, int> CategoriesListPref;
/* Items on the Groups tab */
std::map<int, wxString> GroupsListAltID;
std::map<int, wxString> GroupsListPID;
std::map<int, wxString> GroupsListType;
+ std::map<int, wxString> GroupsListMediaType;
std::map<int, wxString> GroupsListTokens;
std::map<int, int> GroupsListPref;
std::map<int, wxString> SoundsListAudioEncType;
std::map<int, wxString> SoundsListAudioType;
std::map<int, wxString> SoundsListTokens;
- std::map<int, wxString> SoundsListMediatype;
+ std::map<int, wxString> SoundsListMediatype;
+ std::map<int, wxString> SoundsListLanguage;
std::map<int, int> SoundsListPref;
/* Items on the Calendaring tab */
};
+void SplitValues(wxString *PropertyLine,
+ std::map<int,int> *SplitPoints,
+ std::map<int,int> *SplitLength,
+ int intSize);
+
+void CheckType(wxString *PropertySeg1,
+ std::map<int,int> *SplitPoints,
+ std::map<int,int> *SplitLength,
+ int *intPrevValue,
+ PropertyType *intType);
+
+void ProcessIntegerValue(wxString *PropertyName,
+ wxString PropertyNameMatch,
+ std::map<int,int> *PrefPtr,
+ wxString *PropertyValue,
+ int *ItemCount,
+ bool *PropertyMatched);
+
+void ProcessIntegerValue(std::map<int,int> *PrefPtr,
+ wxString *PropertyValue,
+ int *ItemCount);
+
+void ProcessStringValue(wxString *PropertyName,
+ wxString PropertyNameMatch,
+ std::map<int,wxString> *MapPtr,
+ wxString *PropertyValue,
+ int *ItemCount,
+ bool *PropertyMatched);
+
#endif
\ No newline at end of file