UTType.pas 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  1. { File: UTType.p(.pas) }
  2. { }
  3. { Contains: CodeWarrior Pascal(GPC) translation of Apple's Mac OS X 10.3 introduced UTType.h }
  4. { Translation compatible with make-gpc-interfaces.pl generated MWPInterfaces }
  5. { (GPCPInterfaces) and Mac OS X 10.3.x or higher. The GPC translation is linkable with }
  6. { Mac OS X 10.3.x or higher Mach-O ApplicationServices.framework. }
  7. { (Note: ApplicationServices is the ÒumbrellaÓ framework encapsulating the }
  8. { LaunchServices subframework which contains the UTType declared data and function }
  9. { symbols.) }
  10. { }
  11. { The CodeWarrior Pascal translation is NOT linkable with Mac OS X 10.3.x or higher }
  12. { CFM CarbonLib. The declared symbols are exported only from the Mach-O }
  13. { ApplicationServices ÒumbrellaÓ framework (encapsulates the LaunchServices subframework)}
  14. { and references to symbols used by CFM code must be established at runtime. Individual }
  15. { symbol references can be resolved using CFBundleGetFunctionPointerForName and }
  16. { CFBundleGetDataPointerForName (see CFBundle.p) respectively for function and data }
  17. { symbols. For bulk resolution of Mach-O symbol references, CFMLateImport technology }
  18. { can be used. }
  19. { }
  20. { Version: 1.0 }
  21. { }
  22. { Pascal Translation: Gale Paeper, <[email protected]>, 2004 }
  23. { }
  24. { Copyright: Subject to the constraints of Apple's original rights, you're free to use this }
  25. { translation as you deem fit. }
  26. { }
  27. { Bugs?: This is an AS IS translation with no express guarentees of any kind. }
  28. { If you do find a bug, please help out the Macintosh Pascal programming community by }
  29. { reporting your bug finding and possible fix to either personal e-mail to Gale Paeper }
  30. { or a posting to the MacPascal mailing list. }
  31. { }
  32. {
  33. Change History (most recent first) (DD/MM/YY):
  34. <1> 06/12/04 GRP First Pascal translation of UTType.h, version LaunchServices-98~1.
  35. }
  36. { Translation assisted by: }
  37. {This file was processed by Dan's Source Converter}
  38. {version 1.3 (this version modified by Ingemar Ragnemalm)}
  39. {The original source on which this file is based: }
  40. {
  41. File: LaunchServices/UTType.h
  42. Contains: Public interfaces for Uniform Type Indentification
  43. Version: LaunchServices-98~1
  44. Copyright: © 2003 by Apple Computer, Inc., all rights reserved.
  45. Bugs?: For bug reports, consult the following page on
  46. the World Wide Web:
  47. http://www.freepascal.org/bugs.html
  48. }
  49. {
  50. Modified for use with Free Pascal
  51. Version 200
  52. Please report any bugs to <[email protected]>
  53. }
  54. {$mode macpas}
  55. {$packenum 1}
  56. {$macro on}
  57. {$inline on}
  58. {$CALLING MWPASCAL}
  59. unit UTType;
  60. interface
  61. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  62. {$setc GAP_INTERFACES_VERSION := $0200}
  63. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  64. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  65. {$endc}
  66. {$ifc defined CPUPOWERPC and defined CPUI386}
  67. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  68. {$endc}
  69. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  70. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  71. {$endc}
  72. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  73. {$setc __ppc__ := 1}
  74. {$elsec}
  75. {$setc __ppc__ := 0}
  76. {$endc}
  77. {$ifc not defined __i386__ and defined CPUI386}
  78. {$setc __i386__ := 1}
  79. {$elsec}
  80. {$setc __i386__ := 0}
  81. {$endc}
  82. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  83. {$error Conflicting definitions for __ppc__ and __i386__}
  84. {$endc}
  85. {$ifc defined __ppc__ and __ppc__}
  86. {$setc TARGET_CPU_PPC := TRUE}
  87. {$setc TARGET_CPU_X86 := FALSE}
  88. {$elifc defined __i386__ and __i386__}
  89. {$setc TARGET_CPU_PPC := FALSE}
  90. {$setc TARGET_CPU_X86 := TRUE}
  91. {$elsec}
  92. {$error Neither __ppc__ nor __i386__ is defined.}
  93. {$endc}
  94. {$setc TARGET_CPU_PPC_64 := FALSE}
  95. {$ifc defined FPC_BIG_ENDIAN}
  96. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  97. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  98. {$elifc defined FPC_LITTLE_ENDIAN}
  99. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  100. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  101. {$elsec}
  102. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  103. {$endc}
  104. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  105. {$setc CALL_NOT_IN_CARBON := FALSE}
  106. {$setc OLDROUTINENAMES := FALSE}
  107. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  108. {$setc OPAQUE_UPP_TYPES := TRUE}
  109. {$setc OTCARBONAPPLICATION := TRUE}
  110. {$setc OTKERNEL := FALSE}
  111. {$setc PM_USE_SESSION_APIS := TRUE}
  112. {$setc TARGET_API_MAC_CARBON := TRUE}
  113. {$setc TARGET_API_MAC_OS8 := FALSE}
  114. {$setc TARGET_API_MAC_OSX := TRUE}
  115. {$setc TARGET_CARBON := TRUE}
  116. {$setc TARGET_CPU_68K := FALSE}
  117. {$setc TARGET_CPU_MIPS := FALSE}
  118. {$setc TARGET_CPU_SPARC := FALSE}
  119. {$setc TARGET_OS_MAC := TRUE}
  120. {$setc TARGET_OS_UNIX := FALSE}
  121. {$setc TARGET_OS_WIN32 := FALSE}
  122. {$setc TARGET_RT_MAC_68881 := FALSE}
  123. {$setc TARGET_RT_MAC_CFM := FALSE}
  124. {$setc TARGET_RT_MAC_MACHO := TRUE}
  125. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  126. {$setc TYPE_BOOL := FALSE}
  127. {$setc TYPE_EXTENDED := FALSE}
  128. {$setc TYPE_LONGLONG := TRUE}
  129. uses MacTypes,CFBase,CFArray,CFDictionary,CFURL;
  130. {$ALIGN POWER}
  131. { ======================================================================================================== }
  132. { Uniform Type Identification API }
  133. { ======================================================================================================== }
  134. {
  135. Uniform Type Identification Primer
  136. Uniform Type Identifiers (or UTIs) are strings which uniquely identify
  137. abstract types. They can be used to describe a file format or
  138. data type, but can also be used to describe type information for
  139. other sorts of entities, such as directories, volumes, or packages.
  140. The syntax of a uniform type identifier looks like a bundle identifier.
  141. It has the form of a reversed DNS name, although some special top-level
  142. UTI domains are reserved by Apple and are outside the currect IANA
  143. top-level Internet domain name space.
  144. Examples:
  145. public.jpeg
  146. public.utf16-plain-text
  147. com.apple.xml-plist
  148. com.apple.appleworks.doc
  149. Types which are standard or not controlled by any one organization
  150. are declared in the "public" domain. Currently, public types may
  151. be declared only by Apple.
  152. Types specific to Mac OS are declared with identifiers in the
  153. com.apple.macos domain.
  154. Third parties should declare their own uniform type identifiers
  155. in their respective registered Internet domain spaces.
  156. Type declarations appear in bundle property lists and tell
  157. the system several things about a type, including the following:
  158. Conformance
  159. A type may "conform" to one or more other types. For example, the
  160. type com.apple.macos.xml-property-list conforms to both the
  161. com.apple.macos.property-list and public.xml types. The public.xml
  162. type in turn conforms to type public.text. Finally, type public.text
  163. conforms to public.data, which is the base type for all types
  164. describing bytes stream formats. Conformance relationships between
  165. types are established in type declarations.
  166. Conformance relationships establish a multiple inheritanace hierarchy
  167. between types. Type property values may be inherited at runtime
  168. according to the conformance relationships each type. When a type's
  169. declaration does not include a value for particular type property,
  170. then the type's supertypes are searched for a value. Supertypes are
  171. searched depth-first, in the order given in the type declaration.
  172. This is the only way in which the declared order of the conforms-to
  173. supertypes is signitificant.
  174. Tags
  175. A "tag" is a string which indicates a type in some other type
  176. identification space, such as a filename extension, MIME Type,
  177. or NSPboardType. Each type declaration may include a
  178. "tag specification", which is a dictionary listing all of the
  179. tags associated with the type.
  180. A tag's "class" is the namespace of a tag: filename extension,
  181. MIME type, OSType, etc. Tag classes are themselves identified by
  182. uniform type identifiers so that the set of valid tag classes is
  183. easily extendend in the future.
  184. Other Type Properties
  185. Type declarations may include several other properties: a localizable
  186. user description of the type, the name of an icon resource in
  187. the declaring bundle, a reference URL identifying technical
  188. documentation about the type itself, and finally a version number,
  189. which can be incremented as a type evolves. All of these properties
  190. are optional.
  191. Exported vs. Imported Type Declarations
  192. Type declarations are either exported or imported. An exported
  193. type declaration means that the type itself is defined or owned
  194. by the organization making the declaration. For example, a propietary
  195. document type declaration should only be exported by the application
  196. which controls the document format.
  197. An imported declatation is for applications which depend on the
  198. existence of someone else's type declaration. If application A can
  199. open application B's document format, then application A makes
  200. an imported declaration of application B's document type so that
  201. even if application B is not present on the system, there is an
  202. acessible declaration of its document type.
  203. An exported declaration of a particular type identifier is always
  204. preferred over an imported declaration.
  205. Example XML Type Declaration
  206. Appearing below is an XML excerpt from a bundle Info.plist file which
  207. declares the public type "public.jpeg":
  208. <key>UTExportedTypeDeclarations</key>
  209. <array>
  210. <dict>
  211. <key>UTTypeIdentifier</key>
  212. <string>public.jpeg</string>
  213. <key>UTTypeReferenceURL</key>
  214. <string>http://www.w3.org/Graphics/JPEG/</string>
  215. <key>UTTypeDescription</key>
  216. <string>JPEG image</string>
  217. <key>UTTypeIconName</key>
  218. <string>public.jpeg.icns</string>
  219. <key>UTTypeConformsTo</key>
  220. <array>
  221. <string>public.image</string>
  222. <string>public.data</string>
  223. </array>
  224. <key>UTTypeTagSpecification</key>
  225. <dict>
  226. <key>com.apple.macos.ostype</key>
  227. <string>JPEG</string>
  228. <key>public.filename-extension</key>
  229. <array>
  230. <string>jpeg</string>
  231. <string>jpg</string>
  232. </array>
  233. <key>public.mime-type</key>
  234. <string>image/jpeg</string>
  235. </dict>
  236. </dict>
  237. </array>
  238. Dynamic Type Identifiers
  239. Uniform Type Identifiation uses dynamic type identifiers to
  240. represent types for which no identifier has been declared. A
  241. dynamic type identifier is syntactially a regular uniform
  242. type identifier in the "dyn" domain. However, after the
  243. initial domain label, a dynamic type identifier is an
  244. opaque encoding of a tag specification. Dynamic type
  245. identifiers cannot be declared. They are generated on-demand
  246. with whatever type information is available at the time, often
  247. a single (otherwise unknown) type tag.
  248. A dynamic identifier therefore carries within it a minimal
  249. amount of type information, but enough to work well with the
  250. Uniform Type Identification API. For example, a client can
  251. extract from a dynamic type identifier the original tag
  252. specification with which it was created. A client can also
  253. test a dynamic type identifier for equality to another
  254. uniform type identifier. If the dynamic identifier's
  255. tag specification is a subset of the other identifier's
  256. tags, the two are considered equal.
  257. Dynamic type identifiers do not express the full richness
  258. of type information associated with a declared type
  259. identifier, but dynamic type identifiers allow the behavior
  260. to degrade gracefully in the presence of incomplete
  261. declared type information.
  262. A dynamic type identifier may be transmitted across processes
  263. on a given system, but it should never be stored persistently
  264. or transmitted over the wire to another system. In particular,
  265. dynamic identifiers should not appear in bundle info property
  266. lists, and they will generally be ignored when they do. Apple
  267. reserves the right to change the opaque format of dynamic
  268. identifiers in future versions of Mac OS X.
  269. }
  270. {
  271. Type Declaration Dictionary Keys
  272. The following keys are used in type declarations
  273. }
  274. {
  275. * kUTExportedTypeDeclarationsKey
  276. *
  277. * Availability:
  278. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  279. * CarbonLib: not available in CarbonLib 1.x
  280. * Non-Carbon CFM: not available
  281. }
  282. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  283. var kUTExportedTypeDeclarationsKey: CFStringRef; external name '_kUTExportedTypeDeclarationsKey'; (* attribute const *)
  284. {
  285. * kUTImportedTypeDeclarationsKey
  286. *
  287. * Availability:
  288. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  289. * CarbonLib: not available in CarbonLib 1.x
  290. * Non-Carbon CFM: not available
  291. }
  292. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  293. var kUTImportedTypeDeclarationsKey: CFStringRef; external name '_kUTImportedTypeDeclarationsKey'; (* attribute const *)
  294. {
  295. * kUTTypeIdentifierKey
  296. *
  297. * Availability:
  298. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  299. * CarbonLib: not available in CarbonLib 1.x
  300. * Non-Carbon CFM: not available
  301. }
  302. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  303. var kUTTypeIdentifierKey: CFStringRef; external name '_kUTTypeIdentifierKey'; (* attribute const *)
  304. {
  305. * kUTTypeTagSpecificationKey
  306. *
  307. * Availability:
  308. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  309. * CarbonLib: not available in CarbonLib 1.x
  310. * Non-Carbon CFM: not available
  311. }
  312. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  313. var kUTTypeTagSpecificationKey: CFStringRef; external name '_kUTTypeTagSpecificationKey'; (* attribute const *)
  314. {
  315. * kUTTypeConformsToKey
  316. *
  317. * Availability:
  318. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  319. * CarbonLib: not available in CarbonLib 1.x
  320. * Non-Carbon CFM: not available
  321. }
  322. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  323. var kUTTypeConformsToKey: CFStringRef; external name '_kUTTypeConformsToKey'; (* attribute const *)
  324. {
  325. * kUTTypeDescriptionKey
  326. *
  327. * Availability:
  328. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  329. * CarbonLib: not available in CarbonLib 1.x
  330. * Non-Carbon CFM: not available
  331. }
  332. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  333. var kUTTypeDescriptionKey: CFStringRef; external name '_kUTTypeDescriptionKey'; (* attribute const *)
  334. {
  335. * kUTTypeIconFileKey
  336. *
  337. * Availability:
  338. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  339. * CarbonLib: not available in CarbonLib 1.x
  340. * Non-Carbon CFM: not available
  341. }
  342. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  343. var kUTTypeIconFileKey: CFStringRef; external name '_kUTTypeIconFileKey'; (* attribute const *)
  344. {
  345. * kUTTypeReferenceURLKey
  346. *
  347. * Availability:
  348. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  349. * CarbonLib: not available in CarbonLib 1.x
  350. * Non-Carbon CFM: not available
  351. }
  352. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  353. var kUTTypeReferenceURLKey: CFStringRef; external name '_kUTTypeReferenceURLKey'; (* attribute const *)
  354. {
  355. * kUTTypeVersionKey
  356. *
  357. * Availability:
  358. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  359. * CarbonLib: not available in CarbonLib 1.x
  360. * Non-Carbon CFM: not available
  361. }
  362. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  363. var kUTTypeVersionKey: CFStringRef; external name '_kUTTypeVersionKey'; (* attribute const *)
  364. {
  365. Type Tag Classes
  366. The following constant strings identify tag classes for use
  367. when converting uniform type identifiers to and from
  368. equivalent tags.
  369. }
  370. {
  371. * kUTTagClassFilenameExtension
  372. *
  373. * Availability:
  374. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  375. * CarbonLib: not available in CarbonLib 1.x
  376. * Non-Carbon CFM: not available
  377. }
  378. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER:
  379. var kUTTagClassFilenameExtension: CFStringRef; external name '_kUTTagClassFilenameExtension'; (* attribute const *)
  380. {
  381. * kUTTagClassMIMEType
  382. *
  383. * Availability:
  384. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  385. * CarbonLib: not available in CarbonLib 1.x
  386. * Non-Carbon CFM: not available
  387. }
  388. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  389. var kUTTagClassMIMEType: CFStringRef; external name '_kUTTagClassMIMEType'; (* attribute const *)
  390. {
  391. * kUTTagClassNSPboardType
  392. *
  393. * Availability:
  394. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  395. * CarbonLib: not available in CarbonLib 1.x
  396. * Non-Carbon CFM: not available
  397. }
  398. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  399. var kUTTagClassNSPboardType: CFStringRef; external name '_kUTTagClassNSPboardType'; (* attribute const *)
  400. {
  401. * kUTTagClassOSType
  402. *
  403. * Availability:
  404. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  405. * CarbonLib: not available in CarbonLib 1.x
  406. * Non-Carbon CFM: not available
  407. }
  408. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  409. var kUTTagClassOSType: CFStringRef; external name '_kUTTagClassOSType'; (* attribute const *)
  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. * UTTypeCreateAllIdentifiersWithTag. 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. * inConformingToTypeIdentifier:
  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. * Availability:
  455. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  456. * CarbonLib: not available in CarbonLib 1.x
  457. * Non-Carbon CFM: not available
  458. }
  459. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  460. function UTTypeCreatePreferredIdentifierForTag(
  461. inTagClass: CFStringRef;
  462. inTag: CFStringRef;
  463. inConformingToTypeIdentifier: CFStringRef): CFStringRef; external name '_UTTypeCreatePreferredIdentifierForTag'; { can be NULL }
  464. {
  465. * UTTypeCreateAllIdentifiersForTag()
  466. *
  467. * Discussion:
  468. * Creates an array of all uniform type identifiers indicated by the
  469. * specified tag. An overloaded tag (e.g., an extension used by
  470. * several applications for different file formats) may indicate
  471. * multiple types. If no declared type identifiers have the
  472. * specified tag, then a single dynamic type identifier will be
  473. * created for the tag. Optionally, the returned type identifiers
  474. * must conform to the identified "conforming-to" type argument.
  475. * This is a hint to the implementation to constrain the search to a
  476. * particular tree of types. For example, the client may want to
  477. * know the type indicated by a particular extension tag. If the
  478. * client knows that the extension is associated with a directory
  479. * (rather than a file), the client may specify "public.directory"
  480. * for the conforming-to argument. This will allow the
  481. * implementation to ignore all types associated with byte data
  482. * formats (public.data base type).
  483. *
  484. * Mac OS X threading:
  485. * Thread safe since version 10.3
  486. *
  487. * Parameters:
  488. *
  489. * inTagClass:
  490. * the class identifier of the tag argument
  491. *
  492. * inTag:
  493. * the tag string
  494. *
  495. * inConformingToTypeIdentifier:
  496. * the identifier of a type to which the results must conform
  497. *
  498. * Result:
  499. * An array of uniform type identifiers, or NULL if inTagClass is
  500. * not a known tag class
  501. *
  502. * Availability:
  503. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  504. * CarbonLib: not available in CarbonLib 1.x
  505. * Non-Carbon CFM: not available
  506. }
  507. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  508. function UTTypeCreateAllIdentifiersForTag(
  509. inTagClass: CFStringRef;
  510. inTag: CFStringRef;
  511. inConformingToTypeIdentifier: CFStringRef): CFArrayRef; external name '_UTTypeCreateAllIdentifiersForTag'; { can be NULL }
  512. {
  513. * UTTypeCopyPreferredTagWithClass()
  514. *
  515. * Discussion:
  516. * Returns the identified type's preferred tag with the specified
  517. * tag class as a CSString. This is the primary function to use for
  518. * going from uniform type identifier to tag. If the type
  519. * declaration included more than one tag with the specified class,
  520. * the first tag in the declared tag array is the preferred tag.
  521. *
  522. * Mac OS X threading:
  523. * Thread safe since version 10.3
  524. *
  525. * Parameters:
  526. *
  527. * inTypeIdentifier:
  528. * the uniform type identifier
  529. *
  530. * inTagClass:
  531. * the class of tags to return
  532. *
  533. * Result:
  534. * an array of tags (as CFStrings), or NULL if there are no tags
  535. * with the specified class.
  536. *
  537. * Availability:
  538. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  539. * CarbonLib: not available in CarbonLib 1.x
  540. * Non-Carbon CFM: not available
  541. }
  542. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  543. function UTTypeCopyPreferredTagWithClass(
  544. inTypeIdentifier: CFStringRef;
  545. inTagClass: CFStringRef): CFStringRef; external name '_UTTypeCopyPreferredTagWithClass';
  546. {
  547. * UTTypeEqual()
  548. *
  549. * Discussion:
  550. * Compares two identified types for equality. Types are equal if
  551. * their identifier strings are equal using a case-insensitive
  552. * comparison. In addition, if one or both of the identifiers is a
  553. * dynamic identifier, then the types are equal if either
  554. * identifier's tag specification is a subset of the other
  555. * identifier's tag specification.
  556. *
  557. * Mac OS X threading:
  558. * Thread safe since version 10.3
  559. *
  560. * Parameters:
  561. *
  562. * inTypeIdentifier1:
  563. * a uniform type identifier
  564. *
  565. * inTypeIdentifier2:
  566. * another uniform type identifier
  567. *
  568. * Availability:
  569. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  570. * CarbonLib: not available in CarbonLib 1.x
  571. * Non-Carbon CFM: not available
  572. }
  573. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  574. function UTTypeEqual(
  575. inTypeIdentifier1: CFStringRef;
  576. inTypeIdentifier2: CFStringRef): Boolean; external name '_UTTypeEqual';
  577. {
  578. * UTTypeConformsTo()
  579. *
  580. * Discussion:
  581. * Tests for a conformance relationship between the two identified
  582. * types. Returns true if the types are equal, or if the first type
  583. * conforms, directly or indirectly, to the second type.
  584. *
  585. * Mac OS X threading:
  586. * Thread safe since version 10.3
  587. *
  588. * Parameters:
  589. *
  590. * inTypeIdentifier:
  591. * the uniform type identifier to test
  592. *
  593. * inConformsToTypeIdentifier:
  594. * the uniform type identifier against which to test conformance.
  595. *
  596. * Availability:
  597. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  598. * CarbonLib: not available in CarbonLib 1.x
  599. * Non-Carbon CFM: not available
  600. }
  601. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  602. function UTTypeConformsTo(
  603. inTypeIdentifier: CFStringRef;
  604. inConformsToTypeIdentifier: CFStringRef): Boolean; external name '_UTTypeConformsTo';
  605. {
  606. * UTTypeCopyDescription()
  607. *
  608. * Discussion:
  609. * Returns the localized, user-readable type description string
  610. *
  611. * Mac OS X threading:
  612. * Thread safe since version 10.3
  613. *
  614. * Parameters:
  615. *
  616. * inTypeIdentifier:
  617. * the uniform type identifier
  618. *
  619. * Result:
  620. * a localized string, or NULL of no type description is available
  621. *
  622. * Availability:
  623. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  624. * CarbonLib: not available in CarbonLib 1.x
  625. * Non-Carbon CFM: not available
  626. }
  627. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  628. function UTTypeCopyDescription(inTypeIdentifier: CFStringRef): CFStringRef; external name '_UTTypeCopyDescription';
  629. {
  630. * UTTypeCopyDeclaration()
  631. *
  632. * Discussion:
  633. * Returns the identified type's declaration dictionary, as it
  634. * appears in the declaring bundle's info property list. This the
  635. * access path to other type properties for which direct access is
  636. * rarely needed.
  637. *
  638. * Mac OS X threading:
  639. * Thread safe since version 10.3
  640. *
  641. * Parameters:
  642. *
  643. * inTypeIdentifier:
  644. * the uniform type identifier
  645. *
  646. * Result:
  647. * a tag declaration dictionary, or NULL if the type is not declared
  648. *
  649. * Availability:
  650. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  651. * CarbonLib: not available in CarbonLib 1.x
  652. * Non-Carbon CFM: not available
  653. }
  654. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  655. function UTTypeCopyDeclaration(inTypeIdentifier: CFStringRef): CFDictionaryRef; external name '_UTTypeCopyDeclaration';
  656. {
  657. * UTTypeCopyDeclaringBundleURL()
  658. *
  659. * Discussion:
  660. * Returns the URL of the bundle containing the type declaration of
  661. * the identified type.
  662. *
  663. * Mac OS X threading:
  664. * Thread safe since version 10.3
  665. *
  666. * Parameters:
  667. *
  668. * inTypeIdentifier:
  669. * the uniform type identifier
  670. *
  671. * Result:
  672. * a URL, or NULL if the bundle cannot be located.
  673. *
  674. * Availability:
  675. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  676. * CarbonLib: not available in CarbonLib 1.x
  677. * Non-Carbon CFM: not available
  678. }
  679. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  680. function UTTypeCopyDeclaringBundleURL(inTypeIdentifier: CFStringRef): CFURLRef; external name '_UTTypeCopyDeclaringBundleURL';
  681. {
  682. * UTCreateStringForOSType()
  683. *
  684. * Discussion:
  685. * A helper function to canonically encode an OSType as a CFString
  686. * suitable for use as a tag argument.
  687. *
  688. * Mac OS X threading:
  689. * Thread safe since version 10.3
  690. *
  691. * Parameters:
  692. *
  693. * inOSType:
  694. * the OSType value to encode
  695. *
  696. * Result:
  697. * a new CFString representing the OSType, or NULL if the argument
  698. * is 0 or '????'
  699. *
  700. * Availability:
  701. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  702. * CarbonLib: not available in CarbonLib 1.x
  703. * Non-Carbon CFM: not available
  704. }
  705. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  706. function UTCreateStringForOSType(inOSType: OSType): CFStringRef; external name '_UTCreateStringForOSType';
  707. {
  708. * UTGetOSTypeFromString()
  709. *
  710. * Discussion:
  711. * A helper function to canonically decode a string-encoded OSType
  712. * back to the original OSType value.
  713. *
  714. * Mac OS X threading:
  715. * Thread safe since version 10.3
  716. *
  717. * Parameters:
  718. *
  719. * inString:
  720. * the string to decode
  721. *
  722. * Result:
  723. * the OSType value encoded in the string, or 0 if the string is not
  724. * a valid encoding of an OSType
  725. *
  726. * Availability:
  727. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  728. * CarbonLib: not available in CarbonLib 1.x
  729. * Non-Carbon CFM: not available
  730. }
  731. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  732. function UTGetOSTypeFromString(inString: CFStringRef): OSType; external name '_UTGetOSTypeFromString';
  733. {$ALIGN MAC68K}
  734. end.