ICAApplication.pas 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101
  1. //------------------------------------------------------------------------------------------------------------------------------
  2. //
  3. // ImageCapture/ICAApplication.h
  4. //
  5. // Copyright (c) 2004-2007 Apple Inc. All rights reserved.
  6. //
  7. //------------------------------------------------------------------------------------------------------------------------------
  8. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  9. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  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 ICAApplication;
  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.AEDataModel,MacOsApi.Files,MacOsApi.CFBase,MacOsApi.CFArray,MacOsApi.CFData,MacOsApi.CFDictionary;
  202. {$ELSE FPC_DOTTEDUNITS}
  203. uses MacTypes,AEDataModel,Files,CFBase,CFArray,CFData,CFDictionary;
  204. {$ENDIF FPC_DOTTEDUNITS}
  205. {$endc} {not MACOSALLINCLUDE}
  206. {$ifc TARGET_OS_MAC}
  207. {$ALIGN MAC68K}
  208. //------------------------------------------------------------------------------------------------------------------------------
  209. {!
  210. @header
  211. ICAApplication.h
  212. @discussion
  213. ICAApplication.h defines structures and functions that are used by clients of Image Capture framework.
  214. }
  215. //------------------------------------------------------------------------------------------------------------------------------
  216. type
  217. ICAError = OSErr;
  218. //------------------------------------------------------------------------------------------------------ Parameter block version
  219. {!
  220. @enum Parameter block version
  221. @discussion
  222. Parameter block version.
  223. @constant kICAPBVersion
  224. Version 1 parameter block.
  225. }
  226. const
  227. kICAPBVersion = $00010000;
  228. //------------------------------------------------------------------------------------------------------------------ Error codes
  229. // Image Capture error code range = -9900 to -9949
  230. {!
  231. @enum Error codes
  232. @discussion
  233. Definition of error codes returned by Image Capture framework
  234. @constant kICACommunicationErr
  235. An error occurred in communication between different components of Image Capture framework.
  236. @constant kICADeviceNotFoundErr
  237. The specified device is not found.
  238. @constant kICADeviceNotOpenErr
  239. The specified device is not open.
  240. @constant kICAFileCorruptedErr
  241. Encountered a corrupt file.
  242. @constant kICAIOPendingErr
  243. There is a pending I/O.
  244. @constant kICAInvalidObjectErr
  245. The specified object is invalid.
  246. @constant kICAInvalidPropertyErr
  247. The specified property is invalid.
  248. @constant kICAIndexOutOfRangeErr
  249. The specified index is out of range.
  250. @constant kICAPropertyTypeNotFoundErr
  251. A property with the specified property type is not found.
  252. @constant kICACannotYieldDevice
  253. The device module cannot yield the specified device to the requestor.
  254. @constant kICADataTypeNotFoundErr
  255. Data with the specified data type is not found.
  256. @constant kICADeviceMemoryAllocationErr
  257. The device module encountered a memory allocation error.
  258. @constant kICADeviceInternalErr
  259. The device module encountered an unspecifed error.
  260. @constant kICADeviceInvalidParamErr
  261. At least one of the parameters passed to the device module is invalid.
  262. @constant kICADeviceAlreadyOpenErr
  263. The specified device is already open.
  264. @constant kICADeviceLocationIDNotFoundErr
  265. The specified USB Location ID is not found.
  266. @constant kICADeviceGUIDNotFoundErr
  267. The specified FireWire GUID is not found.
  268. @constant kICADeviceIOServicePathNotFoundErr
  269. The specified IOService path is not found.
  270. @constant kICAFrameworkInternalErr
  271. Image Capture Framework encountered an error.
  272. @constant kICAExtensionInternalErr
  273. Image Capture Extension encountered an error.
  274. @constant kICAInvalidSessionErr
  275. The specified session is not valid.
  276. }
  277. const
  278. kICACommunicationErr = -9900;
  279. kICADeviceNotFoundErr = -9901;
  280. kICADeviceNotOpenErr = -9902;
  281. kICAFileCorruptedErr = -9903;
  282. kICAIOPendingErr = -9904;
  283. kICAInvalidObjectErr = -9905;
  284. kICAInvalidPropertyErr = -9906;
  285. kICAIndexOutOfRangeErr = -9907;
  286. kICAPropertyTypeNotFoundErr = -9908;
  287. kICACannotYieldDevice = -9909;
  288. kICADataTypeNotFoundErr = -9910;
  289. kICADeviceMemoryAllocationErr = -9911;
  290. kICADeviceInternalErr = -9912;
  291. kICADeviceInvalidParamErr = -9913;
  292. kICADeviceAlreadyOpenErr = -9914;
  293. kICADeviceLocationIDNotFoundErr = -9915;
  294. kICADeviceGUIDNotFoundErr = -9916;
  295. kICADeviceIOServicePathNotFoundErr = -9917;
  296. kICADeviceUnsupportedErr = -9918;
  297. kICAFrameworkInternalErr = -9919;
  298. kICAExtensionInternalErr = -9920;
  299. kICAInvalidSessionErr = -9921;
  300. //------------------------------------------------------------------------------------------------- ICAObject types and subtypes
  301. {!
  302. @enum ICAObject types and subtypes
  303. @discussion
  304. Definition of ICAObject types and subtypes
  305. @constant kICADevice
  306. Object is a device supported by Image Capture framework.
  307. @constant kICADeviceCamera
  308. Object is a camera.
  309. @constant kICADeviceScanner
  310. Object is a scanner.
  311. @constant kICADeviceMFP
  312. Object is a multi-function peripheral.
  313. @constant kICADevicePhone
  314. Object is a camera phone.
  315. @constant kICADevicePDA
  316. Object is a personal digital assistant.
  317. @constant kICADeviceOther
  318. Object is a device supported by Image Capture framework, but of unknown subtype.
  319. @constant kICAList
  320. Object is a device list.
  321. @constant kICADirectory
  322. Object is a directory.
  323. @constant kICAFile
  324. Object is a file.
  325. @constant kICAFileImage
  326. Object is an image file.
  327. @constant kICAFileMovie
  328. Object is a movie file.
  329. @constant kICAFileAudio
  330. Object is an audio file.
  331. @constant kICAFileFirmware
  332. Object is a firmware file.
  333. @constant kICAFileOther
  334. Object is a generic file.
  335. }
  336. const
  337. kICADevice = FourCharCode('icdv');
  338. kICADeviceCamera = FourCharCode('cmra');
  339. kICADeviceScanner = FourCharCode('scan');
  340. kICADeviceMFP = FourCharCode('mfp ');
  341. kICADevicePhone = FourCharCode('phon');
  342. kICADevicePDA = FourCharCode('pda ');
  343. kICADeviceOther = FourCharCode('doth');
  344. kICAList = FourCharCode('objl');
  345. kICADirectory = FourCharCode('dire');
  346. kICAFile = FourCharCode('file');
  347. kICAFileImage = FourCharCode('imag');
  348. kICAFileMovie = FourCharCode('moov');
  349. kICAFileAudio = FourCharCode('audo');
  350. kICAFileFirmware = FourCharCode('firm');
  351. kICAFileOther = FourCharCode('othe');
  352. //------------------------------------------------------------------------------------------------------------ ICAProperty types
  353. {!
  354. @enum ICAProperty types
  355. @discussion
  356. Definition of ICAProperties
  357. @constant kICAProperty
  358. Generic property type; for images, refer to 'Digital Still Camera Image File Format Standard' Exif Version 2.1 section 2.6.4. and 2.6.5.
  359. @constant kICAPropertyImageWidth
  360. Image width.
  361. @constant kICAPropertyImageHeight
  362. Image height.
  363. @constant kICAPropertyImageBitDepth
  364. Image bit-depth.
  365. @constant kICAPropertyImageDPI
  366. Image DPI.
  367. @constant kICAPropertyImageExposureTime
  368. Image exposure time.
  369. @constant kICAPropertyImageFNumber
  370. Image f-Number.
  371. @constant kICAPropertyImageDateOriginal
  372. Original date & time of an object; value associated with this property is a null-terminated string conforming to format "YYYY:MM:DD hh:mm:ss".
  373. @constant kICAPropertyImageDateDigitized
  374. Digitized date & time of an object; value associated with this property is a null-terminated string conforming to format "YYYY:MM:DD hh:mm:ss".
  375. @constant kICAPropertyImageShutterSpeed
  376. Shutter speed used to capture an image.
  377. @constant kICAPropertyImageAperture
  378. Aperture used to capture an image.
  379. @constant kICAPropertyImageFlash
  380. Indicates whether flash was used to capture an image.
  381. @constant kICAPropertyColorSpace
  382. Color space used to represent an image.
  383. @constant kICAPropertyImageFilename
  384. Filename of an image.
  385. @constant kICAPropertyImageSize
  386. Size of an image in bytes.
  387. @constant kICAPropertyImageData
  388. Data of an image.
  389. @constant kICAPropertyImageThumbnail
  390. Thumbnail of an image.
  391. @constant kICAPropertyColorSyncProfile
  392. ColorSync profile associated with an image.
  393. }
  394. const
  395. kICAProperty = FourCharCode('prop');
  396. kICAPropertyImageWidth = FourCharCode('0100');
  397. kICAPropertyImageHeight = FourCharCode('0101');
  398. kICAPropertyImageBitDepth = FourCharCode('0102');
  399. kICAPropertyImageDPI = FourCharCode('011A');
  400. kICAPropertyImageExposureTime = FourCharCode('829A');
  401. kICAPropertyImageFNumber = FourCharCode('829D');
  402. kICAPropertyImageDateOriginal = FourCharCode('9003');
  403. kICAPropertyImageDateDigitized = FourCharCode('9004');
  404. kICAPropertyImageShutterSpeed = FourCharCode('9201');
  405. kICAPropertyImageAperture = FourCharCode('9202');
  406. kICAPropertyImageFlash = FourCharCode('9209');
  407. kICAPropertyColorSpace = FourCharCode('A001');
  408. kICAPropertyImageFilename = FourCharCode('ifil');
  409. kICAPropertyImageSize = FourCharCode('isiz');
  410. kICAPropertyImageData = FourCharCode('idat');
  411. kICAPropertyImageThumbnail = FourCharCode('thum');
  412. kICAPropertyColorSyncProfile = FourCharCode('prof');
  413. //------------------------------------------------------------------------------------------------------------------- Data types
  414. {!
  415. @enum Data types
  416. @discussion
  417. Definition of data types; these are mapped to AppleEvent types.
  418. @constant kICATypeUInt8
  419. UInt8.
  420. @constant kICATypeUInt16
  421. UInt16.
  422. @constant kICATypeUInt32
  423. UInt32.
  424. @constant kICATypeUInt64
  425. UInt64.
  426. @constant kICATypeSInt16
  427. SInt16.
  428. @constant kICATypeSInt32
  429. SInt32.
  430. @constant kICATypeSInt64
  431. SInt64.
  432. @constant kICATypeFloat
  433. float.
  434. @constant kICATypeFixed
  435. IEEE 32-bit floating point.
  436. @constant kICATypeBoolean
  437. Boolean.
  438. @constant kICATypeString
  439. AnsiChar string.
  440. @constant kICATypeData
  441. void *.
  442. @constant kICATypeThumbnail
  443. ICAThumbnail.
  444. }
  445. const
  446. kICATypeUInt8 = FourCharCode('ui08');
  447. kICATypeUInt16 = FourCharCode('ui16');
  448. kICATypeUInt32 = FourCharCode('ui32');
  449. kICATypeUInt64 = FourCharCode('ui64');
  450. kICATypeSInt16 = FourCharCode('si16');
  451. kICATypeSInt32 = FourCharCode('si32');
  452. kICATypeSInt64 = FourCharCode('si64');
  453. kICATypeFloat = FourCharCode('floa');
  454. kICATypeFixed = FourCharCode('sing');
  455. kICATypeBoolean = FourCharCode('bool');
  456. kICATypeString = FourCharCode('TEXT');
  457. kICATypeData = FourCharCode('data');
  458. kICATypeThumbnail = FourCharCode('thum');
  459. //----------------------------------------------------------------------------------------------------- PropertyInfo flag values
  460. {!
  461. @enum PropertyInfo flag values
  462. @discussion
  463. Values for PropertyInfo flag.
  464. @constant kICAFlagReadWriteAccess
  465. Access for read and write.
  466. @constant kICAFlagReadAccess
  467. Access for read only.
  468. }
  469. const
  470. kICAFlagReadWriteAccess = 1 shl 0;
  471. kICAFlagReadAccess = 1 shl 1;
  472. //----------------------------------------------------------------------------------------------------------------- Button types
  473. {!
  474. @enum Button types
  475. @discussion
  476. Buttons types associated with buttons on a scanner.
  477. @constant kICAButtonScan
  478. Scan button.
  479. @constant kICAButtonCopy
  480. Copy button.
  481. @constant kICAButtonEMail
  482. Email button.
  483. @constant kICAButtonWeb
  484. Web button.
  485. }
  486. const
  487. kICAButtonScan = FourCharCode('scan');
  488. kICAButtonCopy = FourCharCode('copy');
  489. kICAButtonEMail = FourCharCode('mail');
  490. kICAButtonWeb = FourCharCode('web ');
  491. //------------------------------------------------------------------------ Flags associated with Image Capture PassThru commands
  492. {!
  493. @enum Flags associated with Image Capture PassThru commands.
  494. @discussion
  495. Flag values that can be used in ICAUploadFilePB parameter block.
  496. @constant kICACameraPassThruSend
  497. Use this constant when sending data to a device using a pass-through command.
  498. @constant kICACameraPassThruReceive
  499. Use this constant when receiving data from a device using a pass-through command.
  500. @constant kICACameraPassThruNotUsed
  501. Use this constant when using a pass-through command that doesn't involve sending or receiving data.
  502. }
  503. const
  504. kICACameraPassThruSend = 0;
  505. kICACameraPassThruReceive = 1;
  506. kICACameraPassThruNotUsed = 2;
  507. //---------------------------------------------------------------------------------------------------------- ICAPTPPassThroughPB
  508. {!
  509. @struct ICAPTPPassThroughPB
  510. @field commandCode
  511. PTP command code (including vendor specific) <--
  512. @field resultCode
  513. PTP response code -->
  514. @field numOfInputParams
  515. Number of valid parameters to be sent to device <--
  516. @field numOfOutputParams
  517. Number of valid parameters expected from device <--
  518. @field params
  519. PTP parameters (command specific / optional) <->
  520. @field dataUsageMode
  521. One of (kICACameraPassThruSend, kICACameraPassThruReceive, kICACameraPassThruNotUsed) <--
  522. @field flags
  523. Not used currently
  524. @field dataSize
  525. Size of data block <->
  526. @field data
  527. Data block <->
  528. }
  529. type
  530. ICAPTPPassThroughPBPtr = ^ICAPTPPassThroughPB;
  531. ICAPTPPassThroughPB = record
  532. commandCode: UInt32;
  533. resultCode: UInt32;
  534. numOfInputParams: UInt32;
  535. numOfOutputParams: UInt32;
  536. params: array [0..4-1] of UInt32;
  537. dataUsageMode: UInt32;
  538. flags: UInt32;
  539. dataSize: UInt32;
  540. data: array [0..1-1] of UInt8;
  541. end;
  542. //----------------------------------------------------------------------------------------------------------- ICAPTPEventDataset
  543. {!
  544. @struct ICAPTPEventDataset
  545. @field dataLength
  546. Data length in bytes
  547. @field containerType
  548. PTP container type
  549. @field eventCode
  550. PTP event code
  551. @field transactionID
  552. PTP transaction ID
  553. @field params
  554. PTP params. The number of params should be (dataLength - 12)/4
  555. }
  556. type
  557. ICAPTPEventDatasetPtr = ^ICAPTPEventDataset;
  558. ICAPTPEventDataset = record
  559. dataLength: UInt32;
  560. containerType: UInt16; // should be 0x0004 for event
  561. eventCode: UInt16;
  562. transactionID: UInt32;
  563. params: array [0..3-1] of UInt32; // up to 3 params. # of params = (dataLength - 12)/4
  564. end;
  565. //------------------------------------------------------------------------------------- Keys used in object property dictionary
  566. { Keys used in object property dictionary }
  567. //#pragma mark -
  568. //#pragma mark TODO: document the data types of values for these keys
  569. // Keys returned by ICACopyObjectDictionary() for deviceList object returned by ICAGetDeviceList()
  570. var kICADevicesArrayKey: CFStringRef; external name '_kICADevicesArrayKey'; (* attribute const *)
  571. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  572. var kICAObjectKey: CFStringRef; external name '_kICAObjectKey'; (* attribute const *)
  573. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  574. var kICAObjectNameKey: CFStringRef; external name '_kICAObjectNameKey'; (* attribute const *)
  575. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  576. var kICAUSBVendorIDKey: CFStringRef; external name '_kICAUSBVendorIDKey'; (* attribute const *)
  577. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  578. var kICAUSBProductIDKey: CFStringRef; external name '_kICAUSBProductIDKey'; (* attribute const *)
  579. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  580. var kICADeviceTypeKey: CFStringRef; external name '_kICADeviceTypeKey'; (* attribute const *)
  581. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  582. var kICAExecutableArchitectureKey: CFStringRef; external name '_kICAExecutableArchitectureKey'; (* attribute const *)
  583. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  584. var kICARemoteDeviceKey: CFStringRef; external name '_kICARemoteDeviceKey'; (* attribute const *)
  585. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  586. var kICADeviceSharedKey: CFStringRef; external name '_kICADeviceSharedKey'; (* attribute const *)
  587. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  588. var kICADeviceWebSharedKey: CFStringRef; external name '_kICADeviceWebSharedKey'; (* attribute const *)
  589. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  590. var kICADeviceUsedKey: CFStringRef; external name '_kICADeviceUsedKey'; (* attribute const *)
  591. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  592. var kICABonjourServiceTypeKey: CFStringRef; external name '_kICABonjourServiceTypeKey'; (* attribute const *)
  593. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  594. var kICABonjourServiceNameKey: CFStringRef; external name '_kICABonjourServiceNameKey'; (* attribute const *)
  595. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  596. var kICABonjourTXTRecordKey: CFStringRef; external name '_kICABonjourTXTRecordKey'; (* attribute const *)
  597. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  598. var kICADeviceCapabilitiesKey: CFStringRef; external name '_kICADeviceCapabilitiesKey'; (* attribute const *)
  599. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  600. var kICALockStatusKey: CFStringRef; external name '_kICALockStatusKey'; (* attribute const *)
  601. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  602. var kICADataPropertyKey: CFStringRef; external name '_kICADataPropertyKey'; (* attribute const *)
  603. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  604. var kICADataTypeKey: CFStringRef; external name '_kICADataTypeKey'; (* attribute const *)
  605. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  606. var kICADataSizeKey: CFStringRef; external name '_kICADataSizeKey'; (* attribute const *)
  607. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  608. var kICAThumbnailPropertyKey: CFStringRef; external name '_kICAThumbnailPropertyKey'; (* attribute const *)
  609. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  610. var kICAThumbnailSizeKey: CFStringRef; external name '_kICAThumbnailSizeKey'; (* attribute const *)
  611. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  612. var kICARawKey: CFStringRef; external name '_kICARawKey'; (* attribute const *)
  613. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  614. var kICAMediaHeightKey: CFStringRef; external name '_kICAMediaHeightKey'; (* attribute const *)
  615. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // value is a number
  616. var kICAMediaWidthKey: CFStringRef; external name '_kICAMediaWidthKey'; (* attribute const *)
  617. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // value is a number
  618. var kICACreationDateStringKey: CFStringRef; external name '_kICACreationDateStringKey'; (* attribute const *)
  619. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  620. var kICAModificationDateStringKey: CFStringRef; external name '_kICAModificationDateStringKey'; (* attribute const *)
  621. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  622. var kMetaDataDictionaryKey: CFStringRef; external name '_kMetaDataDictionaryKey'; (* attribute const *)
  623. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  624. var kICAMediaDurationInSecondsKey: CFStringRef; external name '_kICAMediaDurationInSecondsKey'; (* attribute const *)
  625. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  626. var kICADeviceTypeCamera: CFStringRef; external name '_kICADeviceTypeCamera'; (* attribute const *)
  627. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  628. var kICADeviceTypeScanner: CFStringRef; external name '_kICADeviceTypeScanner'; (* attribute const *)
  629. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  630. {
  631. In addition to the above, the following keys may also be present in the object property dictionay:
  632. kICAUSBLocationIDKey
  633. kICAFireWireGUIDKey
  634. }
  635. { Transport types }
  636. var kICAUSBTransportType: CFStringRef; external name '_kICAUSBTransportType'; (* attribute const *)
  637. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  638. var kICAFireWireTransportType: CFStringRef; external name '_kICAFireWireTransportType'; (* attribute const *)
  639. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  640. var kICABluetoothTransportType: CFStringRef; external name '_kICABluetoothTransportType'; (* attribute const *)
  641. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  642. var kICATCPIPTransportType: CFStringRef; external name '_kICATCPIPTransportType'; (* attribute const *)
  643. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  644. var kICASCSITransportType: CFStringRef; external name '_kICASCSITransportType'; (* attribute const *)
  645. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  646. var kICATWAINTransportType: CFStringRef; external name '_kICATWAINTransportType'; (* attribute const *)
  647. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  648. { Keys used for paramDictionary in ICALoadDeviceModulePB}
  649. var kICADeviceBrowserDeviceRefKey: CFStringRef; external name '_kICADeviceBrowserDeviceRefKey'; (* attribute const *)
  650. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  651. var kICADeviceModulePathKey: CFStringRef; external name '_kICADeviceModulePathKey'; (* attribute const *)
  652. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  653. var kICADeviceIconPathKey: CFStringRef; external name '_kICADeviceIconPathKey'; (* attribute const *)
  654. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  655. var kICATransportTypeKey: CFStringRef; external name '_kICATransportTypeKey'; (* attribute const *)
  656. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  657. var kICABluetoothAddressKey: CFStringRef; external name '_kICABluetoothAddressKey'; (* attribute const *)
  658. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  659. var kICAUSBLocationIDKey: CFStringRef; external name '_kICAUSBLocationIDKey'; (* attribute const *)
  660. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  661. var kICAFireWireGUIDKey: CFStringRef; external name '_kICAFireWireGUIDKey'; (* attribute const *)
  662. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  663. var kICAIOServicePathKey: CFStringRef; external name '_kICAIOServicePathKey'; (* attribute const *)
  664. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  665. var kICAIPAddressKey: CFStringRef; external name '_kICAIPAddressKey'; (* attribute const *)
  666. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  667. var kICAIPPortKey: CFStringRef; external name '_kICAIPPortKey'; (* attribute const *)
  668. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  669. var kICAIPNameKey: CFStringRef; external name '_kICAIPNameKey'; (* attribute const *)
  670. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  671. var kICAIPGUIDKey: CFStringRef; external name '_kICAIPGUIDKey'; (* attribute const *)
  672. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  673. var kICATWAINDSPathKey: CFStringRef; external name '_kICATWAINDSPathKey'; (* attribute const *)
  674. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  675. {!
  676. @const
  677. kICAUserAssignedDeviceNameKey
  678. @abstract
  679. This key may be present in the property dictionary of a device if the device has a user-assigned name.
  680. @discussion
  681. Value is of type CFStringRef.
  682. }
  683. var kICAUserAssignedDeviceNameKey: CFStringRef; external name '_kICAUserAssignedDeviceNameKey'; (* attribute const *)
  684. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  685. //-------------------------------------------------------------------------------------------------------------------- ICAHeader
  686. {!
  687. @struct ICAHeader
  688. @discussion
  689. This is the first field in all parameter blocks used by APIs defined in ICAApplication.h.
  690. Type of parameter passed to a callback function used by APIs defined in ICAApplication.h.
  691. The parameter for the completion proc should to be casted to an appropriate type such as ICAGetChildCountPB* for it to be useful.
  692. @field err
  693. Error returned by an API. -->
  694. @field refcon
  695. An arbitrary refcon value passed to the callback. <--
  696. }
  697. type
  698. ICAHeaderPtr = ^ICAHeader;
  699. ICAHeader = record
  700. err: ICAError;
  701. refcon: UNSIGNEDLONG;
  702. end;
  703. //--------------------------------------------------------------------------------------------------------------- Callback procs
  704. type
  705. ICACompletion = procedure( var pb: ICAHeader );
  706. type
  707. ICAImportFilterProc = function( imageInfo: CFDictionaryRef; refcon: UNSIGNEDLONG ): Boolean;
  708. type
  709. ICANotificationProc = procedure( notificationType: CFStringRef; notificationDictionary: CFDictionaryRef );
  710. //------------------------------------------------------------------------------------------------------------------- Object IDs
  711. type
  712. ICAObject = UInt32;
  713. ICAProperty = UInt32;
  714. ICAConnectionID = UInt32;
  715. ICASessionID = UInt32;
  716. ICAScannerSessionID = ICASessionID;
  717. ICAEventDataCookie = UInt32;
  718. //#pragma mark -
  719. //#pragma mark General APIs
  720. //--------------------------------------------------------------------------------------------------------------- ICAImportImage
  721. {!
  722. @struct ICAObjectInfo
  723. @field objectType
  724. An object type, e.g., kICAFile.
  725. @field objectSubtype
  726. An object subtype, e.g., kICAFileImage.
  727. }
  728. type
  729. ICAObjectInfoPtr = ^ICAObjectInfo;
  730. ICAObjectInfo = record
  731. objectType: OSType;
  732. objectSubtype: OSType;
  733. end;
  734. {!
  735. @enum ImportImage flags.
  736. @discussion
  737. Flag values that can be used in ICAImportImagePB parameter block.
  738. @constant kICAAllowMultipleImages
  739. Use this constant to allow users to select multiple images in the Import Image dialog.
  740. @constant kICADownloadAndReturnPathArray
  741. Use this constant to download the images to a temporary location and return an array of paths to the downloaded images.
  742. }
  743. const
  744. kICAAllowMultipleImages = $00000001;
  745. kICADownloadAndReturnPathArray = $00000002;
  746. {!
  747. @struct ICAImportImagePB
  748. @field header
  749. See description for ICAHeader. <->
  750. @field deviceObject
  751. Object ID of a camera or scanner device. Set this to NULL to ge the default behavior: (a) if no device is connected, a panel saying that thereÕs no device connected is displayed, (b) if a single device is connected, an appropriate user interface to access that device will be displayed, (c) if several devices are connected, a device selector panel will be displayed. <--
  752. @field flags
  753. One or more flags (combined with an OR operator) defined in ImportImage flags enum. <--
  754. @field supportedFileTypes
  755. An array of file extension strings such as "jpg", "tif", etc., that are of interest to the calling application. Set to NULL to display all files. <--
  756. @field filterProc
  757. Specify a filter proc to that will be called for each file before it is displayed in the user interface. <--
  758. @field importedImages
  759. Returns an array of CFDataRefs for the imported images if the kICADownloadAndReturnPathArray flag is not specified. Otherwise returns an array of CFStringRefs holding the paths of the images that are downloaded. The caller should provide a pointer to a CFArrayRef object initialized to NULL. The caller is responsible for released the array returned by this function. -->
  760. }
  761. type
  762. ICAImportImagePBPtr = ^ICAImportImagePB;
  763. ICAImportImagePB = record
  764. header: ICAHeader;
  765. deviceObject: ICAObject;
  766. flags: UInt32;
  767. supportedFileTypes: CFArrayRef;
  768. filterProc: ICAImportFilterProc;
  769. importedImages: CFArrayRefPtr;
  770. end;
  771. {!
  772. @function ICAImportImage
  773. @abstract
  774. This API displays a Common User Interface panel similar to the user interface of Image Capture Application. This allows the user to work a camera or a scanner.
  775. @discussion
  776. Use this API to add Image Capture support to an application.
  777. <pre>
  778. @textblock
  779. Example:
  780. void ImportImage()
  781. (
  782. OSErr err;
  783. CFArrayRef imagesArray = NULL;
  784. ICAImportImagePB pb = ();
  785. pb.deviceObject = 0;
  786. pb.flags = 0;
  787. pb.supportedFileTypes = (CFArrayRef)[NSArray arrayWithObjects: @"tif", @"tiff", @"jpg", NULL];
  788. pb.importedImages = &imagesArray;
  789. err = ICAImportImage(&pb, NULL);
  790. if ( noErr != err )
  791. (
  792. // handle error
  793. )
  794. else
  795. (
  796. // Process the importedImages array
  797. // pb.importedImages // CFArrayRef *
  798. )
  799. )
  800. @/textblock
  801. </pre>
  802. @param pb
  803. A pointer to an <code><b>ICAImportImagePB</b></code> parameter block.
  804. @param completion
  805. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAImportImage</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  806. @result
  807. Returns an error code defined in ICAApplication.h
  808. }
  809. function ICAImportImage( var pb: ICAImportImagePB; completion: ICACompletion ): ICAError; external name '_ICAImportImage';
  810. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  811. //--------------------------------------------------------------------------------------------------------- ICAShowDeviceBrowser
  812. {!
  813. @function ICAShowDeviceBrowser
  814. @abstract
  815. Use this API to display a device browser user interface from any Image Capture client application.
  816. @discussion
  817. The device browser user interface allows the user to do the following:
  818. - enable and disable sharing of locally connected cameras and scanners.
  819. - connect to or disconnect from cameras and scanners shared by other computers.
  820. - configure WiFi capable cameras for use over the WiFi network.
  821. @param options
  822. Set options to NULL to display the device browser with default settings. <--
  823. This parameter is intended for future use.
  824. @result
  825. Returns an error code defined in ICAApplication.h
  826. }
  827. function ICAShowDeviceBrowser( options: CFDictionaryRef ): ICAError; external name '_ICAShowDeviceBrowser';
  828. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  829. //---------------------------------------------------------------------------------------------- ICARegisterForEventNotification
  830. // Function prototype for an Image Capture notification callback proc
  831. type
  832. ICANotification = procedure( notificationType: CFStringRef; notificationDictionary: CFDictionaryRef );
  833. { The Image Capture notification callabck function will be called with a notificationDictionary that may
  834. contain one or more key-value pairs as defined below:
  835. Key Value Type Comments
  836. kICANotificationICAObjectKey CFNumberRef An object associated with the notification.
  837. kICANotificationDeviceICAObjectKey CFNumberRef A device object associated with the notification.
  838. kICANotificationClassKey CFStringRef See below.
  839. kICANotificationTypeKey CFStringRef See below.
  840. kICANotificationRawEventKey CFNumberRef The unprocesssed event code sent by a device.
  841. kICANotificationDataKey CFDataRef Data associated with the event.
  842. kICANotificationDataSizeKey CFNumberRef Size of data associated with the event. This is used if the data is
  843. not sent with the notification. [Needed for backward compatiblity with pre-Leopard device modules].
  844. kICANotificationDataCookieKey CFNumberRef A token identifying the data associated with this event.
  845. This data can be retrieved by calling ICAObjectSendMessage with messageType set to kICAMessageGetEventData, dataType set to value of kICANotificationDataCookieKeyand dataSize set to value of kICANotificationDataSizeKey.
  846. The following keys are present if the value of kICANotificationDataKey represents image data. The values of these
  847. keys are CFNumbers representing the width, height, bytes per row, start row, and number of rows of the image:
  848. kICANotificationImageKey CFDictionaryRef A dictionary that describes an Image associated
  849. with the notification.
  850. kICANotificationImageDataKey CFDataRef Image data
  851. kICANotificationImageWidthKey CFNumberRef Image width in pixels
  852. kICANotificationImageHeightKey CFNumberRef Image height in pixels
  853. kICANotificationImageBytesPerRowKey CFNumberRef Bytes per row in image
  854. kICANotificationImageStartRowKey CFNumberRef Starting row number of the image.
  855. kICANotificationImageNumberOfRowsKey CFNumberRef Number of rows of image data sent in this notification.
  856. }
  857. // Possible values for kICANotificationTypeKey:
  858. var kICANotificationTypeObjectAdded: CFStringRef; external name '_kICANotificationTypeObjectAdded'; (* attribute const *)
  859. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  860. var kICANotificationTypeObjectRemoved: CFStringRef; external name '_kICANotificationTypeObjectRemoved'; (* attribute const *)
  861. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  862. var kICANotificationTypeObjectInfoChanged: CFStringRef; external name '_kICANotificationTypeObjectInfoChanged'; (* attribute const *)
  863. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  864. var kICANotificationTypeStoreAdded: CFStringRef; external name '_kICANotificationTypeStoreAdded'; (* attribute const *)
  865. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  866. var kICANotificationTypeStoreRemoved: CFStringRef; external name '_kICANotificationTypeStoreRemoved'; (* attribute const *)
  867. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  868. var kICANotificationTypeStoreFull: CFStringRef; external name '_kICANotificationTypeStoreFull'; (* attribute const *)
  869. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  870. var kICANotificationTypeStoreInfoChanged: CFStringRef; external name '_kICANotificationTypeStoreInfoChanged'; (* attribute const *)
  871. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  872. var kICANotificationTypeDeviceAdded: CFStringRef; external name '_kICANotificationTypeDeviceAdded'; (* attribute const *)
  873. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  874. var kICANotificationTypeDeviceRemoved: CFStringRef; external name '_kICANotificationTypeDeviceRemoved'; (* attribute const *)
  875. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  876. var kICANotificationTypeDeviceInfoChanged: CFStringRef; external name '_kICANotificationTypeDeviceInfoChanged'; (* attribute const *)
  877. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  878. var kICANotificationTypeDevicePropertyChanged: CFStringRef; external name '_kICANotificationTypeDevicePropertyChanged'; (* attribute const *)
  879. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  880. var kICANotificationTypeDeviceWasReset: CFStringRef; external name '_kICANotificationTypeDeviceWasReset'; (* attribute const *)
  881. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  882. var kICANotificationTypeDeviceStatusInfo: CFStringRef; external name '_kICANotificationTypeDeviceStatusInfo'; (* attribute const *)
  883. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  884. var kICANotificationTypeDeviceStatusError: CFStringRef; external name '_kICANotificationTypeDeviceStatusError'; (* attribute const *)
  885. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  886. var kICANotificationTypeCaptureComplete: CFStringRef; external name '_kICANotificationTypeCaptureComplete'; (* attribute const *)
  887. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  888. var kICANotificationTypeRequestObjectTransfer: CFStringRef; external name '_kICANotificationTypeRequestObjectTransfer'; (* attribute const *)
  889. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  890. var kICANotificationTypeTransactionCanceled: CFStringRef; external name '_kICANotificationTypeTransactionCanceled'; (* attribute const *)
  891. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  892. var kICANotificationTypeUnreportedStatus: CFStringRef; external name '_kICANotificationTypeUnreportedStatus'; (* attribute const *)
  893. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  894. var kICANotificationTypeProprietary: CFStringRef; external name '_kICANotificationTypeProprietary'; (* attribute const *)
  895. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  896. var kICANotificationTypeDeviceConnectionProgress: CFStringRef; external name '_kICANotificationTypeDeviceConnectionProgress'; (* attribute const *)
  897. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  898. var kICANotificationTypeDownloadProgressStatus: CFStringRef; external name '_kICANotificationTypeDownloadProgressStatus'; (* attribute const *)
  899. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  900. var kICANotificationTypeScanProgressStatus: CFStringRef; external name '_kICANotificationTypeScanProgressStatus'; (* attribute const *)
  901. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  902. var kICANotificationTypeScannerSessionClosed: CFStringRef; external name '_kICANotificationTypeScannerSessionClosed'; (* attribute const *)
  903. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  904. var kICANotificationTypeScannerScanDone: CFStringRef; external name '_kICANotificationTypeScannerScanDone'; (* attribute const *)
  905. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  906. var kICANotificationTypeScannerPageDone: CFStringRef; external name '_kICANotificationTypeScannerPageDone'; (* attribute const *)
  907. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  908. var kICANotificationTypeScannerButtonPressed: CFStringRef; external name '_kICANotificationTypeScannerButtonPressed'; (* attribute const *)
  909. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  910. var kICANotificationTypeScannerOverviewOverlayAvailable: CFStringRef; external name '_kICANotificationTypeScannerOverviewOverlayAvailable'; (* attribute const *)
  911. (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
  912. // Possible keys in the notification dictionary:
  913. var kICAErrorKey: CFStringRef; external name '_kICAErrorKey'; (* attribute const *)
  914. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  915. var kICARefconKey: CFStringRef; external name '_kICARefconKey'; (* attribute const *)
  916. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  917. var kICANotificationICAObjectKey: CFStringRef; external name '_kICANotificationICAObjectKey'; (* attribute const *)
  918. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  919. var kICANotificationDeviceICAObjectKey: CFStringRef; external name '_kICANotificationDeviceICAObjectKey'; (* attribute const *)
  920. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  921. var kICANotificationDeviceListICAObjectKey: CFStringRef; external name '_kICANotificationDeviceListICAObjectKey'; (* attribute const *)
  922. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  923. var kICANotificationClassKey: CFStringRef; external name '_kICANotificationClassKey'; (* attribute const *)
  924. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  925. var kICANotificationTypeKey: CFStringRef; external name '_kICANotificationTypeKey'; (* attribute const *)
  926. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  927. var kICANotificationRawEventKey: CFStringRef; external name '_kICANotificationRawEventKey'; (* attribute const *)
  928. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  929. var kICANotificationDataKey: CFStringRef; external name '_kICANotificationDataKey'; (* attribute const *)
  930. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  931. var kICANotificationDataSizeKey: CFStringRef; external name '_kICANotificationDataSizeKey'; (* attribute const *)
  932. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  933. var kICANotificationDataCookieKey: CFStringRef; external name '_kICANotificationDataCookieKey'; (* attribute const *)
  934. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  935. var kICANotificationImageKey: CFStringRef; external name '_kICANotificationImageKey'; (* attribute const *)
  936. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  937. var kICANotificationImageWidthKey: CFStringRef; external name '_kICANotificationImageWidthKey'; (* attribute const *)
  938. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  939. var kICANotificationImageHeightKey: CFStringRef; external name '_kICANotificationImageHeightKey'; (* attribute const *)
  940. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  941. var kICANotificationImageBytesPerRowKey: CFStringRef; external name '_kICANotificationImageBytesPerRowKey'; (* attribute const *)
  942. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  943. var kICANotificationImageStartRowKey: CFStringRef; external name '_kICANotificationImageStartRowKey'; (* attribute const *)
  944. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  945. var kICANotificationImageNumberOfRowsKey: CFStringRef; external name '_kICANotificationImageNumberOfRowsKey'; (* attribute const *)
  946. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  947. var kICANotificationImageDataKey: CFStringRef; external name '_kICANotificationImageDataKey'; (* attribute const *)
  948. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  949. var kICANotificationImageDataSizeKey: CFStringRef; external name '_kICANotificationImageDataSizeKey'; (* attribute const *)
  950. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  951. var kICANotificationDataIsBigEndianKey: CFStringRef; external name '_kICANotificationDataIsBigEndianKey'; (* attribute const *)
  952. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  953. var kICANotificationScannerDocumentNameKey: CFStringRef; external name '_kICANotificationScannerDocumentNameKey'; (* attribute const *)
  954. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  955. var kICANotificationScannerButtonTypeKey: CFStringRef; external name '_kICANotificationScannerButtonTypeKey'; (* attribute const *)
  956. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  957. var kICANotificationNumerOfImagesRemainingKey: CFStringRef; external name '_kICANotificationNumerOfImagesRemainingKey'; (* attribute const *)
  958. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  959. var kICANotificationPercentDownloadedKey: CFStringRef; external name '_kICANotificationPercentDownloadedKey'; (* attribute const *)
  960. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  961. var kICANotificationSubTypeKey: CFStringRef; external name '_kICANotificationSubTypeKey'; (* attribute const *)
  962. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  963. var kICANotificationSubTypeWarmUpStarted: CFStringRef; external name '_kICANotificationSubTypeWarmUpStarted'; (* attribute const *)
  964. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  965. var kICANotificationSubTypeWarmUpDone: CFStringRef; external name '_kICANotificationSubTypeWarmUpDone'; (* attribute const *)
  966. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  967. var kICANotificationVendorErrorCodeKey: CFStringRef; external name '_kICANotificationVendorErrorCodeKey'; (* attribute const *)
  968. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  969. var kICANotificationSubTypePerformOverviewScan: CFStringRef; external name '_kICANotificationSubTypePerformOverviewScan'; (* attribute const *)
  970. (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
  971. var kICANotificationSubTypeDocumentLoaded: CFStringRef; external name '_kICANotificationSubTypeDocumentLoaded'; (* attribute const *)
  972. (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
  973. var kICANotificationSubTypeDocumentNotLoaded: CFStringRef; external name '_kICANotificationSubTypeDocumentNotLoaded'; (* attribute const *)
  974. (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
  975. // Possible values in the notification dictionary:
  976. // ...
  977. // Possible values for kICANotificationClassKey
  978. var kICANotificationClassPTPStandard: CFStringRef; external name '_kICANotificationClassPTPStandard'; (* attribute const *)
  979. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  980. var kICANotificationClassPTPVendor: CFStringRef; external name '_kICANotificationClassPTPVendor'; (* attribute const *)
  981. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  982. var kICANotificationClassProprietary: CFStringRef; external name '_kICANotificationClassProprietary'; (* attribute const *)
  983. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  984. // Device Properties
  985. var kICADevicePropUndefined: CFStringRef; external name '_kICADevicePropUndefined'; (* attribute const *)
  986. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  987. var kICADevicePropBatteryLevel: CFStringRef; external name '_kICADevicePropBatteryLevel'; (* attribute const *)
  988. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  989. var kICADevicePropFunctionalMode: CFStringRef; external name '_kICADevicePropFunctionalMode'; (* attribute const *)
  990. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  991. var kICADevicePropImageSize: CFStringRef; external name '_kICADevicePropImageSize'; (* attribute const *)
  992. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  993. var kICADevicePropCompressionSetting: CFStringRef; external name '_kICADevicePropCompressionSetting'; (* attribute const *)
  994. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  995. var kICADevicePropWhiteBalance: CFStringRef; external name '_kICADevicePropWhiteBalance'; (* attribute const *)
  996. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  997. var kICADevicePropRGBGain: CFStringRef; external name '_kICADevicePropRGBGain'; (* attribute const *)
  998. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  999. var kICADevicePropFNumber: CFStringRef; external name '_kICADevicePropFNumber'; (* attribute const *)
  1000. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1001. var kICADevicePropFocalLength: CFStringRef; external name '_kICADevicePropFocalLength'; (* attribute const *)
  1002. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1003. var kICADevicePropFocusDistance: CFStringRef; external name '_kICADevicePropFocusDistance'; (* attribute const *)
  1004. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1005. var kICADevicePropFocusMode: CFStringRef; external name '_kICADevicePropFocusMode'; (* attribute const *)
  1006. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1007. var kICADevicePropExposureMeteringMode: CFStringRef; external name '_kICADevicePropExposureMeteringMode'; (* attribute const *)
  1008. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1009. var kICADevicePropFlashMode: CFStringRef; external name '_kICADevicePropFlashMode'; (* attribute const *)
  1010. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1011. var kICADevicePropExposureTime: CFStringRef; external name '_kICADevicePropExposureTime'; (* attribute const *)
  1012. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1013. var kICADevicePropExposureProgramMode: CFStringRef; external name '_kICADevicePropExposureProgramMode'; (* attribute const *)
  1014. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1015. var kICADevicePropExposureIndex: CFStringRef; external name '_kICADevicePropExposureIndex'; (* attribute const *)
  1016. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1017. var kICADevicePropExposureBiasCompensation: CFStringRef; external name '_kICADevicePropExposureBiasCompensation'; (* attribute const *)
  1018. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1019. var kICADevicePropDateTime: CFStringRef; external name '_kICADevicePropDateTime'; (* attribute const *)
  1020. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1021. var kICADevicePropCaptureDelay: CFStringRef; external name '_kICADevicePropCaptureDelay'; (* attribute const *)
  1022. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1023. var kICADevicePropStillCaptureMode: CFStringRef; external name '_kICADevicePropStillCaptureMode'; (* attribute const *)
  1024. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1025. var kICADevicePropContrast: CFStringRef; external name '_kICADevicePropContrast'; (* attribute const *)
  1026. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1027. var kICADevicePropSharpness: CFStringRef; external name '_kICADevicePropSharpness'; (* attribute const *)
  1028. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1029. var kICADevicePropDigitalZoom: CFStringRef; external name '_kICADevicePropDigitalZoom'; (* attribute const *)
  1030. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1031. var kICADevicePropEffectMode: CFStringRef; external name '_kICADevicePropEffectMode'; (* attribute const *)
  1032. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1033. var kICADevicePropBurstNumber: CFStringRef; external name '_kICADevicePropBurstNumber'; (* attribute const *)
  1034. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1035. var kICADevicePropBurstInterval: CFStringRef; external name '_kICADevicePropBurstInterval'; (* attribute const *)
  1036. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1037. var kICADevicePropTimelapseNumber: CFStringRef; external name '_kICADevicePropTimelapseNumber'; (* attribute const *)
  1038. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1039. var kICADevicePropTimelapseInterval: CFStringRef; external name '_kICADevicePropTimelapseInterval'; (* attribute const *)
  1040. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1041. var kICADevicePropFocusMeteringMode: CFStringRef; external name '_kICADevicePropFocusMeteringMode'; (* attribute const *)
  1042. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1043. var kICADevicePropUploadURL: CFStringRef; external name '_kICADevicePropUploadURL'; (* attribute const *)
  1044. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1045. var kICADevicePropArtist: CFStringRef; external name '_kICADevicePropArtist'; (* attribute const *)
  1046. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1047. var kICADevicePropCopyrightInfo: CFStringRef; external name '_kICADevicePropCopyrightInfo'; (* attribute const *)
  1048. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1049. {!
  1050. @struct ICARegisterForEventNotificationPB
  1051. @discussion
  1052. Use this parameter structure to specify a set of events associated with an object
  1053. about which notifications should be sent to the specified notification function.
  1054. @field header
  1055. See description for ICAHeader. <->
  1056. @field objectOfInterest
  1057. An object about which notifications are requested. <--
  1058. @field eventsOfInterest
  1059. An array of notification types of interest. <--
  1060. @field notificationProc
  1061. A callback function to receive the notifications. <--
  1062. @field options
  1063. Set options to NULL. This parameter is intended for future use. <--
  1064. }
  1065. type
  1066. ICARegisterForEventNotificationPBPtr = ^ICARegisterForEventNotificationPB;
  1067. ICARegisterForEventNotificationPB = record
  1068. header: ICAHeader;
  1069. objectOfInterest: ICAObject;
  1070. eventsOfInterest: CFArrayRef;
  1071. notificationProc: ICANotification;
  1072. options: CFDictionaryRef;
  1073. end;
  1074. {!
  1075. @function ICARegisterForEventNotification
  1076. @abstract
  1077. Use this API to register with Image Capture framework to receive
  1078. notification about events of interest.
  1079. @param params
  1080. A pointer to ICARegisterForEventNotificationPB struct <--
  1081. @param completionProc
  1082. A pointer to a completion routine that will be invoked at the completion of
  1083. this function. Set this parameter to NULL to invoke this API synchronously.
  1084. @result
  1085. Returns an error code defined in ICAApplication.h
  1086. }
  1087. function ICARegisterForEventNotification( var params: ICARegisterForEventNotificationPB; completionProc: ICACompletion ): ICAError; external name '_ICARegisterForEventNotification';
  1088. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1089. //---------------------------------------------------------------------------------------------------------- ICASendNotification
  1090. // This parameter block is used with 'ICDSendNotification' and 'ICDSendNotificationAndWaitForReply' APIs defined
  1091. // in ICADevices.framework
  1092. type
  1093. ICASendNotificationPBPtr = ^ICASendNotificationPB;
  1094. ICASendNotificationPB = record
  1095. header: ICAHeader;
  1096. notificationDictionary: CFMutableDictionaryRef;
  1097. replyCode: UInt32;
  1098. end;
  1099. function ICASendNotification( var pb: ICASendNotificationPB ): ICAError; external name '_ICASendNotification';
  1100. (* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
  1101. function ICASendNotificationAndWaitForReply( var pb: ICASendNotificationPB ): ICAError; external name '_ICASendNotificationAndWaitForReply';
  1102. (* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
  1103. //#pragma mark -
  1104. //#pragma mark Object related APIs
  1105. //------------------------------------------------------------------------------------------------------------- ICAGetDeviceList
  1106. {!
  1107. @struct ICAGetDeviceListPB
  1108. @field header
  1109. See description for ICAHeader. <-->
  1110. @field object
  1111. The device list object, if ICAGetDeviceList returns successfully. -->
  1112. }
  1113. type
  1114. ICAGetDeviceListPBPtr = ^ICAGetDeviceListPB;
  1115. ICAGetDeviceListPB = record
  1116. header: ICAHeader;
  1117. objct: ICAObject;
  1118. end;
  1119. {!
  1120. @function ICAGetDeviceList
  1121. @abstract
  1122. Fetches the object at the top of the object heirarchy.
  1123. @discussion
  1124. Image Capture framework presents cameras and scanners, their contents and their capabilities as a heirarchy of objects and their properties. The device list object is at the top of the heirarchy of objects. The <b><code>ICAGetDeviceList</b></code> function fetches this object in the <code><b>object</b></code> field of parameter <code><b>pb</b></code>. Children of the device list object can be accessed by passing the device list object to functions <code><b>ICAGetChildCount()</b></code> and <code>ICAGetNthChild()</code>.
  1125. <pre>
  1126. @textblock
  1127. Example:
  1128. ICAObject GetDeviceList()
  1129. (
  1130. ICAGetDeviceListPB getDeviceListPB = ();
  1131. ICAObject deviceList = 0;
  1132. OSErr err;
  1133. err = ICAGetDeviceList( &getDeviceListPB, nil );
  1134. if ( noErr == err )
  1135. (
  1136. deviceList = getDeviceListPB.object;
  1137. )
  1138. return deviceList;
  1139. )
  1140. @/textblock
  1141. </pre>
  1142. @param pb
  1143. A pointer to an <code><b>ICAGetDeviceListPB</b></code> parameter block.
  1144. @param completion
  1145. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAGetDeviceList</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1146. @result
  1147. Returns an error code defined in ICAApplication.h
  1148. }
  1149. function ICAGetDeviceList( var pb: ICAGetDeviceListPB; completion: ICACompletion ): ICAError; external name '_ICAGetDeviceList';
  1150. (* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
  1151. //---------------------------------------------------------------------------------------------- ICACopyObjectPropertyDictionary
  1152. {!
  1153. @struct ICACopyObjectPropertyDictionaryPB
  1154. @field header
  1155. See description for ICAHeader. <->
  1156. @field object
  1157. An object whose properties are being requested. <--
  1158. @field theDict
  1159. A dictionary to hold the properties. This must be released by the caller. -->
  1160. }
  1161. type
  1162. ICACopyObjectPropertyDictionaryPBPtr = ^ICACopyObjectPropertyDictionaryPB;
  1163. ICACopyObjectPropertyDictionaryPB = record
  1164. header: ICAHeader;
  1165. objct: ICAObject;
  1166. theDict: CFDictionaryRefPtr;
  1167. end;
  1168. {!
  1169. @function ICACopyObjectPropertyDictionary
  1170. @abstract
  1171. Use this API to get a CFDictionaryRef containing all the properties for an object specified in the object field of the ICACopyObjectPropertyDictionaryPB struct.
  1172. @discussion
  1173. This API is the preferred way to get to any ICAObject related property data.
  1174. <pre>
  1175. @textblock
  1176. Example:
  1177. void CopyObjectPropertyDictionary()
  1178. (
  1179. OSErr err;
  1180. ICACopyObjectPropertyDictionaryPB pb = ();
  1181. pb.object = <#ICAObject object#>;
  1182. err = ICACopyObjectPropertyDictionary( &pb, NULL );
  1183. if ( noErr != err)
  1184. (
  1185. // handle error
  1186. )
  1187. else
  1188. (
  1189. // Make sure to release the returned dictionary
  1190. // pb.theDict // CFDictionaryRef *
  1191. )
  1192. )
  1193. @/textblock
  1194. </pre>
  1195. @param pb
  1196. A pointer to an <code><b>ICACopyObjectPropertyDictionaryPB</b></code> parameter block.
  1197. @param completion
  1198. A pointer to a completion routine that will be invoked at the completion of <code><b>ICACopyObjectPropertyDictionary</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1199. @result
  1200. Returns an error code defined in ICAApplication.h
  1201. }
  1202. function ICACopyObjectPropertyDictionary( var pb: ICACopyObjectPropertyDictionaryPB; completion: ICACompletion ): ICAError; external name '_ICACopyObjectPropertyDictionary';
  1203. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1204. //------------------------------------------------------------------------------------------------------- ICACopyObjectThumbnail
  1205. {!
  1206. @enum Thumbnail formats.
  1207. @discussion
  1208. Format alues that can be used in ICACopyObjectThumbnailPB parameter block.
  1209. @constant kICAThumbnailFormatJPEG
  1210. Use this constant to receive a thumbnail in JPEG format.
  1211. @constant kICAThumbnailFormatTIFF
  1212. Use this constant to receive a thumbnail in TIFF format.
  1213. @constant kICAThumbnailFormatPNG
  1214. Use this constant to receive a thumbnail in PNG format.
  1215. }
  1216. const
  1217. kICAThumbnailFormatJPEG = FourCharCode('jpeg');
  1218. kICAThumbnailFormatTIFF = FourCharCode('tiff');
  1219. kICAThumbnailFormatPNG = FourCharCode('png ');
  1220. {!
  1221. @struct ICACopyObjectThumbnailPB
  1222. @field header
  1223. See description for ICAHeader. <->
  1224. @field object
  1225. An object whose thumbail is being requested. <--
  1226. @field thumbnailFormat
  1227. One of the format values defined above. <--
  1228. @field thumbnailData
  1229. A pointer to a CFDataRef holding the thumbnail data. The returned CFDataRef must be released by the caller. -->
  1230. }
  1231. type
  1232. ICACopyObjectThumbnailPBPtr = ^ICACopyObjectThumbnailPB;
  1233. ICACopyObjectThumbnailPB = record
  1234. header: ICAHeader;
  1235. objct: ICAObject;
  1236. thumbnailFormat: OSType;
  1237. thumbnailData: CFDataRefPtr;
  1238. end;
  1239. {!
  1240. @function ICACopyObjectThumbnail
  1241. @abstract
  1242. Use this API to get a thumbnail associated with an object.
  1243. @discussion
  1244. This is the recommended way to get the thumbnail of an object. Getting the thumbnail using ICAGetPropertyData is deprecaed in 10.5.
  1245. <pre>
  1246. @textblock
  1247. Example:
  1248. void CopyObjectThumbnail()
  1249. (
  1250. OSErr err;
  1251. ICACopyObjectThumbnailPB pb = ();
  1252. pb.object = <#ICAObject object#>;
  1253. pb.thumbnailFormat = <#OSType thumbnailFormat#>;
  1254. err = ICACopyObjectThumbnail( &pb, NULL );
  1255. if ( noErr != err )
  1256. (
  1257. // handle error
  1258. )
  1259. else
  1260. (
  1261. // Make sure to release the thumbnailData
  1262. // pb.thumbnailData // CFDataRef *
  1263. )
  1264. )
  1265. @/textblock
  1266. </pre>
  1267. @param pb
  1268. A pointer to an <code><b>ICACopyObjectThumbnailPB</b></code> parameter block.
  1269. @param completion
  1270. A pointer to a completion routine that will be invoked at the completion of <code><b>ICACopyObjectThumbnail</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1271. @result
  1272. Returns an error code defined in ICAApplication.h
  1273. }
  1274. function ICACopyObjectThumbnail( var pb: ICACopyObjectThumbnailPB; completion: ICACompletion ): ICAError; external name '_ICACopyObjectThumbnail';
  1275. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1276. //------------------------------------------------------------------------------------------------------------ ICACopyObjectData
  1277. {!
  1278. @struct ICACopyObjectDataPB
  1279. @field header
  1280. See description for ICAHeader. <->
  1281. @field object
  1282. A file object. <--
  1283. @field startByte
  1284. Starting byte offset of the data in the file object. <--
  1285. @field requestedSize
  1286. Requested data size in bytes. <--
  1287. @field data
  1288. A pointer to CFDataRef in which the data will be returned. -->
  1289. It is the responsibility fo the caller to release this object.
  1290. }
  1291. type
  1292. ICACopyObjectDataPBPtr = ^ICACopyObjectDataPB;
  1293. ICACopyObjectDataPB = record
  1294. header: ICAHeader;
  1295. objct: ICAObject;
  1296. startByte: size_t;
  1297. requestedSize: size_t;
  1298. data: CFDataRefPtr;
  1299. end;
  1300. {!
  1301. @function ICACopyObjectData
  1302. @abstract
  1303. Use this API to get a copy of data associated with a file object.
  1304. @discussion
  1305. Use this API to get a copy of data associated with a file object. This API should be used in place of ICAGetPropertyData.
  1306. @param params
  1307. A pointer to ICACopyObjectDataPB struct <--
  1308. @param completionProc
  1309. A pointer to a completion routine that will be invoked at the completion of
  1310. this function. Set this parameter to NULL to invoke this API synchronously.
  1311. @result
  1312. Returns an error code defined in ICAApplication.h
  1313. }
  1314. function ICACopyObjectData( var params: ICACopyObjectDataPB; completionProc: ICACompletion ): ICAError; external name '_ICACopyObjectData';
  1315. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1316. //--------------------------------------------------------------------------------------------------------- ICAObjectSendMessage
  1317. {!
  1318. @struct ICAMessage
  1319. @field messageType
  1320. A message type. e.g., kICAMessageCameraCaptureNewImage. <--
  1321. @field startByte
  1322. Offset in dataPtr from where data access for read/write should occur. <--
  1323. @field dataPtr
  1324. A pointer to a data buffer. <--
  1325. @field dataSize
  1326. Size of data. <--
  1327. @field dataType
  1328. Type of data. <--
  1329. }
  1330. type
  1331. ICAMessagePtr = ^ICAMessage;
  1332. ICAMessage = record
  1333. messageType: OSType;
  1334. startByte: UInt32;
  1335. dataPtr: UnivPtr;
  1336. dataSize: UInt32;
  1337. dataType: OSType;
  1338. end;
  1339. {!
  1340. @enum ICAMessage types
  1341. @discussion
  1342. Definition of ICAMessage types.
  1343. @constant kICAMessageConnect
  1344. Connect to device.
  1345. @constant kICAMessageDisconnect
  1346. Disconnect device.
  1347. @constant kICAMessageReset
  1348. Reset device.
  1349. @constant kICAMessageCheckDevice
  1350. Check device.
  1351. @constant kICAMessageCameraReadClock
  1352. Read clock from device.
  1353. @constant kICAMessageGetLastButtonPressed
  1354. Get last button pressed on the device (scanner).
  1355. @constant kICAMessageGetEventData
  1356. Get data associated with an event.
  1357. @constant kICAMessageDeviceYield
  1358. Yield device. Image Capture framework yields a device so that the sender of the message can directly communicate with the device.
  1359. }
  1360. const
  1361. kICAMessageConnect = FourCharCode('open');
  1362. kICAMessageDisconnect = FourCharCode('clos');
  1363. kICAMessageReset = FourCharCode('rese');
  1364. kICAMessageCheckDevice = FourCharCode('chkd');
  1365. kICAMessageCameraReadClock = FourCharCode('rclk');
  1366. kICAMessageGetLastButtonPressed = FourCharCode('btn?');
  1367. kICAMessageGetEventData = FourCharCode('mged');
  1368. kICAMessageDeviceYield = FourCharCode('yiel');
  1369. kICAMessageCameraPassThrough = FourCharCode('pass');
  1370. kICAMessageScannerOverviewSelectionChanged = FourCharCode('area');
  1371. {!
  1372. @struct ICAObjectSendMessagePB
  1373. @field header
  1374. See description for ICAHeader. <-->
  1375. @field object
  1376. A target object for the message sent by ICAObjectSendMessage. <--
  1377. @field message
  1378. One of the messages define above. <--
  1379. @field result
  1380. A message specific result is returned here. -->
  1381. }
  1382. type
  1383. ICAObjectSendMessagePBPtr = ^ICAObjectSendMessagePB;
  1384. ICAObjectSendMessagePB = record
  1385. header: ICAHeader;
  1386. objct: ICAObject;
  1387. message: ICAMessage;
  1388. result: UInt32;
  1389. end;
  1390. {!
  1391. @function ICAObjectSendMessage
  1392. @abstract
  1393. Use this API to send a message to a device object.
  1394. @discussion
  1395. Use this API to send a message to a device object. All devices do not respond to all the messages defined above.
  1396. @param pb
  1397. A pointer to an <code><b>ICAObjectSendMessagePB</b></code> parameter block.
  1398. @param completion
  1399. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAObjectSendMessage</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1400. @result
  1401. Returns an error code defined in ICAApplication.h
  1402. }
  1403. function ICAObjectSendMessage( var pb: ICAObjectSendMessagePB; completion: ICACompletion ): ICAError; external name '_ICAObjectSendMessage';
  1404. (* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
  1405. //-------------------------------------------------------------------------------------------------------------- ICADownloadFile
  1406. {!
  1407. @enum Flag to use with ICADownloadFile
  1408. @discussion
  1409. Use any combination of these values when downloading a file.
  1410. @constant kDeleteAfterDownload
  1411. Delete file after a successful download.
  1412. @constant kCreateCustomIcon
  1413. Create a custom icon for Finder.
  1414. @constant kAddMetaDataToFinderComment
  1415. Add basic metadata to finder comment field.
  1416. @constant kAdjustCreationDate
  1417. Set creation date of the downloaded file same as the creation date for the file as reported by the device.
  1418. @constant kSetFileTypeAndCreator
  1419. Set 4-AnsiChar file type and creator code.
  1420. @constant kRotateImage
  1421. Rotate the image.
  1422. @constant kDontEmbedColorSyncProfile
  1423. Embed ColorSync profile to the image if one was not already embedded.
  1424. }
  1425. const
  1426. kDeleteAfterDownload = $00000001;
  1427. kCreateCustomIcon = $00000002;
  1428. kAddMetaDataToFinderComment = $00000004;
  1429. kAdjustCreationDate = $00000008;
  1430. kSetFileTypeAndCreator = $00000010;
  1431. //kEmbedColorSyncProfile = 0x00000020,
  1432. kRotateImage = $00000040;
  1433. kDontEmbedColorSyncProfile = $00000080;
  1434. {!
  1435. @struct ICADownloadFilePB
  1436. @field header
  1437. See description for ICAHeader. <->
  1438. @field object
  1439. The file object. <--
  1440. @field dirFSRef
  1441. FSRef of destination directiory. <--
  1442. @field flags
  1443. Any combination of flag values defined above. <--
  1444. @field fileType
  1445. Four-AnsiChar code indicating the type of file. <--
  1446. @field fileCreator
  1447. Four-AnsiChar code indicating with the creator of the file. <--
  1448. @field rotationAngle
  1449. Rotation angle in steps of 90 degress. <--
  1450. @field fileFSRef
  1451. A pointer to FSRef struct to hold the FSRef of downloaded file. Set this to NULL if the FSRef of downloaded file is not of interest. -->
  1452. }
  1453. type
  1454. ICADownloadFilePBPtr = ^ICADownloadFilePB;
  1455. ICADownloadFilePB = record
  1456. header: ICAHeader;
  1457. objct: ICAObject;
  1458. dirFSRef: FSRefPtr;
  1459. flags: UInt32;
  1460. fileType: OSType;
  1461. fileCreator: OSType;
  1462. rotationAngle: Fixed;
  1463. fileFSRef: FSRefPtr;
  1464. end;
  1465. {!
  1466. @function ICADownloadFile
  1467. @abstract
  1468. Use this API to download a file to disk.
  1469. @discussion
  1470. This API is a convenient way to download a file to disk. To receive the image data in memory use ICACopyObjectData. Using ICAGetPropertyData is not recommend for this purpose since ICAGetPropertyData is Deprecated in 10.5.
  1471. <pre>
  1472. @textblock
  1473. Example:
  1474. void DownloadFile()
  1475. (
  1476. OSErr err;
  1477. ICADownloadFilePB pb = ();
  1478. pb.flags = <#UInt32 flags#>;
  1479. pb.rotationAngle = <#Fixed rotationAngle#>;
  1480. pb.object = <#ICAObject object#>;
  1481. pb.fileCreator = <#OSType fileCreator#>;
  1482. pb.dirFSRef = <#FSRef * dirFSRef#>;
  1483. pb.fileType = <#OSType fileType#>;
  1484. err = ICADownloadFile( &pb, NULL );
  1485. if ( noErr != err )
  1486. (
  1487. // handle error
  1488. )
  1489. else
  1490. (
  1491. // pb.fileFSRef // FSRef *
  1492. )
  1493. )
  1494. @/textblock
  1495. </pre>
  1496. @param pb
  1497. A pointer to an <code><b>ICADownloadFilePB</b></code> parameter block.
  1498. @param completion
  1499. A pointer to a completion routine that will be invoked at the completion of <code><b>ICADownloadFile</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1500. @result
  1501. Returns an error code defined in ICAApplication.h
  1502. }
  1503. function ICADownloadFile( var pb: ICADownloadFilePB; completion: ICACompletion ): ICAError; external name '_ICADownloadFile';
  1504. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1505. //---------------------------------------------------------------------------------------------------------------- ICAUploadFile
  1506. {!
  1507. @enum Upload file option flags.
  1508. @discussion
  1509. Flag values that can be used in ICAUploadFilePB parameter block.
  1510. @constant kICAUploadFileAsIs
  1511. Use this constant to upload a file as is.
  1512. @constant kICAUploadFileScaleToFit
  1513. Use this constant to upload a file after scaling to fit a specified bounding rect.
  1514. }
  1515. const
  1516. kICAUploadFileAsIs = $00000000;
  1517. kICAUploadFileScaleToFit = $00000001;
  1518. {!
  1519. @struct ICAUploadFilePB
  1520. @field header
  1521. See description for ICAHeader. <->
  1522. @field parentObject <->
  1523. An ICAObject corresponding to a folder on the device. The device will store the uploaded file inside this folder if possible.
  1524. @field fileFSRef <--
  1525. An FSRef for the file to be uploaded to the device.
  1526. @field flags <--
  1527. One of the flags defined above.
  1528. }
  1529. type
  1530. ICAUploadFilePBPtr = ^ICAUploadFilePB;
  1531. ICAUploadFilePB = record
  1532. header: ICAHeader;
  1533. parentObject: ICAObject;
  1534. fileFSRef: FSRefPtr;
  1535. flags: UInt32;
  1536. end;
  1537. {!
  1538. @function ICAUploadFile
  1539. @abstract
  1540. Use this API to upload a file to a device that supports this capability.
  1541. @discussion
  1542. The device choses an appropriate destination location for the uploaded image and sends a kICANotificationTypeObjectAdded notification.
  1543. <pre>
  1544. @textblock
  1545. Example:
  1546. void UploadFile()
  1547. (
  1548. OSErr err;
  1549. ICAUploadFilePB pb = ();
  1550. pb.fileFSRef = <#FSRef * fileFSRef#>;
  1551. pb.flags = <#UInt32 flags#>;
  1552. pb.parentObject = <#ICAObject parentObject#>;
  1553. err = ICAUploadFile( &pb, NULL );
  1554. if ( noErr != err )
  1555. (
  1556. // handle error
  1557. )
  1558. else
  1559. (
  1560. // no return value(s)
  1561. )
  1562. )
  1563. @/textblock
  1564. </pre>
  1565. @param pb
  1566. A pointer to an <code><b>ICAUploadFilePB</b></code> parameter block.
  1567. @param completion
  1568. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAUploadFile</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1569. @result
  1570. Returns an error code defined in ICAApplication.h
  1571. }
  1572. function ICAUploadFile( var pb: ICAUploadFilePB; completion: ICACompletion ): ICAError; external name '_ICAUploadFile';
  1573. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1574. //#pragma mark -
  1575. //#pragma mark Device related APIs
  1576. //---------------------------------------------------------------------------------------------------------- ICALoadDeviceModule
  1577. { struct ICALoadDeviceModulePB
  1578. Legal Key-Value pairs for populating paramDictionary:
  1579. Key Value Comment
  1580. kICADeviceModulePathKey CFStringRef Path to the device module bundle that needs to be launched.
  1581. kICATransportTypeKey CFStringRef Should be one of the six predifined transport types.
  1582. kICABluetoothAddressKey CFStringRef Bluetooth device address string formatted as "00-11-22-33-44-55".
  1583. kICAUSBLocationIDKey CFNumberRef (kCFNumberLongType) 32 bit USB location ID.
  1584. kICAFireWireGUIDKey CFNumberRef (kCFNumberLongLongType) 64 bit FireWire GUID.
  1585. kICAIOServicePathKey CFStringRef IO service path to the device obtained from the IO registry.
  1586. kICAIPAddressKey CFStringRef IP address of the device. This can be a host address ("camera.apple.com"),
  1587. ipv4 address ('192.168.123.10") or ipv6 address ("3ff3:0000:0000:0000:0123:4567:89ab:cdef")
  1588. kICAIPPortKey CFNumberRef (kCFNumberLongType) IP port number of the device.
  1589. kICAIPNameKey CFStringRef Human readable device name.
  1590. kICAIPGUIDKey CFStringRef 16 byte GUID string of the device formatted as "01234567-89ab-cdef-0123-456789abcdef".
  1591. kICATWAINDSPathKey CFStringRef Path to TWAIN DS bundle. }
  1592. {!
  1593. @struct ICALoadDeviceModulePB
  1594. @field header
  1595. See description for ICAHeader. <->
  1596. @field paramDictionary <--
  1597. A parameter dictionary with sufficient key-value pairs to load a device module. This dictionary itself or the information provided in this dictionary will be sent to the device module.
  1598. }
  1599. type
  1600. ICALoadDeviceModulePBPtr = ^ICALoadDeviceModulePB;
  1601. ICALoadDeviceModulePB = record
  1602. header: ICAHeader;
  1603. paramDictionary: CFDictionaryRef;
  1604. end;
  1605. {!
  1606. @function ICALoadDeviceModule
  1607. @abstract
  1608. Use this API to load a device module.
  1609. @discussion
  1610. Typically, connecting a FireWire or an USB device will automatically load an appropriate device module. This API is needed only for loading a device module manually for devices that do not use a hot-plug interface, such as Bluetooth, SCSI, or TCP/IP.
  1611. @param pb
  1612. A pointer to an <code><b>ICALoadDeviceModulePB</b></code> parameter block.
  1613. @param completion
  1614. A pointer to a completion routine that will be invoked at the completion of <code><b>ICALoadDeviceModule</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1615. @result
  1616. Returns an error code defined in ICAApplication.h
  1617. }
  1618. function ICALoadDeviceModule( var pb: ICALoadDeviceModulePB; completion: ICACompletion ): ICAError; external name '_ICALoadDeviceModule';
  1619. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1620. //--------------------------------------------------------------------------------------------------------- ICAUnloadDeviceModule
  1621. {!
  1622. @struct ICAUnloadDeviceModulePB
  1623. @field header
  1624. See description for ICAHeader. <->
  1625. @field deviceObject <--
  1626. A device ICAObject.
  1627. }
  1628. type
  1629. ICAUnloadDeviceModulePBPtr = ^ICAUnloadDeviceModulePB;
  1630. ICAUnloadDeviceModulePB = record
  1631. header: ICAHeader;
  1632. deviceObject: ICAObject;
  1633. end;
  1634. {!
  1635. @function ICAUnloadDeviceModule
  1636. @abstract
  1637. Uset this API to unload a device module.
  1638. @discussion
  1639. The device module providing this object will be unloaded, if this is the last device object provided by the device module.
  1640. @param pb
  1641. A pointer to an <code><b>ICAUnloadDeviceModulePB</b></code> parameter block.
  1642. @param completion
  1643. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAUnloadDeviceModule</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1644. @result
  1645. Returns an error code defined in ICAApplication.h
  1646. }
  1647. function ICAUnloadDeviceModule( var pb: ICAUnloadDeviceModulePB; completion: ICACompletion ): ICAError; external name '_ICAUnloadDeviceModule';
  1648. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1649. //--------------------------------------------------------------------------------------------------------------- ICAOpenSession
  1650. {!
  1651. @struct ICAOpenSessionPB
  1652. @field header
  1653. See description for ICAHeader. <->
  1654. @field deviceObject
  1655. A camera object. <--
  1656. @field sessionID
  1657. A session ID of the opened session. -->
  1658. }
  1659. type
  1660. ICAOpenSessionPBPtr = ^ICAOpenSessionPB;
  1661. ICAOpenSessionPB = record
  1662. header: ICAHeader;
  1663. deviceObject: ICAObject;
  1664. sessionID: ICASessionID;
  1665. end;
  1666. {!
  1667. @function ICAOpenSession
  1668. @abstract
  1669. Use this API to open a session on a camera device. For a scanner device use the ICAScannerOpenSession API.
  1670. @discussion
  1671. This API gets a session ID for a open session on a camera device. Since access to cameras is generally not be session-based, this API generall will not fail. If the camera has open session, the device module controlling the camera will continue to control it during fast-user-switching.
  1672. @param pb
  1673. A pointer to an <code><b>ICAOpenSessionPB</b></code> parameter block.
  1674. @param completion
  1675. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAOpenSession</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1676. @result
  1677. Returns an error code defined in ICAApplication.h
  1678. }
  1679. function ICAOpenSession( var pb: ICAOpenSessionPB; completion: ICACompletion ): ICAError; external name '_ICAOpenSession';
  1680. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1681. //-------------------------------------------------------------------------------------------------------------- ICACloseSession
  1682. {!
  1683. @struct ICACloseSessionPB
  1684. @field header
  1685. See description for ICAHeader. <->
  1686. @field sessionID
  1687. A session ID of the session to be closed. <--
  1688. }
  1689. type
  1690. ICACloseSessionPBPtr = ^ICACloseSessionPB;
  1691. ICACloseSessionPB = record
  1692. header: ICAHeader;
  1693. sessionID: ICASessionID;
  1694. end;
  1695. {!
  1696. @function ICACloseSession
  1697. @abstract
  1698. Use this API to close a session on a camera device. For a scanner device use the ICAScannerCloseSession API.
  1699. @discussion
  1700. This API closes an open session on a camera device. If the camera does not have any open sessions, the device module controlling the camera is free to give it up during fast-user-switching.
  1701. @param pb
  1702. A pointer to an <code><b>ICACloseSessionPB</b></code> parameter block.
  1703. @param completion
  1704. A pointer to a completion routine that will be invoked at the completion of <code><b>ICACloseSession</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1705. @result
  1706. Returns an error code defined in ICAApplication.h
  1707. }
  1708. function ICACloseSession( var pb: ICACloseSessionPB; completion: ICACompletion ): ICAError; external name '_ICACloseSession';
  1709. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1710. //-------------------------------------------------------------------------------------------------------- ICAScannerOpenSession
  1711. {!
  1712. @struct ICAScannerOpenSessionPB
  1713. @field header
  1714. See description for ICAHeader. <->
  1715. @field object
  1716. A scanner object. <--
  1717. @field sessionID
  1718. A session ID of the opened session. -->
  1719. }
  1720. type
  1721. ICAScannerOpenSessionPBPtr = ^ICAScannerOpenSessionPB;
  1722. ICAScannerOpenSessionPB = record
  1723. header: ICAHeader;
  1724. objct: ICAObject;
  1725. sessionID: ICAScannerSessionID;
  1726. end;
  1727. {!
  1728. @function ICAScannerOpenSession
  1729. @abstract
  1730. Use this API to open a session on a scanner device. For a camera device use the ICAOpenSession API.
  1731. @discussion
  1732. For a given scanner, this API returns a unique session ID that allows you to work with the device. This API will fail, if a session is already open.
  1733. @param pb
  1734. A pointer to an <code><b>ICAScannerOpenSessionPB</b></code> parameter block.
  1735. @param completion
  1736. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAScannerOpenSession</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1737. @result
  1738. Returns an error code defined in ICAApplication.h
  1739. }
  1740. function ICAScannerOpenSession( var pb: ICAScannerOpenSessionPB; completion: ICACompletion ): ICAError; external name '_ICAScannerOpenSession';
  1741. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1742. //------------------------------------------------------------------------------------------------------- ICAScannerCloseSession
  1743. {!
  1744. @struct ICAScannerCloseSessionPB
  1745. @field header
  1746. See description for ICAHeader. <->
  1747. @field sessionID
  1748. A session ID of the session to be closed. <--
  1749. }
  1750. type
  1751. ICAScannerCloseSessionPBPtr = ^ICAScannerCloseSessionPB;
  1752. ICAScannerCloseSessionPB = record
  1753. header: ICAHeader;
  1754. sessionID: ICAScannerSessionID;
  1755. end;
  1756. {!
  1757. @function ICAScannerCloseSession
  1758. @abstract
  1759. Use this API to close a session on a scanner device. For a camera device use the ICACloseSession API.
  1760. @discussion
  1761. This API closes an open session, allowing other clients to work with the scanner.
  1762. @param pb
  1763. A pointer to an <code><b>ICAScannerCloseSessionPB</b></code> parameter block.
  1764. @param completion
  1765. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAScannerCloseSession</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1766. @result
  1767. Returns an error code defined in ICAApplication.h
  1768. }
  1769. function ICAScannerCloseSession( var pb: ICAScannerCloseSessionPB; completion: ICACompletion ): ICAError; external name '_ICAScannerCloseSession';
  1770. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1771. //--------------------------------------------------------------------------------------------------------- ICAScannerInitialize
  1772. {!
  1773. @struct ICAScannerInitializePB
  1774. @field header
  1775. See description for ICAHeader. <->
  1776. @field sessionID
  1777. A session ID of the scanner to be initialized. <--
  1778. }
  1779. type
  1780. ICAScannerInitializePBPtr = ^ICAScannerInitializePB;
  1781. ICAScannerInitializePB = record
  1782. header: ICAHeader;
  1783. sessionID: ICAScannerSessionID;
  1784. end;
  1785. {!
  1786. @function ICAScannerInitialize
  1787. @abstract
  1788. Use this API to initialize a scanner device.
  1789. @discussion
  1790. After opening a session on a scanner device, use this API to set an initial state for the scanner.
  1791. @param pb
  1792. A pointer to an <code><b>ICAScannerInitializePB</b></code> parameter block.
  1793. @param completion
  1794. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAScannerInitialize</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1795. @result
  1796. Returns an error code defined in ICAApplication.h
  1797. }
  1798. function ICAScannerInitialize( var pb: ICAScannerInitializePB; completion: ICACompletion ): ICAError; external name '_ICAScannerInitialize';
  1799. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1800. //------------------------------------------------------------------------------------------------------ ICAScannerGetParameters
  1801. {!
  1802. @struct ICAScannerGetParametersPB
  1803. @field header
  1804. See description for ICAHeader. <->
  1805. @field sessionID
  1806. A session ID of the scanner whose parameters are being fetched. <--
  1807. @field theDict
  1808. A dictionary containing the parameters. -->
  1809. }
  1810. type
  1811. ICAScannerGetParametersPBPtr = ^ICAScannerGetParametersPB;
  1812. ICAScannerGetParametersPB = record
  1813. header: ICAHeader;
  1814. sessionID: ICAScannerSessionID;
  1815. theDict: CFMutableDictionaryRef;
  1816. end;
  1817. {!
  1818. @function ICAScannerGetParameters
  1819. @abstract
  1820. Use this API to get information about the scanner such as resolution, scanning area, etc.
  1821. @discussion
  1822. Use this API to get information about the scanner such as resolution, scanning area, etc.
  1823. @param pb
  1824. A pointer to an <code><b>ICAScannerGetParametersPB</b></code> parameter block.
  1825. @param completion
  1826. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAScannerGetParameters</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1827. @result
  1828. Returns an error code defined in ICAApplication.h
  1829. }
  1830. function ICAScannerGetParameters( var pb: ICAScannerGetParametersPB; completion: ICACompletion ): ICAError; external name '_ICAScannerGetParameters';
  1831. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1832. //------------------------------------------------------------------------------------------------------ ICAScannerSetParameters
  1833. {!
  1834. @struct ICAScannerSetParametersPB
  1835. @field header
  1836. See description for ICAHeader. <->
  1837. @field sessionID
  1838. A session ID of the scanner whose parameters are being set. <--
  1839. @field theDict
  1840. A dictionary containing the parameters. <--
  1841. }
  1842. type
  1843. ICAScannerSetParametersPBPtr = ^ICAScannerSetParametersPB;
  1844. ICAScannerSetParametersPB = record
  1845. header: ICAHeader;
  1846. sessionID: ICAScannerSessionID;
  1847. theDict: CFMutableDictionaryRef;
  1848. end;
  1849. {!
  1850. @function ICAScannerSetParameters
  1851. @abstract
  1852. Use this API to specify scan parameters that will be used when a scan is initiated via an ICAScannerStart.
  1853. @discussion
  1854. Use this API to specify scan parameters that will be used when a scan is initiated via an ICAScannerStart.
  1855. @param pb
  1856. A pointer to an <code><b>ICAScannerSetParametersPB</b></code> parameter block.
  1857. @param completion
  1858. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAScannerSetParameters</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1859. @result
  1860. Returns an error code defined in ICAApplication.h
  1861. }
  1862. function ICAScannerSetParameters( var pb: ICAScannerSetParametersPB; completion: ICACompletion ): ICAError; external name '_ICAScannerSetParameters';
  1863. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1864. //------------------------------------------------------------------------------------------------------------- ICAScannerStatus
  1865. {!
  1866. @struct ICAScannerStatusPB
  1867. @field header
  1868. See description for ICAHeader. <->
  1869. @field sessionID
  1870. A session ID of the scanner whose status is being fetched. <--
  1871. @field status
  1872. A status value. -->
  1873. }
  1874. type
  1875. ICAScannerStatusPBPtr = ^ICAScannerStatusPB;
  1876. ICAScannerStatusPB = record
  1877. header: ICAHeader;
  1878. sessionID: ICAScannerSessionID;
  1879. status: UInt32;
  1880. end;
  1881. {!
  1882. @function ICAScannerStatus
  1883. @abstract
  1884. Use this API to get information about the current status of the scanner.
  1885. @discussion
  1886. Use this API to get information about the current status of the scanner.
  1887. @param pb
  1888. A pointer to an <code><b>ICAScannerStatusPB</b></code> parameter block.
  1889. @param completion
  1890. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAScannerStatus</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1891. @result
  1892. Returns an error code defined in ICAApplication.h
  1893. }
  1894. function ICAScannerStatus( var pb: ICAScannerStatusPB; completion: ICACompletion ): ICAError; external name '_ICAScannerStatus';
  1895. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1896. //-------------------------------------------------------------------------------------------------------------- ICAScannerStart
  1897. {!
  1898. @struct ICAScannerStartPB
  1899. @field header
  1900. See description for ICAHeader. <->
  1901. @field sessionID
  1902. A session ID of the scanner that should start scanning. <--
  1903. }
  1904. type
  1905. ICAScannerStartPBPtr = ^ICAScannerStartPB;
  1906. ICAScannerStartPB = record
  1907. header: ICAHeader;
  1908. sessionID: ICAScannerSessionID;
  1909. end;
  1910. {!
  1911. @function ICAScannerStart
  1912. @abstract
  1913. Use this API start a scan based on the parameters that were specified in a previous ICAScannerSetParameters call.
  1914. @discussion
  1915. Use this API start a scan based on the parameters that were specified in a previous ICAScannerSetParameters call.
  1916. @param pb
  1917. A pointer to an <code><b>ICAScannerStartPB</b></code> parameter block.
  1918. @param completion
  1919. A pointer to a completion routine that will be invoked at the completion of <code><b>ICAScannerStart</b></code> function. Set this parameter to <code><b>NULL</b></code> to invoke this API synchronously.
  1920. @result
  1921. Returns an error code defined in ICAApplication.h
  1922. }
  1923. function ICAScannerStart( var pb: ICAScannerStartPB; completion: ICACompletion ): ICAError; external name '_ICAScannerStart';
  1924. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 *)
  1925. //------------------------------------------------------------------------------------------------------------------------------
  1926. //------------------------------------------------------------------------------------------------------------------------------
  1927. //------------------------------------------------------------------------------------------------------------------------------
  1928. {$endc} {TARGET_OS_MAC}
  1929. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1930. end.
  1931. {$endc} {not MACOSALLINCLUDE}