SKSearch.pas 24 KB

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