X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2Fcdo%2FContactDataObject.cpp;h=c017406e7eff2e095d8d3fc72c6b582c732af6cb;hb=6dcb2ed929d861d7ca12bd2f646392b2dfaa9a51;hp=7a19c0e6c783088ecb45d3520758ae28ae371cd5;hpb=e84fab463acd898067e17d83b748dc365fd9a8d0;p=xestiaab%2F.git diff --git a/source/contacteditor/cdo/ContactDataObject.cpp b/source/contacteditor/cdo/ContactDataObject.cpp index 7a19c0e..c017406 100644 --- a/source/contacteditor/cdo/ContactDataObject.cpp +++ b/source/contacteditor/cdo/ContactDataObject.cpp @@ -1,6 +1,6 @@ // ContactDataObject.cpp - Client Data Object. // -// (c) 2012-2015 Xestia Software Development. +// (c) 2012-2016 Xestia Software Development. // // This file is part of Xestia Address Book. // @@ -20,6 +20,8 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ + // Load the ContactDataObject using the Filename given. + if (!wxFileExists(Filename)){ return CONTACTLOAD_FILEMISSING; @@ -375,13 +377,6 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ ProcessLogo(PropertySeg1, PropertySeg2, &LogoCount); LogoCount++; - } else if (Property == wxT("LOGO")) { - - // See frmContactEditor-LoadPhoto.cpp - - ProcessLogo(PropertySeg1, PropertySeg2, &LogoCount); - LogoCount++; - } else if (Property == wxT("SOUND")) { // See frmContactEditor-LoadSound.cpp @@ -436,6 +431,8 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ void ContactDataObject::ProcessKind(wxString KindType){ + // Process the type of contact. + if (KindType == wxT("individual")){ ContactKind = CONTACTKIND_INDIVIDUAL; @@ -461,6 +458,8 @@ void ContactDataObject::ProcessKind(wxString KindType){ void ContactDataObject::ProcessRevision(wxString PropertySeg1, wxString PropertySeg2){ + // Process the revision date. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -524,6 +523,8 @@ void ContactDataObject::ProcessRevision(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessSource(wxString PropertySeg1, wxString PropertySeg2, int *SourceCount){ + // Process the source address. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -630,6 +631,8 @@ void ContactDataObject::ProcessSource(wxString PropertySeg1, wxString PropertySe void ContactDataObject::ProcessXML(wxString PropertySeg1, wxString PropertySeg2, int *XMLCount){ + // Process the XML data. + std::map SplitPoints; std::map SplitLength; @@ -674,6 +677,8 @@ void ContactDataObject::ProcessXML(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySeg2, int *GroupCount){ + // Process the membership data. + std::map SplitPoints; std::map SplitLength; @@ -730,6 +735,8 @@ void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, int *FNCount){ + // Process the full name. + std::map SplitPoints; std::map SplitLength; @@ -799,6 +806,8 @@ void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessN(wxString PropertySeg1, wxString PropertySeg2){ + // Process the name. + std::map SplitPoints; std::map SplitLength; @@ -938,6 +947,8 @@ void ContactDataObject::ProcessN(wxString PropertySeg1, wxString PropertySeg2){ void ContactDataObject::ProcessClientPIDMap(wxString PropertySeg1, wxString PropertySeg2, int *ClientPIDCount){ + // Process the Client PID Map. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -985,6 +996,8 @@ void ContactDataObject::ProcessClientPIDMap(wxString PropertySeg1, wxString Prop void ContactDataObject::ProcessNickname(wxString PropertySeg1, wxString PropertySeg2, int *NicknameCount){ + // Process the Nickname. + std::map SplitPoints; std::map SplitLength; @@ -1088,6 +1101,8 @@ void ContactDataObject::ProcessNickname(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessGender(wxString PropertySeg1, wxString PropertySeg2){ + // Process the gender. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -1158,7 +1173,7 @@ void ContactDataObject::ProcessGender(wxString PropertySeg1, wxString PropertySe void ContactDataObject::ProcessBirthday(wxString PropertySeg1, wxString PropertySeg2){ - // Process date. Preserve the remainder in the string. + // Process birthday date. std::map SplitPoints; std::map SplitLength; @@ -1167,7 +1182,6 @@ void ContactDataObject::ProcessBirthday(wxString PropertySeg1, wxString Property wxString PropertyName; wxString PropertyValue; wxString PropertyTokens; - bool BirthdayText = FALSE; int intPrevValue = 6; SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue); @@ -1261,7 +1275,7 @@ void ContactDataObject::ProcessBirthday(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessAnniversary(wxString PropertySeg1, wxString PropertySeg2){ - // Process date. Preserve the remainder in the string. + // Process the anniversary. std::map SplitPoints; std::map SplitLength; @@ -1270,7 +1284,6 @@ void ContactDataObject::ProcessAnniversary(wxString PropertySeg1, wxString Prope wxString PropertyName; wxString PropertyValue; wxString PropertyTokens; - bool AnniversaryText = FALSE; int intPrevValue = 13; SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue); @@ -1364,6 +1377,8 @@ void ContactDataObject::ProcessAnniversary(wxString PropertySeg1, wxString Prope void ContactDataObject::ProcessTimeZone(wxString PropertySeg1, wxString PropertySeg2, int *TimeZoneCount){ + // Process the timezone. + std::map SplitPoints; std::map SplitLength; @@ -1472,6 +1487,8 @@ void ContactDataObject::ProcessTimeZone(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessAddress(wxString PropertySeg1, wxString PropertySeg2, int *AddressCount){ + // Process the address. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -1595,7 +1612,15 @@ void ContactDataObject::ProcessAddress(wxString PropertySeg1, wxString PropertyS ProcessNameValue(&PropertyData, &PropertyName, &PropertyValue); intPrevValue = intiter->second; - CaptureString(&PropertyValue, FALSE); + if (PropertyName == "GEO"){ + + CaptureString(&PropertyValue, TRUE); + + } else { + + CaptureString(&PropertyValue, FALSE); + + } // Process properties. @@ -1763,6 +1788,8 @@ void ContactDataObject::ProcessAddress(wxString PropertySeg1, wxString PropertyS void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg2, int *EmailCount){ + // Process the email address. + std::map SplitPoints; std::map SplitLength; @@ -1864,6 +1891,8 @@ void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, int *IMCount){ + // Process the IM. + std::map SplitPoints; std::map SplitLength; @@ -1884,7 +1913,8 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, std::map *IMListAltID = NULL; std::map *IMListPID = NULL; std::map *IMListTokens = NULL; - std::map *IMListMediatype = NULL; + std::map *IMListMediatype = NULL; + std::map *IMListTypeInfo = NULL; std::map *IMListPref = NULL; switch(PropType){ @@ -1895,6 +1925,7 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, IMListPID = &GeneralIMListPID; IMListTokens = &GeneralIMListTokens; IMListMediatype = &GeneralIMListMediatype; + IMListTypeInfo = &GeneralIMListTypeInfo; IMListPref = &GeneralIMListPref; break; case PROPERTY_HOME: @@ -1903,7 +1934,8 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, IMListAltID = &HomeIMListAltID; IMListPID = &HomeIMListPID; IMListTokens = &HomeIMListTokens; - IMListMediatype = &HomeIMListMediatype; + IMListMediatype = &HomeIMListMediatype; + IMListTypeInfo = &HomeIMListTypeInfo; IMListPref = &HomeIMListPref; break; case PROPERTY_WORK: @@ -1912,7 +1944,8 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, IMListAltID = &BusinessIMListAltID; IMListPID = &BusinessIMListPID; IMListTokens = &BusinessIMListTokens; - IMListMediatype = &BusinessIMListMediatype; + IMListMediatype = &BusinessIMListMediatype; + IMListTypeInfo = &BusinessIMListTypeInfo; IMListPref = &BusinessIMListPref; break; } @@ -1955,7 +1988,19 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, } - IMList->insert(std::make_pair(*IMCount, PropertySeg2)); + wxStringTokenizer IMPPSplitData(PropertySeg2, wxT(":")); + + if (IMPPSplitData.CountTokens() > 1){ + + IMListTypeInfo->insert(std::make_pair(*IMCount, IMPPSplitData.GetNextToken())); + IMList->insert(std::make_pair(*IMCount, IMPPSplitData.GetString())); + + } else { + + IMList->insert(std::make_pair(*IMCount, PropertySeg2)); + IMListTypeInfo->insert(std::make_pair(*IMCount, "none")); + + } // Add the name token data. @@ -1969,6 +2014,8 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString PropertySeg2, int *TelephoneCount){ + // Process the telephone. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -2067,10 +2114,11 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize)); int intTypeSeek = 0; + bool TypeFound = FALSE; for (std::map::iterator typeiter = TypeSplitPoints.begin(); typeiter != TypeSplitPoints.end(); ++typeiter){ - + wxString TypePropertyName; TSLiter = TypeSplitLength.find(typeiter->first); @@ -2085,18 +2133,23 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert TelTypeUI.Append(wxT(",")); } - - if (TypePropertyName == wxT("home")){ + + if (TypePropertyName == wxT("home") && TypeFound == FALSE){ PropType = PROPERTY_HOME; + TelTypeUI.Append("home"); + intTypeSeek++; + TypeFound = TRUE; - } else if (TypePropertyName == wxT("work")){ + } else if (TypePropertyName == wxT("work") && TypeFound == FALSE){ PropType = PROPERTY_WORK; - + TelTypeUI.Append("work"); + intTypeSeek++; + TypeFound = TRUE; + } - if (TypePropertyName == wxT("text")){ TelTypeUI.Append(_("text")); @@ -2114,7 +2167,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert } else if (TypePropertyName == wxT("cell")){ - TelTypeUI.Append(_("mobile")); + TelTypeUI.Append(_("cell")); intTypeSeek++; } else if (TypePropertyName == wxT("video")){ @@ -2145,7 +2198,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert std::map *TelephoneListAltID = NULL; std::map *TelephoneListPID = NULL; std::map *TelephoneListTokens = NULL; - std::map *TelephoneListTypeInfo = NULL; + std::map *TelephoneListTypeInfo = NULL; + std::map *TelephoneListDataType = NULL; std::map *TelephoneListPref = NULL; switch(PropType){ @@ -2156,6 +2210,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert TelephoneListPID = &GeneralTelephoneListPID; TelephoneListTokens = &GeneralTelephoneListTokens; TelephoneListTypeInfo = &GeneralTelephoneListTypeInfo; + TelephoneListDataType = &GeneralTelephoneListDataType; TelephoneListPref = &GeneralTelephoneListPref; break; case PROPERTY_HOME: @@ -2164,7 +2219,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert TelephoneListAltID = &HomeTelephoneListAltID; TelephoneListPID = &HomeTelephoneListPID; TelephoneListTokens = &HomeTelephoneListTokens; - TelephoneListTypeInfo = &HomeTelephoneListTypeInfo; + TelephoneListTypeInfo = &HomeTelephoneListTypeInfo; + TelephoneListDataType = &HomeTelephoneListDataType; TelephoneListPref = &HomeTelephoneListPref; break; case PROPERTY_WORK: @@ -2173,7 +2229,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert TelephoneListAltID = &BusinessTelephoneListAltID; TelephoneListPID = &BusinessTelephoneListPID; TelephoneListTokens = &BusinessTelephoneListTokens; - TelephoneListTypeInfo = &BusinessTelephoneListTypeInfo; + TelephoneListTypeInfo = &BusinessTelephoneListTypeInfo; + TelephoneListDataType = &BusinessTelephoneListDataType; TelephoneListPref = &BusinessTelephoneListPref; break; } @@ -2219,9 +2276,24 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert } - TelephoneList->insert(std::make_pair(*TelephoneCount, PropertySeg2)); - TelephoneListTypeInfo->insert(std::make_pair(*TelephoneCount, TelTypeUI)); + // Check for the type information and split it down. + wxStringTokenizer TelSplitData(PropertySeg2, wxT(":")); + + if (TelSplitData.CountTokens() > 1){ + + TelephoneListDataType->insert(std::make_pair(*TelephoneCount, TelSplitData.GetNextToken())); + TelephoneList->insert(std::make_pair(*TelephoneCount, TelSplitData.GetString())); + + } else { + + TelephoneList->insert(std::make_pair(*TelephoneCount, PropertySeg2)); + TelephoneListDataType->insert(std::make_pair(*TelephoneCount, "tel")); + + } + + TelephoneListTypeInfo->insert(std::make_pair(*TelephoneCount, TelTypeUI)); + // Add the name token data. if (!PropertyTokens.IsEmpty()){ @@ -2234,6 +2306,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString PropertySeg2, int *LanguageCount){ + // Process the language. + std::map SplitPoints; std::map SplitLength; @@ -2334,6 +2408,8 @@ void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString PropertySeg2, int *GeographicCount){ + // Process the geographic location. + std::map SplitPoints; std::map SplitLength; @@ -2355,6 +2431,7 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper std::map *GeopositionListPID = NULL; std::map *GeopositionListTokens = NULL; std::map *GeopositionListMediatype = NULL; + std::map *GeopositionListDataType = NULL; std::map *GeopositionListPref = NULL; switch(PropType){ @@ -2365,6 +2442,7 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper GeopositionListPID = &GeneralGeographyListPID; GeopositionListTokens = &GeneralGeographyListTokens; GeopositionListMediatype = &GeneralGeographyListMediatype; + GeopositionListDataType = &GeneralGeographyListDataType; GeopositionListPref = &GeneralGeographyListPref; break; case PROPERTY_HOME: @@ -2374,6 +2452,7 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper GeopositionListPID = &HomeGeographyListPID; GeopositionListTokens = &HomeGeographyListTokens; GeopositionListMediatype = &HomeGeographyListMediatype; + GeopositionListDataType = &HomeGeographyListDataType; GeopositionListPref = &HomeGeographyListPref; break; case PROPERTY_WORK: @@ -2382,7 +2461,8 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper GeopositionListAltID = &BusinessGeographyListAltID; GeopositionListPID = &BusinessGeographyListPID; GeopositionListTokens = &BusinessGeographyListTokens; - GeopositionListMediatype = &BusinessGeographyListMediatype; + GeopositionListMediatype = &BusinessGeographyListMediatype; + GeopositionListDataType = &BusinessGeographyListDataType; GeopositionListPref = &BusinessGeographyListPref; break; } @@ -2424,9 +2504,21 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper ProcessTokens(&PropertyName, &PropertyValue, &PropertyTokens, &FirstToken); } + + wxStringTokenizer GeoSplitData(PropertySeg2, wxT(":")); - GeopositionList->insert(std::make_pair(*GeographicCount, PropertySeg2)); + if (GeoSplitData.CountTokens() > 1){ + + GeopositionListDataType->insert(std::make_pair(*GeographicCount, GeoSplitData.GetNextToken())); + GeopositionList->insert(std::make_pair(*GeographicCount, GeoSplitData.GetString())); + + } else { + GeopositionList->insert(std::make_pair(*GeographicCount, PropertySeg2)); + GeopositionListDataType->insert(std::make_pair(*GeographicCount, "tel")); + + } + // Add the name token data. if (!PropertyTokens.IsEmpty()){ @@ -2439,6 +2531,8 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper void ContactDataObject::ProcessRelated(wxString PropertySeg1, wxString PropertySeg2, int *RelatedCount){ + // Process the relation. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -2627,6 +2721,8 @@ void ContactDataObject::ProcessRelated(wxString PropertySeg1, wxString PropertyS void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2, int *URLCount){ + // Process the URL. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -2751,6 +2847,8 @@ void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg2, int *TitleCount){ + // Process the title. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -2875,6 +2973,8 @@ void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2, int *RoleCount){ + // Process the role. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -2999,6 +3099,8 @@ void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2 void ContactDataObject::ProcessOrganisation(wxString PropertySeg1, wxString PropertySeg2, int *OrganisationCount){ + // Process the organisation. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -3128,6 +3230,8 @@ void ContactDataObject::ProcessOrganisation(wxString PropertySeg1, wxString Prop void ContactDataObject::ProcessNote(wxString PropertySeg1, wxString PropertySeg2, int *NoteCount){ + // Process the note. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -3252,6 +3356,8 @@ void ContactDataObject::ProcessNote(wxString PropertySeg1, wxString PropertySeg2 void ContactDataObject::ProcessCategory(wxString PropertySeg1, wxString PropertySeg2, int *CategoryCount){ + // Process the category. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -3502,6 +3608,8 @@ void ContactDataObject::ProcessCategory(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg2, int *PhotoCount){ + // Process the photo. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -3670,6 +3778,8 @@ void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2, int *LogoCount){ + // Process the logo. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -3812,7 +3922,7 @@ void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2 } // Add the data to the General/Home/Work address variables. - + LogosList.insert(std::make_pair(*LogoCount, base64enc)); LogosListPictureType.insert(std::make_pair(*LogoCount, wxSPhotoMIME)); LogosListPicEncType.insert(std::make_pair(*LogoCount, wxSPhotoEncoding)); @@ -3838,6 +3948,8 @@ void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2 void ContactDataObject::ProcessSound(wxString PropertySeg1, wxString PropertySeg2, int *SoundCount){ + // Process the sound. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4007,6 +4119,8 @@ void ContactDataObject::ProcessSound(wxString PropertySeg1, wxString PropertySeg void ContactDataObject::ProcessCalendarURI(wxString PropertySeg1, wxString PropertySeg2, int *CalURICount){ + // Process the calendar URI. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4110,6 +4224,8 @@ void ContactDataObject::ProcessCalendarURI(wxString PropertySeg1, wxString Prope void ContactDataObject::ProcessCalendarAddressURI(wxString PropertySeg1, wxString PropertySeg2, int *CalAdrURICount){ + // Process the calendar address URI. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4213,6 +4329,8 @@ void ContactDataObject::ProcessCalendarAddressURI(wxString PropertySeg1, wxStrin void ContactDataObject::ProcessCalendarFreeBusy(wxString PropertySeg1, wxString PropertySeg2, int *FreeBusyAddressCount){ + // Process the calendar free busy URL. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4316,6 +4434,8 @@ void ContactDataObject::ProcessCalendarFreeBusy(wxString PropertySeg1, wxString void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2, int *KeyCount){ + // Process the key. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4497,6 +4617,8 @@ void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySeg2, int *VendorCount){ + // Process the vendor information. + // Split the Vendor three ways. wxStringTokenizer wSTVendorDetails(PropertySeg1, wxT("-")); @@ -4529,10 +4651,518 @@ void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySe } +void ContactDataObject::ClearData(){ + + // Clear the contact information. + + NameTitle.clear(); + NameForename.clear(); + NameSurname.clear(); + NameOtherNames.clear(); + NameSuffix.clear(); + NameNickname.clear(); + NameDisplayAs.clear(); + NameLanguage.clear(); + NameAltID.clear(); + NameTokens.clear(); + + Birthday.clear(); + BirthdayAltID.clear(); + BirthdayCalScale.clear(); + BirthdayTokens.clear(); + Anniversary.clear(); + AnniversaryAltID.clear(); + AnniversaryCalScale.clear(); + AnniversaryTokens.clear(); + + Gender.clear(); + GenderDetails.clear(); + GenderTokens.clear(); + + UIDToken.clear(); + Revision.clear(); + RevisionTokens.clear(); + + SourceList.clear(); + SourceListAltID.clear(); + SourceListPID.clear(); + SourceListType.clear(); + SourceListTokens.clear(); + SourceListMediatype.clear(); + SourceListPref.clear(); + + XMLList.clear(); + XMLListAltID.clear(); + + ClientPIDList.clear(); + ClientPIDListTokens.clear(); + + FullNamesList.clear(); + FullNamesListType.clear(); + FullNamesListLanguage.clear(); + FullNamesListAltID.clear(); + FullNamesListPID.clear(); + FullNamesListTokens.clear(); + FullNamesListPref.clear(); + + GeneralNicknamesList.clear(); + GeneralNicknamesListType.clear(); + GeneralNicknamesListLanguage.clear(); + GeneralNicknamesListAltID.clear(); + GeneralNicknamesListPID.clear(); + GeneralNicknamesListTokens.clear(); + GeneralNicknamesListPref.clear(); + + GeneralAddressList.clear(); + GeneralAddressListTown.clear(); + GeneralAddressListCounty.clear(); + GeneralAddressListPostCode.clear(); + GeneralAddressListCountry.clear(); + GeneralAddressListLabel.clear(); + GeneralAddressListLang.clear(); + GeneralAddressListAltID.clear(); + GeneralAddressListPID.clear(); + GeneralAddressListTokens.clear(); + GeneralAddressListGeo.clear(); + GeneralAddressListTimezone.clear(); + GeneralAddressListType.clear(); + GeneralAddressListMediatype.clear(); + GeneralAddressListPref.clear(); + + GeneralEmailList.clear(); + GeneralEmailListAltID.clear(); + GeneralEmailListPID.clear(); + GeneralEmailListType.clear(); + GeneralEmailListTokens.clear(); + GeneralEmailListPref.clear(); + + GeneralIMList.clear(); + GeneralIMListAltID.clear(); + GeneralIMListPID.clear(); + GeneralIMListType.clear(); + GeneralIMListTypeInfo.clear(); + GeneralIMListTokens.clear(); + GeneralIMListMediatype.clear(); + GeneralIMListPref.clear(); + + GeneralTelephoneList.clear(); + GeneralTelephoneListAltID.clear(); + GeneralTelephoneListPID.clear(); + GeneralTelephoneListType.clear(); + GeneralTelephoneListTokens.clear(); + GeneralTelephoneListTypeInfo.clear(); + GeneralTelephoneListPref.clear(); + + GeneralLanguageList.clear(); + GeneralLanguageListAltID.clear(); + GeneralLanguageListPID.clear(); + GeneralLanguageListType.clear(); + GeneralLanguageListTokens.clear(); + GeneralLanguageListPref.clear(); + + GeneralTZList.clear(); + GeneralTZListAltID.clear(); + GeneralTZListPID.clear(); + GeneralTZListType.clear(); + GeneralTZListTokens.clear(); + GeneralTZListMediatype.clear(); + GeneralTZListPref.clear(); + + GeneralGeographyList.clear(); + GeneralGeographyListAltID.clear(); + GeneralGeographyListPID.clear(); + GeneralGeographyListType.clear(); + GeneralGeographyListTokens.clear(); + GeneralGeographyListMediatype.clear(); + GeneralGeographyListPref.clear(); + + GeneralRelatedList.clear(); + GeneralRelatedListRelType.clear(); + GeneralRelatedListLanguage.clear(); + GeneralRelatedListAltID.clear(); + GeneralRelatedListPID.clear(); + GeneralRelatedListType.clear(); + GeneralRelatedListTokens.clear(); + GeneralRelatedListPref.clear(); + + GeneralWebsiteList.clear(); + GeneralWebsiteListAltID.clear(); + GeneralWebsiteListPID.clear(); + GeneralWebsiteListType.clear(); + GeneralWebsiteListTokens.clear(); + GeneralWebsiteListMediatype.clear(); + GeneralWebsiteListPref.clear(); + + GeneralTitleList.clear(); + GeneralTitleListLanguage.clear(); + GeneralTitleListAltID.clear(); + GeneralTitleListPID.clear(); + GeneralTitleListType.clear(); + GeneralTitleListTokens.clear(); + GeneralTitleListPref.clear(); + + GeneralRoleList.clear(); + GeneralRoleListLanguage.clear(); + GeneralRoleListAltID.clear(); + GeneralRoleListPID.clear(); + GeneralRoleListType.clear(); + GeneralRoleListTokens.clear(); + GeneralRoleListPref.clear(); + + GeneralOrganisationsList.clear(); + GeneralOrganisationsListLanguage.clear(); + GeneralOrganisationsListAltID.clear(); + GeneralOrganisationsListPID.clear(); + GeneralOrganisationsListType.clear(); + GeneralOrganisationsListTokens.clear(); + GeneralOrganisationsListSortAs.clear(); + GeneralOrganisationsListPref.clear(); + + GeneralNoteList.clear(); + GeneralNoteListLanguage.clear(); + GeneralNoteListAltID.clear(); + GeneralNoteListPID.clear(); + GeneralNoteListType.clear(); + GeneralNoteListTokens.clear(); + GeneralNoteListPref.clear(); + + /* Items on Home Tab */ + + HomeNicknamesList.clear(); + HomeNicknamesListType.clear(); + HomeNicknamesListLanguage.clear(); + HomeNicknamesListAltID.clear(); + HomeNicknamesListPID.clear(); + HomeNicknamesListTokens.clear(); + HomeNicknamesListPref.clear(); + + HomeAddressList.clear(); + HomeAddressListTown.clear(); + HomeAddressListCounty.clear(); + HomeAddressListPostCode.clear(); + HomeAddressListCountry.clear(); + HomeAddressListLabel.clear(); + HomeAddressListLang.clear(); + HomeAddressListAltID.clear(); + HomeAddressListPID.clear(); + HomeAddressListTokens.clear(); + HomeAddressListGeo.clear(); + HomeAddressListTimezone.clear(); + HomeAddressListType.clear(); + HomeAddressListMediatype.clear(); + HomeAddressListPref.clear(); + + HomeEmailList.clear(); + HomeEmailListAltID.clear(); + HomeEmailListPID.clear(); + HomeEmailListType.clear(); + HomeEmailListTokens.clear(); + HomeEmailListPref.clear(); + + HomeIMList.clear(); + HomeIMListAltID.clear(); + HomeIMListPID.clear(); + HomeIMListType.clear(); + HomeIMListTypeInfo.clear(); + HomeIMListTokens.clear(); + HomeIMListMediatype.clear(); + HomeIMListPref.clear(); + + HomeTelephoneList.clear(); + HomeTelephoneListAltID.clear(); + HomeTelephoneListPID.clear(); + HomeTelephoneListType.clear(); + HomeTelephoneListTokens.clear(); + HomeTelephoneListTypeInfo.clear(); + HomeTelephoneListPref.clear(); + + HomeLanguageList.clear(); + HomeLanguageListAltID.clear(); + HomeLanguageListPID.clear(); + HomeLanguageListType.clear(); + HomeLanguageListTokens.clear(); + HomeLanguageListPref.clear(); + + HomeTZList.clear(); + HomeTZListAltID.clear(); + HomeTZListPID.clear(); + HomeTZListType.clear(); + HomeTZListTokens.clear(); + HomeTZListMediatype.clear(); + HomeTZListPref.clear(); + + HomeGeographyList.clear(); + HomeGeographyListAltID.clear(); + HomeGeographyListPID.clear(); + HomeGeographyListType.clear(); + HomeGeographyListTokens.clear(); + HomeGeographyListMediatype.clear(); + HomeGeographyListPref.clear(); + + HomeWebsiteList.clear(); + HomeWebsiteListAltID.clear(); + HomeWebsiteListPID.clear(); + HomeWebsiteListType.clear(); + HomeWebsiteListTokens.clear(); + HomeWebsiteListMediatype.clear(); + HomeWebsiteListPref.clear(); + + HomeTitleList.clear(); + HomeTitleListLanguage.clear(); + HomeTitleListAltID.clear(); + HomeTitleListPID.clear(); + HomeTitleListType.clear(); + HomeTitleListTokens.clear(); + HomeTitleListPref.clear(); + + HomeRoleList.clear(); + HomeRoleListLanguage.clear(); + HomeRoleListAltID.clear(); + HomeRoleListPID.clear(); + HomeRoleListType.clear(); + HomeRoleListTokens.clear(); + HomeRoleListPref.clear(); + + HomeOrganisationsList.clear(); + HomeOrganisationsListLanguage.clear(); + HomeOrganisationsListAltID.clear(); + HomeOrganisationsListPID.clear(); + HomeOrganisationsListType.clear(); + HomeOrganisationsListTokens.clear(); + HomeOrganisationsListSortAs.clear(); + HomeOrganisationsListPref.clear(); + + HomeNoteList.clear(); + HomeNoteListLanguage.clear(); + HomeNoteListAltID.clear(); + HomeNoteListPID.clear(); + HomeNoteListType.clear(); + HomeNoteListTokens.clear(); + HomeNoteListPref.clear(); + + /* Items on the Business tab */ + + BusinessNicknamesList.clear(); + BusinessNicknamesListType.clear(); + BusinessNicknamesListLanguage.clear(); + BusinessNicknamesListAltID.clear(); + BusinessNicknamesListPID.clear(); + BusinessNicknamesListTokens.clear(); + BusinessNicknamesListPref.clear(); + + BusinessAddressList.clear(); + BusinessAddressListTown.clear(); + BusinessAddressListCounty.clear(); + BusinessAddressListPostCode.clear(); + BusinessAddressListCountry.clear(); + BusinessAddressListLabel.clear(); + BusinessAddressListLang.clear(); + BusinessAddressListAltID.clear(); + BusinessAddressListPID.clear(); + BusinessAddressListTokens.clear(); + BusinessAddressListGeo.clear(); + BusinessAddressListTimezone.clear(); + BusinessAddressListType.clear(); + BusinessAddressListMediatype.clear(); + BusinessAddressListPref.clear(); + + BusinessEmailList.clear(); + BusinessEmailListAltID.clear(); + BusinessEmailListPID.clear(); + BusinessEmailListType.clear(); + BusinessEmailListTokens.clear(); + BusinessEmailListPref.clear(); + + BusinessIMList.clear(); + BusinessIMListAltID.clear(); + BusinessIMListPID.clear(); + BusinessIMListType.clear(); + BusinessIMListTokens.clear(); + BusinessIMListMediatype.clear(); + BusinessIMListPref.clear(); + + BusinessTelephoneList.clear(); + BusinessTelephoneListAltID.clear(); + BusinessTelephoneListPID.clear(); + BusinessTelephoneListType.clear(); + BusinessTelephoneListTokens.clear(); + BusinessTelephoneListPref.clear(); + + BusinessLanguageList.clear(); + BusinessLanguageListAltID.clear(); + BusinessLanguageListPID.clear(); + BusinessLanguageListType.clear(); + BusinessLanguageListTokens.clear(); + BusinessLanguageListPref.clear(); + + BusinessTZList.clear(); + BusinessTZListAltID.clear(); + BusinessTZListPID.clear(); + BusinessTZListType.clear(); + BusinessTZListTokens.clear(); + BusinessTZListMediatype.clear(); + BusinessTZListPref.clear(); + + BusinessGeographyList.clear(); + BusinessGeographyListAltID.clear(); + BusinessGeographyListPID.clear(); + BusinessGeographyListType.clear(); + BusinessGeographyListTokens.clear(); + BusinessGeographyListMediatype.clear(); + BusinessGeographyListPref.clear(); + + BusinessWebsiteList.clear(); + BusinessWebsiteListAltID.clear(); + BusinessWebsiteListPID.clear(); + BusinessWebsiteListType.clear(); + BusinessWebsiteListTokens.clear(); + BusinessWebsiteListMediatype.clear(); + BusinessWebsiteListPref.clear(); + + BusinessTitleList.clear(); + BusinessTitleListLanguage.clear(); + BusinessTitleListAltID.clear(); + BusinessTitleListPID.clear(); + BusinessTitleListType.clear(); + BusinessTitleListTokens.clear(); + BusinessTitleListPref.clear(); + + BusinessRoleList.clear(); + BusinessRoleListLanguage.clear(); + BusinessRoleListAltID.clear(); + BusinessRoleListPID.clear(); + BusinessRoleListType.clear(); + BusinessRoleListTokens.clear(); + BusinessRoleListPref.clear(); + + BusinessOrganisationsList.clear(); + BusinessOrganisationsListLanguage.clear(); + BusinessOrganisationsListAltID.clear(); + BusinessOrganisationsListPID.clear(); + BusinessOrganisationsListType.clear(); + BusinessOrganisationsListTokens.clear(); + BusinessOrganisationsListSortAs.clear(); + BusinessOrganisationsListPref.clear(); + + BusinessNoteList.clear(); + BusinessNoteListLanguage.clear(); + BusinessNoteListAltID.clear(); + BusinessNoteListPID.clear(); + BusinessNoteListType.clear(); + BusinessNoteListTokens.clear(); + BusinessNoteListPref.clear(); + + /* Items on the Categories tab */ + + CategoriesList.clear(); + CategoriesListAltID.clear(); + CategoriesListPID.clear(); + CategoriesListType.clear(); + CategoriesListTokens.clear(); + CategoriesListLanguage.clear(); + CategoriesListPref.clear(); + + /* Items on the Groups tab */ + + GroupsList.clear(); + GroupsListAltID.clear(); + GroupsListPID.clear(); + GroupsListType.clear(); + GroupsListMediaType.clear(); + GroupsListTokens.clear(); + GroupsListPref.clear(); + + /* Items on the Pictures tab */ + + PicturesList.clear(); + PicturesListAltID.clear(); + PicturesListPID.clear(); + PicturesListType.clear(); + PicturesListPicEncType.clear(); + PicturesListPictureType.clear(); + PicturesListTokens.clear(); + PicturesListMediatype.clear(); + PicturesListPref.clear(); + + /* Items on the Logos tab */ + + LogosList.clear(); + LogosListAltID.clear(); + LogosListPID.clear(); + LogosListType.clear(); + LogosListPicEncType.clear(); + LogosListPictureType.clear(); + LogosListTokens.clear(); + LogosListMediatype.clear(); + LogosListPref.clear(); + + /* Items on the Sounds tab */ + + SoundsList.clear(); + SoundsListAltID.clear(); + SoundsListPID.clear(); + SoundsListType.clear(); + SoundsListAudioEncType.clear(); + SoundsListAudioType.clear(); + SoundsListTokens.clear(); + SoundsListMediatype.clear(); + SoundsListPref.clear(); + + /* Items on the Calendaring tab */ + + CalendarList.clear(); + CalendarListAltID.clear(); + CalendarListPID.clear(); + CalendarListType.clear(); + CalendarListTokens.clear(); + CalendarListMediatype.clear(); + CalendarListPref.clear(); + + CalendarRequestList.clear(); + CalendarRequestListAltID.clear(); + CalendarRequestListPID.clear(); + CalendarRequestListType.clear(); + CalendarRequestListTokens.clear(); + CalendarRequestListMediatype.clear(); + CalendarRequestListPref.clear(); + + FreeBusyList.clear(); + FreeBusyListAltID.clear(); + FreeBusyListPID.clear(); + FreeBusyListType.clear(); + FreeBusyListTokens.clear(); + FreeBusyListMediatype.clear(); + FreeBusyListPref.clear(); + + /* Items on the Security tab */ + + KeyList.clear(); + KeyListAltID.clear(); + KeyListPID.clear(); + KeyListKeyType.clear(); + KeyListDataType.clear(); + KeyListDataEncType.clear(); + KeyListType.clear(); + KeyListTokens.clear(); + KeyListPref.clear(); + + /* Items on the Other tab */ + + VendorList.clear(); + VendorListPEN.clear(); + VendorListElement.clear(); + + XTokenList.clear(); + XTokenListTokens.clear(); + +} + void ProcessNameValue(wxString *PropertyData, wxString *PropertyName, wxString *PropertyValue){ + // Proces the name and value information. + wxStringTokenizer PropertyElement (*PropertyData, wxT("=")); *PropertyName = PropertyElement.GetNextToken(); *PropertyValue = PropertyElement.GetNextToken(); @@ -4544,6 +5174,8 @@ void ProcessTokens(wxString *PropertyName, wxString *PropertyTokens, bool *FirstToken){ + // Process the tokens. + if (!PropertyName->IsEmpty() && !PropertyValue->IsEmpty() && *PropertyName != wxT("TYPE")){ if (*FirstToken == TRUE){ @@ -4568,6 +5200,8 @@ void ProcessStringValue(wxString *PropertyName, int *ItemCount, bool *PropertyMatched){ + // Process the string value. + if (*PropertyName == PropertyNameMatch){ MapPtr->erase(*ItemCount); MapPtr->insert(std::make_pair(*ItemCount, *PropertyValue)); @@ -4583,6 +5217,8 @@ void ProcessIntegerValue(wxString *PropertyName, int *ItemCount, bool *PropertyMatched){ + // Process the integer value. + if (*PropertyName == PropertyNameMatch){ *PropertyMatched = TRUE; } else { @@ -4613,7 +5249,9 @@ void SplitValues(wxString *PropertyLine, std::map *SplitPoints, std::map *SplitLength, int intSize){ - + + // Split values from a string supplied by PropertyLine. + size_t intPropertyLen = PropertyLine->Len(); int intSplitsFound = 0; int intSplitSize = 0; @@ -4666,6 +5304,8 @@ void CheckType(wxString *PropertySeg1, int *intPrevValue, PropertyType *PropType){ + // Check the information type. + wxString PropertyData; wxString PropertyName; wxString PropertyValue;