UTType.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. {
  2. File: UTType.h
  3. Contains: Public interfaces for uniform type identifiers
  4. Copyright: (c) 2003-2012 by Apple Inc. All rights reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://bugs.freepascal.org
  8. }
  9. {
  10. Modified for use with Free Pascal
  11. Version 308
  12. Please report any bugs to <[email protected]>
  13. }
  14. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  15. {$mode macpas}
  16. {$modeswitch cblocks}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$calling mwpascal}
  21. unit UTType;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  24. {$setc GAP_INTERFACES_VERSION := $0308}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  40. {$setc __ppc64__ := 1}
  41. {$elsec}
  42. {$setc __ppc64__ := 0}
  43. {$endc}
  44. {$ifc not defined __i386__ and defined CPUI386}
  45. {$setc __i386__ := 1}
  46. {$elsec}
  47. {$setc __i386__ := 0}
  48. {$endc}
  49. {$ifc not defined __x86_64__ and defined CPUX86_64}
  50. {$setc __x86_64__ := 1}
  51. {$elsec}
  52. {$setc __x86_64__ := 0}
  53. {$endc}
  54. {$ifc not defined __arm__ and defined CPUARM}
  55. {$setc __arm__ := 1}
  56. {$elsec}
  57. {$setc __arm__ := 0}
  58. {$endc}
  59. {$ifc not defined __arm64__ and defined CPUAARCH64}
  60. {$setc __arm64__ := 1}
  61. {$elsec}
  62. {$setc __arm64__ := 0}
  63. {$endc}
  64. {$ifc defined cpu64}
  65. {$setc __LP64__ := 1}
  66. {$elsec}
  67. {$setc __LP64__ := 0}
  68. {$endc}
  69. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  70. {$error Conflicting definitions for __ppc__ and __i386__}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__}
  73. {$setc TARGET_CPU_PPC := TRUE}
  74. {$setc TARGET_CPU_PPC64 := FALSE}
  75. {$setc TARGET_CPU_X86 := FALSE}
  76. {$setc TARGET_CPU_X86_64 := FALSE}
  77. {$setc TARGET_CPU_ARM := FALSE}
  78. {$setc TARGET_CPU_ARM64 := FALSE}
  79. {$setc TARGET_OS_MAC := TRUE}
  80. {$setc TARGET_OS_IPHONE := FALSE}
  81. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  82. {$setc TARGET_OS_EMBEDDED := FALSE}
  83. {$elifc defined __ppc64__ and __ppc64__}
  84. {$setc TARGET_CPU_PPC := FALSE}
  85. {$setc TARGET_CPU_PPC64 := TRUE}
  86. {$setc TARGET_CPU_X86 := FALSE}
  87. {$setc TARGET_CPU_X86_64 := FALSE}
  88. {$setc TARGET_CPU_ARM := FALSE}
  89. {$setc TARGET_CPU_ARM64 := FALSE}
  90. {$setc TARGET_OS_MAC := TRUE}
  91. {$setc TARGET_OS_IPHONE := FALSE}
  92. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  93. {$setc TARGET_OS_EMBEDDED := FALSE}
  94. {$elifc defined __i386__ and __i386__}
  95. {$setc TARGET_CPU_PPC := FALSE}
  96. {$setc TARGET_CPU_PPC64 := FALSE}
  97. {$setc TARGET_CPU_X86 := TRUE}
  98. {$setc TARGET_CPU_X86_64 := FALSE}
  99. {$setc TARGET_CPU_ARM := FALSE}
  100. {$setc TARGET_CPU_ARM64 := FALSE}
  101. {$ifc defined iphonesim}
  102. {$setc TARGET_OS_MAC := FALSE}
  103. {$setc TARGET_OS_IPHONE := TRUE}
  104. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  105. {$elsec}
  106. {$setc TARGET_OS_MAC := TRUE}
  107. {$setc TARGET_OS_IPHONE := FALSE}
  108. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  109. {$endc}
  110. {$setc TARGET_OS_EMBEDDED := FALSE}
  111. {$elifc defined __x86_64__ and __x86_64__}
  112. {$setc TARGET_CPU_PPC := FALSE}
  113. {$setc TARGET_CPU_PPC64 := FALSE}
  114. {$setc TARGET_CPU_X86 := FALSE}
  115. {$setc TARGET_CPU_X86_64 := TRUE}
  116. {$setc TARGET_CPU_ARM := FALSE}
  117. {$setc TARGET_CPU_ARM64 := FALSE}
  118. {$ifc defined iphonesim}
  119. {$setc TARGET_OS_MAC := FALSE}
  120. {$setc TARGET_OS_IPHONE := TRUE}
  121. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  122. {$elsec}
  123. {$setc TARGET_OS_MAC := TRUE}
  124. {$setc TARGET_OS_IPHONE := FALSE}
  125. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  126. {$endc}
  127. {$setc TARGET_OS_EMBEDDED := FALSE}
  128. {$elifc defined __arm__ and __arm__}
  129. {$setc TARGET_CPU_PPC := FALSE}
  130. {$setc TARGET_CPU_PPC64 := FALSE}
  131. {$setc TARGET_CPU_X86 := FALSE}
  132. {$setc TARGET_CPU_X86_64 := FALSE}
  133. {$setc TARGET_CPU_ARM := TRUE}
  134. {$setc TARGET_CPU_ARM64 := FALSE}
  135. {$setc TARGET_OS_MAC := FALSE}
  136. {$setc TARGET_OS_IPHONE := TRUE}
  137. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  138. {$setc TARGET_OS_EMBEDDED := TRUE}
  139. {$elifc defined __arm64__ and __arm64__}
  140. {$setc TARGET_CPU_PPC := FALSE}
  141. {$setc TARGET_CPU_PPC64 := FALSE}
  142. {$setc TARGET_CPU_X86 := FALSE}
  143. {$setc TARGET_CPU_X86_64 := FALSE}
  144. {$setc TARGET_CPU_ARM := FALSE}
  145. {$setc TARGET_CPU_ARM64 := TRUE}
  146. {$ifc defined ios}
  147. {$setc TARGET_OS_MAC := FALSE}
  148. {$setc TARGET_OS_IPHONE := TRUE}
  149. {$setc TARGET_OS_EMBEDDED := TRUE}
  150. {$elsec}
  151. {$setc TARGET_OS_MAC := TRUE}
  152. {$setc TARGET_OS_IPHONE := FALSE}
  153. {$setc TARGET_OS_EMBEDDED := FALSE}
  154. {$endc}
  155. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  156. {$elsec}
  157. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  158. {$endc}
  159. {$ifc defined __LP64__ and __LP64__ }
  160. {$setc TARGET_CPU_64 := TRUE}
  161. {$elsec}
  162. {$setc TARGET_CPU_64 := FALSE}
  163. {$endc}
  164. {$ifc defined FPC_BIG_ENDIAN}
  165. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  166. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  167. {$elifc defined FPC_LITTLE_ENDIAN}
  168. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  169. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  170. {$elsec}
  171. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  172. {$endc}
  173. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  174. {$setc CALL_NOT_IN_CARBON := FALSE}
  175. {$setc OLDROUTINENAMES := FALSE}
  176. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  177. {$setc OPAQUE_UPP_TYPES := TRUE}
  178. {$setc OTCARBONAPPLICATION := TRUE}
  179. {$setc OTKERNEL := FALSE}
  180. {$setc PM_USE_SESSION_APIS := TRUE}
  181. {$setc TARGET_API_MAC_CARBON := TRUE}
  182. {$setc TARGET_API_MAC_OS8 := FALSE}
  183. {$setc TARGET_API_MAC_OSX := TRUE}
  184. {$setc TARGET_CARBON := TRUE}
  185. {$setc TARGET_CPU_68K := FALSE}
  186. {$setc TARGET_CPU_MIPS := FALSE}
  187. {$setc TARGET_CPU_SPARC := FALSE}
  188. {$setc TARGET_OS_UNIX := FALSE}
  189. {$setc TARGET_OS_WIN32 := FALSE}
  190. {$setc TARGET_RT_MAC_68881 := FALSE}
  191. {$setc TARGET_RT_MAC_CFM := FALSE}
  192. {$setc TARGET_RT_MAC_MACHO := TRUE}
  193. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  194. {$setc TYPE_BOOL := FALSE}
  195. {$setc TYPE_EXTENDED := FALSE}
  196. {$setc TYPE_LONGLONG := TRUE}
  197. uses MacTypes,CFBase,CFArray,CFDictionary,CFURL;
  198. {$endc} {not MACOSALLINCLUDE}
  199. {$ALIGN POWER}
  200. { ======================================================================================================== }
  201. { Uniform Type Identification API }
  202. { ======================================================================================================== }
  203. {
  204. Uniform Type Identification Primer
  205. Uniform Type Identifiers (or UTIs) are strings which uniquely identify
  206. abstract types. They can be used to describe a file format or an
  207. in-memory data type, but can also be used to describe the type of
  208. other sorts of entities, such as directories, volumes, or packages.
  209. The syntax of a uniform type identifier looks like a bundle identifier.
  210. It has the form of a reversed DNS name, although some special top-level
  211. UTI domains are reserved by Apple and are outside the current IANA
  212. top-level Internet domain name space.
  213. Examples:
  214. public.jpeg
  215. public.utf16-plain-text
  216. com.apple.xml-property-list
  217. Types which are standard or not controlled by any one organization
  218. are declared in the "public" domain. Currently, public types may
  219. be declared only by Apple.
  220. Types specific to Mac OS are declared with identifiers in the
  221. com.apple.macos domain.
  222. Third parties should declare their own uniform type identifiers
  223. in their respective registered Internet domain spaces.
  224. Type declarations appear in bundle property lists and tell
  225. the system several things about a type, including the following:
  226. Conformance
  227. A type may "conform" to one or more other types. For example, the
  228. type com.apple.xml-property-list conforms to both the
  229. com.apple.property-list and public.xml types. The public.xml
  230. type in turn conforms to type public.text. Finally, type public.text
  231. conforms to public.data, which is the base type for all types
  232. describing bytes stream formats. Conformance relationships between
  233. types are established in type declarations.
  234. Conformance relationships establish a multiple inheritanace hierarchy
  235. between types. Type property values may be inherited at runtime
  236. according to the conformance relationships for each type. When a type's
  237. declaration does not include a value for particular type property,
  238. then the type's supertypes are searched for a value. Supertypes are
  239. searched depth-first, in the order given in the type declaration.
  240. This is the only way in which the declared order of the conforms-to
  241. supertypes is significant.
  242. Tags
  243. A "tag" is a string which indicates a type in some other type
  244. identification space, such as a filename extension, MIME Type,
  245. or NSPboardType. Each type declaration may include a
  246. "tag specification", which is a dictionary listing all of the
  247. tags associated with the type.
  248. A tag's "class" is the namespace of a tag: filename extension,
  249. MIME type, OSType, etc. Tag classes are themselves identified by
  250. uniform type identifiers so that the set of valid tag classes is
  251. easily extendend in the future.
  252. Other Type Properties
  253. Type declarations may include several other properties: a localizable
  254. user description of the type, the name of an icon resource in
  255. the declaring bundle, a reference URL identifying technical
  256. documentation about the type itself, and finally a version number,
  257. which can be incremented as a type evolves. All of these properties
  258. are optional.
  259. Exported vs. Imported Type Declarations
  260. Type declarations are either exported or imported. An exported
  261. type declaration means that the type itself is defined or owned
  262. by the organization making the declaration. For example, a propietary
  263. document type declaration should only be exported by the application
  264. which controls the document format.
  265. An imported declaration is for applications which depend on the
  266. existence of someone else's type declaration. If application A can
  267. open application B's document format, then application A makes
  268. an imported declaration of application B's document type so that
  269. even if application B is not present on the system, there is an
  270. acessible declaration of its document type.
  271. An exported declaration of a particular type identifier is always
  272. preferred over an imported declaration.
  273. Example XML Type Declaration
  274. Appearing below is an XML excerpt from a bundle Info.plist file which
  275. declares the public type "public.jpeg":
  276. <key>UTExportedTypeDeclarations</key>
  277. <array>
  278. <dict>
  279. <key>UTTypeIdentifier</key>
  280. <string>public.jpeg</string>
  281. <key>UTTypeDescription</key>
  282. <string>JPEG image</string>
  283. <key>UTTypeIconFile</key>
  284. <string>public.jpeg.icns</string>
  285. <key>UTTypeConformsTo</key>
  286. <array>
  287. <string>public.image</string>
  288. </array>
  289. <key>UTTypeTagSpecification</key>
  290. <dict>
  291. <key>com.apple.ostype</key>
  292. <string>JPEG</string>
  293. <key>public.filename-extension</key>
  294. <array>
  295. <string>jpeg</string>
  296. <string>jpg</string>
  297. </array>
  298. <key>public.mime-type</key>
  299. <string>image/jpeg</string>
  300. </dict>
  301. </dict>
  302. </array>
  303. Dynamic Type Identifiers
  304. Uniform Type Identifiation uses dynamic type identifiers to
  305. represent types for which no identifier has been declared. A
  306. dynamic type identifier is syntactially a regular uniform
  307. type identifier in the "dyn" domain. However, after the
  308. initial domain label, a dynamic type identifier is an
  309. opaque encoding of a tag specification. Dynamic type
  310. identifiers cannot be declared. They are generated on-demand
  311. with whatever type information is available at the time, often
  312. a single (otherwise unknown) type tag.
  313. A dynamic identifier therefore carries within it a minimal
  314. amount of type information, but enough to work well with the
  315. Uniform Type Identification API. For example, a client can
  316. extract from a dynamic type identifier the original tag
  317. specification with which it was created. A client can also
  318. test a dynamic type identifier for equality to another
  319. uniform type identifier. If the dynamic identifier's
  320. tag specification is a subset of the other identifier's
  321. tags, the two are considered equal.
  322. Dynamic type identifiers do not express the full richness
  323. of type information associated with a declared type
  324. identifier, but dynamic type identifiers allow the behavior
  325. to degrade gracefully in the presence of incomplete
  326. declared type information.
  327. A dynamic type identifier may be transmitted across processes
  328. on a given system, but it should never be stored persistently
  329. or transmitted over the wire to another system. In particular,
  330. dynamic identifiers should not appear in bundle info property
  331. lists, and they will generally be ignored when they do. Apple
  332. reserves the right to change the opaque format of dynamic
  333. identifiers in future versions of Mac OS X.
  334. }
  335. {
  336. Type Declaration Dictionary Keys
  337. The following keys are used in type declarations
  338. }
  339. {
  340. * kUTExportedTypeDeclarationsKey
  341. }
  342. var kUTExportedTypeDeclarationsKey: CFStringRef; external name '_kUTExportedTypeDeclarationsKey'; (* attribute const *)
  343. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  344. {
  345. * kUTImportedTypeDeclarationsKey
  346. }
  347. var kUTImportedTypeDeclarationsKey: CFStringRef; external name '_kUTImportedTypeDeclarationsKey'; (* attribute const *)
  348. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  349. {
  350. * kUTTypeIdentifierKey
  351. }
  352. var kUTTypeIdentifierKey: CFStringRef; external name '_kUTTypeIdentifierKey'; (* attribute const *)
  353. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  354. {
  355. * kUTTypeTagSpecificationKey
  356. }
  357. var kUTTypeTagSpecificationKey: CFStringRef; external name '_kUTTypeTagSpecificationKey'; (* attribute const *)
  358. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  359. {
  360. * kUTTypeConformsToKey
  361. }
  362. var kUTTypeConformsToKey: CFStringRef; external name '_kUTTypeConformsToKey'; (* attribute const *)
  363. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  364. {
  365. * kUTTypeDescriptionKey
  366. }
  367. var kUTTypeDescriptionKey: CFStringRef; external name '_kUTTypeDescriptionKey'; (* attribute const *)
  368. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  369. {
  370. * kUTTypeIconFileKey
  371. }
  372. var kUTTypeIconFileKey: CFStringRef; external name '_kUTTypeIconFileKey'; (* attribute const *)
  373. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  374. {
  375. * kUTTypeReferenceURLKey
  376. }
  377. var kUTTypeReferenceURLKey: CFStringRef; external name '_kUTTypeReferenceURLKey'; (* attribute const *)
  378. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  379. {
  380. * kUTTypeVersionKey
  381. }
  382. var kUTTypeVersionKey: CFStringRef; external name '_kUTTypeVersionKey'; (* attribute const *)
  383. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  384. {
  385. Type Tag Classes
  386. The following constant strings identify tag classes for use
  387. when converting uniform type identifiers to and from
  388. equivalent tags.
  389. }
  390. {
  391. * kUTTagClassFilenameExtension
  392. }
  393. var kUTTagClassFilenameExtension: CFStringRef; external name '_kUTTagClassFilenameExtension'; (* attribute const *)
  394. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  395. {
  396. * kUTTagClassMIMEType
  397. }
  398. var kUTTagClassMIMEType: CFStringRef; external name '_kUTTagClassMIMEType'; (* attribute const *)
  399. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  400. {
  401. * kUTTagClassNSPboardType
  402. }
  403. var kUTTagClassNSPboardType: CFStringRef; external name '_kUTTagClassNSPboardType'; (* attribute const *)
  404. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA) *)
  405. {
  406. * kUTTagClassOSType
  407. }
  408. var kUTTagClassOSType: CFStringRef; external name '_kUTTagClassOSType'; (* attribute const *)
  409. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA) *)
  410. {
  411. * UTTypeCreatePreferredIdentifierForTag()
  412. *
  413. * Discussion:
  414. * Creates a uniform type identifier for the type indicated by the
  415. * specified tag. This is the primary function to use for going from
  416. * tag (extension/MIMEType/OSType) to uniform type identifier.
  417. * Optionally, the returned type identifiers must conform to the
  418. * identified "conforming-to" type argument. This is a hint to the
  419. * implementation to constrain the search to a particular tree of
  420. * types. For example, the client may want to know the type
  421. * indicated by a particular extension tag. If the client knows that
  422. * the extension is associated with a directory (rather than a
  423. * file), the client may specify "public.directory" for the
  424. * conforming-to argument. This will allow the implementation to
  425. * ignore all types associated with byte data formats (public.data
  426. * base type). If more than one type is indicated, preference is
  427. * given to a public type over a non-public type on the theory that
  428. * instances of public types are more common, and therefore more
  429. * likely to be correct. When there a choice must be made between
  430. * multiple public types or multiple non-public types, the selection
  431. * rules are undefined. Clients needing finer control should use
  432. * UTTypeCreateAllIdentifiersForTag. If no declared type is
  433. * indicated, a dynamic type identifier is generated which satisfies
  434. * the parameters.
  435. *
  436. * Mac OS X threading:
  437. * Thread safe since version 10.3
  438. *
  439. * Parameters:
  440. *
  441. * inTagClass:
  442. * the class identifier of the tag argument
  443. *
  444. * inTag:
  445. * the tag string
  446. *
  447. * inConformingToUTI:
  448. * the identifier of a type to which the result must conform
  449. *
  450. * Result:
  451. * a new CFStringRef containing the type identifier, or NULL if
  452. * inTagClass is not a known tag class
  453. }
  454. function UTTypeCreatePreferredIdentifierForTag( inTagClass: CFStringRef; inTag: CFStringRef; inConformingToUTI: CFStringRef { can be NULL } ): CFStringRef; external name '_UTTypeCreatePreferredIdentifierForTag';
  455. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  456. {
  457. * UTTypeCreateAllIdentifiersForTag()
  458. *
  459. * Discussion:
  460. * Creates an array of all uniform type identifiers indicated by the
  461. * specified tag. An overloaded tag (e.g., an extension used by
  462. * several applications for different file formats) may indicate
  463. * multiple types. If no declared type identifiers have the
  464. * specified tag, then a single dynamic type identifier will be
  465. * created for the tag. Optionally, the returned type identifiers
  466. * must conform to the identified "conforming-to" type argument.
  467. * This is a hint to the implementation to constrain the search to a
  468. * particular tree of types. For example, the client may want to
  469. * know the type indicated by a particular extension tag. If the
  470. * client knows that the extension is associated with a directory
  471. * (rather than a file), the client may specify "public.directory"
  472. * for the conforming-to argument. This will allow the
  473. * implementation to ignore all types associated with byte data
  474. * formats (public.data base type).
  475. *
  476. * Mac OS X threading:
  477. * Thread safe since version 10.3
  478. *
  479. * Parameters:
  480. *
  481. * inTagClass:
  482. * the class identifier of the tag argument
  483. *
  484. * inTag:
  485. * the tag string
  486. *
  487. * inConformingToUTI:
  488. * the identifier of a type to which the results must conform
  489. *
  490. * Result:
  491. * An array of uniform type identifiers, or NULL if inTagClass is
  492. * not a known tag class
  493. }
  494. function UTTypeCreateAllIdentifiersForTag( inTagClass: CFStringRef; inTag: CFStringRef; inConformingToUTI: CFStringRef { can be NULL } ): CFArrayRef; external name '_UTTypeCreateAllIdentifiersForTag';
  495. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  496. {
  497. * UTTypeCopyPreferredTagWithClass()
  498. *
  499. * Discussion:
  500. * Returns the identified type's preferred tag with the specified
  501. * tag class as a CFString. This is the primary function to use for
  502. * going from uniform type identifier to tag. If the type
  503. * declaration included more than one tag with the specified class,
  504. * the first tag in the declared tag array is the preferred tag.
  505. *
  506. * Mac OS X threading:
  507. * Thread safe since version 10.3
  508. *
  509. * Parameters:
  510. *
  511. * inUTI:
  512. * the uniform type identifier
  513. *
  514. * inTagClass:
  515. * the class of tags to return
  516. *
  517. * Result:
  518. * the tag string, or NULL if there is no tag of the specified class.
  519. }
  520. function UTTypeCopyPreferredTagWithClass( inUTI: CFStringRef; inTagClass: CFStringRef ): CFStringRef; external name '_UTTypeCopyPreferredTagWithClass';
  521. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  522. {
  523. * UTTypeEqual()
  524. *
  525. * Discussion:
  526. * Compares two identified types for equality. Types are equal if
  527. * their identifier strings are equal using a case-insensitive
  528. * comparison. In addition, if one or both of the identifiers is a
  529. * dynamic identifier, then the types are equal if either
  530. * identifier's tag specification is a subset of the other
  531. * identifier's tag specification.
  532. *
  533. * Mac OS X threading:
  534. * Thread safe since version 10.3
  535. *
  536. * Parameters:
  537. *
  538. * inUTI1:
  539. * a uniform type identifier
  540. *
  541. * inUTI2:
  542. * another uniform type identifier
  543. }
  544. function UTTypeEqual( inUTI1: CFStringRef; inUTI2: CFStringRef ): Boolean; external name '_UTTypeEqual';
  545. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  546. {
  547. * UTTypeConformsTo()
  548. *
  549. * Discussion:
  550. * Tests for a conformance relationship between the two identified
  551. * types. Returns true if the types are equal, or if the first type
  552. * conforms, directly or indirectly, to the second type.
  553. *
  554. * Mac OS X threading:
  555. * Thread safe since version 10.3
  556. *
  557. * Parameters:
  558. *
  559. * inUTI:
  560. * the uniform type identifier to test
  561. *
  562. * inConformsToUTI:
  563. * the uniform type identifier against which to test conformance.
  564. }
  565. function UTTypeConformsTo( inUTI: CFStringRef; inConformsToUTI: CFStringRef ): Boolean; external name '_UTTypeConformsTo';
  566. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  567. {
  568. * UTTypeCopyDescription()
  569. *
  570. * Discussion:
  571. * Returns the localized, user-readable type description string
  572. *
  573. * Mac OS X threading:
  574. * Thread safe since version 10.3
  575. *
  576. * Parameters:
  577. *
  578. * inUTI:
  579. * the uniform type identifier
  580. *
  581. * Result:
  582. * a localized string, or NULL of no type description is available
  583. }
  584. function UTTypeCopyDescription( inUTI: CFStringRef ): CFStringRef; external name '_UTTypeCopyDescription';
  585. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  586. {
  587. * UTTypeCopyDeclaration()
  588. *
  589. * Discussion:
  590. * Returns the identified type's declaration dictionary, as it
  591. * appears in the declaring bundle's info property list. This the
  592. * access path to other type properties for which direct access is
  593. * rarely needed.
  594. *
  595. * Mac OS X threading:
  596. * Thread safe since version 10.3
  597. *
  598. * Parameters:
  599. *
  600. * inUTI:
  601. * the uniform type identifier
  602. *
  603. * Result:
  604. * a tag declaration dictionary, or NULL if the type is not declared
  605. }
  606. function UTTypeCopyDeclaration( inUTI: CFStringRef ): CFDictionaryRef; external name '_UTTypeCopyDeclaration';
  607. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  608. {
  609. * UTTypeCopyDeclaringBundleURL()
  610. *
  611. * Discussion:
  612. * Returns the URL of the bundle containing the type declaration of
  613. * the identified type.
  614. *
  615. * Mac OS X threading:
  616. * Thread safe since version 10.3
  617. *
  618. * Parameters:
  619. *
  620. * inUTI:
  621. * the uniform type identifier
  622. *
  623. * Result:
  624. * a URL, or NULL if the bundle cannot be located.
  625. }
  626. function UTTypeCopyDeclaringBundleURL( inUTI: CFStringRef ): CFURLRef; external name '_UTTypeCopyDeclaringBundleURL';
  627. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_3_0) *)
  628. {
  629. * UTCreateStringForOSType()
  630. *
  631. * Discussion:
  632. * A helper function to canonically encode an OSType as a CFString
  633. * suitable for use as a tag argument.
  634. *
  635. * Mac OS X threading:
  636. * Thread safe since version 10.3
  637. *
  638. * Parameters:
  639. *
  640. * inOSType:
  641. * the OSType value to encode
  642. *
  643. * Result:
  644. * a new CFString representing the OSType
  645. }
  646. function UTCreateStringForOSType( inOSType: OSType ): CFStringRef; external name '_UTCreateStringForOSType';
  647. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA) *)
  648. {
  649. * UTGetOSTypeFromString()
  650. *
  651. * Discussion:
  652. * A helper function to canonically decode a string-encoded OSType
  653. * back to the original OSType value.
  654. *
  655. * Mac OS X threading:
  656. * Thread safe since version 10.3
  657. *
  658. * Parameters:
  659. *
  660. * inString:
  661. * the string to decode
  662. *
  663. * Result:
  664. * the OSType value encoded in the string, or 0 if the string is not
  665. * a valid encoding of an OSType
  666. }
  667. function UTGetOSTypeFromString( inString: CFStringRef ): OSType; external name '_UTGetOSTypeFromString';
  668. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA) *)
  669. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  670. end.
  671. {$endc} {not MACOSALLINCLUDE}