Changeset 39 for trunk/UContact.pas
- Timestamp:
- Nov 29, 2021, 2:17:26 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UContact.pas
r37 r39 17 17 TContactFieldIndex = (cfFirstName, cfMiddleName, cfLastName, cfTitleBefore, 18 18 cfTitleAfter, cfFullName, cfTelCell, cfTelHome, cfTelHome2, cfTelWork, cfTelVoip, 19 cfTelMain, cfEmail, cfTel, cfUid, cfUrl ,19 cfTelMain, cfEmail, cfTel, cfUid, cfUrlHome, cfUrlWork, 20 20 cfEmailHome, cfEmailInternet, cfNickName, cfNote, cfRole, cfTitle, 21 21 cfCategories, cfOrganization, cfDepartment, 22 cfHomeAddress, cfHomeAddressStreet, cfHomeAddressCity, cfHomeAddressCountry, 23 cfWorkAddress, cfWorkAddressStreet, cfWorkAddressCity, cfWorkAddressCountry, 22 cfHomeAddressStreet, cfHomeAddressStreetExtended, cfHomeAddressCity, cfHomeAddressCountry, 23 cfHomeAddressPostalCode, cfHomeAddressRegion, cfHomeAddressPostOfficeBox, 24 cfWorkAddressStreet, cfWorkAddressStreetExtended, cfWorkAddressCity, cfWorkAddressCountry, 25 cfWorkAddressPostalCode, cfWorkAddressRegion, cfWorkAddressPostOfficeBox, 24 26 cfXTimesContacted, cfXLastTimeContacted, cfPhoto, cfXJabber, cfDayOfBirth, cfRevision, 25 27 cfVersion); … … 62 64 63 65 TContactProperties = class(TFPGObjectList<TContactProperty>) 66 procedure AssignToList(List: TFPGObjectList<TObject>); 64 67 function GetByName(Name: string): TContactProperty; 65 68 function GetByNameGroups(Name: string; Groups: TStringArray): TContactProperty; … … 151 154 SOrganization = 'Organization'; 152 155 SDepartement = 'Departement'; 153 SHomeAddress = 'Home Address'; 154 SHomeAddressStreet = 'Home Address Street'; 155 SHomeAddressCity = 'Home Address City'; 156 SHomeAddressCountry = 'Home Address Country'; 157 SWorkAddress = 'Home Address'; 158 SWorkAddressStreet = 'Work Address Street'; 159 SWorkAddressCity = 'Work Address City'; 160 SWorkAddressCountry = 'Work Address Country'; 156 SHomeAddressPostOfficeBox = 'Home address post office box'; 157 SHomeAddressStreetExtended = 'Home address extended street'; 158 SHomeAddressStreet = 'Home address street'; 159 SHomeAddressCity = 'Home address city'; 160 SHomeAddressRegion = 'Home address region'; 161 SHomeAddressPostalCode = 'Home address postal code'; 162 SHomeAddressCountry = 'Home address country'; 163 SWorkAddressPostOfficeBox = 'Work address post office box'; 164 SWorkAddressStreetExtended = 'Work address extended street'; 165 SWorkAddressStreet = 'Work address street'; 166 SWorkAddressCity = 'Work address city'; 167 SWorkAddressRegion = 'Work address region'; 168 SWorkAddressPostalCode = 'Work address postal code'; 169 SWorkAddressCountry = 'Work address country'; 161 170 STimesContacted = 'Times Contacted'; 162 171 SLastTimeContacted = 'Last Time Contacted'; … … 166 175 SRevision = 'Revision'; 167 176 SUniqueIdentifier = 'Unique identifier'; 168 SWebAddress = 'Web address'; 177 SWebAddressHome = 'Web address home'; 178 SWebAddressWork = 'Web address work'; 169 179 170 180 function GetNext(var Text: string; Separator: string): string; … … 192 202 193 203 { TContactProperties } 204 205 procedure TContactProperties.AssignToList(List: TFPGObjectList<TObject>); 206 var 207 I: Integer; 208 begin 209 while List.Count > Count do List.Delete(List.Count - 1); 210 while List.Count < Count do List.Add(nil); 211 for I := 0 to Count - 1 do 212 List[I] := Items[I]; 213 end; 194 214 195 215 function TContactProperties.GetByName(Name: string): TContactProperty; … … 441 461 I: Integer; 442 462 begin 463 Parent := Source.Parent; 443 464 while Properties.Count < Source.Properties.Count do 444 465 Properties.Add(TContactProperty.Create); … … 503 524 AddNew('ORG', [], SOrganization, cfOrganization, dtString, 0); 504 525 AddNew('ORG', [], SDepartement, cfDepartment, dtString, 1); 505 AddNew('ADR', ['HOME'], SHomeAddress, cfHomeAddress, dtString); 506 AddNew('ADR', ['HOME'], SHomeAddressStreet, cfHomeAddressStreet, dtString, 1); 507 AddNew('ADR', ['HOME'], SHomeAddressCity, cfHomeAddressCity, dtString, 2); 508 AddNew('ADR', ['HOME'], SHomeAddressCountry, cfHomeAddressCountry, dtString, 3); 509 AddNew('ADR', ['WORK'], SWorkAddress, cfWorkAddress, dtString); 510 AddNew('ADR', ['WORK'], SWorkAddressStreet, cfWorkAddressStreet, dtString, 1); 511 AddNew('ADR', ['WORK'], SWorkAddressCity, cfWorkAddressCity, dtString, 2); 512 AddNew('ADR', ['WORK'], SWorkAddressCountry, cfWorkAddressCountry, dtString, 3); 526 AddNew('ADR', ['HOME'], SHomeAddressPostOfficeBox, cfHomeAddressPostOfficeBox, dtString, 0); 527 AddNew('ADR', ['HOME'], SHomeAddressStreetExtended, cfHomeAddressStreetExtended, dtString, 1); 528 AddNew('ADR', ['HOME'], SHomeAddressStreet, cfHomeAddressStreet, dtString, 2); 529 AddNew('ADR', ['HOME'], SHomeAddressCity, cfHomeAddressCity, dtString, 3); 530 AddNew('ADR', ['HOME'], SHomeAddressRegion, cfHomeAddressRegion, dtString, 4); 531 AddNew('ADR', ['HOME'], SHomeAddressPostalCode, cfHomeAddressPostalCode, dtString, 5); 532 AddNew('ADR', ['HOME'], SHomeAddressCountry, cfHomeAddressCountry, dtString, 6); 533 AddNew('ADR', ['WORK'], SWorkAddressPostOfficeBox, cfWorkAddressPostOfficeBox, dtString, 0); 534 AddNew('ADR', ['WORK'], SWorkAddressStreetExtended, cfWorkAddressStreetExtended, dtString, 1); 535 AddNew('ADR', ['WORK'], SWorkAddressStreet, cfWorkAddressStreet, dtString, 2); 536 AddNew('ADR', ['WORK'], SWorkAddressCity, cfWorkAddressCity, dtString, 3); 537 AddNew('ADR', ['WORK'], SWorkAddressRegion, cfWorkAddressRegion, dtString, 4); 538 AddNew('ADR', ['WORK'], SWorkAddressPostalCode, cfWorkAddressPostalCode, dtString, 5); 539 AddNew('ADR', ['WORK'], SWorkAddressCountry, cfWorkAddressCountry, dtString, 6); 513 540 AddNew('X-TIMES_CONTACTED', [], STimesContacted, cfXTimesContacted, dtString); 514 541 AddNew('X-LAST_TIME_CONTACTED', [], SLastTimeContacted, cfXLastTimeContacted, dtString); … … 518 545 AddNew('REV', [], SRevision, cfRevision, dtString); 519 546 AddNew('UID', [], SUniqueIdentifier, cfUid, dtString); 520 AddNew('URL', [], SWebAddress, cfUrl, dtString); 547 AddNew('URL', ['HOME'], SWebAddressHome, cfUrlHome, dtString); 548 AddNew('URL', ['WORK'], SWebAddressWork, cfUrlWork, dtString); 521 549 end; 522 550 end;
Note:
See TracChangeset
for help on using the changeset viewer.