forked from FMXExpress/ios-object-pascal-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiOSapi.AddressBook.pas
901 lines (789 loc) · 31.7 KB
/
iOSapi.AddressBook.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
{ *********************************************************** }
{ }
{ CodeGear Delphi Runtime Library }
{ }
{ Copyright(c) 2012-2014 Embarcadero Technologies, Inc. }
{ }
{ *********************************************************** }
//
// Delphi-Objective-C Bridge
// Interfaces for Cocoa framework AddressBook
//
unit iOSapi.AddressBook;
interface
uses
Macapi.CoreFoundation,
Macapi.CoreServices,
Macapi.Dispatch,
Macapi.Foundation,
Macapi.Mach,
Macapi.ObjCRuntime,
Macapi.ObjectiveC,
Macapi.QuartzCore,
iOSapi.CocoaTypes,
iOSapi.Foundation;
const
kABPersonType = 0;
kABGroupType = 1;
kABSourceType = 2;
kABInvalidPropertyType = 0;
kABStringPropertyType = 1;
kABIntegerPropertyType = 2;
kABRealPropertyType = 3;
kABDateTimePropertyType = 4;
kABDictionaryPropertyType = 5;
kABMultiStringPropertyType = (1 shl 8) or kABStringPropertyType;
kABMultiIntegerPropertyType = (1 shl 8) or kABIntegerPropertyType;
kABMultiRealPropertyType = (1 shl 8) or kABRealPropertyType;
kABMultiDateTimePropertyType = (1 shl 8) or kABDateTimePropertyType;
kABMultiDictionaryPropertyType = (1 shl 8) or kABDictionaryPropertyType;
kABOperationNotPermittedByStoreError = 0;
kABOperationNotPermittedByUserError = 1;
kABAuthorizationStatusNotDetermined = 0;
kABAuthorizationStatusRestricted = 1;
kABAuthorizationStatusDenied = 2;
kABAuthorizationStatusAuthorized = 3;
kABSourceTypeLocal = 0;
kABSourceTypeExchange = 1;
kABSourceTypeExchangeGAL = kABSourceTypeExchange or 16777216;
kABSourceTypeMobileMe = 2;
kABSourceTypeLDAP = 3 or 16777216;
kABSourceTypeCardDAV = 4;
kABSourceTypeCardDAVSearch = kABSourceTypeCardDAV or 16777216;
kABPersonSortByFirstName = 0;
kABPersonSortByLastName = 1;
kABPersonCompositeNameFormatFirstNameFirst = 0;
kABPersonCompositeNameFormatLastNameFirst = 1;
kABPersonImageFormatThumbnail = 0;
kABPersonImageFormatOriginalSize = 2;
type
// ===== Framework typedefs =====
{$M+}
CFTypeRef = Pointer;
ABRecordRef = CFTypeRef;
ABRecordID = Int32;
ABPropertyID = Int32;
ABRecordType = LongWord;
ABPropertyType = LongWord;
CFStringRef = Pointer;
ABAddressBookRef = CFTypeRef;
CFIndex = LongInt;
ABAuthorizationStatus = CFIndex;
CFDictionaryRef = Pointer;
CFErrorRef = Pointer;
ABAddressBookRequestAccessCompletionHandler = procedure(param1: Integer;
param2: CFErrorRef) of object;
ABExternalChangeCallback = procedure(param1: ABAddressBookRef;
param2: CFDictionaryRef; param3: Pointer); cdecl;
ABSourceType = Integer;
PABSourceType = ^ABSourceType;
CFArrayRef = Pointer;
ABPersonSortOrdering = LongWord;
ABPersonCompositeNameFormat = LongWord;
ABPersonImageFormat = Cardinal;
CFDataRef = Pointer;
CFComparisonResult = CFIndex;
CFNumberRef = Pointer;
ABMultiValueRef = CFTypeRef;
ABMultiValueIdentifier = Int32;
ABMutableMultiValueRef = CFTypeRef;
// ===== Exported string consts =====
function ABAddressBookErrorDomain: Pointer;
function kABSourceNameProperty: Pointer;
function kABSourceTypeProperty: Pointer;
function kABWorkLabel: Pointer;
function kABHomeLabel: Pointer;
function kABOtherLabel: Pointer;
function kABPersonFirstNameProperty: Pointer;
function kABPersonLastNameProperty: Pointer;
function kABPersonMiddleNameProperty: Pointer;
function kABPersonPrefixProperty: Pointer;
function kABPersonSuffixProperty: Pointer;
function kABPersonNicknameProperty: Pointer;
function kABPersonFirstNamePhoneticProperty: Pointer;
function kABPersonLastNamePhoneticProperty: Pointer;
function kABPersonMiddleNamePhoneticProperty: Pointer;
function kABPersonOrganizationProperty: Pointer;
function kABPersonDepartmentProperty: Pointer;
function kABPersonJobTitleProperty: Pointer;
function kABPersonEmailProperty: Pointer;
function kABPersonBirthdayProperty: Pointer;
function kABPersonNoteProperty: Pointer;
function kABPersonCreationDateProperty: Pointer;
function kABPersonModificationDateProperty: Pointer;
function kABPersonAddressProperty: Pointer;
function kABPersonAddressStreetKey: Pointer;
function kABPersonAddressCityKey: Pointer;
function kABPersonAddressStateKey: Pointer;
function kABPersonAddressZIPKey: Pointer;
function kABPersonAddressCountryKey: Pointer;
function kABPersonAddressCountryCodeKey: Pointer;
function kABPersonDateProperty: Pointer;
function kABPersonAnniversaryLabel: Pointer;
function kABPersonKindProperty: Pointer;
function kABPersonKindPerson: Pointer;
function kABPersonKindOrganization: Pointer;
function kABPersonPhoneProperty: Pointer;
function kABPersonPhoneMobileLabel: Pointer;
function kABPersonPhoneIPhoneLabel: Pointer;
function kABPersonPhoneMainLabel: Pointer;
function kABPersonPhoneHomeFAXLabel: Pointer;
function kABPersonPhoneWorkFAXLabel: Pointer;
function kABPersonPhoneOtherFAXLabel: Pointer;
function kABPersonPhonePagerLabel: Pointer;
function kABPersonInstantMessageProperty: Pointer;
function kABPersonInstantMessageServiceKey: Pointer;
function kABPersonInstantMessageServiceYahoo: Pointer;
function kABPersonInstantMessageServiceJabber: Pointer;
function kABPersonInstantMessageServiceMSN: Pointer;
function kABPersonInstantMessageServiceICQ: Pointer;
function kABPersonInstantMessageServiceAIM: Pointer;
function kABPersonInstantMessageServiceQQ: Pointer;
function kABPersonInstantMessageServiceGoogleTalk: Pointer;
function kABPersonInstantMessageServiceSkype: Pointer;
function kABPersonInstantMessageServiceFacebook: Pointer;
function kABPersonInstantMessageServiceGaduGadu: Pointer;
function kABPersonInstantMessageUsernameKey: Pointer;
function kABPersonURLProperty: Pointer;
function kABPersonHomePageLabel: Pointer;
function kABPersonRelatedNamesProperty: Pointer;
function kABPersonFatherLabel: Pointer;
function kABPersonMotherLabel: Pointer;
function kABPersonParentLabel: Pointer;
function kABPersonBrotherLabel: Pointer;
function kABPersonSisterLabel: Pointer;
function kABPersonChildLabel: Pointer;
function kABPersonFriendLabel: Pointer;
function kABPersonSpouseLabel: Pointer;
function kABPersonPartnerLabel: Pointer;
function kABPersonAssistantLabel: Pointer;
function kABPersonManagerLabel: Pointer;
function kABPersonSocialProfileProperty: Pointer;
function kABPersonSocialProfileURLKey: Pointer;
function kABPersonSocialProfileServiceKey: Pointer;
function kABPersonSocialProfileUsernameKey: Pointer;
function kABPersonSocialProfileUserIdentifierKey: Pointer;
function kABPersonSocialProfileServiceTwitter: Pointer;
function kABPersonSocialProfileServiceSinaWeibo: Pointer;
function kABPersonSocialProfileServiceGameCenter: Pointer;
function kABPersonSocialProfileServiceFacebook: Pointer;
function kABPersonSocialProfileServiceMyspace: Pointer;
function kABPersonSocialProfileServiceLinkedIn: Pointer;
function kABPersonSocialProfileServiceFlickr: Pointer;
function kABPersonAlternateBirthdayProperty: Pointer;
function kABPersonAlternateBirthdayCalendarIdentifierKey: Pointer;
function kABPersonAlternateBirthdayEraKey: Pointer;
function kABPersonAlternateBirthdayYearKey: Pointer;
function kABPersonAlternateBirthdayMonthKey: Pointer;
function kABPersonAlternateBirthdayIsLeapMonthKey: Pointer;
function kABPersonAlternateBirthdayDayKey: Pointer;
function kABGroupNameProperty: Pointer;
// ===== External functions =====
const
libAddressBook =
'/System/Library/Frameworks/AddressBook.framework/AddressBook';
function ABRecordGetRecordID(&record: ABRecordRef): ABRecordID; cdecl;
external libAddressBook name _PU + 'ABRecordGetRecordID';
function ABRecordGetRecordType(&record: ABRecordRef): ABRecordType; cdecl;
external libAddressBook name _PU + 'ABRecordGetRecordType';
function ABRecordCopyValue(&record: ABRecordRef; &property: ABPropertyID)
: CFTypeRef; cdecl; external libAddressBook name _PU + 'ABRecordCopyValue';
function ABRecordSetValue(&record: ABRecordRef; &property: ABPropertyID;
value: CFTypeRef; error: Pointer): Integer; cdecl;
external libAddressBook name _PU + 'ABRecordSetValue';
function ABRecordRemoveValue(&record: ABRecordRef; &property: ABPropertyID;
error: Pointer): Integer; cdecl;
external libAddressBook name _PU + 'ABRecordRemoveValue';
function ABRecordCopyCompositeName(&record: ABRecordRef): CFStringRef; cdecl;
external libAddressBook name _PU + 'ABRecordCopyCompositeName';
function ABAddressBookGetAuthorizationStatus: ABAuthorizationStatus; cdecl;
external libAddressBook name _PU + 'ABAddressBookGetAuthorizationStatus';
function ABAddressBookCreateWithOptions(options: CFDictionaryRef;
error: Pointer): ABAddressBookRef; cdecl;
external libAddressBook name _PU + 'ABAddressBookCreateWithOptions';
function ABAddressBookCreate: ABAddressBookRef; cdecl;
external libAddressBook name _PU + 'ABAddressBookCreate';
procedure ABAddressBookRequestAccessWithCompletion
(AddressBook: ABAddressBookRef;
completion: ABAddressBookRequestAccessCompletionHandler); cdecl;
external libAddressBook name _PU + 'ABAddressBookRequestAccessWithCompletion';
function ABAddressBookSave(AddressBook: ABAddressBookRef; error: Pointer)
: Integer; cdecl; external libAddressBook name _PU + 'ABAddressBookSave';
function ABAddressBookHasUnsavedChanges(AddressBook: ABAddressBookRef): Integer;
cdecl; external libAddressBook name _PU + 'ABAddressBookHasUnsavedChanges';
function ABAddressBookAddRecord(AddressBook: ABAddressBookRef;
&record: ABRecordRef; error: Pointer): Integer; cdecl;
external libAddressBook name _PU + 'ABAddressBookAddRecord';
function ABAddressBookRemoveRecord(AddressBook: ABAddressBookRef;
&record: ABRecordRef; error: Pointer): Integer; cdecl;
external libAddressBook name _PU + 'ABAddressBookRemoveRecord';
function ABAddressBookCopyLocalizedLabel(&label: CFStringRef): CFStringRef;
cdecl; external libAddressBook name _PU + 'ABAddressBookCopyLocalizedLabel';
procedure ABAddressBookRegisterExternalChangeCallback
(AddressBook: ABAddressBookRef; callback: ABExternalChangeCallback;
context: Pointer); cdecl; external libAddressBook name _PU +
'ABAddressBookRegisterExternalChangeCallback';
procedure ABAddressBookUnregisterExternalChangeCallback
(AddressBook: ABAddressBookRef; callback: ABExternalChangeCallback;
context: Pointer); cdecl; external libAddressBook name _PU +
'ABAddressBookUnregisterExternalChangeCallback';
procedure ABAddressBookRevert(AddressBook: ABAddressBookRef); cdecl;
external libAddressBook name _PU + 'ABAddressBookRevert';
function ABAddressBookCopyDefaultSource(AddressBook: ABAddressBookRef)
: ABRecordRef; cdecl; external libAddressBook name _PU +
'ABAddressBookCopyDefaultSource';
function ABAddressBookGetSourceWithRecordID(AddressBook: ABAddressBookRef;
sourceID: ABRecordID): ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABAddressBookGetSourceWithRecordID';
function ABAddressBookCopyArrayOfAllSources(AddressBook: ABAddressBookRef)
: CFArrayRef; cdecl; external libAddressBook name _PU +
'ABAddressBookCopyArrayOfAllSources';
function ABPersonCreate: ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABPersonCreate';
function ABPersonCreateInSource(source: ABRecordRef): ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABPersonCreateInSource';
function ABPersonCopySource(person: ABRecordRef): ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABPersonCopySource';
function ABPersonCopyArrayOfAllLinkedPeople(person: ABRecordRef): CFArrayRef;
cdecl; external libAddressBook name _PU +
'ABPersonCopyArrayOfAllLinkedPeople';
function ABPersonGetTypeOfProperty(&property: ABPropertyID): ABPropertyType;
cdecl; external libAddressBook name _PU + 'ABPersonGetTypeOfProperty';
function ABPersonCopyLocalizedPropertyName(&property: ABPropertyID)
: CFStringRef; cdecl; external libAddressBook name _PU +
'ABPersonCopyLocalizedPropertyName';
function ABPersonGetSortOrdering: ABPersonSortOrdering; cdecl;
external libAddressBook name _PU + 'ABPersonGetSortOrdering';
function ABPersonGetCompositeNameFormat: ABPersonCompositeNameFormat; cdecl;
external libAddressBook name _PU + 'ABPersonGetCompositeNameFormat';
function ABPersonGetCompositeNameFormatForRecord(&record: ABRecordRef)
: ABPersonCompositeNameFormat; cdecl;
external libAddressBook name _PU + 'ABPersonGetCompositeNameFormatForRecord';
function ABPersonCopyCompositeNameDelimiterForRecord(&record: ABRecordRef)
: CFStringRef; cdecl; external libAddressBook name _PU +
'ABPersonCopyCompositeNameDelimiterForRecord';
function ABPersonSetImageData(person: ABRecordRef; imageData: CFDataRef;
error: Pointer): Integer; cdecl;
external libAddressBook name _PU + 'ABPersonSetImageData';
function ABPersonCopyImageData(person: ABRecordRef): CFDataRef; cdecl;
external libAddressBook name _PU + 'ABPersonCopyImageData';
function ABPersonCopyImageDataWithFormat(person: ABRecordRef;
format: ABPersonImageFormat): CFDataRef; cdecl;
external libAddressBook name _PU + 'ABPersonCopyImageDataWithFormat';
function ABPersonHasImageData(person: ABRecordRef): Integer; cdecl;
external libAddressBook name _PU + 'ABPersonHasImageData';
function ABPersonRemoveImageData(person: ABRecordRef; error: Pointer): Integer;
cdecl; external libAddressBook name _PU + 'ABPersonRemoveImageData';
function ABPersonComparePeopleByName(person1: ABRecordRef; person2: ABRecordRef;
ordering: ABPersonSortOrdering): CFComparisonResult; cdecl;
external libAddressBook name _PU + 'ABPersonComparePeopleByName';
function ABAddressBookGetPersonCount(AddressBook: ABAddressBookRef): CFIndex;
cdecl; external libAddressBook name _PU + 'ABAddressBookGetPersonCount';
function ABAddressBookGetPersonWithRecordID(AddressBook: ABAddressBookRef;
recordID: ABRecordID): ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABAddressBookGetPersonWithRecordID';
function ABAddressBookCopyArrayOfAllPeople(AddressBook: ABAddressBookRef)
: CFArrayRef; cdecl; external libAddressBook name _PU +
'ABAddressBookCopyArrayOfAllPeople';
function ABAddressBookCopyArrayOfAllPeopleInSource
(AddressBook: ABAddressBookRef; source: ABRecordRef): CFArrayRef; cdecl;
external libAddressBook name _PU +
'ABAddressBookCopyArrayOfAllPeopleInSource';
function ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering
(AddressBook: ABAddressBookRef; source: ABRecordRef;
sortOrdering: ABPersonSortOrdering): CFArrayRef; cdecl;
external libAddressBook name _PU +
'ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering';
function ABAddressBookCopyPeopleWithName(AddressBook: ABAddressBookRef;
name: CFStringRef): CFArrayRef; cdecl;
external libAddressBook name _PU + 'ABAddressBookCopyPeopleWithName';
function ABPersonCreatePeopleInSourceWithVCardRepresentation
(source: ABRecordRef; vCardData: CFDataRef): CFArrayRef; cdecl;
external libAddressBook name _PU +
'ABPersonCreatePeopleInSourceWithVCardRepresentation';
function ABPersonCreateVCardRepresentationWithPeople(people: CFArrayRef)
: CFDataRef; cdecl; external libAddressBook name _PU +
'ABPersonCreateVCardRepresentationWithPeople';
function ABGroupCreate: ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABGroupCreate';
function ABGroupCreateInSource(source: ABRecordRef): ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABGroupCreateInSource';
function ABGroupCopySource(group: ABRecordRef): ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABGroupCopySource';
function ABGroupCopyArrayOfAllMembers(group: ABRecordRef): CFArrayRef; cdecl;
external libAddressBook name _PU + 'ABGroupCopyArrayOfAllMembers';
function ABGroupCopyArrayOfAllMembersWithSortOrdering(group: ABRecordRef;
sortOrdering: ABPersonSortOrdering): CFArrayRef; cdecl;
external libAddressBook name _PU +
'ABGroupCopyArrayOfAllMembersWithSortOrdering';
function ABGroupAddMember(group: ABRecordRef; person: ABRecordRef;
error: Pointer): Integer; cdecl;
external libAddressBook name _PU + 'ABGroupAddMember';
function ABGroupRemoveMember(group: ABRecordRef; member: ABRecordRef;
error: Pointer): Integer; cdecl;
external libAddressBook name _PU + 'ABGroupRemoveMember';
function ABAddressBookGetGroupWithRecordID(AddressBook: ABAddressBookRef;
recordID: ABRecordID): ABRecordRef; cdecl;
external libAddressBook name _PU + 'ABAddressBookGetGroupWithRecordID';
function ABAddressBookGetGroupCount(AddressBook: ABAddressBookRef): CFIndex;
cdecl; external libAddressBook name _PU + 'ABAddressBookGetGroupCount';
function ABAddressBookCopyArrayOfAllGroups(AddressBook: ABAddressBookRef)
: CFArrayRef; cdecl; external libAddressBook name _PU +
'ABAddressBookCopyArrayOfAllGroups';
function ABAddressBookCopyArrayOfAllGroupsInSource
(AddressBook: ABAddressBookRef; source: ABRecordRef): CFArrayRef; cdecl;
external libAddressBook name _PU +
'ABAddressBookCopyArrayOfAllGroupsInSource';
function ABMultiValueGetPropertyType(multiValue: ABMultiValueRef)
: ABPropertyType; cdecl; external libAddressBook name _PU +
'ABMultiValueGetPropertyType';
function ABMultiValueGetCount(multiValue: ABMultiValueRef): CFIndex; cdecl;
external libAddressBook name _PU + 'ABMultiValueGetCount';
function ABMultiValueCopyValueAtIndex(multiValue: ABMultiValueRef;
index: CFIndex): CFTypeRef; cdecl;
external libAddressBook name _PU + 'ABMultiValueCopyValueAtIndex';
function ABMultiValueCopyArrayOfAllValues(multiValue: ABMultiValueRef)
: CFArrayRef; cdecl; external libAddressBook name _PU +
'ABMultiValueCopyArrayOfAllValues';
function ABMultiValueCopyLabelAtIndex(multiValue: ABMultiValueRef;
index: CFIndex): CFStringRef; cdecl;
external libAddressBook name _PU + 'ABMultiValueCopyLabelAtIndex';
function ABMultiValueGetIndexForIdentifier(multiValue: ABMultiValueRef;
identifier: ABMultiValueIdentifier): CFIndex; cdecl;
external libAddressBook name _PU + 'ABMultiValueGetIndexForIdentifier';
function ABMultiValueGetIdentifierAtIndex(multiValue: ABMultiValueRef;
index: CFIndex): ABMultiValueIdentifier; cdecl;
external libAddressBook name _PU + 'ABMultiValueGetIdentifierAtIndex';
function ABMultiValueGetFirstIndexOfValue(multiValue: ABMultiValueRef;
value: CFTypeRef): CFIndex; cdecl;
external libAddressBook name _PU + 'ABMultiValueGetFirstIndexOfValue';
function ABMultiValueCreateMutable(&type: ABPropertyType)
: ABMutableMultiValueRef; cdecl;
external libAddressBook name _PU + 'ABMultiValueCreateMutable';
function ABMultiValueCreateMutableCopy(multiValue: ABMultiValueRef)
: ABMutableMultiValueRef; cdecl;
external libAddressBook name _PU + 'ABMultiValueCreateMutableCopy';
function ABMultiValueAddValueAndLabel(multiValue: ABMutableMultiValueRef;
value: CFTypeRef; &label: CFStringRef; outIdentifier: PInt32): Integer; cdecl;
external libAddressBook name _PU + 'ABMultiValueAddValueAndLabel';
function ABMultiValueInsertValueAndLabelAtIndex
(multiValue: ABMutableMultiValueRef; value: CFTypeRef; &label: CFStringRef;
index: CFIndex; outIdentifier: PInt32): Integer; cdecl;
external libAddressBook name _PU + 'ABMultiValueInsertValueAndLabelAtIndex';
function ABMultiValueRemoveValueAndLabelAtIndex
(multiValue: ABMutableMultiValueRef; index: CFIndex): Integer; cdecl;
external libAddressBook name _PU + 'ABMultiValueRemoveValueAndLabelAtIndex';
function ABMultiValueReplaceValueAtIndex(multiValue: ABMutableMultiValueRef;
value: CFTypeRef; index: CFIndex): Integer; cdecl;
external libAddressBook name _PU + 'ABMultiValueReplaceValueAtIndex';
function ABMultiValueReplaceLabelAtIndex(multiValue: ABMutableMultiValueRef;
&label: CFStringRef; index: CFIndex): Integer; cdecl;
external libAddressBook name _PU + 'ABMultiValueReplaceLabelAtIndex';
implementation
{$IF defined(IOS) and NOT defined(CPUARM)}
uses
Posix.Dlfcn;
var
AddressBookModule: THandle;
{$ENDIF IOS}
function ABAddressBookErrorDomain: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'ABAddressBookErrorDomain');
end;
function kABSourceNameProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABSourceNameProperty');
end;
function kABSourceTypeProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABSourceTypeProperty');
end;
function kABWorkLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABWorkLabel');
end;
function kABHomeLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABHomeLabel');
end;
function kABOtherLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABOtherLabel');
end;
function kABPersonFirstNameProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonFirstNameProperty');
end;
function kABPersonLastNameProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonLastNameProperty');
end;
function kABPersonMiddleNameProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonMiddleNameProperty');
end;
function kABPersonPrefixProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPrefixProperty');
end;
function kABPersonSuffixProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonSuffixProperty');
end;
function kABPersonNicknameProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonNicknameProperty');
end;
function kABPersonFirstNamePhoneticProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonFirstNamePhoneticProperty');
end;
function kABPersonLastNamePhoneticProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonLastNamePhoneticProperty');
end;
function kABPersonMiddleNamePhoneticProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonMiddleNamePhoneticProperty');
end;
function kABPersonOrganizationProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonOrganizationProperty');
end;
function kABPersonDepartmentProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonDepartmentProperty');
end;
function kABPersonJobTitleProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonJobTitleProperty');
end;
function kABPersonEmailProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonEmailProperty');
end;
function kABPersonBirthdayProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonBirthdayProperty');
end;
function kABPersonNoteProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonNoteProperty');
end;
function kABPersonCreationDateProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonCreationDateProperty');
end;
function kABPersonModificationDateProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonModificationDateProperty');
end;
function kABPersonAddressProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAddressProperty');
end;
function kABPersonAddressStreetKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAddressStreetKey');
end;
function kABPersonAddressCityKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAddressCityKey');
end;
function kABPersonAddressStateKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAddressStateKey');
end;
function kABPersonAddressZIPKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAddressZIPKey');
end;
function kABPersonAddressCountryKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAddressCountryKey');
end;
function kABPersonAddressCountryCodeKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAddressCountryCodeKey');
end;
function kABPersonDateProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonDateProperty');
end;
function kABPersonAnniversaryLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAnniversaryLabel');
end;
function kABPersonKindProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonKindProperty');
end;
function kABPersonKindPerson: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonKindPerson');
end;
function kABPersonKindOrganization: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonKindOrganization');
end;
function kABPersonPhoneProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPhoneProperty');
end;
function kABPersonPhoneMobileLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPhoneMobileLabel');
end;
function kABPersonPhoneIPhoneLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPhoneIPhoneLabel');
end;
function kABPersonPhoneMainLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPhoneMainLabel');
end;
function kABPersonPhoneHomeFAXLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPhoneHomeFAXLabel');
end;
function kABPersonPhoneWorkFAXLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPhoneWorkFAXLabel');
end;
function kABPersonPhoneOtherFAXLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPhoneOtherFAXLabel');
end;
function kABPersonPhonePagerLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPhonePagerLabel');
end;
function kABPersonInstantMessageProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageProperty');
end;
function kABPersonInstantMessageServiceKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceKey');
end;
function kABPersonInstantMessageServiceYahoo: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceYahoo');
end;
function kABPersonInstantMessageServiceJabber: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceJabber');
end;
function kABPersonInstantMessageServiceMSN: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceMSN');
end;
function kABPersonInstantMessageServiceICQ: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceICQ');
end;
function kABPersonInstantMessageServiceAIM: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceAIM');
end;
function kABPersonInstantMessageServiceQQ: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceQQ');
end;
function kABPersonInstantMessageServiceGoogleTalk: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceGoogleTalk');
end;
function kABPersonInstantMessageServiceSkype: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceSkype');
end;
function kABPersonInstantMessageServiceFacebook: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceFacebook');
end;
function kABPersonInstantMessageServiceGaduGadu: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageServiceGaduGadu');
end;
function kABPersonInstantMessageUsernameKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonInstantMessageUsernameKey');
end;
function kABPersonURLProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonURLProperty');
end;
function kABPersonHomePageLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonHomePageLabel');
end;
function kABPersonRelatedNamesProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonRelatedNamesProperty');
end;
function kABPersonFatherLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonFatherLabel');
end;
function kABPersonMotherLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonMotherLabel');
end;
function kABPersonParentLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonParentLabel');
end;
function kABPersonBrotherLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonBrotherLabel');
end;
function kABPersonSisterLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonSisterLabel');
end;
function kABPersonChildLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonChildLabel');
end;
function kABPersonFriendLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonFriendLabel');
end;
function kABPersonSpouseLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonSpouseLabel');
end;
function kABPersonPartnerLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonPartnerLabel');
end;
function kABPersonAssistantLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonAssistantLabel');
end;
function kABPersonManagerLabel: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonManagerLabel');
end;
function kABPersonSocialProfileProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonSocialProfileProperty');
end;
function kABPersonSocialProfileURLKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABPersonSocialProfileURLKey');
end;
function kABPersonSocialProfileServiceKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileServiceKey');
end;
function kABPersonSocialProfileUsernameKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileUsernameKey');
end;
function kABPersonSocialProfileUserIdentifierKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileUserIdentifierKey');
end;
function kABPersonSocialProfileServiceTwitter: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileServiceTwitter');
end;
function kABPersonSocialProfileServiceSinaWeibo: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileServiceSinaWeibo');
end;
function kABPersonSocialProfileServiceGameCenter: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileServiceGameCenter');
end;
function kABPersonSocialProfileServiceFacebook: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileServiceFacebook');
end;
function kABPersonSocialProfileServiceMyspace: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileServiceMyspace');
end;
function kABPersonSocialProfileServiceLinkedIn: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileServiceLinkedIn');
end;
function kABPersonSocialProfileServiceFlickr: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonSocialProfileServiceFlickr');
end;
function kABPersonAlternateBirthdayProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonAlternateBirthdayProperty');
end;
function kABPersonAlternateBirthdayCalendarIdentifierKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonAlternateBirthdayCalendarIdentifierKey');
end;
function kABPersonAlternateBirthdayEraKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonAlternateBirthdayEraKey');
end;
function kABPersonAlternateBirthdayYearKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonAlternateBirthdayYearKey');
end;
function kABPersonAlternateBirthdayMonthKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonAlternateBirthdayMonthKey');
end;
function kABPersonAlternateBirthdayIsLeapMonthKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonAlternateBirthdayIsLeapMonthKey');
end;
function kABPersonAlternateBirthdayDayKey: Pointer;
begin
Result := CocoaPointerConst(libAddressBook,
'kABPersonAlternateBirthdayDayKey');
end;
function kABGroupNameProperty: Pointer;
begin
Result := CocoaPointerConst(libAddressBook, 'kABGroupNameProperty');
end;
{$IF defined(IOS) and NOT defined(CPUARM)}
initialization
AddressBookModule := dlopen(MarshaledAString(libAddressBook), RTLD_LAZY);
finalization
dlclose(AddressBookModule);
{$ENDIF IOS}
end.