LSSharedFileList.pas 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147
  1. {
  2. File: LSSharedFileList.h
  3. Contains: Services to load and share file lists.
  4. Copyright: Copyright 2003-2009 by Apple Inc., all rights reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://bugs.freepascal.org
  8. }
  9. { Pascal Translation: Gorazd Krosl <[email protected]>, October 2009 }
  10. { Updated Pascal Translation: Jonas Maebe <[email protected]>, September 2012 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 308
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  17. {$mode macpas}
  18. {$modeswitch cblocks}
  19. {$packenum 1}
  20. {$macro on}
  21. {$inline on}
  22. {$calling mwpascal}
  23. {$IFNDEF FPC_DOTTEDUNITS}
  24. unit LSSharedFileList;
  25. {$ENDIF FPC_DOTTEDUNITS}
  26. interface
  27. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  28. {$setc GAP_INTERFACES_VERSION := $0308}
  29. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  30. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  31. {$endc}
  32. {$ifc defined CPUPOWERPC and defined CPUI386}
  33. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  34. {$endc}
  35. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  36. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  37. {$endc}
  38. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  39. {$setc __ppc__ := 1}
  40. {$elsec}
  41. {$setc __ppc__ := 0}
  42. {$endc}
  43. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  44. {$setc __ppc64__ := 1}
  45. {$elsec}
  46. {$setc __ppc64__ := 0}
  47. {$endc}
  48. {$ifc not defined __i386__ and defined CPUI386}
  49. {$setc __i386__ := 1}
  50. {$elsec}
  51. {$setc __i386__ := 0}
  52. {$endc}
  53. {$ifc not defined __x86_64__ and defined CPUX86_64}
  54. {$setc __x86_64__ := 1}
  55. {$elsec}
  56. {$setc __x86_64__ := 0}
  57. {$endc}
  58. {$ifc not defined __arm__ and defined CPUARM}
  59. {$setc __arm__ := 1}
  60. {$elsec}
  61. {$setc __arm__ := 0}
  62. {$endc}
  63. {$ifc not defined __arm64__ and defined CPUAARCH64}
  64. {$setc __arm64__ := 1}
  65. {$elsec}
  66. {$setc __arm64__ := 0}
  67. {$endc}
  68. {$ifc defined cpu64}
  69. {$setc __LP64__ := 1}
  70. {$elsec}
  71. {$setc __LP64__ := 0}
  72. {$endc}
  73. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  74. {$error Conflicting definitions for __ppc__ and __i386__}
  75. {$endc}
  76. {$ifc defined __ppc__ and __ppc__}
  77. {$setc TARGET_CPU_PPC := TRUE}
  78. {$setc TARGET_CPU_PPC64 := FALSE}
  79. {$setc TARGET_CPU_X86 := FALSE}
  80. {$setc TARGET_CPU_X86_64 := FALSE}
  81. {$setc TARGET_CPU_ARM := FALSE}
  82. {$setc TARGET_CPU_ARM64 := FALSE}
  83. {$setc TARGET_OS_MAC := TRUE}
  84. {$setc TARGET_OS_IPHONE := FALSE}
  85. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  86. {$setc TARGET_OS_EMBEDDED := FALSE}
  87. {$elifc defined __ppc64__ and __ppc64__}
  88. {$setc TARGET_CPU_PPC := FALSE}
  89. {$setc TARGET_CPU_PPC64 := TRUE}
  90. {$setc TARGET_CPU_X86 := FALSE}
  91. {$setc TARGET_CPU_X86_64 := FALSE}
  92. {$setc TARGET_CPU_ARM := FALSE}
  93. {$setc TARGET_CPU_ARM64 := FALSE}
  94. {$setc TARGET_OS_MAC := TRUE}
  95. {$setc TARGET_OS_IPHONE := FALSE}
  96. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  97. {$setc TARGET_OS_EMBEDDED := FALSE}
  98. {$elifc defined __i386__ and __i386__}
  99. {$setc TARGET_CPU_PPC := FALSE}
  100. {$setc TARGET_CPU_PPC64 := FALSE}
  101. {$setc TARGET_CPU_X86 := TRUE}
  102. {$setc TARGET_CPU_X86_64 := FALSE}
  103. {$setc TARGET_CPU_ARM := FALSE}
  104. {$setc TARGET_CPU_ARM64 := FALSE}
  105. {$ifc defined iphonesim}
  106. {$setc TARGET_OS_MAC := FALSE}
  107. {$setc TARGET_OS_IPHONE := TRUE}
  108. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  109. {$elsec}
  110. {$setc TARGET_OS_MAC := TRUE}
  111. {$setc TARGET_OS_IPHONE := FALSE}
  112. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  113. {$endc}
  114. {$setc TARGET_OS_EMBEDDED := FALSE}
  115. {$elifc defined __x86_64__ and __x86_64__}
  116. {$setc TARGET_CPU_PPC := FALSE}
  117. {$setc TARGET_CPU_PPC64 := FALSE}
  118. {$setc TARGET_CPU_X86 := FALSE}
  119. {$setc TARGET_CPU_X86_64 := TRUE}
  120. {$setc TARGET_CPU_ARM := FALSE}
  121. {$setc TARGET_CPU_ARM64 := FALSE}
  122. {$ifc defined iphonesim}
  123. {$setc TARGET_OS_MAC := FALSE}
  124. {$setc TARGET_OS_IPHONE := TRUE}
  125. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  126. {$elsec}
  127. {$setc TARGET_OS_MAC := TRUE}
  128. {$setc TARGET_OS_IPHONE := FALSE}
  129. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  130. {$endc}
  131. {$setc TARGET_OS_EMBEDDED := FALSE}
  132. {$elifc defined __arm__ and __arm__}
  133. {$setc TARGET_CPU_PPC := FALSE}
  134. {$setc TARGET_CPU_PPC64 := FALSE}
  135. {$setc TARGET_CPU_X86 := FALSE}
  136. {$setc TARGET_CPU_X86_64 := FALSE}
  137. {$setc TARGET_CPU_ARM := TRUE}
  138. {$setc TARGET_CPU_ARM64 := FALSE}
  139. {$setc TARGET_OS_MAC := FALSE}
  140. {$setc TARGET_OS_IPHONE := TRUE}
  141. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  142. {$setc TARGET_OS_EMBEDDED := TRUE}
  143. {$elifc defined __arm64__ and __arm64__}
  144. {$setc TARGET_CPU_PPC := FALSE}
  145. {$setc TARGET_CPU_PPC64 := FALSE}
  146. {$setc TARGET_CPU_X86 := FALSE}
  147. {$setc TARGET_CPU_X86_64 := FALSE}
  148. {$setc TARGET_CPU_ARM := FALSE}
  149. {$setc TARGET_CPU_ARM64 := TRUE}
  150. {$ifc defined ios}
  151. {$setc TARGET_OS_MAC := FALSE}
  152. {$setc TARGET_OS_IPHONE := TRUE}
  153. {$setc TARGET_OS_EMBEDDED := TRUE}
  154. {$elsec}
  155. {$setc TARGET_OS_MAC := TRUE}
  156. {$setc TARGET_OS_IPHONE := FALSE}
  157. {$setc TARGET_OS_EMBEDDED := FALSE}
  158. {$endc}
  159. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  160. {$elsec}
  161. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  162. {$endc}
  163. {$ifc defined __LP64__ and __LP64__ }
  164. {$setc TARGET_CPU_64 := TRUE}
  165. {$elsec}
  166. {$setc TARGET_CPU_64 := FALSE}
  167. {$endc}
  168. {$ifc defined FPC_BIG_ENDIAN}
  169. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  170. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  171. {$elifc defined FPC_LITTLE_ENDIAN}
  172. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  173. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  174. {$elsec}
  175. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  176. {$endc}
  177. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  178. {$setc CALL_NOT_IN_CARBON := FALSE}
  179. {$setc OLDROUTINENAMES := FALSE}
  180. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  181. {$setc OPAQUE_UPP_TYPES := TRUE}
  182. {$setc OTCARBONAPPLICATION := TRUE}
  183. {$setc OTKERNEL := FALSE}
  184. {$setc PM_USE_SESSION_APIS := TRUE}
  185. {$setc TARGET_API_MAC_CARBON := TRUE}
  186. {$setc TARGET_API_MAC_OS8 := FALSE}
  187. {$setc TARGET_API_MAC_OSX := TRUE}
  188. {$setc TARGET_CARBON := TRUE}
  189. {$setc TARGET_CPU_68K := FALSE}
  190. {$setc TARGET_CPU_MIPS := FALSE}
  191. {$setc TARGET_CPU_SPARC := FALSE}
  192. {$setc TARGET_OS_UNIX := FALSE}
  193. {$setc TARGET_OS_WIN32 := FALSE}
  194. {$setc TARGET_RT_MAC_68881 := FALSE}
  195. {$setc TARGET_RT_MAC_CFM := FALSE}
  196. {$setc TARGET_RT_MAC_MACHO := TRUE}
  197. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  198. {$setc TYPE_BOOL := FALSE}
  199. {$setc TYPE_EXTENDED := FALSE}
  200. {$setc TYPE_LONGLONG := TRUE}
  201. {$IFDEF FPC_DOTTEDUNITS}
  202. uses MacOsApi.MacTypes,MacOsApi.CFBase,MacOsApi.CFArray,MacOsApi.CFDictionary,MacOsApi.CFURL,MacOsApi.CFRunLoop,MacOsApi.Files,MacOsApi.IconsCore,MacOsApi.Authorization;
  203. {$ELSE FPC_DOTTEDUNITS}
  204. uses MacTypes,CFBase,CFArray,CFDictionary,CFURL,CFRunLoop,Files,IconsCore,Authorization;
  205. {$ENDIF FPC_DOTTEDUNITS}
  206. {$endc} {not MACOSALLINCLUDE}
  207. {$ifc TARGET_OS_MAC}
  208. {$ALIGN POWER}
  209. { The shared file list API is for sharing and storing list of references to file system objects.
  210. The shared file list is a persistent list of objects, where each item has assigned display name, icon, and url
  211. as well as other optional properties.
  212. Each list can also have various properties attached.
  213. }
  214. type
  215. LSSharedFileListRef = ^OpaqueLSSharedFileListRef; { an opaque type }
  216. OpaqueLSSharedFileListRef = record end;
  217. LSSharedFileListItemRef = ^OpaqueLSSharedFileListItemRef; { an opaque type }
  218. OpaqueLSSharedFileListItemRef = record end;
  219. { list types }
  220. {
  221. * kLSSharedFileListFavoriteVolumes
  222. *
  223. * Availability:
  224. * Mac OS X: in version 10.5 and later in CoreServices.framework
  225. * CarbonLib: not available
  226. * Non-Carbon CFM: not available
  227. }
  228. var kLSSharedFileListFavoriteVolumes: CFStringRef; external name '_kLSSharedFileListFavoriteVolumes'; (* attribute const *)
  229. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  230. {
  231. * kLSSharedFileListFavoriteItems
  232. *
  233. * Availability:
  234. * Mac OS X: in version 10.5 and later in CoreServices.framework
  235. * CarbonLib: not available
  236. * Non-Carbon CFM: not available
  237. }
  238. var kLSSharedFileListFavoriteItems: CFStringRef; external name '_kLSSharedFileListFavoriteItems'; (* attribute const *)
  239. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  240. {
  241. * kLSSharedFileListRecentApplicationItems
  242. *
  243. * Availability:
  244. * Mac OS X: in version 10.5 and later in CoreServices.framework
  245. * CarbonLib: not available
  246. * Non-Carbon CFM: not available
  247. }
  248. var kLSSharedFileListRecentApplicationItems: CFStringRef; external name '_kLSSharedFileListRecentApplicationItems'; (* attribute const *)
  249. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  250. {
  251. * kLSSharedFileListRecentDocumentItems
  252. *
  253. * Availability:
  254. * Mac OS X: in version 10.5 and later in CoreServices.framework
  255. * CarbonLib: not available
  256. * Non-Carbon CFM: not available
  257. }
  258. var kLSSharedFileListRecentDocumentItems: CFStringRef; external name '_kLSSharedFileListRecentDocumentItems'; (* attribute const *)
  259. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  260. {
  261. * kLSSharedFileListRecentServerItems
  262. *
  263. * Availability:
  264. * Mac OS X: in version 10.5 and later in CoreServices.framework
  265. * CarbonLib: not available
  266. * Non-Carbon CFM: not available
  267. }
  268. var kLSSharedFileListRecentServerItems: CFStringRef; external name '_kLSSharedFileListRecentServerItems'; (* attribute const *)
  269. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  270. {
  271. * kLSSharedFileListSessionLoginItems
  272. *
  273. * Availability:
  274. * Mac OS X: in version 10.5 and later in CoreServices.framework
  275. * CarbonLib: not available
  276. * Non-Carbon CFM: not available
  277. }
  278. var kLSSharedFileListSessionLoginItems: CFStringRef; external name '_kLSSharedFileListSessionLoginItems'; (* attribute const *)
  279. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  280. {
  281. * kLSSharedFileListGlobalLoginItems *** DEPRECATED ***
  282. *
  283. * Deprecated:
  284. * Use a LaunchAgent instead.
  285. *
  286. * Availability:
  287. * Mac OS X: in version 10.5 and later in CoreServices.framework
  288. * CarbonLib: not available
  289. * Non-Carbon CFM: not available
  290. }
  291. var kLSSharedFileListGlobalLoginItems: CFStringRef; external name '_kLSSharedFileListGlobalLoginItems'; (* attribute const *)
  292. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_9, __IPHONE_NA, __IPHONE_NA) *)
  293. { LSSharedFileList property keys }
  294. {
  295. * kLSSharedFileListRecentItemsMaxAmount
  296. *
  297. * Discussion:
  298. * maximum amount of items in the list. Associated property is
  299. * CFNumber
  300. *
  301. * Availability:
  302. * Mac OS X: in version 10.5 and later in CoreServices.framework
  303. * CarbonLib: not available
  304. * Non-Carbon CFM: not available
  305. }
  306. var kLSSharedFileListRecentItemsMaxAmount: CFStringRef; external name '_kLSSharedFileListRecentItemsMaxAmount'; (* attribute const *)
  307. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  308. {
  309. * kLSSharedFileListVolumesComputerVisible
  310. *
  311. * Discussion:
  312. * is Computer item visible in favorite volumes list. Associated
  313. * property is CFBoolean.
  314. *
  315. * Availability:
  316. * Mac OS X: in version 10.5 and later in CoreServices.framework
  317. * CarbonLib: not available
  318. * Non-Carbon CFM: not available
  319. }
  320. var kLSSharedFileListVolumesComputerVisible: CFStringRef; external name '_kLSSharedFileListVolumesComputerVisible'; (* attribute const *)
  321. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  322. {
  323. * kLSSharedFileListVolumesIDiskVisible
  324. *
  325. * Discussion:
  326. * is iDisk item visible in favorite volumes list. Associated
  327. * property is CFBoolean.
  328. *
  329. * Availability:
  330. * Mac OS X: in version 10.5 and later in CoreServices.framework
  331. * CarbonLib: not available
  332. * Non-Carbon CFM: not available
  333. }
  334. var kLSSharedFileListVolumesIDiskVisible: CFStringRef; external name '_kLSSharedFileListVolumesIDiskVisible'; (* attribute const *)
  335. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  336. {
  337. * kLSSharedFileListVolumesNetworkVisible
  338. *
  339. * Discussion:
  340. * is Network item visible in favorite volumes list. Associated
  341. * property is CFBoolean.
  342. *
  343. * Availability:
  344. * Mac OS X: in version 10.5 and later in CoreServices.framework
  345. * CarbonLib: not available
  346. * Non-Carbon CFM: not available
  347. }
  348. var kLSSharedFileListVolumesNetworkVisible: CFStringRef; external name '_kLSSharedFileListVolumesNetworkVisible'; (* attribute const *)
  349. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  350. { item default positions }
  351. {
  352. * kLSSharedFileListItemBeforeFirst
  353. *
  354. * Discussion:
  355. * A virtual item reference for inserting new item at beginning of
  356. * the list.
  357. *
  358. * Availability:
  359. * Mac OS X: in version 10.5 and later in CoreServices.framework
  360. * CarbonLib: not available
  361. * Non-Carbon CFM: not available
  362. }
  363. var kLSSharedFileListItemBeforeFirst: LSSharedFileListItemRef; external name '_kLSSharedFileListItemBeforeFirst'; (* attribute const *)
  364. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  365. {
  366. * kLSSharedFileListItemLast
  367. *
  368. * Discussion:
  369. * A virtual item reference for inserting new item at end of the
  370. * list.
  371. *
  372. * Availability:
  373. * Mac OS X: in version 10.5 and later in CoreServices.framework
  374. * CarbonLib: not available
  375. * Non-Carbon CFM: not available
  376. }
  377. var kLSSharedFileListItemLast: LSSharedFileListItemRef; external name '_kLSSharedFileListItemLast'; (* attribute const *)
  378. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  379. { LSSharedFileListItem property keys }
  380. {
  381. * kLSSharedFileListItemHidden
  382. *
  383. * Discussion:
  384. * Is item hidden in UI? Associated property is CFBoolean.
  385. *
  386. * Availability:
  387. * Mac OS X: in version 10.5 and later in CoreServices.framework
  388. * CarbonLib: not available
  389. * Non-Carbon CFM: not available
  390. }
  391. var kLSSharedFileListItemHidden: CFStringRef; external name '_kLSSharedFileListItemHidden'; (* attribute const *)
  392. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  393. {
  394. * kLSSharedFileListLoginItemHidden
  395. *
  396. * Discussion:
  397. * Should UI hide login item's window? Associated property is
  398. * CFBoolean.
  399. *
  400. * Availability:
  401. * Mac OS X: in version 10.6 and later in CoreServices.framework
  402. * CarbonLib: not available
  403. * Non-Carbon CFM: not available
  404. }
  405. var kLSSharedFileListLoginItemHidden: CFStringRef; external name '_kLSSharedFileListLoginItemHidden'; (* attribute const *)
  406. (* __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA) *)
  407. { LSSharedFileListItemResolve flags }
  408. const
  409. kLSSharedFileListNoUserInteraction = 1 shl 0; { no user interaction during resolution }
  410. kLSSharedFileListDoNotMountVolumes = 1 shl 1; { do not mount volumes during resolution }
  411. {
  412. * LSSharedFileListChangedProcPtr
  413. *
  414. * Discussion:
  415. * callback to use with LSSharedFileListAddObserver and
  416. * LSSharedFileListRemoveObserver.
  417. }
  418. type
  419. LSSharedFileListChangedProcPtr = procedure( inList: LSSharedFileListRef; context: UnivPtr );
  420. {
  421. * LSSharedFileListGetTypeID()
  422. *
  423. * Discussion:
  424. * This routine will return the CFTypeID for the LSSharedFileListRef
  425. * type.
  426. *
  427. * Mac OS X threading:
  428. * Thread safe since version 10.5
  429. *
  430. * Result:
  431. * CFTypeID for the LSSharedFileListRef type.
  432. *
  433. * Availability:
  434. * Mac OS X: in version 10.5 and later in CoreServices.framework
  435. * CarbonLib: not available
  436. * Non-Carbon CFM: not available
  437. }
  438. function LSSharedFileListGetTypeID: CFTypeID; external name '_LSSharedFileListGetTypeID';
  439. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  440. {
  441. * LSSharedFileListItemGetTypeID()
  442. *
  443. * Discussion:
  444. * This routine will return the CFTypeID for the
  445. * LSSharedFileListItemRef type.
  446. *
  447. * Mac OS X threading:
  448. * Thread safe since version 10.5
  449. *
  450. * Result:
  451. * CFTypeID for the LSSharedFileListItemRef type.
  452. *
  453. * Availability:
  454. * Mac OS X: in version 10.5 and later in CoreServices.framework
  455. * CarbonLib: not available
  456. * Non-Carbon CFM: not available
  457. }
  458. function LSSharedFileListItemGetTypeID: CFTypeID; external name '_LSSharedFileListItemGetTypeID';
  459. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  460. {
  461. * LSSharedFileListCreate()
  462. *
  463. * Summary:
  464. * Create shared file list reference.
  465. *
  466. * Discussion:
  467. * Creates shared file list reference to be used for changing list
  468. * and reading its various properties.
  469. *
  470. * Mac OS X threading:
  471. * Thread safe since version 10.5
  472. *
  473. * Parameters:
  474. *
  475. * inAllocator:
  476. * CFAllocatorRef used to allocate the LSSharedFileListRef object.
  477. * As usual, NULL means default allocator.
  478. *
  479. * inListType:
  480. * A constant indicating list type to create (for example
  481. * kLSSharedFileListSessionLoginItems).
  482. *
  483. * listOptions:
  484. * Additional parameters for the list type (as applicable). NULL
  485. * means no options.
  486. *
  487. * Result:
  488. * A reference to created shared file list object or NULL if
  489. * creation failed. Has to be released with CFRelease when list
  490. * object is not needed anymore.
  491. *
  492. * Availability:
  493. * Mac OS X: in version 10.5 and later in CoreServices.framework
  494. * CarbonLib: not available
  495. * Non-Carbon CFM: not available
  496. }
  497. function LSSharedFileListCreate( inAllocator: CFAllocatorRef; inListType: CFStringRef; listOptions: CFTypeRef ): LSSharedFileListRef; external name '_LSSharedFileListCreate';
  498. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  499. {
  500. * LSSharedFileListSetAuthorization()
  501. *
  502. * Summary:
  503. * Set authorization reference for the shared list.
  504. *
  505. * Discussion:
  506. * Sets authorization reference for the shared list. Before
  507. * attempting to perform a privileged operation on the shared list
  508. * caller must authorize appropriate rights. For example, modifying
  509. * kLSSharedFileListGlobalLoginItems list requires
  510. * "system.global-login-items." right authorized.
  511. *
  512. * Mac OS X threading:
  513. * Thread safe since version 10.5
  514. *
  515. * Parameters:
  516. *
  517. * inList:
  518. * Shared list reference.
  519. *
  520. * inAuthorization:
  521. * Authorization reference.
  522. *
  523. * Availability:
  524. * Mac OS X: in version 10.5 and later in CoreServices.framework
  525. * CarbonLib: not available
  526. * Non-Carbon CFM: not available
  527. }
  528. function LSSharedFileListSetAuthorization( inList: LSSharedFileListRef; inAuthorization: AuthorizationRef ): OSStatus; external name '_LSSharedFileListSetAuthorization';
  529. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  530. {
  531. * LSSharedFileListAddObserver()
  532. *
  533. * Summary:
  534. * Add observer of shared list changes.
  535. *
  536. * Discussion:
  537. * Adds observer of shared list changes. The provided function will
  538. * be called when the list has changed (or any item property has
  539. * changed).
  540. *
  541. * Mac OS X threading:
  542. * Thread safe since version 10.5
  543. *
  544. * Parameters:
  545. *
  546. * inList:
  547. * Shared list reference.
  548. *
  549. * inRunloop:
  550. * Runloop to run on.
  551. *
  552. * inRunloopMode:
  553. * Mode for runloop.
  554. *
  555. * callback:
  556. * Function to call when list has changed.
  557. *
  558. * context:
  559. * Context pointer defined by client.
  560. *
  561. * Availability:
  562. * Mac OS X: in version 10.5 and later in CoreServices.framework
  563. * CarbonLib: not available
  564. * Non-Carbon CFM: not available
  565. }
  566. procedure LSSharedFileListAddObserver( inList: LSSharedFileListRef; inRunloop: CFRunLoopRef; inRunloopMode: CFStringRef; callback: LSSharedFileListChangedProcPtr; context: UnivPtr ); external name '_LSSharedFileListAddObserver';
  567. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  568. {
  569. * LSSharedFileListRemoveObserver()
  570. *
  571. * Summary:
  572. * Remove observer of shared list changes.
  573. *
  574. * Discussion:
  575. * Removes observer of shared list changes.
  576. *
  577. * Mac OS X threading:
  578. * Thread safe since version 10.5
  579. *
  580. * Parameters:
  581. *
  582. * inList:
  583. * Shared list reference.
  584. *
  585. * inRunloop:
  586. * Runloop to run on.
  587. *
  588. * inRunloopMode:
  589. * Mode for runloop.
  590. *
  591. * callback:
  592. * Function to call when list has changed.
  593. *
  594. * context:
  595. * Context pointer defined by client.
  596. *
  597. * Availability:
  598. * Mac OS X: in version 10.5 and later in CoreServices.framework
  599. * CarbonLib: not available
  600. * Non-Carbon CFM: not available
  601. }
  602. procedure LSSharedFileListRemoveObserver( inList: LSSharedFileListRef; inRunloop: CFRunLoopRef; inRunloopMode: CFStringRef; callback: LSSharedFileListChangedProcPtr; context: UnivPtr ); external name '_LSSharedFileListRemoveObserver';
  603. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  604. {
  605. * LSSharedFileListGetSeedValue()
  606. *
  607. * Summary:
  608. * Return current seed value.
  609. *
  610. * Discussion:
  611. * Returns seed value of the shared list.
  612. *
  613. * Mac OS X threading:
  614. * Thread safe since version 10.5
  615. *
  616. * Parameters:
  617. *
  618. * inList:
  619. * Shared list reference.
  620. *
  621. * Availability:
  622. * Mac OS X: in version 10.5 and later in CoreServices.framework
  623. * CarbonLib: not available
  624. * Non-Carbon CFM: not available
  625. }
  626. function LSSharedFileListGetSeedValue( inList: LSSharedFileListRef ): UInt32; external name '_LSSharedFileListGetSeedValue';
  627. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  628. {
  629. * LSSharedFileListCopyProperty()
  630. *
  631. * Summary:
  632. * Return property by its name.
  633. *
  634. * Discussion:
  635. * Returns lists named property as CFTypeRef object.
  636. *
  637. * Mac OS X threading:
  638. * Thread safe since version 10.5
  639. *
  640. * Parameters:
  641. *
  642. * inList:
  643. * Shared list reference.
  644. *
  645. * inPropertyName:
  646. * Name of the property to return.
  647. *
  648. * Result:
  649. * CFTypeRef containing requested property. NULL means list has no
  650. * property with this name. Has to be released with CFRelease when
  651. * property object is not needed anymore.
  652. *
  653. * Availability:
  654. * Mac OS X: in version 10.5 and later in CoreServices.framework
  655. * CarbonLib: not available
  656. * Non-Carbon CFM: not available
  657. }
  658. function LSSharedFileListCopyProperty( inList: LSSharedFileListRef; inPropertyName: CFStringRef ): CFTypeRef; external name '_LSSharedFileListCopyProperty';
  659. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  660. {
  661. * LSSharedFileListSetProperty()
  662. *
  663. * Summary:
  664. * Set property by its name.
  665. *
  666. * Discussion:
  667. * Set lists named property as CFTypeRef object.
  668. *
  669. * Mac OS X threading:
  670. * Thread safe since version 10.5
  671. *
  672. * Parameters:
  673. *
  674. * inList:
  675. * Shared list reference.
  676. *
  677. * inPropertyName:
  678. * Name of the property to return.
  679. *
  680. * inPropertyData:
  681. * Property data to set. Pass NULL to remove existing property.
  682. *
  683. * Availability:
  684. * Mac OS X: in version 10.5 and later in CoreServices.framework
  685. * CarbonLib: not available
  686. * Non-Carbon CFM: not available
  687. }
  688. function LSSharedFileListSetProperty( inList: LSSharedFileListRef; inPropertyName: CFStringRef; inPropertyData: CFTypeRef ): OSStatus; external name '_LSSharedFileListSetProperty';
  689. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  690. {
  691. * LSSharedFileListCopySnapshot()
  692. *
  693. * Summary:
  694. * Create snapshot array.
  695. *
  696. * Discussion:
  697. * Creates snapshot array, which is list of all items at the moment
  698. * LSSharedFileListCopySnapshot was called.
  699. *
  700. * Mac OS X threading:
  701. * Thread safe since version 10.5
  702. *
  703. * Parameters:
  704. *
  705. * inList:
  706. * Shared list reference.
  707. *
  708. * outSnapshotSeed:
  709. * Returned seed value at which snapshot was taken.
  710. *
  711. * Result:
  712. * Immutable CFArray of LSSharedFileListItemRef values. Has to be
  713. * released with CFRelease when snapshot array is not needed anymore.
  714. *
  715. * Availability:
  716. * Mac OS X: in version 10.5 and later in CoreServices.framework
  717. * CarbonLib: not available
  718. * Non-Carbon CFM: not available
  719. }
  720. function LSSharedFileListCopySnapshot( inList: LSSharedFileListRef; var outSnapshotSeed: UInt32 ): CFArrayRef; external name '_LSSharedFileListCopySnapshot';
  721. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  722. {
  723. * LSSharedFileListInsertItemURL()
  724. *
  725. * Summary:
  726. * Insert item into shared list.
  727. *
  728. * Discussion:
  729. * Inserts item into shared list at specified location. If the item
  730. * already exists in the list it will be moved and its icon, display
  731. * name and properties will be updated.
  732. *
  733. * Mac OS X threading:
  734. * Thread safe since version 10.5
  735. *
  736. * Parameters:
  737. *
  738. * inList:
  739. * Shared list reference.
  740. *
  741. * insertAfterThisItem:
  742. * Item after which new item has to be inserted. To insert at the
  743. * beginning of the list use kLSSharedFileListItemBeforeFirst or
  744. * to insert at the end of the list use kLSSharedFileListItemLast.
  745. *
  746. * inDisplayName:
  747. * Display name of the new item. Can be NULL.
  748. *
  749. * inIconRef:
  750. * Icon of the new item. Can be NULL.
  751. *
  752. * inURL:
  753. * URL of the new item.
  754. *
  755. * inPropertiesToSet:
  756. * CFDictionary of properties to set. Keys are property names and
  757. * values are property values. The property values are retained
  758. * and copied by the API. Can be NULL.
  759. *
  760. * inPropertiesToClear:
  761. * CFArray of property names to clear if item already exists. Can
  762. * be NULL.
  763. *
  764. * Result:
  765. * Reference to new item. Has to be released with CFRelease when the
  766. * item is not needed anymore.
  767. *
  768. * Availability:
  769. * Mac OS X: in version 10.5 and later in CoreServices.framework
  770. * CarbonLib: not available
  771. * Non-Carbon CFM: not available
  772. }
  773. function LSSharedFileListInsertItemURL( inList: LSSharedFileListRef; insertAfterThisItem: LSSharedFileListItemRef; inDisplayName: CFStringRef; inIconRef: IconRef; inURL: CFURLRef; inPropertiesToSet: CFDictionaryRef; inPropertiesToClear: CFArrayRef ): LSSharedFileListItemRef; external name '_LSSharedFileListInsertItemURL';
  774. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  775. {
  776. * LSSharedFileListInsertItemFSRef()
  777. *
  778. * Summary:
  779. * Insert item into shared list.
  780. *
  781. * Discussion:
  782. * Inserts item into shared list at specified location. If the item
  783. * already exists in the list it will be moved and its icon, display
  784. * name and properties will be updated.
  785. *
  786. * Mac OS X threading:
  787. * Thread safe since version 10.5
  788. *
  789. * Parameters:
  790. *
  791. * inList:
  792. * Shared list reference.
  793. *
  794. * insertAfterThisItem:
  795. * Item after which new item has to be inserted. To insert at the
  796. * beginning of the list use kLSSharedFileListItemBeforeFirst or
  797. * to insert at the end of the list use kLSSharedFileListItemLast.
  798. *
  799. * inDisplayName:
  800. * Display name of the new item. Can be NULL.
  801. *
  802. * inIconRef:
  803. * Icon of the new item. Can be NULL.
  804. *
  805. * inFSRef:
  806. * FSRef of the new item.
  807. *
  808. * inPropertiesToSet:
  809. * CFDictionary of properties to set. Keys are property names and
  810. * values are property values. The property values are retained
  811. * and copied by the API. Can be NULL.
  812. *
  813. * inPropertiesToClear:
  814. * CFArray of property names to clear if item already exists. Can
  815. * be NULL.
  816. *
  817. * Result:
  818. * Reference to new item. Has to be released with CFRelease when the
  819. * item is not needed anymore.
  820. *
  821. * Availability:
  822. * Mac OS X: in version 10.5 and later in CoreServices.framework
  823. * CarbonLib: not available
  824. * Non-Carbon CFM: not available
  825. }
  826. function LSSharedFileListInsertItemFSRef( inList: LSSharedFileListRef; insertAfterThisItem: LSSharedFileListItemRef; inDisplayName: CFStringRef; inIconRef: IconRef; const (*var*) inFSRef: FSRef; inPropertiesToSet: CFDictionaryRef; inPropertiesToClear: CFArrayRef ): LSSharedFileListItemRef; external name '_LSSharedFileListInsertItemFSRef';
  827. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  828. {
  829. * LSSharedFileListItemMove()
  830. *
  831. * Summary:
  832. * Move item.
  833. *
  834. * Discussion:
  835. * Moves item at specified location.
  836. *
  837. * Mac OS X threading:
  838. * Thread safe since version 10.5
  839. *
  840. * Parameters:
  841. *
  842. * inList:
  843. * Shared list reference.
  844. *
  845. * inItem:
  846. * Item to move.
  847. *
  848. * inMoveAfterItem:
  849. * New icon of the new item. Use kLSSharedFileListItemBeforeFirst
  850. * and kLSSharedFileListItemLast to move at the beginning or the
  851. * end of the shared list.
  852. *
  853. * Availability:
  854. * Mac OS X: in version 10.5 and later in CoreServices.framework
  855. * CarbonLib: not available
  856. * Non-Carbon CFM: not available
  857. }
  858. function LSSharedFileListItemMove( inList: LSSharedFileListRef; inItem: LSSharedFileListItemRef; inMoveAfterItem: LSSharedFileListItemRef ): OSStatus; external name '_LSSharedFileListItemMove';
  859. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  860. {
  861. * LSSharedFileListItemRemove()
  862. *
  863. * Summary:
  864. * Remove item from shared list.
  865. *
  866. * Discussion:
  867. * Removes item from shared list.
  868. *
  869. * Mac OS X threading:
  870. * Thread safe since version 10.5
  871. *
  872. * Parameters:
  873. *
  874. * inList:
  875. * Shared list reference.
  876. *
  877. * inItem:
  878. * Item to remove.
  879. *
  880. * Availability:
  881. * Mac OS X: in version 10.5 and later in CoreServices.framework
  882. * CarbonLib: not available
  883. * Non-Carbon CFM: not available
  884. }
  885. function LSSharedFileListItemRemove( inList: LSSharedFileListRef; inItem: LSSharedFileListItemRef ): OSStatus; external name '_LSSharedFileListItemRemove';
  886. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  887. {
  888. * LSSharedFileListRemoveAllItems()
  889. *
  890. * Summary:
  891. * Remove all items from shared list.
  892. *
  893. * Discussion:
  894. * Removes all items from shared list.
  895. *
  896. * Mac OS X threading:
  897. * Thread safe since version 10.5
  898. *
  899. * Parameters:
  900. *
  901. * inList:
  902. * Shared list to clear.
  903. *
  904. * Availability:
  905. * Mac OS X: in version 10.5 and later in CoreServices.framework
  906. * CarbonLib: not available
  907. * Non-Carbon CFM: not available
  908. }
  909. function LSSharedFileListRemoveAllItems( inList: LSSharedFileListRef ): OSStatus; external name '_LSSharedFileListRemoveAllItems';
  910. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  911. {
  912. * LSSharedFileListItemGetID()
  913. *
  914. * Summary:
  915. * Obtain unique item id.
  916. *
  917. * Discussion:
  918. * Returns unique item id.
  919. *
  920. * Mac OS X threading:
  921. * Thread safe since version 10.5
  922. *
  923. * Availability:
  924. * Mac OS X: in version 10.5 and later in CoreServices.framework
  925. * CarbonLib: not available
  926. * Non-Carbon CFM: not available
  927. }
  928. function LSSharedFileListItemGetID( inItem: LSSharedFileListItemRef ): UInt32; external name '_LSSharedFileListItemGetID';
  929. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  930. {
  931. * LSSharedFileListItemCopyIconRef()
  932. *
  933. * Summary:
  934. * Obtain item's icon.
  935. *
  936. * Discussion:
  937. * Returns icon ref for the item.
  938. *
  939. * Mac OS X threading:
  940. * Thread safe since version 10.5
  941. *
  942. * Result:
  943. * IconRef to the item. Caller is responsible to releasing it by
  944. * calling ReleaseIconRef().
  945. *
  946. * Availability:
  947. * Mac OS X: in version 10.5 and later in CoreServices.framework
  948. * CarbonLib: not available
  949. * Non-Carbon CFM: not available
  950. }
  951. function LSSharedFileListItemCopyIconRef( inItem: LSSharedFileListItemRef ): IconRef; external name '_LSSharedFileListItemCopyIconRef';
  952. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  953. {
  954. * LSSharedFileListItemCopyDisplayName()
  955. *
  956. * Summary:
  957. * Obtain item's display name.
  958. *
  959. * Discussion:
  960. * Returns display name of the item. Caller is responsible to
  961. * releasing it by calling CFRelease().
  962. *
  963. * Mac OS X threading:
  964. * Thread safe since version 10.5
  965. *
  966. * Availability:
  967. * Mac OS X: in version 10.5 and later in CoreServices.framework
  968. * CarbonLib: not available
  969. * Non-Carbon CFM: not available
  970. }
  971. function LSSharedFileListItemCopyDisplayName( inItem: LSSharedFileListItemRef ): CFStringRef; external name '_LSSharedFileListItemCopyDisplayName';
  972. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  973. {
  974. * LSSharedFileListItemResolve()
  975. *
  976. * Summary:
  977. * Resolve LSSharedFileListItemRef's item and return its FSRef.
  978. *
  979. * Discussion:
  980. * Resolves LSSharedFileListItemRef's item and returns its FSRef.
  981. *
  982. * Mac OS X threading:
  983. * Thread safe since version 10.5
  984. *
  985. * Parameters:
  986. *
  987. * inItem:
  988. * Item to resolve.
  989. *
  990. * inFlags:
  991. * Resolution flags. Pass zero for default resolution flags.
  992. *
  993. * outURL:
  994. * CFURL of original item. Can be NULL. Returned valus has to be
  995. * released with CFRelease().
  996. *
  997. * outRef:
  998. * FSRef of original item. Can be NULL.
  999. *
  1000. * Availability:
  1001. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1002. * CarbonLib: not available
  1003. * Non-Carbon CFM: not available
  1004. }
  1005. function LSSharedFileListItemResolve( inItem: LSSharedFileListItemRef; inFlags: UInt32; var outURL: CFURLRef; var outRef: FSRef ): OSStatus; external name '_LSSharedFileListItemResolve';
  1006. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  1007. {
  1008. * LSSharedFileListItemCopyProperty()
  1009. *
  1010. * Summary:
  1011. * Obtain item's property by its name.
  1012. *
  1013. * Discussion:
  1014. * Returns persistent item's property as CF object. Caller is
  1015. * responsible to releasing it by calling CFRelease().
  1016. *
  1017. * Mac OS X threading:
  1018. * Thread safe since version 10.5
  1019. *
  1020. * Availability:
  1021. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1022. * CarbonLib: not available
  1023. * Non-Carbon CFM: not available
  1024. }
  1025. function LSSharedFileListItemCopyProperty( inItem: LSSharedFileListItemRef; inPropertyName: CFStringRef ): CFTypeRef; external name '_LSSharedFileListItemCopyProperty';
  1026. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  1027. {
  1028. * LSSharedFileListItemSetProperty()
  1029. *
  1030. * Summary:
  1031. * Set item property by its name.
  1032. *
  1033. * Discussion:
  1034. * Sets persistent item property by its name.
  1035. *
  1036. * Mac OS X threading:
  1037. * Thread safe since version 10.5
  1038. *
  1039. * Availability:
  1040. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1041. * CarbonLib: not available
  1042. * Non-Carbon CFM: not available
  1043. }
  1044. function LSSharedFileListItemSetProperty( inItem: LSSharedFileListItemRef; inPropertyName: CFStringRef; inPropertyData: CFTypeRef ): OSStatus; external name '_LSSharedFileListItemSetProperty';
  1045. (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  1046. {$endc} {TARGET_OS_MAC}
  1047. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1048. end.
  1049. {$endc} {not MACOSALLINCLUDE}