ABGlobals.pas 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. {
  2. * ABGlobals.h
  3. * AddressBook Framework
  4. *
  5. * Copyright (c) 2002-2003 Apple Computer. All rights reserved.
  6. *
  7. }
  8. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  9. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, Feburary 2006 }
  10. {
  11. Modified for use with Free Pascal
  12. Version 200
  13. Please report any bugs to <[email protected]>
  14. }
  15. {$mode macpas}
  16. {$packenum 1}
  17. {$macro on}
  18. {$inline on}
  19. {$CALLING MWPASCAL}
  20. unit ABGlobals;
  21. interface
  22. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  23. {$setc GAP_INTERFACES_VERSION := $0200}
  24. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  25. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  26. {$endc}
  27. {$ifc defined CPUPOWERPC and defined CPUI386}
  28. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  29. {$endc}
  30. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  31. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  32. {$endc}
  33. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  34. {$setc __ppc__ := 1}
  35. {$elsec}
  36. {$setc __ppc__ := 0}
  37. {$endc}
  38. {$ifc not defined __i386__ and defined CPUI386}
  39. {$setc __i386__ := 1}
  40. {$elsec}
  41. {$setc __i386__ := 0}
  42. {$endc}
  43. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  44. {$error Conflicting definitions for __ppc__ and __i386__}
  45. {$endc}
  46. {$ifc defined __ppc__ and __ppc__}
  47. {$setc TARGET_CPU_PPC := TRUE}
  48. {$setc TARGET_CPU_X86 := FALSE}
  49. {$elifc defined __i386__ and __i386__}
  50. {$setc TARGET_CPU_PPC := FALSE}
  51. {$setc TARGET_CPU_X86 := TRUE}
  52. {$elsec}
  53. {$error Neither __ppc__ nor __i386__ is defined.}
  54. {$endc}
  55. {$setc TARGET_CPU_PPC_64 := FALSE}
  56. {$ifc defined FPC_BIG_ENDIAN}
  57. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  58. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  59. {$elifc defined FPC_LITTLE_ENDIAN}
  60. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  61. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  62. {$elsec}
  63. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  64. {$endc}
  65. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  66. {$setc CALL_NOT_IN_CARBON := FALSE}
  67. {$setc OLDROUTINENAMES := FALSE}
  68. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  69. {$setc OPAQUE_UPP_TYPES := TRUE}
  70. {$setc OTCARBONAPPLICATION := TRUE}
  71. {$setc OTKERNEL := FALSE}
  72. {$setc PM_USE_SESSION_APIS := TRUE}
  73. {$setc TARGET_API_MAC_CARBON := TRUE}
  74. {$setc TARGET_API_MAC_OS8 := FALSE}
  75. {$setc TARGET_API_MAC_OSX := TRUE}
  76. {$setc TARGET_CARBON := TRUE}
  77. {$setc TARGET_CPU_68K := FALSE}
  78. {$setc TARGET_CPU_MIPS := FALSE}
  79. {$setc TARGET_CPU_SPARC := FALSE}
  80. {$setc TARGET_OS_MAC := TRUE}
  81. {$setc TARGET_OS_UNIX := FALSE}
  82. {$setc TARGET_OS_WIN32 := FALSE}
  83. {$setc TARGET_RT_MAC_68881 := FALSE}
  84. {$setc TARGET_RT_MAC_CFM := FALSE}
  85. {$setc TARGET_RT_MAC_MACHO := TRUE}
  86. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  87. {$setc TYPE_BOOL := FALSE}
  88. {$setc TYPE_EXTENDED := FALSE}
  89. {$setc TYPE_LONGLONG := TRUE}
  90. uses MacTypes,CFBase;
  91. {$ALIGN POWER}
  92. // NOTE: This header is for C programmers. For Objective-C use ABGlobals.h
  93. // ================================================================
  94. // Global Table properties
  95. // ================================================================
  96. // ----- Properties common to all Records
  97. var kABUIDProperty: CFStringRef; external name '_kABUIDProperty'; (* attribute const *) // The UID property - kABStringProperty
  98. var kABCreationDateProperty: CFStringRef; external name '_kABCreationDateProperty'; (* attribute const *) // Creation Date (when first saved) - kABDateProperty
  99. var kABModificationDateProperty: CFStringRef; external name '_kABModificationDateProperty'; (* attribute const *) // Last saved date - kABDateProperty
  100. // ----- Person specific properties
  101. var kABFirstNameProperty: CFStringRef; external name '_kABFirstNameProperty'; (* attribute const *) // First name - kABStringProperty
  102. var kABLastNameProperty: CFStringRef; external name '_kABLastNameProperty'; (* attribute const *) // Last name - kABStringProperty
  103. var kABFirstNamePhoneticProperty: CFStringRef; external name '_kABFirstNamePhoneticProperty'; (* attribute const *) // First name Phonetic - kABStringProperty
  104. var kABLastNamePhoneticProperty: CFStringRef; external name '_kABLastNamePhoneticProperty'; (* attribute const *) // Last name Phonetic - kABStringProperty
  105. var kABNicknameProperty: CFStringRef; external name '_kABNicknameProperty'; (* attribute const *) // kABStringProperty
  106. var kABMaidenNameProperty: CFStringRef; external name '_kABMaidenNameProperty'; (* attribute const *) // kABStringProperty
  107. var kABBirthdayProperty: CFStringRef; external name '_kABBirthdayProperty'; (* attribute const *) // Birth date - kABDateProperty
  108. var kABOrganizationProperty: CFStringRef; external name '_kABOrganizationProperty'; (* attribute const *) // Company name - kABStringProperty
  109. var kABJobTitleProperty: CFStringRef; external name '_kABJobTitleProperty'; (* attribute const *) // Job Title - kABStringProperty
  110. // Deprecated in Mac OS 10.4. You should use kABURLsProperty.
  111. var kABHomePageProperty: CFStringRef; external name '_kABHomePageProperty'; (* attribute const *) // Home Web page - kABStringProperty
  112. var kABURLsProperty: CFStringRef; external name '_kABURLsProperty'; (* attribute const *)
  113. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // URLs - kABMultiStringProperty
  114. var kABHomePageLabel: CFStringRef; external name '_kABHomePageLabel'; (* attribute const *)
  115. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // Homepage URL
  116. var kABEmailProperty: CFStringRef; external name '_kABEmailProperty'; (* attribute const *) // Email(s) - kABMultiStringProperty
  117. var kABEmailWorkLabel: CFStringRef; external name '_kABEmailWorkLabel'; (* attribute const *) // Home email
  118. var kABEmailHomeLabel: CFStringRef; external name '_kABEmailHomeLabel'; (* attribute const *) // Work email
  119. var kABAddressProperty: CFStringRef; external name '_kABAddressProperty'; (* attribute const *) // Street Addresses - kABMultiDictionaryProperty
  120. var kABAddressStreetKey: CFStringRef; external name '_kABAddressStreetKey'; (* attribute const *) // Street
  121. var kABAddressCityKey: CFStringRef; external name '_kABAddressCityKey'; (* attribute const *) // City
  122. var kABAddressStateKey: CFStringRef; external name '_kABAddressStateKey'; (* attribute const *) // State
  123. var kABAddressZIPKey: CFStringRef; external name '_kABAddressZIPKey'; (* attribute const *) // Zip
  124. var kABAddressCountryKey: CFStringRef; external name '_kABAddressCountryKey'; (* attribute const *) // Country
  125. var kABAddressCountryCodeKey: CFStringRef; external name '_kABAddressCountryCodeKey'; (* attribute const *) // Country Code
  126. var kABAddressHomeLabel: CFStringRef; external name '_kABAddressHomeLabel'; (* attribute const *) // Home Address
  127. var kABAddressWorkLabel: CFStringRef; external name '_kABAddressWorkLabel'; (* attribute const *) // Work Address
  128. {
  129. * kABAddressCountryCodeKey code must be one of the following:
  130. * iso country codes
  131. *
  132. * ae = United Arab Emirates
  133. * ar = Argentina
  134. * at = Austria
  135. * au = Australia
  136. * ba = Bosnia and Herzegovina
  137. * be = Belgium
  138. * bg = Bulgaria
  139. * bh = Bahrain
  140. * br = Brazil
  141. * ca = Canada
  142. * ch = Switzerland
  143. * cn = China
  144. * cs = Czech
  145. * de = Germany
  146. * dk = Denmark
  147. * eg = Egypt
  148. * es = Spain
  149. * fi = Finland
  150. * fr = France
  151. * gr = Greece
  152. * gl = Greenland
  153. * hk = Hong Kong
  154. * hr = Croatia
  155. * hu = Hungary
  156. * ie = Ireland
  157. * il = Israel
  158. * id = Indonesia
  159. * in = India
  160. * is = Iceland
  161. * it = Italy
  162. * ja = Japan
  163. * jo = Jordan
  164. * kr = South Korea
  165. * kw = Kuwait
  166. * lb = Lebanon
  167. * lu = Luxembourg
  168. * mk = Macedonia
  169. * mx = Mexico
  170. * nl = Netherlands
  171. * no = Norway
  172. * nz = New Zealand
  173. * om = Oman
  174. * pl = Poland
  175. * pt = Portugal
  176. * qa = Qatar
  177. * ro = Romania
  178. * ru = Russian Federation
  179. * sa = Saudi Arabia
  180. * se = Sweden
  181. * sg = Singapore
  182. * si = Slovenia
  183. * sk = Slovakia
  184. * sy = Syrian Arab Republic
  185. * tw = Taiwan
  186. * tr = Turkey
  187. * ua = Ukraine
  188. * uk = United Kingdom
  189. * us = United States
  190. * ye = Yemen
  191. * yu = Serbia and Montenegro
  192. * za = South Africa
  193. *
  194. }
  195. var kABOtherDatesProperty: CFStringRef; external name '_kABOtherDatesProperty'; (* attribute const *)
  196. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // Dates associated with this person - kABMultiDateProperty - (Person)
  197. var kABAnniversaryLabel: CFStringRef; external name '_kABAnniversaryLabel'; (* attribute const *)
  198. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  199. var kABRelatedNamesProperty: CFStringRef; external name '_kABRelatedNamesProperty'; (* attribute const *)
  200. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // names - kABMultiStringProperty
  201. var kABFatherLabel: CFStringRef; external name '_kABFatherLabel'; (* attribute const *)
  202. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  203. var kABMotherLabel: CFStringRef; external name '_kABMotherLabel'; (* attribute const *)
  204. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  205. var kABParentLabel: CFStringRef; external name '_kABParentLabel'; (* attribute const *)
  206. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  207. var kABBrotherLabel: CFStringRef; external name '_kABBrotherLabel'; (* attribute const *)
  208. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  209. var kABSisterLabel: CFStringRef; external name '_kABSisterLabel'; (* attribute const *)
  210. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  211. var kABChildLabel: CFStringRef; external name '_kABChildLabel'; (* attribute const *)
  212. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  213. var kABFriendLabel: CFStringRef; external name '_kABFriendLabel'; (* attribute const *)
  214. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  215. var kABSpouseLabel: CFStringRef; external name '_kABSpouseLabel'; (* attribute const *)
  216. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  217. var kABPartnerLabel: CFStringRef; external name '_kABPartnerLabel'; (* attribute const *)
  218. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  219. var kABAssistantLabel: CFStringRef; external name '_kABAssistantLabel'; (* attribute const *)
  220. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  221. var kABManagerLabel: CFStringRef; external name '_kABManagerLabel'; (* attribute const *)
  222. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  223. var kABDepartmentProperty: CFStringRef; external name '_kABDepartmentProperty'; (* attribute const *)
  224. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // Department name - (Person)
  225. var kABPersonFlags: CFStringRef; external name '_kABPersonFlags'; (* attribute const *)
  226. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // Various flags - kABIntegerProperty
  227. const
  228. kABShowAsMask = 7;
  229. kABShowAsPerson = 0;
  230. kABShowAsCompany = 1;
  231. kABNameOrderingMask = 7 shl 3;
  232. kABDefaultNameOrdering = 0 shl 3;
  233. kABFirstNameFirst = 4 shl 3;
  234. kABLastNameFirst = 2 shl 3;
  235. var kABPhoneProperty: CFStringRef; external name '_kABPhoneProperty'; (* attribute const *) // Generic phone number - kABMultiStringProperty
  236. var kABPhoneWorkLabel: CFStringRef; external name '_kABPhoneWorkLabel'; (* attribute const *) // Work phone
  237. var kABPhoneHomeLabel: CFStringRef; external name '_kABPhoneHomeLabel'; (* attribute const *) // Home phone
  238. var kABPhoneMobileLabel: CFStringRef; external name '_kABPhoneMobileLabel'; (* attribute const *) // Cell phone
  239. var kABPhoneMainLabel: CFStringRef; external name '_kABPhoneMainLabel'; (* attribute const *) // Main phone
  240. var kABPhoneHomeFAXLabel: CFStringRef; external name '_kABPhoneHomeFAXLabel'; (* attribute const *) // FAX number
  241. var kABPhoneWorkFAXLabel: CFStringRef; external name '_kABPhoneWorkFAXLabel'; (* attribute const *) // FAX number
  242. var kABPhonePagerLabel: CFStringRef; external name '_kABPhonePagerLabel'; (* attribute const *) // Pager number
  243. var kABAIMInstantProperty: CFStringRef; external name '_kABAIMInstantProperty'; (* attribute const *) // AIM Instant Messaging - kABMultiStringProperty
  244. var kABAIMWorkLabel: CFStringRef; external name '_kABAIMWorkLabel'; (* attribute const *)
  245. var kABAIMHomeLabel: CFStringRef; external name '_kABAIMHomeLabel'; (* attribute const *)
  246. var kABJabberInstantProperty: CFStringRef; external name '_kABJabberInstantProperty'; (* attribute const *) // Jabber Instant Messaging - kABMultiStringProperty
  247. var kABJabberWorkLabel: CFStringRef; external name '_kABJabberWorkLabel'; (* attribute const *)
  248. var kABJabberHomeLabel: CFStringRef; external name '_kABJabberHomeLabel'; (* attribute const *)
  249. var kABMSNInstantProperty: CFStringRef; external name '_kABMSNInstantProperty'; (* attribute const *) // MSN Instant Messaging - kABMultiStringProperty
  250. var kABMSNWorkLabel: CFStringRef; external name '_kABMSNWorkLabel'; (* attribute const *)
  251. var kABMSNHomeLabel: CFStringRef; external name '_kABMSNHomeLabel'; (* attribute const *)
  252. var kABYahooInstantProperty: CFStringRef; external name '_kABYahooInstantProperty'; (* attribute const *) // Yahoo Instant Messaging - kABMultiStringProperty
  253. var kABYahooWorkLabel: CFStringRef; external name '_kABYahooWorkLabel'; (* attribute const *)
  254. var kABYahooHomeLabel: CFStringRef; external name '_kABYahooHomeLabel'; (* attribute const *)
  255. var kABICQInstantProperty: CFStringRef; external name '_kABICQInstantProperty'; (* attribute const *) // ICQ Instant Messaging - kABMultiStringProperty
  256. var kABICQWorkLabel: CFStringRef; external name '_kABICQWorkLabel'; (* attribute const *)
  257. var kABICQHomeLabel: CFStringRef; external name '_kABICQHomeLabel'; (* attribute const *)
  258. var kABNoteProperty: CFStringRef; external name '_kABNoteProperty'; (* attribute const *) // Note - kABStringProperty
  259. var kABMiddleNameProperty: CFStringRef; external name '_kABMiddleNameProperty'; (* attribute const *) // kABStringProperty
  260. var kABMiddleNamePhoneticProperty: CFStringRef; external name '_kABMiddleNamePhoneticProperty'; (* attribute const *) // kABStringProperty
  261. var kABTitleProperty: CFStringRef; external name '_kABTitleProperty'; (* attribute const *) // kABStringProperty "Sir" "Duke" "General" "Lord"
  262. var kABSuffixProperty: CFStringRef; external name '_kABSuffixProperty'; (* attribute const *) // kABStringProperty "Sr." "Jr." "III"
  263. // ----- Group Specific Properties
  264. var kABGroupNameProperty: CFStringRef; external name '_kABGroupNameProperty'; (* attribute const *) // Name of the group - kABStringProperty
  265. // ================================================================
  266. // Generic Labels
  267. // ================================================================
  268. // All kABXXXXWorkLabel are equivalent to this label
  269. var kABWorkLabel: CFStringRef; external name '_kABWorkLabel'; (* attribute const *)
  270. // All kABXXXXHomeLabel are equivalent to this label
  271. var kABHomeLabel: CFStringRef; external name '_kABHomeLabel'; (* attribute const *)
  272. // Can be used with any multi-value property
  273. var kABOtherLabel: CFStringRef; external name '_kABOtherLabel'; (* attribute const *)
  274. // ================================================================
  275. // Notifications published when something changes
  276. // ================================================================
  277. // These notifications are not sent until ABGetSharedAddressBook()
  278. // has been called somewhere
  279. // This process has changed the DB
  280. var kABDatabaseChangedNotification: CFStringRef; external name '_kABDatabaseChangedNotification'; (* attribute const *)
  281. // Another process has changed the DB
  282. var kABDatabaseChangedExternallyNotification: CFStringRef; external name '_kABDatabaseChangedExternallyNotification'; (* attribute const *)
  283. // The user info (dictionary) in the above notification will contain
  284. // the following 3 keys. Value for each keys is an array of
  285. // uniqueId of the Inserted/Updated/Deleted Records.
  286. // If all three values are nil assume that everything has changed (could be the case
  287. // when restoring from backup)
  288. var kABInsertedRecords: CFStringRef; external name '_kABInsertedRecords'; (* attribute const *)
  289. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  290. var kABUpdatedRecords: CFStringRef; external name '_kABUpdatedRecords'; (* attribute const *)
  291. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  292. var kABDeletedRecords: CFStringRef; external name '_kABDeletedRecords'; (* attribute const *)
  293. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  294. // ================================================================
  295. // Localization of property or label
  296. // ================================================================
  297. // Returns the localized version of built in properties, labels or keys
  298. // Returns propertyOrLabel if not found (e.g. if not built in)
  299. function ABLocalizedPropertyOrLabel( propertyOrLabel: CFStringRef ): CFStringRef; external name '_ABLocalizedPropertyOrLabel';
  300. end.