HIArchive.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. {
  2. File: HIToolbox/HIArchive.h
  3. Contains: HIArchive Interfaces.
  4. Version: HIToolbox-624~3
  5. Copyright: © 2004-2008 by Apple Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation: Peter N Lewis, <[email protected]>, August 2005 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  12. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  13. {
  14. Modified for use with Free Pascal
  15. Version 308
  16. Please report any bugs to <[email protected]>
  17. }
  18. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  19. {$mode macpas}
  20. {$modeswitch cblocks}
  21. {$packenum 1}
  22. {$macro on}
  23. {$inline on}
  24. {$calling mwpascal}
  25. unit HIArchive;
  26. interface
  27. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  28. {$setc GAP_INTERFACES_VERSION := $0308}
  29. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  30. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  31. {$endc}
  32. {$ifc defined CPUPOWERPC and defined CPUI386}
  33. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  34. {$endc}
  35. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  36. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  37. {$endc}
  38. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  39. {$setc __ppc__ := 1}
  40. {$elsec}
  41. {$setc __ppc__ := 0}
  42. {$endc}
  43. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  44. {$setc __ppc64__ := 1}
  45. {$elsec}
  46. {$setc __ppc64__ := 0}
  47. {$endc}
  48. {$ifc not defined __i386__ and defined CPUI386}
  49. {$setc __i386__ := 1}
  50. {$elsec}
  51. {$setc __i386__ := 0}
  52. {$endc}
  53. {$ifc not defined __x86_64__ and defined CPUX86_64}
  54. {$setc __x86_64__ := 1}
  55. {$elsec}
  56. {$setc __x86_64__ := 0}
  57. {$endc}
  58. {$ifc not defined __arm__ and defined CPUARM}
  59. {$setc __arm__ := 1}
  60. {$elsec}
  61. {$setc __arm__ := 0}
  62. {$endc}
  63. {$ifc not defined __arm64__ and defined CPUAARCH64}
  64. {$setc __arm64__ := 1}
  65. {$elsec}
  66. {$setc __arm64__ := 0}
  67. {$endc}
  68. {$ifc defined cpu64}
  69. {$setc __LP64__ := 1}
  70. {$elsec}
  71. {$setc __LP64__ := 0}
  72. {$endc}
  73. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  74. {$error Conflicting definitions for __ppc__ and __i386__}
  75. {$endc}
  76. {$ifc defined __ppc__ and __ppc__}
  77. {$setc TARGET_CPU_PPC := TRUE}
  78. {$setc TARGET_CPU_PPC64 := FALSE}
  79. {$setc TARGET_CPU_X86 := FALSE}
  80. {$setc TARGET_CPU_X86_64 := FALSE}
  81. {$setc TARGET_CPU_ARM := FALSE}
  82. {$setc TARGET_CPU_ARM64 := FALSE}
  83. {$setc TARGET_OS_MAC := TRUE}
  84. {$setc TARGET_OS_IPHONE := FALSE}
  85. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  86. {$setc TARGET_OS_EMBEDDED := FALSE}
  87. {$elifc defined __ppc64__ and __ppc64__}
  88. {$setc TARGET_CPU_PPC := FALSE}
  89. {$setc TARGET_CPU_PPC64 := TRUE}
  90. {$setc TARGET_CPU_X86 := FALSE}
  91. {$setc TARGET_CPU_X86_64 := FALSE}
  92. {$setc TARGET_CPU_ARM := FALSE}
  93. {$setc TARGET_CPU_ARM64 := FALSE}
  94. {$setc TARGET_OS_MAC := TRUE}
  95. {$setc TARGET_OS_IPHONE := FALSE}
  96. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  97. {$setc TARGET_OS_EMBEDDED := FALSE}
  98. {$elifc defined __i386__ and __i386__}
  99. {$setc TARGET_CPU_PPC := FALSE}
  100. {$setc TARGET_CPU_PPC64 := FALSE}
  101. {$setc TARGET_CPU_X86 := TRUE}
  102. {$setc TARGET_CPU_X86_64 := FALSE}
  103. {$setc TARGET_CPU_ARM := FALSE}
  104. {$setc TARGET_CPU_ARM64 := FALSE}
  105. {$ifc defined iphonesim}
  106. {$setc TARGET_OS_MAC := FALSE}
  107. {$setc TARGET_OS_IPHONE := TRUE}
  108. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  109. {$elsec}
  110. {$setc TARGET_OS_MAC := TRUE}
  111. {$setc TARGET_OS_IPHONE := FALSE}
  112. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  113. {$endc}
  114. {$setc TARGET_OS_EMBEDDED := FALSE}
  115. {$elifc defined __x86_64__ and __x86_64__}
  116. {$setc TARGET_CPU_PPC := FALSE}
  117. {$setc TARGET_CPU_PPC64 := FALSE}
  118. {$setc TARGET_CPU_X86 := FALSE}
  119. {$setc TARGET_CPU_X86_64 := TRUE}
  120. {$setc TARGET_CPU_ARM := FALSE}
  121. {$setc TARGET_CPU_ARM64 := FALSE}
  122. {$ifc defined iphonesim}
  123. {$setc TARGET_OS_MAC := FALSE}
  124. {$setc TARGET_OS_IPHONE := TRUE}
  125. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  126. {$elsec}
  127. {$setc TARGET_OS_MAC := TRUE}
  128. {$setc TARGET_OS_IPHONE := FALSE}
  129. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  130. {$endc}
  131. {$setc TARGET_OS_EMBEDDED := FALSE}
  132. {$elifc defined __arm__ and __arm__}
  133. {$setc TARGET_CPU_PPC := FALSE}
  134. {$setc TARGET_CPU_PPC64 := FALSE}
  135. {$setc TARGET_CPU_X86 := FALSE}
  136. {$setc TARGET_CPU_X86_64 := FALSE}
  137. {$setc TARGET_CPU_ARM := TRUE}
  138. {$setc TARGET_CPU_ARM64 := FALSE}
  139. {$setc TARGET_OS_MAC := FALSE}
  140. {$setc TARGET_OS_IPHONE := TRUE}
  141. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  142. {$setc TARGET_OS_EMBEDDED := TRUE}
  143. {$elifc defined __arm64__ and __arm64__}
  144. {$setc TARGET_CPU_PPC := FALSE}
  145. {$setc TARGET_CPU_PPC64 := FALSE}
  146. {$setc TARGET_CPU_X86 := FALSE}
  147. {$setc TARGET_CPU_X86_64 := FALSE}
  148. {$setc TARGET_CPU_ARM := FALSE}
  149. {$setc TARGET_CPU_ARM64 := TRUE}
  150. {$ifc defined ios}
  151. {$setc TARGET_OS_MAC := FALSE}
  152. {$setc TARGET_OS_IPHONE := TRUE}
  153. {$setc TARGET_OS_EMBEDDED := TRUE}
  154. {$elsec}
  155. {$setc TARGET_OS_MAC := TRUE}
  156. {$setc TARGET_OS_IPHONE := FALSE}
  157. {$setc TARGET_OS_EMBEDDED := FALSE}
  158. {$endc}
  159. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  160. {$elsec}
  161. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  162. {$endc}
  163. {$ifc defined __LP64__ and __LP64__ }
  164. {$setc TARGET_CPU_64 := TRUE}
  165. {$elsec}
  166. {$setc TARGET_CPU_64 := FALSE}
  167. {$endc}
  168. {$ifc defined FPC_BIG_ENDIAN}
  169. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  170. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  171. {$elifc defined FPC_LITTLE_ENDIAN}
  172. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  173. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  174. {$elsec}
  175. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  176. {$endc}
  177. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  178. {$setc CALL_NOT_IN_CARBON := FALSE}
  179. {$setc OLDROUTINENAMES := FALSE}
  180. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  181. {$setc OPAQUE_UPP_TYPES := TRUE}
  182. {$setc OTCARBONAPPLICATION := TRUE}
  183. {$setc OTKERNEL := FALSE}
  184. {$setc PM_USE_SESSION_APIS := TRUE}
  185. {$setc TARGET_API_MAC_CARBON := TRUE}
  186. {$setc TARGET_API_MAC_OS8 := FALSE}
  187. {$setc TARGET_API_MAC_OSX := TRUE}
  188. {$setc TARGET_CARBON := TRUE}
  189. {$setc TARGET_CPU_68K := FALSE}
  190. {$setc TARGET_CPU_MIPS := FALSE}
  191. {$setc TARGET_CPU_SPARC := FALSE}
  192. {$setc TARGET_OS_UNIX := FALSE}
  193. {$setc TARGET_OS_WIN32 := FALSE}
  194. {$setc TARGET_RT_MAC_68881 := FALSE}
  195. {$setc TARGET_RT_MAC_CFM := FALSE}
  196. {$setc TARGET_RT_MAC_MACHO := TRUE}
  197. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  198. {$setc TYPE_BOOL := FALSE}
  199. {$setc TYPE_EXTENDED := FALSE}
  200. {$setc TYPE_LONGLONG := TRUE}
  201. uses MacTypes,CFBase,CFData,CFNumber,HIObject;
  202. {$endc} {not MACOSALLINCLUDE}
  203. {$ifc TARGET_OS_MAC}
  204. {$ALIGN POWER}
  205. {
  206. * HIArchive
  207. *
  208. * Discussion:
  209. * HIArchive provides a standard, extensible mechanism to flatten
  210. * objects for storage in memory or on disk for later retrieval or
  211. * transfer to another application. The archive is encoded using the
  212. * binary property list format. The binary plist can be converted to
  213. * text XML with /usr/bin/plutil for development purposes. Details
  214. * on how to create an object that supports the HIArchive protocol
  215. * are provided in HIToolbox/HIObject.h.
  216. *
  217. * When writing data out to an archive, the client must first use
  218. * HIArchiveCreateForEncoding to generate the archive into which the
  219. * data will be encoded. From there, data may be added to the
  220. * archive by calling HIArchiveEncodeBoolean, HIArchiveEncodeNumber,
  221. * and HIArchiveEncodeCFType. If HIArchiveEncodeCFType is being
  222. * called on one of your custom HIObjects, HIToolbox will send it
  223. * the kEventHIObjectEncode event (see HIObject.h). In order to
  224. * receive this event your HIObject must first have set its
  225. * archiving-ignored value to false via HIObjectSetArchivingIgnored.
  226. * This lets HIToolbox know your object supports archiving. The
  227. * kEventParamHIArchive parameter contains the HIArchiveRef into
  228. * which it should encode all of its relevant state information. All
  229. * information added to the archive is written with a key. This key
  230. * is used later during the unarchiving process to pull the encoded
  231. * data from the archive. System supplied HIObjects namespace their
  232. * keys with an HI prefix. Subclasses of system supplied HIObjects
  233. * should only use this namespace if explicitly overriding a value
  234. * written to the archive by the superclass. Take care to mantain
  235. * the same data format when overriding the default to avoid
  236. * incompatibilities. When your archiving process is complete,
  237. * HIArchiveCopyEncodedData will compress the data into the archive
  238. * and return it in a CFDataRef. This CFDataRef can be sent to
  239. * another application or written out to disk for later retrieval.
  240. * Once the encoded data is compressed, no more data may be added to
  241. * the archive. At this point, the HIArchiveRef must be released via
  242. * CFRelease.
  243. *
  244. * When retrieving data from an archive, the client must first use
  245. * HIArchiveCreateForDecoding to create an archive reference capable
  246. * of decoding the data from the provided CFDataRef. Given the
  247. * HIArchiveRef, data may be pulled from the archive via
  248. * HIArchiveDecodeBoolean, HIArchiveDecodeNumber, and
  249. * HIArchiveCopyDecodedCFType. If HIArchiveCopyDecodedCFType is
  250. * called on one of your custom HIObjects, HIToolbox will send it
  251. * the kEventHIObjectInitialize event (see HIOject.h). The
  252. * kEventParamHIArchive parameter contains the HIArchiveRef from
  253. * which it should decode all of its relevant state information.
  254. * Because these data values were written by key, they can be read
  255. * in any order regardless of how they were written. This also means
  256. * new keyed values can be added without breaking existing decoding
  257. * routines. Once all data has been read from the archive, it may
  258. * simply be released via CFRelease.
  259. *
  260. * For those clients who wish to provide HIArchive editing features
  261. * there are a few tricks necessary to achieve the desired behavior.
  262. * A generic HIArchive editor will likely be used by clients to edit
  263. * objects for which it has no direct knowledge (or which have not
  264. * yet been designed). For instance, it may provide users with the
  265. * ability to edit custom HIViews, including generic functionality
  266. * to set the view's class identifier, title, frame, etc. In this
  267. * case, it is necessary to instantiate the superclass
  268. * ("com.apple.hiview") of the custom view object because the custom
  269. * view class itself hasn't been registered within the editor.
  270. *
  271. *
  272. * After the user has completed editing the object and desires to
  273. * write out the archive, the editor must set the custom archive
  274. * data to the object with HIObjectSetCustomArchiveData as a
  275. * CFDictionary. Standard keys for initialization parameter types,
  276. * names and values, class and superclass identifiers and CDEF
  277. * procID are provided in HIToolbox/HIObject.h. Of particular
  278. * importance are the object's class and superclass identifier.
  279. * HIArchive uses these values to instantiate the proper object when
  280. * loading the archive within the client's application. The
  281. * parameter types, names and values are then automatically passed
  282. * to the client object through its initialization event.
  283. *
  284. * At this point, the object can simply be written into the archive
  285. * with HIArchiveCreateForEncoding and HIArchiveEncodeCFType.
  286. * HIArchive will handle writing the appropriate classID based on
  287. * the custom data that was assigned earlier.
  288. *
  289. * Generic HIArchive editing applications will also need to handle
  290. * loading client archives. In this case, the archive is decoded in
  291. * editing mode by passing the
  292. * kHIArchiveDecodeSuperclassForUnregisteredObjects proxy bit in
  293. * HIArchiveCreateForDecoding. When objects not registered in the
  294. * current application are decoded, HIArchive will notice this and
  295. * look into the custom data for the object's superclass identifier,
  296. * instantiate an object of that type instead and attach the custom
  297. * data to the newly created object. The editor can then look at the
  298. * attached custom data with HIObjectCopyCustomArchiveData and
  299. * provide it in the UI for the user to edit.
  300. }
  301. type
  302. HIArchiveRef = ^OpaqueHIArchiveRef; { an opaque type }
  303. OpaqueHIArchiveRef = record end;
  304. {
  305. * Discussion:
  306. * HIArchive errors
  307. }
  308. const
  309. {
  310. * The archive was created specifically for encoding or decoding but
  311. * passed into a non-corresponding routine.
  312. }
  313. hiArchiveTypeMismatchErr = -6780;
  314. {
  315. * The keyed value requested does not exist in the archive.
  316. }
  317. hiArchiveKeyNotAvailableErr = -6781;
  318. {
  319. * HIArchiveCopyEncodedData has been called and no more data may be
  320. * encoded.
  321. }
  322. hiArchiveEncodingCompleteErr = -6782;
  323. {
  324. * The HIObject does not support the archiving protocol.
  325. }
  326. hiArchiveHIObjectIgnoresArchivingErr = -6783;
  327. {
  328. * Discussion:
  329. * HIArchiveCreateForDecoding options
  330. }
  331. const
  332. {
  333. * kDecodeSuperclassForUnregisteredObjects is passed to
  334. * HIArchiveCreateForDecoding indicating that if an HIObject's class
  335. * has not been registered before it is pulled from the archive,
  336. * HIArchiveCopyDecodedCFType will automatically instantiate the
  337. * unarchived object as its superclass if it exists. For instance, a
  338. * custom HIView of class "com.myco.customview" being unarchived will
  339. * be instantiated as class "com.apple.hiview" if your app has not
  340. * yet registered "com.myco.customview". This is useful for archive
  341. * editors that do not implement all objects contained in a client
  342. * archive. Note that only data written to the archive by the
  343. * superclass will be decoded. All data unique to the unregistered
  344. * subclass will be ignored. This option also signals the HIObject to
  345. * load its custom archive data so it can be accessed via
  346. * HIObjectCopyCustomArchiveData. HIArchive is unable to instantiate
  347. * unregistered objects whose superclasses are also unregistered.
  348. }
  349. kHIArchiveDecodeSuperclassForUnregisteredObjects = 1 shl 0;
  350. {
  351. * Indicates that an archive is being decoded by an archive editor.
  352. * This information is passed to the object being decoded via the
  353. * kEventParamDecodingForEditor parameter in the
  354. * kEventHIObjectInitialize and kEventHIObjectCreatedFromArchive
  355. * event. This option may be used in Mac OS X 10.5 and later.
  356. }
  357. kHIArchiveDecodingForEditor = 1 shl 1;
  358. {$ifc not TARGET_CPU_64}
  359. {
  360. * HIArchiveGetTypeID()
  361. *
  362. * Summary:
  363. * Returns the CFType identifier for an HIArchive object.
  364. *
  365. * Mac OS X threading:
  366. * Not thread safe
  367. *
  368. * Result:
  369. * A CFTypeID unique to HIArchive instances.
  370. *
  371. * Availability:
  372. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  373. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  374. * Non-Carbon CFM: not available
  375. }
  376. function HIArchiveGetTypeID: CFTypeID; external name '_HIArchiveGetTypeID';
  377. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  378. {
  379. * HIArchiveCreateForEncoding()
  380. *
  381. * Summary:
  382. * Creates an HIArchive for use in encoding object information.
  383. *
  384. * Discussion:
  385. * The created HIArchiveRef is a CFType and must be released via
  386. * CFRelease.
  387. *
  388. * Mac OS X threading:
  389. * Not thread safe
  390. *
  391. * Parameters:
  392. *
  393. * outEncoder:
  394. * An HIArchive reference which receives the created HIArchive on
  395. * return.
  396. *
  397. * Result:
  398. * An operating system result code.
  399. *
  400. * Availability:
  401. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  402. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  403. * Non-Carbon CFM: not available
  404. }
  405. function HIArchiveCreateForEncoding( var outEncoder: HIArchiveRef ): OSStatus; external name '_HIArchiveCreateForEncoding';
  406. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  407. {
  408. * HIArchiveEncodeBoolean()
  409. *
  410. * Summary:
  411. * Adds a keyed boolean value to the provided archive.
  412. *
  413. * Mac OS X threading:
  414. * Not thread safe
  415. *
  416. * Parameters:
  417. *
  418. * inEncoder:
  419. * An HIArchiveRef to which the boolean value is added.
  420. *
  421. * inKey:
  422. * The key associated with the boolean value used for later
  423. * decoding.
  424. *
  425. * inBoolean:
  426. * The boolean value to be encoded.
  427. *
  428. * Result:
  429. * An operating system result code.
  430. *
  431. * Availability:
  432. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  433. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  434. * Non-Carbon CFM: not available
  435. }
  436. function HIArchiveEncodeBoolean( inEncoder: HIArchiveRef; inKey: CFStringRef; inBoolean: Boolean ): OSStatus; external name '_HIArchiveEncodeBoolean';
  437. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  438. {
  439. * HIArchiveEncodeNumber()
  440. *
  441. * Summary:
  442. * Adds a keyed number value to the provided archive.
  443. *
  444. * Mac OS X threading:
  445. * Not thread safe
  446. *
  447. * Parameters:
  448. *
  449. * inEncoder:
  450. * An HIArchiveRef to which the number value is added.
  451. *
  452. * inKey:
  453. * The key associated with the number value used for later
  454. * decoding.
  455. *
  456. * inNumberType:
  457. * A CFNumberType describing the type of number value being
  458. * encoded.
  459. *
  460. * inNumberValue:
  461. * The number value to be encoded.
  462. *
  463. * Result:
  464. * An operating system result code.
  465. *
  466. * Availability:
  467. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  468. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  469. * Non-Carbon CFM: not available
  470. }
  471. function HIArchiveEncodeNumber( inEncoder: HIArchiveRef; inKey: CFStringRef; inNumberType: CFNumberType; inNumberValue: {const} UnivPtr ): OSStatus; external name '_HIArchiveEncodeNumber';
  472. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  473. {
  474. * HIArchiveEncodeCFType()
  475. *
  476. * Summary:
  477. * Adds a keyed CFType to the provided archive.
  478. *
  479. * Discussion:
  480. * Encodes basic and property list based CFTypes including HIObjects
  481. * supporting the archiving protocol. If the HIObject supports the
  482. * archiving protocol, it will receive the kEventHIObjectEncode
  483. * event during which it should encode all relevant state
  484. * information. The kEventParamHIArchive parameter contains the
  485. * archive into which data should be added.
  486. *
  487. * Mac OS X threading:
  488. * Not thread safe
  489. *
  490. * Parameters:
  491. *
  492. * inEncoder:
  493. * An HIArchiveRef to which the CFType is added.
  494. *
  495. * inKey:
  496. * The key associated with the CFType used for later decoding.
  497. *
  498. * inCFType:
  499. * The CFType to be encoded.
  500. *
  501. * Result:
  502. * An operating system result code.
  503. *
  504. * Availability:
  505. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  506. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  507. * Non-Carbon CFM: not available
  508. }
  509. function HIArchiveEncodeCFType( inEncoder: HIArchiveRef; inKey: CFStringRef; inCFType: CFTypeRef ): OSStatus; external name '_HIArchiveEncodeCFType';
  510. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  511. {
  512. * HIArchiveCopyEncodedData()
  513. *
  514. * Summary:
  515. * Returns the encoded archive as a CFDataRef.
  516. *
  517. * Discussion:
  518. * Compresses the archived data for storage and returns it as a
  519. * CFDataRef. After the archived data is compressed, no further
  520. * information may be encoded. Do not call this routine until the
  521. * encoding process is complete.
  522. *
  523. * Mac OS X threading:
  524. * Not thread safe
  525. *
  526. * Parameters:
  527. *
  528. * inEncoder:
  529. * An HIArchiveRef into which the archived data was compiled.
  530. *
  531. * outData:
  532. * A CFData reference which receives the compressed archive data
  533. * on return.
  534. *
  535. * Result:
  536. * An operating system result code.
  537. *
  538. * Availability:
  539. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  540. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  541. * Non-Carbon CFM: not available
  542. }
  543. function HIArchiveCopyEncodedData( inEncoder: HIArchiveRef; var outData: CFDataRef ): OSStatus; external name '_HIArchiveCopyEncodedData';
  544. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  545. {
  546. * HIArchiveCreateForDecoding()
  547. *
  548. * Summary:
  549. * Creates an HIArchive for use in decoding the object information
  550. * contained in the provided CFData reference.
  551. *
  552. * Discussion:
  553. * The created HIArchiveRef is a CFType and must be released via
  554. * CFRelease.
  555. *
  556. * Mac OS X threading:
  557. * Not thread safe
  558. *
  559. * Parameters:
  560. *
  561. * inData:
  562. * A CFDataRef containing a previously encoded archive.
  563. *
  564. * inOptions:
  565. * The only option supported by this routine at present is
  566. * kHIArchiveDecodeSuperclassForUnregisteredObjects. You may also
  567. * pass zero for this parameter to get the default behavior.
  568. *
  569. * outDecoder:
  570. * An HIArchive reference which receives the created HIArchive on
  571. * return.
  572. *
  573. * Result:
  574. * An operating system result code.
  575. *
  576. * Availability:
  577. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  578. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  579. * Non-Carbon CFM: not available
  580. }
  581. function HIArchiveCreateForDecoding( inData: CFDataRef; inOptions: OptionBits; var outDecoder: HIArchiveRef ): OSStatus; external name '_HIArchiveCreateForDecoding';
  582. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  583. {
  584. * HIArchiveDecodeBoolean()
  585. *
  586. * Summary:
  587. * Pulls a keyed boolean value from the provided archive.
  588. *
  589. * Mac OS X threading:
  590. * Not thread safe
  591. *
  592. * Parameters:
  593. *
  594. * inDecoder:
  595. * An HIArchiveRef from which the boolean value is pulled.
  596. *
  597. * inKey:
  598. * The key associated with the boolean value used while encoding.
  599. *
  600. * outBoolean:
  601. * The boolean value to be decoded.
  602. *
  603. * Result:
  604. * An operating system result code.
  605. *
  606. * Availability:
  607. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  608. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  609. * Non-Carbon CFM: not available
  610. }
  611. function HIArchiveDecodeBoolean( inDecoder: HIArchiveRef; inKey: CFStringRef; var outBoolean: Boolean ): OSStatus; external name '_HIArchiveDecodeBoolean';
  612. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  613. {
  614. * HIArchiveDecodeNumber()
  615. *
  616. * Summary:
  617. * Pulls a keyed number value from the provided archive.
  618. *
  619. * Mac OS X threading:
  620. * Not thread safe
  621. *
  622. * Parameters:
  623. *
  624. * inDecoder:
  625. * An HIArchiveRef from which the number value is pulled.
  626. *
  627. * inKey:
  628. * The key associated with the number value used while encoding.
  629. *
  630. * inNumberType:
  631. * A CFNumberType describing the type of number value being
  632. * encoded.
  633. *
  634. * outNumberValue:
  635. * The number value to be decoded.
  636. *
  637. * Result:
  638. * An operating system result code.
  639. *
  640. * Availability:
  641. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  642. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  643. * Non-Carbon CFM: not available
  644. }
  645. function HIArchiveDecodeNumber( inDecoder: HIArchiveRef; inKey: CFStringRef; inNumberType: CFNumberType; outNumberValue: UnivPtr ): OSStatus; external name '_HIArchiveDecodeNumber';
  646. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  647. {
  648. * HIArchiveCopyDecodedCFType()
  649. *
  650. * Summary:
  651. * Pulls a keyed CFType from the provided archive.
  652. *
  653. * Discussion:
  654. * Decodes basic and property list based CFTypes and HIObjects. If
  655. * the CFType is an HIObject, it will be constructed and receive the
  656. * kEventHIObjectInitialize event. The kEventParamHIArchive
  657. * parameter contains the archive from which data should be
  658. * retrieved.
  659. *
  660. * Mac OS X threading:
  661. * Not thread safe
  662. *
  663. * Parameters:
  664. *
  665. * inDecoder:
  666. * An HIArchiveRef from which the CFType value is pulled.
  667. *
  668. * inKey:
  669. * The key associated with the CFType used while encoding.
  670. *
  671. * outCFType:
  672. * The CFType to be decoded.
  673. *
  674. * Result:
  675. * An operating system result code.
  676. *
  677. * Availability:
  678. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  679. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  680. * Non-Carbon CFM: not available
  681. }
  682. function HIArchiveCopyDecodedCFType( inDecoder: HIArchiveRef; inKey: CFStringRef; var outCFType: CFTypeRef ): OSStatus; external name '_HIArchiveCopyDecodedCFType';
  683. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  684. {$endc} {not TARGET_CPU_64}
  685. {$endc} {TARGET_OS_MAC}
  686. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  687. end.
  688. {$endc} {not MACOSALLINCLUDE}