SKSearch.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. {
  2. File: SearchKit/SKSearch.h
  3. Contains: SearchKit Interfaces.
  4. Version: SearchKit-407~38
  5. Copyright: © 2003-2008 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. }
  10. {
  11. Modified for use with Free Pascal
  12. Version 308
  13. Please report any bugs to <[email protected]>
  14. }
  15. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$calling mwpascal}
  21. unit SKSearch;
  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. {$setc TARGET_OS_MAC := TRUE}
  119. {$setc TARGET_OS_IPHONE := FALSE}
  120. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  121. {$setc TARGET_OS_EMBEDDED := FALSE}
  122. {$elifc defined __arm__ and __arm__}
  123. {$setc TARGET_CPU_PPC := FALSE}
  124. {$setc TARGET_CPU_PPC64 := FALSE}
  125. {$setc TARGET_CPU_X86 := FALSE}
  126. {$setc TARGET_CPU_X86_64 := FALSE}
  127. {$setc TARGET_CPU_ARM := TRUE}
  128. {$setc TARGET_CPU_ARM64 := FALSE}
  129. { will require compiler define when/if other Apple devices with ARM cpus ship }
  130. {$setc TARGET_OS_MAC := FALSE}
  131. {$setc TARGET_OS_IPHONE := TRUE}
  132. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  133. {$setc TARGET_OS_EMBEDDED := TRUE}
  134. {$elifc defined __arm64__ and __arm64__}
  135. {$setc TARGET_CPU_PPC := FALSE}
  136. {$setc TARGET_CPU_PPC64 := FALSE}
  137. {$setc TARGET_CPU_X86 := FALSE}
  138. {$setc TARGET_CPU_X86_64 := FALSE}
  139. {$setc TARGET_CPU_ARM := FALSE}
  140. {$setc TARGET_CPU_ARM64 := TRUE}
  141. { will require compiler define when/if other Apple devices with ARM cpus ship }
  142. {$setc TARGET_OS_MAC := FALSE}
  143. {$setc TARGET_OS_IPHONE := TRUE}
  144. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  145. {$setc TARGET_OS_EMBEDDED := TRUE}
  146. {$elsec}
  147. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  148. {$endc}
  149. {$ifc defined __LP64__ and __LP64__ }
  150. {$setc TARGET_CPU_64 := TRUE}
  151. {$elsec}
  152. {$setc TARGET_CPU_64 := FALSE}
  153. {$endc}
  154. {$ifc defined FPC_BIG_ENDIAN}
  155. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  156. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  157. {$elifc defined FPC_LITTLE_ENDIAN}
  158. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  159. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  160. {$elsec}
  161. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  162. {$endc}
  163. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  164. {$setc CALL_NOT_IN_CARBON := FALSE}
  165. {$setc OLDROUTINENAMES := FALSE}
  166. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  167. {$setc OPAQUE_UPP_TYPES := TRUE}
  168. {$setc OTCARBONAPPLICATION := TRUE}
  169. {$setc OTKERNEL := FALSE}
  170. {$setc PM_USE_SESSION_APIS := TRUE}
  171. {$setc TARGET_API_MAC_CARBON := TRUE}
  172. {$setc TARGET_API_MAC_OS8 := FALSE}
  173. {$setc TARGET_API_MAC_OSX := TRUE}
  174. {$setc TARGET_CARBON := TRUE}
  175. {$setc TARGET_CPU_68K := FALSE}
  176. {$setc TARGET_CPU_MIPS := FALSE}
  177. {$setc TARGET_CPU_SPARC := FALSE}
  178. {$setc TARGET_OS_UNIX := FALSE}
  179. {$setc TARGET_OS_WIN32 := FALSE}
  180. {$setc TARGET_RT_MAC_68881 := FALSE}
  181. {$setc TARGET_RT_MAC_CFM := FALSE}
  182. {$setc TARGET_RT_MAC_MACHO := TRUE}
  183. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  184. {$setc TYPE_BOOL := FALSE}
  185. {$setc TYPE_EXTENDED := FALSE}
  186. {$setc TYPE_LONGLONG := TRUE}
  187. uses MacTypes,CFBase,CFArray,CFURL,CFDictionary,CFDate,SKIndex,SKDocument;
  188. {$endc} {not MACOSALLINCLUDE}
  189. {$ALIGN POWER}
  190. {$ifc TARGET_OS_MAC}
  191. {
  192. * Asynchronous search
  193. }
  194. {
  195. * SKSearchRef
  196. *
  197. * Summary:
  198. * An opaque data type representing an asynchronous search.
  199. }
  200. type
  201. SKSearchRef = ^__SKSearch; { an opaque type }
  202. __SKSearch = record end;
  203. {
  204. * SKSearchGetTypeID()
  205. *
  206. * Summary:
  207. * Returns the type identifier for the SKSearch type.
  208. *
  209. * Availability:
  210. * Mac OS X: in version 10.4 and later in CoreServices.framework
  211. * CarbonLib: not available
  212. * Non-Carbon CFM: not available
  213. }
  214. function SKSearchGetTypeID: CFTypeID; external name '_SKSearchGetTypeID';
  215. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  216. {
  217. * SKSearchOptions
  218. *
  219. * Summary:
  220. * The various search options you can use with
  221. * <tt>SKSearchCreate</tt>.
  222. }
  223. type
  224. SKSearchOptions = UInt32;
  225. const
  226. kSKSearchOptionDefault = 0;
  227. kSKSearchOptionNoRelevanceScores = 1 shl 0; { Save time by not computing relevance scores. }
  228. kSKSearchOptionSpaceMeansOR = 1 shl 1; { Space in a query means OR instead of AND. }
  229. kSKSearchOptionFindSimilar = 1 shl 2; { Find documents similar to given text string }
  230. {
  231. * SKSearchCreate()
  232. *
  233. * Summary:
  234. * Create an asynchronous search request.
  235. *
  236. * Discussion:
  237. * A call to this function must be balanced with a call at a later
  238. * time to <tt>CFRelease</tt>.
  239. *
  240. * Parameters:
  241. *
  242. * inIndex:
  243. * A reference to the index to be searched.
  244. *
  245. * inQuery:
  246. * The query string to search for.
  247. *
  248. * inSearchOptions:
  249. * The search options. See the <tt>SKSearchOptions</tt>
  250. * enumeration for options.
  251. *
  252. * Result:
  253. * SKSearchRef A reference to a SKSearch opaque type.
  254. *
  255. * Availability:
  256. * Mac OS X: in version 10.4 and later in CoreServices.framework
  257. * CarbonLib: not available
  258. * Non-Carbon CFM: not available
  259. }
  260. function SKSearchCreate( inIndex: SKIndexRef; inQuery: CFStringRef; inSearchOptions: SKSearchOptions ): SKSearchRef; external name '_SKSearchCreate';
  261. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  262. {
  263. * SKSearchCancel()
  264. *
  265. * Summary:
  266. * Cancel the search request.
  267. *
  268. * Availability:
  269. * Mac OS X: in version 10.4 and later in CoreServices.framework
  270. * CarbonLib: not available
  271. * Non-Carbon CFM: not available
  272. }
  273. procedure SKSearchCancel( inSearch: SKSearchRef ); external name '_SKSearchCancel';
  274. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  275. {
  276. * SKSearchFindMatches()
  277. *
  278. * Summary:
  279. * Search for up to maximumTime seconds or until inMaximumCount (or
  280. * all) items are found.
  281. *
  282. * Discussion:
  283. * Returns TRUE if more to search, FALSE when the search is
  284. * exhausted. Returns number of entries actually found in
  285. * *outFoundCount. The maximumTime of 0 means return quickly, so may
  286. * return TRUE, and 0 outFoundCount. The relevance score is not
  287. * normalized, so it can be very large.
  288. *
  289. * Parameters:
  290. *
  291. * inSearch:
  292. * A reference to the SKSearch opaque type.
  293. *
  294. * inMaximumCount:
  295. * The maximum number of found items to return.
  296. *
  297. * outDocumentIDsArray:
  298. * An array of found document IDs. Must be inMaximumCount in size.
  299. *
  300. * outScoresArray:
  301. * An array of relevance scores for found items. May be
  302. * <tt>NULL</tt>.
  303. *
  304. * maximumTime:
  305. * The maximum seconds before return.
  306. *
  307. * outFoundCount:
  308. * The number of items actually found.
  309. *
  310. * Result:
  311. * Boolean Returns TRUE if more to search, FALSE when
  312. * the search is exhausted.
  313. *
  314. * Availability:
  315. * Mac OS X: in version 10.4 and later in CoreServices.framework
  316. * CarbonLib: not available
  317. * Non-Carbon CFM: not available
  318. }
  319. function SKSearchFindMatches( inSearch: SKSearchRef; inMaximumCount: CFIndex; outDocumentIDsArray: SKDocumentIDPtr { array }; outScoresArray: Float32Ptr { array }; maximumTime: CFTimeInterval; var outFoundCount: CFIndex ): Boolean; external name '_SKSearchFindMatches';
  320. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  321. {
  322. * SKIndexCopyInfoForDocumentIDs()
  323. *
  324. * Summary:
  325. * Copies document names and parent ids by way of document IDs in an
  326. * index.
  327. *
  328. * Parameters:
  329. *
  330. * inIndex:
  331. * A reference to the index.
  332. *
  333. * inCount:
  334. * The number of inDocumentIDsArray.
  335. *
  336. * inDocumentIDsArray:
  337. * An array of document IDs.
  338. *
  339. * outNamesArray:
  340. * An array of names for the specified document IDs. May be
  341. * <tt>NULL</tt>.
  342. *
  343. * outParentIDsArray:
  344. * An array of parent ids for the specified document IDs. May be
  345. * <tt>NULL</tt>.
  346. *
  347. * Availability:
  348. * Mac OS X: in version 10.4 and later in CoreServices.framework
  349. * CarbonLib: not available
  350. * Non-Carbon CFM: not available
  351. }
  352. procedure SKIndexCopyInfoForDocumentIDs( inIndex: SKIndexRef; inCount: CFIndex; inDocumentIDsArray: SKDocumentIDPtr { array }; outNamesArray: CFStringRefPtr { array }; outParentIDsArray: SKDocumentIDPtr { array } ); external name '_SKIndexCopyInfoForDocumentIDs';
  353. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  354. {
  355. * SKIndexCopyDocumentRefsForDocumentIDs()
  356. *
  357. * Summary:
  358. * Copies document references by way of document IDs in an index.
  359. *
  360. * Parameters:
  361. *
  362. * inIndex:
  363. * A reference to the index.
  364. *
  365. * inCount:
  366. * The number of inDocumentIDsArray.
  367. *
  368. * inDocumentIDsArray:
  369. * An array of document IDs.
  370. *
  371. * outDocumentRefsArray:
  372. * An array of document references for the specified document IDs.
  373. *
  374. * Availability:
  375. * Mac OS X: in version 10.4 and later in CoreServices.framework
  376. * CarbonLib: not available
  377. * Non-Carbon CFM: not available
  378. }
  379. procedure SKIndexCopyDocumentRefsForDocumentIDs( inIndex: SKIndexRef; inCount: CFIndex; inDocumentIDsArray: SKDocumentIDPtr { array }; outDocumentRefsArray: SKDocumentRefPtr { array } ); external name '_SKIndexCopyDocumentRefsForDocumentIDs';
  380. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  381. {
  382. * SKIndexCopyDocumentURLsForDocumentIDs()
  383. *
  384. * Summary:
  385. * Copies document URLs by way of document IDs in an index.
  386. *
  387. * Parameters:
  388. *
  389. * inIndex:
  390. * A reference to the index.
  391. *
  392. * inCount:
  393. * The number of inDocumentIDsArray.
  394. *
  395. * inDocumentIDsArray:
  396. * An array of document IDs.
  397. *
  398. * outDocumentURLsArray:
  399. * An array of CFURLs for the specified document IDs.
  400. *
  401. * Availability:
  402. * Mac OS X: in version 10.4 and later in CoreServices.framework
  403. * CarbonLib: not available
  404. * Non-Carbon CFM: not available
  405. }
  406. procedure SKIndexCopyDocumentURLsForDocumentIDs( inIndex: SKIndexRef; inCount: CFIndex; inDocumentIDsArray: SKDocumentIDPtr { array }; outDocumentURLsArray: CFURLRefPtr { array } ); external name '_SKIndexCopyDocumentURLsForDocumentIDs';
  407. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  408. {
  409. * Synchronous search
  410. }
  411. {
  412. * SKSearchGroupRef
  413. *
  414. * Summary:
  415. * An opaque data type representing a search group.
  416. *
  417. * Discussion:
  418. * A search group is a group of indexes to be searched.
  419. }
  420. type
  421. SKSearchGroupRef = ^__SKSearchGroup; { an opaque type }
  422. __SKSearchGroup = record end;
  423. {
  424. * SKSearchGroupGetTypeID() *** DEPRECATED ***
  425. *
  426. * Summary:
  427. * Returns the type identifier for the SKSearchGroup type.
  428. *
  429. * Availability:
  430. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  431. * CarbonLib: not available
  432. * Non-Carbon CFM: not available
  433. }
  434. function SKSearchGroupGetTypeID: CFTypeID; external name '_SKSearchGroupGetTypeID';
  435. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  436. {
  437. * SKSearchResultsRef
  438. *
  439. * Summary:
  440. * An opaque data type representing search results.
  441. }
  442. type
  443. SKSearchResultsRef = ^__SKSearchResults; { an opaque type }
  444. __SKSearchResults = record end;
  445. {
  446. * SKSearchResultsGetTypeID() *** DEPRECATED ***
  447. *
  448. * Summary:
  449. * Returns the type identifier for the SKSearchResults object.
  450. *
  451. * Availability:
  452. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  453. * CarbonLib: not available
  454. * Non-Carbon CFM: not available
  455. }
  456. function SKSearchResultsGetTypeID: CFTypeID; external name '_SKSearchResultsGetTypeID';
  457. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  458. {
  459. * SKSearchType
  460. *
  461. * Discussion:
  462. * The various search types you can use with
  463. * <tt>SKSearchResultsCreateWithQuery</tt>. Each of these specifies
  464. * a set of ranked search hits. The kSKSearchRanked and
  465. * kSKSearchPrefixRanked constants can be used for all index types.
  466. * The kSKSearchBooleanRanked and kSKSearchRequiredRanked constants
  467. * cannot be used for Vector indexes.
  468. }
  469. type
  470. SKSearchType = SInt32;
  471. SKSearchTypePtr = ^SKSearchType;
  472. const
  473. {
  474. * Basic ranked search.
  475. }
  476. kSKSearchRanked = 0;
  477. {
  478. * The query can include boolean operators including '|', '&', '!',
  479. * '(', and ')'.
  480. }
  481. kSKSearchBooleanRanked = 1;
  482. {
  483. * The query can specify required ('+') or excluded ('-') terms.
  484. }
  485. kSKSearchRequiredRanked = 2;
  486. {
  487. * Prefix-based search.
  488. }
  489. kSKSearchPrefixRanked = 3;
  490. {
  491. * SKSearchResultsFilterCallBack
  492. *
  493. * Summary:
  494. * A callback function for hit testing during searching.
  495. *
  496. * Discussion:
  497. * Return <tt>true</tt> to keep this document in the results,
  498. * <tt>false</tt> to filter it out.
  499. }
  500. type
  501. SKSearchResultsFilterCallBack = function( inIndex: SKIndexRef; inDocument: SKDocumentRef; inContext: UnivPtr ): Boolean;
  502. {
  503. * SKSearchGroupCreate() *** DEPRECATED ***
  504. *
  505. * Summary:
  506. * Creates a search group as an array of references to indexes.
  507. *
  508. * Discussion:
  509. * A search group is used to search one or more indexes.
  510. *
  511. * Parameters:
  512. *
  513. * inArrayOfInIndexes:
  514. * A CFArray object containing SKIndex objects.
  515. *
  516. * Result:
  517. * SKSearchGroupRef A reference to an SKSearchGroup opaque type.
  518. *
  519. * Availability:
  520. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  521. * CarbonLib: not available
  522. * Non-Carbon CFM: not available
  523. }
  524. function SKSearchGroupCreate( inArrayOfInIndexes: CFArrayRef ): SKSearchGroupRef; external name '_SKSearchGroupCreate';
  525. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  526. {
  527. * SKSearchGroupCopyIndexes() *** DEPRECATED ***
  528. *
  529. * Summary:
  530. * Gets the indexes for a search group.
  531. *
  532. * Result:
  533. * A CFArray object containing SKIndex objects.
  534. *
  535. * Availability:
  536. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  537. * CarbonLib: not available
  538. * Non-Carbon CFM: not available
  539. }
  540. function SKSearchGroupCopyIndexes( inSearchGroup: SKSearchGroupRef ): CFArrayRef; external name '_SKSearchGroupCopyIndexes';
  541. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  542. {
  543. * SKSearchResultsCreateWithQuery() *** DEPRECATED ***
  544. *
  545. * Summary:
  546. * Queries the indexes in a search group. This call has been
  547. * deprecated in favor of <tt>SKSearchCreate</tt>.
  548. *
  549. * Discussion:
  550. * A call to this function must be balanced with a call at a later
  551. * time to <tt>CFRelease</tt>.
  552. *
  553. * Parameters:
  554. *
  555. * inSearchGroup:
  556. * A reference to the search group.
  557. *
  558. * inQuery:
  559. * The query string to search for.
  560. *
  561. * inSearchType:
  562. * The type of search to perform. See the <tt>SKSearchType</tt>
  563. * enumeration for options.
  564. *
  565. * inMaxFoundDocuments:
  566. * The maximum number of found items to return. Your client must
  567. * specify a positive value.
  568. *
  569. * inContext:
  570. * A client-specified context. May be <tt>NULL</tt>.
  571. *
  572. * inFilterCallBack:
  573. * A callback function for hit testing during searching. May be
  574. * <tt>NULL</tt>.
  575. *
  576. * Result:
  577. * SKSearchResultsRef A reference to an SKSearchResults opaque type.
  578. *
  579. * Availability:
  580. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  581. * CarbonLib: not available
  582. * Non-Carbon CFM: not available
  583. }
  584. function SKSearchResultsCreateWithQuery( inSearchGroup: SKSearchGroupRef; inQuery: CFStringRef; inSearchType: SKSearchType; inMaxFoundDocuments: CFIndex; inContext: UnivPtr; inFilterCallBack: SKSearchResultsFilterCallBack ): SKSearchResultsRef; external name '_SKSearchResultsCreateWithQuery';
  585. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  586. {
  587. * SKSearchResultsCreateWithDocuments() *** DEPRECATED ***
  588. *
  589. * Summary:
  590. * Finds documents similar to given example documents by searching
  591. * the indexes in a search group. This call has been deprecated in
  592. * favor of <tt>SKSearchCreate</tt>.
  593. *
  594. * Discussion:
  595. * A call to SKSearchResultsCreateWithDocuments must be balanced
  596. * with a call at a later time to <tt>CFRelease</tt>.
  597. *
  598. * Parameters:
  599. *
  600. * inSearchGroup:
  601. * A reference to the search group.
  602. *
  603. * inExampleDocuments:
  604. * An array of example documents. The documents must previously
  605. * have been indexed.
  606. *
  607. * inMaxFoundDocuments:
  608. * The maximum number of found items to return. Your client must
  609. * specify a positive value.
  610. *
  611. * inContext:
  612. * A client-specified context. May be <tt>NULL</tt>.
  613. *
  614. * inFilterCallBack:
  615. * A callback function for hit testing during searching. May be
  616. * <tt>NULL</tt>.
  617. *
  618. * Result:
  619. * SKSearchResultsRef A reference to an SKSearchResults opaque type.
  620. *
  621. * Availability:
  622. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  623. * CarbonLib: not available
  624. * Non-Carbon CFM: not available
  625. }
  626. function SKSearchResultsCreateWithDocuments( inSearchGroup: SKSearchGroupRef; inExampleDocuments: CFArrayRef; inMaxFoundDocuments: CFIndex; inContext: UnivPtr; inFilterCallBack: SKSearchResultsFilterCallBack ): SKSearchResultsRef; external name '_SKSearchResultsCreateWithDocuments';
  627. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  628. {
  629. * SKSearchResultsGetCount() *** DEPRECATED ***
  630. *
  631. * Summary:
  632. * Gets the total number of found items in a search.
  633. *
  634. * Availability:
  635. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  636. * CarbonLib: not available
  637. * Non-Carbon CFM: not available
  638. }
  639. function SKSearchResultsGetCount( inSearchResults: SKSearchResultsRef ): CFIndex; external name '_SKSearchResultsGetCount';
  640. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  641. {
  642. * SKSearchResultsGetInfoInRange() *** DEPRECATED ***
  643. *
  644. * Summary:
  645. * Fills in requested results, returns number of items that were
  646. * returned.
  647. *
  648. * Discussion:
  649. * Search results are returned in descending order of relevance
  650. * score.
  651. *
  652. * Parameters:
  653. *
  654. * inSearchResults:
  655. * A reference to the search results.
  656. *
  657. * inRange:
  658. * A CFRange value pair, specified as (location, length). The
  659. * location value specifies the starting item by ranking. The
  660. * length value specifies the total number of items. Examples:
  661. * (0,1) means the first item, which is also the highest ranking
  662. * item. (1,1) means the second item, which is also the
  663. * second-highest ranking item. (0,5) means to get the first 5
  664. * items.
  665. *
  666. * outDocumentsArray:
  667. * An array of found documents.
  668. *
  669. * outIndexesArray:
  670. * An array of indexes in which the found docouments reside. May
  671. * be <tt>NULL</tt> provided that the client does not care.
  672. *
  673. * outScoresArray:
  674. * An array of correspondence scores for found items. May be
  675. * <tt>NULL</tt>.
  676. *
  677. * Result:
  678. * The number of items returned -- usually the same number as
  679. * specified.
  680. *
  681. * Availability:
  682. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  683. * CarbonLib: not available
  684. * Non-Carbon CFM: not available
  685. }
  686. function SKSearchResultsGetInfoInRange( inSearchResults: SKSearchResultsRef; inRange: CFRange; outDocumentsArray: SKDocumentRefPtr { array }; outIndexesArray: SKIndexRefPtr { array }; outScoresArray: Float32Ptr { array } ): CFIndex; external name '_SKSearchResultsGetInfoInRange';
  687. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  688. {
  689. * SKSearchResultsCopyMatchingTerms() *** DEPRECATED ***
  690. *
  691. * Summary:
  692. * Gets the matching terms for the specified search result item
  693. * index.
  694. *
  695. * Parameters:
  696. *
  697. * inSearchResults:
  698. * A reference to the search results.
  699. *
  700. * inItem:
  701. * The search result item index, starting from 1.
  702. *
  703. * Result:
  704. * A reference to a CFArray object of term IDs.
  705. *
  706. * Availability:
  707. * Mac OS X: in version 10.3 and later in CoreServices.framework but deprecated in 10.4
  708. * CarbonLib: not available
  709. * Non-Carbon CFM: not available
  710. }
  711. function SKSearchResultsCopyMatchingTerms( inSearchResults: SKSearchResultsRef; inItem: CFIndex ): CFArrayRef; external name '_SKSearchResultsCopyMatchingTerms';
  712. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  713. {$endc} {TARGET_OS_MAC}
  714. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  715. end.
  716. {$endc} {not MACOSALLINCLUDE}