AppleHelp.pas 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. {
  2. File: AppleHelp.p
  3. Contains: Apple Help
  4. Version: Technology: Mac OS X/CarbonLib 1.1
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 2000-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit AppleHelp;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  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 CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,CFBase,Files,CFString;
  92. {$ALIGN MAC68K}
  93. { AppleHelp Error Codes }
  94. const
  95. kAHInternalErr = -10790;
  96. kAHInternetConfigPrefErr = -10791;
  97. type
  98. AHTOCType = SInt16;
  99. const
  100. kAHTOCTypeUser = 0;
  101. kAHTOCTypeDeveloper = 1;
  102. {
  103. * AHSearch()
  104. *
  105. * Discussion:
  106. * Delivers a request to perform the specified search to the Help
  107. * Viewer application.
  108. *
  109. * Parameters:
  110. *
  111. * bookname:
  112. * Optionally, the AppleTitle of the Help book to be searched. If
  113. * NULL, all installed Help books are searched.
  114. *
  115. * query:
  116. * The query to be made. This string can, if desired, have boolean
  117. * operators or be a natural language phrase.
  118. *
  119. * Result:
  120. * An operating system result code that indicates whether the
  121. * request was successfully sent to the Help Viewer application.
  122. * Possible values: noErr, paramErr, kAHInternalErr,
  123. * kAHInternetConfigPrefErr.
  124. *
  125. * Availability:
  126. * Non-Carbon CFM: not available
  127. * CarbonLib: in CarbonLib 1.1 and later
  128. * Mac OS X: in version 10.0 and later
  129. }
  130. function AHSearch(bookname: CFStringRef; query: CFStringRef): OSStatus; external name '_AHSearch';
  131. {
  132. * AHGotoMainTOC()
  133. *
  134. * Discussion:
  135. * Delivers a request to load the main table of contents of
  136. * installed help books to the Help Viewer application.
  137. *
  138. * Parameters:
  139. *
  140. * toctype:
  141. * The type of table of contents to be loaded: user or developer.
  142. *
  143. * Result:
  144. * An operating system result code that indicates whether the
  145. * request was successfully sent to the Help Viewer application.
  146. * Possible values: noErr, paramErr, kAHInternalErr,
  147. * kAHInternetConfigPrefErr.
  148. *
  149. * Availability:
  150. * Non-Carbon CFM: not available
  151. * CarbonLib: in CarbonLib 1.1 and later
  152. * Mac OS X: in version 10.0 and later
  153. }
  154. function AHGotoMainTOC(toctype: AHTOCType): OSStatus; external name '_AHGotoMainTOC';
  155. {
  156. * AHGotoPage()
  157. *
  158. * Discussion:
  159. * Delivers a request to load a specific text/html file to the Help
  160. * Viewer application.
  161. *
  162. * Parameters:
  163. *
  164. * bookname:
  165. * Optionally, the AppleTitle of an installed Help book. If NULL,
  166. * the path parameter must be a full file: URL to the file to be
  167. * opened.
  168. *
  169. * path:
  170. * Optionally, one of two types of paths: 1) a URL-style path to a
  171. * file that is relative to the main folder of the book supplied
  172. * in the bookname parameter, or 2) if bookname is NULL, a full
  173. * file: URL to the file to be opened. If this parameter is NULL,
  174. * then bookname must not be NULL, and is used to open the Help
  175. * Viewer to the main page of Help content for the specified book.
  176. *
  177. * anchor:
  178. * Optionally, the name of anchor tag to scroll to in the newly
  179. * opened file. Can be NULL.
  180. *
  181. * Result:
  182. * An operating system result code that indicates whether the
  183. * request was successfully sent to the Help Viewer application.
  184. * Possible values: noErr, paramErr, kAHInternalErr,
  185. * kAHInternetConfigPrefErr.
  186. *
  187. * Availability:
  188. * Non-Carbon CFM: not available
  189. * CarbonLib: in CarbonLib 1.1 and later
  190. * Mac OS X: in version 10.0 and later
  191. }
  192. function AHGotoPage(bookname: CFStringRef; path: CFStringRef; anchor: CFStringRef): OSStatus; external name '_AHGotoPage';
  193. {
  194. * AHLookupAnchor()
  195. *
  196. * Discussion:
  197. * Delivers a request to perform an anchor lookup to the Help Viewer
  198. * application. Note: anchor lookups will fail unless you have
  199. * indexed your help content with anchor indexing turned on in the
  200. * indexing tool's preferences panel.
  201. *
  202. * Parameters:
  203. *
  204. * bookname:
  205. * Optionally, the AppleTitle of the Help book to searched. If
  206. * NULL, the anchor lookup is performed using all installed Help
  207. * books.
  208. *
  209. * anchor:
  210. * The name of the anchor tag to look up.
  211. *
  212. * Result:
  213. * An operating system result code that indicates whether the
  214. * request was successfully sent to the Help Viewer application.
  215. * Possible values: noErr, paramErr, kAHInternalErr,
  216. * kAHInternetConfigPrefErr.
  217. *
  218. * Availability:
  219. * Non-Carbon CFM: not available
  220. * CarbonLib: in CarbonLib 1.1 and later
  221. * Mac OS X: in version 10.0 and later
  222. }
  223. function AHLookupAnchor(bookname: CFStringRef; anchor: CFStringRef): OSStatus; external name '_AHLookupAnchor';
  224. {
  225. * AHRegisterHelpBook()
  226. *
  227. * Discussion:
  228. * Registers a book of Help content such that the book will appear
  229. * in the current user's main table of contents (Help Center) in the
  230. * Help Viewer application. To be used when help books reside
  231. * outside of the known help folders (i.e. help books that are kept
  232. * inside of application bundles).
  233. *
  234. * Parameters:
  235. *
  236. * appBundleRef:
  237. * An FSRef pointer to the bundle within which one or more Help
  238. * books is stored. This is likely an FSRef to your application's
  239. * main bundle.
  240. *
  241. * Result:
  242. * An operating system result code that indicates whether all help
  243. * books contained within the specified bundle were registered.
  244. * Possible values: noErr, paramErr, kAHInternalErr, dirNFErr.
  245. *
  246. * Availability:
  247. * Non-Carbon CFM: not available
  248. * CarbonLib: in CarbonLib 1.1 and later
  249. * Mac OS X: in version 10.0 and later
  250. }
  251. function AHRegisterHelpBook(const (*var*) appBundleRef: FSRef): OSStatus; external name '_AHRegisterHelpBook';
  252. {$ALIGN MAC68K}
  253. end.