ICAApplication.pas 91 KB

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