Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added extra unit tests for CATEGORIES and begun work on the PHOTO vCard property.
[xestiaab/.git] / source / contacteditor / ContactDataObject.h
index 050bd53..48c7182 100644 (file)
@@ -25,6 +25,7 @@
 #include <wx/tokenzr.h>
 
 #include "../vcard/vcard.h"
+#include "../common/textprocessing.h"
 
 enum ContactLoadStatus{
        CONTACTLOAD_UNITTESTFAIL = -1,
@@ -35,10 +36,52 @@ enum ContactLoadStatus{
        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;
@@ -125,6 +168,7 @@ class ContactDataObject{
        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;
@@ -246,6 +290,7 @@ class ContactDataObject{
        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;
@@ -271,15 +316,6 @@ class ContactDataObject{
        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;
@@ -366,6 +402,7 @@ class ContactDataObject{
        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;
        
@@ -390,16 +427,7 @@ class ContactDataObject{
        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;
@@ -449,6 +477,7 @@ class ContactDataObject{
        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 */
@@ -457,6 +486,7 @@ class ContactDataObject{
        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;
        
@@ -549,4 +579,15 @@ class ContactDataObject{
 
 };
 
+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);
+
 #endif
\ 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