Navigation.pas 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328
  1. {
  2. File: NavigationServices/Navigation.h
  3. Contains: Navigation Services Interfaces
  4. Version: NavigationServices-200~178
  5. Copyright: © 1996-2008 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$modeswitch cblocks}
  20. {$packenum 1}
  21. {$macro on}
  22. {$inline on}
  23. {$calling mwpascal}
  24. {$IFNDEF FPC_DOTTEDUNITS}
  25. unit Navigation;
  26. {$ENDIF FPC_DOTTEDUNITS}
  27. interface
  28. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  29. {$setc GAP_INTERFACES_VERSION := $0308}
  30. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  31. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  32. {$endc}
  33. {$ifc defined CPUPOWERPC and defined CPUI386}
  34. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  35. {$endc}
  36. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  37. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  38. {$endc}
  39. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  40. {$setc __ppc__ := 1}
  41. {$elsec}
  42. {$setc __ppc__ := 0}
  43. {$endc}
  44. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  45. {$setc __ppc64__ := 1}
  46. {$elsec}
  47. {$setc __ppc64__ := 0}
  48. {$endc}
  49. {$ifc not defined __i386__ and defined CPUI386}
  50. {$setc __i386__ := 1}
  51. {$elsec}
  52. {$setc __i386__ := 0}
  53. {$endc}
  54. {$ifc not defined __x86_64__ and defined CPUX86_64}
  55. {$setc __x86_64__ := 1}
  56. {$elsec}
  57. {$setc __x86_64__ := 0}
  58. {$endc}
  59. {$ifc not defined __arm__ and defined CPUARM}
  60. {$setc __arm__ := 1}
  61. {$elsec}
  62. {$setc __arm__ := 0}
  63. {$endc}
  64. {$ifc not defined __arm64__ and defined CPUAARCH64}
  65. {$setc __arm64__ := 1}
  66. {$elsec}
  67. {$setc __arm64__ := 0}
  68. {$endc}
  69. {$ifc defined cpu64}
  70. {$setc __LP64__ := 1}
  71. {$elsec}
  72. {$setc __LP64__ := 0}
  73. {$endc}
  74. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  75. {$error Conflicting definitions for __ppc__ and __i386__}
  76. {$endc}
  77. {$ifc defined __ppc__ and __ppc__}
  78. {$setc TARGET_CPU_PPC := TRUE}
  79. {$setc TARGET_CPU_PPC64 := FALSE}
  80. {$setc TARGET_CPU_X86 := FALSE}
  81. {$setc TARGET_CPU_X86_64 := FALSE}
  82. {$setc TARGET_CPU_ARM := FALSE}
  83. {$setc TARGET_CPU_ARM64 := FALSE}
  84. {$setc TARGET_OS_MAC := TRUE}
  85. {$setc TARGET_OS_IPHONE := FALSE}
  86. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  87. {$setc TARGET_OS_EMBEDDED := FALSE}
  88. {$elifc defined __ppc64__ and __ppc64__}
  89. {$setc TARGET_CPU_PPC := FALSE}
  90. {$setc TARGET_CPU_PPC64 := TRUE}
  91. {$setc TARGET_CPU_X86 := FALSE}
  92. {$setc TARGET_CPU_X86_64 := FALSE}
  93. {$setc TARGET_CPU_ARM := FALSE}
  94. {$setc TARGET_CPU_ARM64 := FALSE}
  95. {$setc TARGET_OS_MAC := TRUE}
  96. {$setc TARGET_OS_IPHONE := FALSE}
  97. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  98. {$setc TARGET_OS_EMBEDDED := FALSE}
  99. {$elifc defined __i386__ and __i386__}
  100. {$setc TARGET_CPU_PPC := FALSE}
  101. {$setc TARGET_CPU_PPC64 := FALSE}
  102. {$setc TARGET_CPU_X86 := TRUE}
  103. {$setc TARGET_CPU_X86_64 := FALSE}
  104. {$setc TARGET_CPU_ARM := FALSE}
  105. {$setc TARGET_CPU_ARM64 := FALSE}
  106. {$ifc defined iphonesim}
  107. {$setc TARGET_OS_MAC := FALSE}
  108. {$setc TARGET_OS_IPHONE := TRUE}
  109. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  110. {$elsec}
  111. {$setc TARGET_OS_MAC := TRUE}
  112. {$setc TARGET_OS_IPHONE := FALSE}
  113. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  114. {$endc}
  115. {$setc TARGET_OS_EMBEDDED := FALSE}
  116. {$elifc defined __x86_64__ and __x86_64__}
  117. {$setc TARGET_CPU_PPC := FALSE}
  118. {$setc TARGET_CPU_PPC64 := FALSE}
  119. {$setc TARGET_CPU_X86 := FALSE}
  120. {$setc TARGET_CPU_X86_64 := TRUE}
  121. {$setc TARGET_CPU_ARM := FALSE}
  122. {$setc TARGET_CPU_ARM64 := FALSE}
  123. {$ifc defined iphonesim}
  124. {$setc TARGET_OS_MAC := FALSE}
  125. {$setc TARGET_OS_IPHONE := TRUE}
  126. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  127. {$elsec}
  128. {$setc TARGET_OS_MAC := TRUE}
  129. {$setc TARGET_OS_IPHONE := FALSE}
  130. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  131. {$endc}
  132. {$setc TARGET_OS_EMBEDDED := FALSE}
  133. {$elifc defined __arm__ and __arm__}
  134. {$setc TARGET_CPU_PPC := FALSE}
  135. {$setc TARGET_CPU_PPC64 := FALSE}
  136. {$setc TARGET_CPU_X86 := FALSE}
  137. {$setc TARGET_CPU_X86_64 := FALSE}
  138. {$setc TARGET_CPU_ARM := TRUE}
  139. {$setc TARGET_CPU_ARM64 := FALSE}
  140. {$setc TARGET_OS_MAC := FALSE}
  141. {$setc TARGET_OS_IPHONE := TRUE}
  142. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  143. {$setc TARGET_OS_EMBEDDED := TRUE}
  144. {$elifc defined __arm64__ and __arm64__}
  145. {$setc TARGET_CPU_PPC := FALSE}
  146. {$setc TARGET_CPU_PPC64 := FALSE}
  147. {$setc TARGET_CPU_X86 := FALSE}
  148. {$setc TARGET_CPU_X86_64 := FALSE}
  149. {$setc TARGET_CPU_ARM := FALSE}
  150. {$setc TARGET_CPU_ARM64 := TRUE}
  151. {$ifc defined ios}
  152. {$setc TARGET_OS_MAC := FALSE}
  153. {$setc TARGET_OS_IPHONE := TRUE}
  154. {$setc TARGET_OS_EMBEDDED := TRUE}
  155. {$elsec}
  156. {$setc TARGET_OS_MAC := TRUE}
  157. {$setc TARGET_OS_IPHONE := FALSE}
  158. {$setc TARGET_OS_EMBEDDED := FALSE}
  159. {$endc}
  160. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  161. {$elsec}
  162. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  163. {$endc}
  164. {$ifc defined __LP64__ and __LP64__ }
  165. {$setc TARGET_CPU_64 := TRUE}
  166. {$elsec}
  167. {$setc TARGET_CPU_64 := FALSE}
  168. {$endc}
  169. {$ifc defined FPC_BIG_ENDIAN}
  170. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  171. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  172. {$elifc defined FPC_LITTLE_ENDIAN}
  173. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  174. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  175. {$elsec}
  176. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  177. {$endc}
  178. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  179. {$setc CALL_NOT_IN_CARBON := FALSE}
  180. {$setc OLDROUTINENAMES := FALSE}
  181. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  182. {$setc OPAQUE_UPP_TYPES := TRUE}
  183. {$setc OTCARBONAPPLICATION := TRUE}
  184. {$setc OTKERNEL := FALSE}
  185. {$setc PM_USE_SESSION_APIS := TRUE}
  186. {$setc TARGET_API_MAC_CARBON := TRUE}
  187. {$setc TARGET_API_MAC_OS8 := FALSE}
  188. {$setc TARGET_API_MAC_OSX := TRUE}
  189. {$setc TARGET_CARBON := TRUE}
  190. {$setc TARGET_CPU_68K := FALSE}
  191. {$setc TARGET_CPU_MIPS := FALSE}
  192. {$setc TARGET_CPU_SPARC := FALSE}
  193. {$setc TARGET_OS_UNIX := FALSE}
  194. {$setc TARGET_OS_WIN32 := FALSE}
  195. {$setc TARGET_RT_MAC_68881 := FALSE}
  196. {$setc TARGET_RT_MAC_CFM := FALSE}
  197. {$setc TARGET_RT_MAC_MACHO := TRUE}
  198. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  199. {$setc TYPE_BOOL := FALSE}
  200. {$setc TYPE_EXTENDED := FALSE}
  201. {$setc TYPE_LONGLONG := TRUE}
  202. {$IFDEF FPC_DOTTEDUNITS}
  203. uses MacOsApi.MacTypes,MacOsApi.AEDataModel,MacOsApi.CFBase,MacOsApi.QuickdrawTypes,MacOsApi.Finder,MacOsApi.Events,MacOsApi.AppleEvents,MacOsApi.Translation,MacOsApi.MacWindows,MacOsApi.CodeFragments,MacOsApi.MacErrors,MacOsApi.CFArray,MacOsApi.CFString;
  204. {$ELSE FPC_DOTTEDUNITS}
  205. uses MacTypes,AEDataModel,CFBase,QuickdrawTypes,Finder,Events,AppleEvents,Translation,MacWindows,CodeFragments,MacErrors,CFArray,CFString;
  206. {$ENDIF FPC_DOTTEDUNITS}
  207. {$endc} {not MACOSALLINCLUDE}
  208. {$ifc TARGET_OS_MAC}
  209. {$ALIGN MAC68K}
  210. {
  211. * Navigation Services
  212. *
  213. * Discussion:
  214. * In Mac OS X 10.5, Navigation Services has been reimplemented atop
  215. * Cocoa's NSSavePanel. A NavDialogRef may be cast to an
  216. * NSSavePanel* for put dialogs, an NSOpenPanel* for get and choose
  217. * dialogs and an NSAlert* for the various ask save changes dialogs.
  218. * Once cast to the appropriate Cocoa object you can call Cocoa APIs
  219. * on that object normally. For instance, the custom area of the Nav
  220. * dialog may be populated with Cocoa NSViews
  221. * [(NSSavePanel*)myNavDialogRef setAccesoryView:myNSView].
  222. * Exception: Once a dialog is created via the NavgationServices API
  223. * it must be invoked with NavDialogRun. Custom preview support is
  224. * no longer available on Mac OS X 10.5. NavPreview procedures are
  225. * no longer called, kNavCBAdjustPreview Nav event callback messages
  226. * are no longer sent and the NavCBRec previewRect field will always
  227. * be empty. Navigation Services now depends on QuickLook for
  228. * preview rendering. Clients may write a QuickLook plug-in to
  229. * generate custom previews for open dialogs as well as Finder and
  230. * Spotlight. Because a NavDialogRef is an Objective-C object
  231. * underneath, -release or CFRelease may be called on it instead of
  232. * NavDialogDispose.
  233. }
  234. type
  235. NavAskSaveChangesAction = UInt32;
  236. const
  237. { input action codes for NavAskSaveChanges() }
  238. kNavSaveChangesClosingDocument = 1;
  239. kNavSaveChangesQuittingApplication = 2;
  240. kNavSaveChangesOther = 0;
  241. type
  242. NavAskSaveChangesResult = UInt32;
  243. const
  244. { result codes for NavAskSaveChanges() }
  245. kNavAskSaveChangesSave = 1;
  246. kNavAskSaveChangesCancel = 2;
  247. kNavAskSaveChangesDontSave = 3;
  248. type
  249. NavAskDiscardChangesResult = UInt32;
  250. const
  251. { result codes for NavAskDiscardChanges() }
  252. kNavAskDiscardChanges = 1;
  253. kNavAskDiscardChangesCancel = 2;
  254. type
  255. NavFilterModes = SInt16;
  256. const
  257. { which elements are being filtered for objects: }
  258. kNavFilteringBrowserList = 0;
  259. kNavFilteringFavorites = 1;
  260. kNavFilteringRecents = 2;
  261. kNavFilteringShortCutVolumes = 3;
  262. kNavFilteringLocationPopup = 4; { for v1.1 or greater }
  263. const
  264. kNavFileOrFolderVersion = 1;
  265. type
  266. NavFileOrFolderInfoPtr = ^NavFileOrFolderInfo;
  267. NavFileOrFolderInfo = record
  268. version: UInt16;
  269. isFolder: Boolean;
  270. visible: Boolean;
  271. creationDate: UInt32;
  272. modificationDate: UInt32;
  273. case SInt16 of
  274. 0: (
  275. locked: Boolean; { file is locked }
  276. resourceOpen: Boolean; { resource fork is opened }
  277. dataOpen: Boolean; { data fork is opened }
  278. reserved1: Boolean;
  279. dataSize: ByteCount; { size of the data fork }
  280. resourceSize: ByteCount; { size of the resource fork }
  281. finderInfo: FInfo; { more file info: }
  282. finderXInfo: FXInfo;
  283. );
  284. 1: (
  285. shareable: Boolean;
  286. sharePoint: Boolean;
  287. mounted: Boolean;
  288. readable: Boolean;
  289. writeable: Boolean;
  290. reserved2: Boolean;
  291. numberOfFiles: ItemCount;
  292. finderDInfo: DInfo;
  293. finderDXInfo: DXInfo;
  294. folderType: OSType; { package type, For struct version >= 1 }
  295. folderCreator: OSType; { package creator, For struct version >= 1 }
  296. reserved3: packed array [0..205] of AnsiChar;
  297. );
  298. end;
  299. NavEventDataInfoPtr = ^NavEventDataInfo;
  300. NavEventDataInfo = record
  301. case SInt16 of
  302. 0: (
  303. event: EventRecordPtr; { for event processing }
  304. );
  305. 1: (
  306. param: UnivPtr; { points to event specific data }
  307. );
  308. end;
  309. type
  310. NavEventDataPtr = ^NavEventData;
  311. NavEventData = record
  312. eventDataParms: NavEventDataInfo; { the event data }
  313. itemHit: SInt16; { the dialog item number, for v1.1 or greater }
  314. end;
  315. {
  316. * NavDialogRef
  317. *
  318. * Summary:
  319. * Opaque Navigation Services dialog identifier
  320. *
  321. * Discussion:
  322. * A NavDialogRef is an opaque reference to an instance of a
  323. * Navigation Services dialog. A new NavDialogRef is returned from
  324. * any of the NavCreate*Dialog functions and is later disposed with
  325. * the NavDialogDispose function. NavDialogRef is the new name for
  326. * the NavContext type, and thus when a client's event proc is
  327. * called, the value of the NavCBRec.context field is the same as
  328. * the NavDialogRef returned from the corresponding
  329. * NavCreate*Dialog. A NavDialogRef is distinct from, and is not
  330. * interchangable with, a Dialog Manager DialogRef.
  331. }
  332. type
  333. NavDialogRef = ^__NavDialog; { an opaque type }
  334. __NavDialog = record end;
  335. NavDialogRefPtr = ^NavDialogRef; { when a var xx:NavDialogRef parameter can be nil, it is changed to xx: NavDialogRefPtr }
  336. {$ifc CALL_NOT_IN_CARBON}
  337. { NavContext is the old name for NavDialogRef }
  338. NavContext = NavDialogRef;
  339. {$endc} {CALL_NOT_IN_CARBON}
  340. {
  341. * NavUserAction
  342. *
  343. * Summary:
  344. * Indicates an action taken by the user
  345. *
  346. * Discussion:
  347. * When the user clicks a button at the bottom of a Nav Services
  348. * dialog (or makes an equivalent mouse or key gesture), a
  349. * kNavCBUserAction event is sent to the client's event proc
  350. * indicating which action was taken. Often, the action also
  351. * dismisses the dialog. User action events are only generated when
  352. * using dialogs created from a NavCreate*Dialog function. In the
  353. * special case of a modeless GetFile dialog (supported only on Mac
  354. * OS X), the user can option-click on the open button to keep the
  355. * dialog from being dismissed, but the kNavCBUserAction event is
  356. * sent so the client can get the reply record and open the selected
  357. * files.
  358. }
  359. type
  360. NavUserAction = UInt32;
  361. const
  362. {
  363. * No action taken. The dialog is still running or was terminated
  364. * programmatically.
  365. }
  366. kNavUserActionNone = 0;
  367. {
  368. * The user cancelled the dialog.
  369. }
  370. kNavUserActionCancel = 1;
  371. {
  372. * The user clicked the Open button in the GetFile dialog.
  373. }
  374. kNavUserActionOpen = 2;
  375. {
  376. * The user clicked the Save button in the PutFile dialog.
  377. }
  378. kNavUserActionSaveAs = 3;
  379. {
  380. * The user clicked the Choose button in the ChooseFile,
  381. * ChooseFolder, ChooseVolume or ChooseObject dialogs.
  382. }
  383. kNavUserActionChoose = 4;
  384. {
  385. * The user clicked the New Folder button in the New Folder dialog.
  386. }
  387. kNavUserActionNewFolder = 5;
  388. {
  389. * The user clicked the Save button in an AskSaveChanges dialog.
  390. }
  391. kNavUserActionSaveChanges = 6;
  392. {
  393. * The user clicked the Don't Save button in an AskSaveChanges dialog.
  394. }
  395. kNavUserActionDontSaveChanges = 7;
  396. {
  397. * The user clicked the Discard button in the AskDiscardChanges
  398. * dialog.
  399. }
  400. kNavUserActionDiscardChanges = 8;
  401. {
  402. * The user clicked the Review Unsaved button in the
  403. * AskReviewDocuments dialog (used only on Mac OS X).
  404. }
  405. kNavUserActionReviewDocuments = 9;
  406. {
  407. * The user clicked the Discard Changes button in the
  408. * AskReviewDocuments dialog (used only on Mac OS X).
  409. }
  410. kNavUserActionDiscardDocuments = 10;
  411. const
  412. kNavCBRecVersion = 1;
  413. {
  414. * NavCBRec
  415. *
  416. * Summary:
  417. * A structure passed to event and preview callbacks
  418. *
  419. * Discussion:
  420. * The NavCBRec structure is passed to the client's event proc or
  421. * custom preview proc. It provides information that is specific to
  422. * each event type. New for Carbon: the userAction field.
  423. }
  424. type
  425. NavCBRec = record
  426. {
  427. * The version of the struct (currently 1)
  428. }
  429. version: UInt16;
  430. {
  431. * The NavDialogRef this callback with which this call is associated
  432. }
  433. context: NavDialogRef;
  434. {
  435. * The dialog's window
  436. }
  437. window: WindowRef;
  438. {
  439. * The custom control area rectangle (window coordinates)
  440. }
  441. customRect: Rect;
  442. {
  443. * The custom preview area rectangle (window coordinates)
  444. }
  445. previewRect: Rect;
  446. {
  447. * The event-specific data, including the EventRecord, if any
  448. }
  449. eventData: NavEventData;
  450. {
  451. * The action taken by the user that generated a kNavCBUserAction
  452. * event (Carbon dialogs only)
  453. }
  454. userAction: NavUserAction;
  455. {
  456. * Reserved for future use
  457. }
  458. reserved: array [0..217] of SInt8;
  459. end;
  460. NavCBRecPtr = ^NavCBRec;
  461. {
  462. * NavEventCallbackMessage
  463. *
  464. * Summary:
  465. * Identifies the message type being sent to the client's event proc
  466. }
  467. type
  468. NavEventCallbackMessage = SInt32;
  469. const
  470. {
  471. * An OS event has occurred. A pointer to the EventRecord is in the
  472. * eventData.eventDataParms.event field of the NavCBRec.
  473. }
  474. kNavCBEvent = 0;
  475. {
  476. * Negotiate for custom control space. Client can set change the
  477. * customRect field in the NavCBRec to create space for a custom
  478. * area. Nav Services will continue to send the kNavCBCustomize
  479. * message until the client leaves the customRect field unchanged.
  480. }
  481. kNavCBCustomize = 1;
  482. {
  483. * This message is sent after custom area negotiation, just before
  484. * the dialog is made visible. Add your custom controls when you
  485. * receive this message.
  486. }
  487. kNavCBStart = 2;
  488. {
  489. * This is the last message sent, after the dialog has been hidden.
  490. }
  491. kNavCBTerminate = 3;
  492. {
  493. * Sent when the dialog has been resized. Check the customRect and or
  494. * previewRect values to see if any relayout is needed. Nav Services
  495. * automatically moves controls in the custom area.
  496. }
  497. kNavCBAdjustRect = 4;
  498. {
  499. * The target folder of the dialog has changed. The
  500. * NavCBRec.eventData.eventDataParms.param field is an AEDesc*
  501. * containing an descriptor of the new location (ususally an FSSpec
  502. * or an FSRef).
  503. }
  504. kNavCBNewLocation = 5;
  505. {
  506. * The target folder has changed to the user's desktop folder.
  507. }
  508. kNavCBShowDesktop = 6;
  509. {
  510. * The user has selected or deselected a file or folder. The
  511. * NavCBRec.eventData.eventDataParms.param field is an AEDescList*
  512. * identifying the currently selected items.
  513. }
  514. kNavCBSelectEntry = 7;
  515. {
  516. * The value of the Show/Format popup menu has changed. The
  517. * NavCBRec.eventData.eventDataParms.param is a NavMenuItemSpec*
  518. * identifying the menu item selected. If the dialog was created
  519. * using the Carbon-only NavCreate*Dialog APIs, then the menuType
  520. * field of the NavMenuItemSpec is set to the index into the client's
  521. * CFArray of popupExtension strings (see NavDialogCreationOptions).
  522. * In these cases, the menuCreator field of the NavManuItemSpec is
  523. * set to kNavClientPopupExtensionTag. For system supplied menu items
  524. * it will be set to 0. A kNavCBPopupMenuSelect message is also sent
  525. * as the dialog opens to notify the client of the initial menu
  526. * setting.
  527. }
  528. kNavCBPopupMenuSelect = 8;
  529. {
  530. * Sent when the user has accepted (Open, Save, etc.).
  531. }
  532. kNavCBAccept = 9;
  533. {
  534. * Sent when the user has cancelled the dialog.
  535. }
  536. kNavCBCancel = 10;
  537. {
  538. * ** NOT SENT STARTING IN 10.5 *** The custom preview area state has
  539. * changed. The NavCBRec.eventData.eventDataParms.param is a Boolean*
  540. * set to true if the preview area is visible or false if it is not.
  541. }
  542. kNavCBAdjustPreview = 11;
  543. {
  544. * The user has taken one of the actions described in the
  545. * NavUserAction definition. The action may or may not dismiss the
  546. * dialog. The NavCBRec.userAction field indicates which action was
  547. * taken (Carbon dialogs only).
  548. }
  549. kNavCBUserAction = 12;
  550. {
  551. * The user has opened a folder or chosen a file. The client can
  552. * block navigation or dismissal by setting the appropriate action
  553. * state with the kNavCtlSetActionState NavCustomControl selector.
  554. }
  555. kNavCBOpenSelection = $80000000;
  556. type
  557. NavCallBackUserData = UnivPtr;
  558. { for events and customization: }
  559. type
  560. NavEventProcPtr = procedure( callBackSelector: NavEventCallbackMessage; callBackParms: NavCBRecPtr; callBackUD: UnivPtr );
  561. { for preview support: }
  562. type
  563. NavPreviewProcPtr = function( callBackParms: NavCBRecPtr; callBackUD: UnivPtr ): Boolean;
  564. { filtering callback information: }
  565. type
  566. NavObjectFilterProcPtr = function( var theItem: AEDesc; info: NavFileOrFolderInfoPtr; callBackUD: UnivPtr; filterMode: NavFilterModes ): Boolean;
  567. NavEventUPP = NavEventProcPtr;
  568. NavPreviewUPP = NavPreviewProcPtr;
  569. NavObjectFilterUPP = NavObjectFilterProcPtr;
  570. {
  571. * NewNavEventUPP()
  572. *
  573. * Availability:
  574. * Mac OS X: in version 10.0 and later in Carbon.framework
  575. * CarbonLib: in CarbonLib 1.0 and later
  576. * Non-Carbon CFM: available as macro/inline
  577. }
  578. function NewNavEventUPP( userRoutine: NavEventProcPtr ): NavEventUPP; external name '_NewNavEventUPP';
  579. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  580. {
  581. * NewNavPreviewUPP()
  582. *
  583. * Availability:
  584. * Mac OS X: in version 10.0 and later in Carbon.framework
  585. * CarbonLib: in CarbonLib 1.0 and later
  586. * Non-Carbon CFM: available as macro/inline
  587. }
  588. function NewNavPreviewUPP( userRoutine: NavPreviewProcPtr ): NavPreviewUPP; external name '_NewNavPreviewUPP';
  589. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  590. {
  591. * NewNavObjectFilterUPP()
  592. *
  593. * Availability:
  594. * Mac OS X: in version 10.0 and later in Carbon.framework
  595. * CarbonLib: in CarbonLib 1.0 and later
  596. * Non-Carbon CFM: available as macro/inline
  597. }
  598. function NewNavObjectFilterUPP( userRoutine: NavObjectFilterProcPtr ): NavObjectFilterUPP; external name '_NewNavObjectFilterUPP';
  599. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  600. {
  601. * DisposeNavEventUPP()
  602. *
  603. * Availability:
  604. * Mac OS X: in version 10.0 and later in Carbon.framework
  605. * CarbonLib: in CarbonLib 1.0 and later
  606. * Non-Carbon CFM: available as macro/inline
  607. }
  608. procedure DisposeNavEventUPP( userUPP: NavEventUPP ); external name '_DisposeNavEventUPP';
  609. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  610. {
  611. * DisposeNavPreviewUPP()
  612. *
  613. * Availability:
  614. * Mac OS X: in version 10.0 and later in Carbon.framework
  615. * CarbonLib: in CarbonLib 1.0 and later
  616. * Non-Carbon CFM: available as macro/inline
  617. }
  618. procedure DisposeNavPreviewUPP( userUPP: NavPreviewUPP ); external name '_DisposeNavPreviewUPP';
  619. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  620. {
  621. * DisposeNavObjectFilterUPP()
  622. *
  623. * Availability:
  624. * Mac OS X: in version 10.0 and later in Carbon.framework
  625. * CarbonLib: in CarbonLib 1.0 and later
  626. * Non-Carbon CFM: available as macro/inline
  627. }
  628. procedure DisposeNavObjectFilterUPP( userUPP: NavObjectFilterUPP ); external name '_DisposeNavObjectFilterUPP';
  629. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  630. {
  631. * InvokeNavEventUPP()
  632. *
  633. * Availability:
  634. * Mac OS X: in version 10.0 and later in Carbon.framework
  635. * CarbonLib: in CarbonLib 1.0 and later
  636. * Non-Carbon CFM: available as macro/inline
  637. }
  638. procedure InvokeNavEventUPP( callBackSelector: NavEventCallbackMessage; callBackParms: NavCBRecPtr; callBackUD: UnivPtr; userUPP: NavEventUPP ); external name '_InvokeNavEventUPP';
  639. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  640. {
  641. * InvokeNavPreviewUPP()
  642. *
  643. * Availability:
  644. * Mac OS X: in version 10.0 and later in Carbon.framework
  645. * CarbonLib: in CarbonLib 1.0 and later
  646. * Non-Carbon CFM: available as macro/inline
  647. }
  648. function InvokeNavPreviewUPP( callBackParms: NavCBRecPtr; callBackUD: UnivPtr; userUPP: NavPreviewUPP ): Boolean; external name '_InvokeNavPreviewUPP';
  649. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  650. {
  651. * InvokeNavObjectFilterUPP()
  652. *
  653. * Availability:
  654. * Mac OS X: in version 10.0 and later in Carbon.framework
  655. * CarbonLib: in CarbonLib 1.0 and later
  656. * Non-Carbon CFM: available as macro/inline
  657. }
  658. function InvokeNavObjectFilterUPP( var theItem: AEDesc; info: UnivPtr; callBackUD: UnivPtr; filterMode: NavFilterModes; userUPP: NavObjectFilterUPP ): Boolean; external name '_InvokeNavObjectFilterUPP';
  659. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  660. type
  661. NavCustomControlMessage = SInt32;
  662. const
  663. kNavCtlShowDesktop = 0; { show desktop, parms = nil }
  664. kNavCtlSortBy = 1; { sort key field, parms->NavSortKeyField }
  665. kNavCtlSortOrder = 2; { sort order, parms->NavSortOrder }
  666. kNavCtlScrollHome = 3; { scroll list home, parms = nil }
  667. kNavCtlScrollEnd = 4; { scroll list end, parms = nil }
  668. kNavCtlPageUp = 5; { page list up, parms = nil }
  669. kNavCtlPageDown = 6; { page list down, parms = nil }
  670. kNavCtlGetLocation = 7; { get current location, parms<-AEDesc* }
  671. kNavCtlSetLocation = 8; { set current location, parms->AEDesc* }
  672. kNavCtlGetSelection = 9; { get current selection, parms<-AEDescList* }
  673. kNavCtlSetSelection = 10; { set current selection, parms->AEDescList* }
  674. kNavCtlShowSelection = 11; { make selection visible, parms = nil }
  675. kNavCtlOpenSelection = 12; { open view of selection, parms = nil }
  676. kNavCtlEjectVolume = 13; { eject volume, parms->vRefNum }
  677. kNavCtlNewFolder = 14; { create a new folder, parms->StringPtr }
  678. kNavCtlCancel = 15; { cancel dialog, parms = nil }
  679. kNavCtlAccept = 16; { accept dialog default, parms = nil }
  680. kNavCtlIsPreviewShowing = 17; { query preview status, parms<-Boolean }
  681. kNavCtlAddControl = 18; { add one control to dialog, parms->ControlHandle }
  682. kNavCtlAddControlList = 19; { add control list to dialog, parms->Handle (DITL rsrc) }
  683. kNavCtlGetFirstControlID = 20; { get 1st control ID, parms<-UInt16 }
  684. kNavCtlSelectCustomType = 21; { select a custom menu item parms->NavMenuItemSpec* }
  685. kNavCtlSelectAllType = 22; { select an "All" menu item parms->SInt16 }
  686. kNavCtlGetEditFileName = 23; { get save dlog's file name parms<-StringPtr }
  687. kNavCtlSetEditFileName = 24; { set save dlog's file name parms->StringPtr }
  688. kNavCtlSelectEditFileName = 25; { select save dlog file name parms->ControlEditTextSelectionRec*, v1.1 or greater }
  689. kNavCtlBrowserSelectAll = 26; { re-scan the browser list parms = nil, v2.0 or greater }
  690. kNavCtlGotoParent = 27; { navigate to parent parms = nil, v2.0 or greater }
  691. kNavCtlSetActionState = 28; { restrict navigation parms->NavActionState (flags), v2.0 or greater }
  692. kNavCtlBrowserRedraw = 29; { rescan browser list parms = nil, v2.0 or greater }
  693. kNavCtlTerminate = 30; { terminate/dismiss dialog parms = nil, v2.0 or greater }
  694. type
  695. NavActionState = UInt32;
  696. const
  697. kNavNormalState = $00000000; { normal/default state }
  698. kNavDontOpenState = $00000001; { disallow opening files/folders }
  699. kNavDontSaveState = $00000002; { disallow saving files }
  700. kNavDontChooseState = $00000004; { disallow choosing objects }
  701. kNavDontNewFolderState = $00000010; { disallow creating new folders }
  702. type
  703. NavPopupMenuItem = UInt16;
  704. const
  705. kNavAllKnownFiles = 0;
  706. kNavAllReadableFiles = 1;
  707. kNavAllFiles = 2;
  708. type
  709. NavSortKeyField = UInt16;
  710. const
  711. kNavSortNameField = 0;
  712. kNavSortDateField = 1;
  713. type
  714. NavSortOrder = UInt16;
  715. const
  716. kNavSortAscending = 0;
  717. kNavSortDescending = 1;
  718. type
  719. NavDialogOptionFlags = OptionBits;
  720. const
  721. kNavDefaultNavDlogOptions = $000000E4; { use defaults for all the options }
  722. kNavNoTypePopup = $00000001; { don't show file type/extension popup on Open/Save }
  723. kNavDontAutoTranslate = $00000002; { don't automatically translate on Open }
  724. kNavDontAddTranslateItems = $00000004; { don't add translation choices on Open/Save }
  725. kNavAllFilesInPopup = $00000010; { "All Files" menu item in the type popup on Open }
  726. kNavAllowStationery = $00000020; { Deprecated: Not available in Mac OS X }
  727. kNavAllowPreviews = $00000040; { allow preview to show }
  728. kNavAllowMultipleFiles = $00000080; { allow multiple items to be selected }
  729. kNavAllowInvisibleFiles = $00000100; { allow invisible items to be shown }
  730. kNavDontResolveAliases = $00000200; { don't resolve aliases }
  731. kNavSelectDefaultLocation = $00000400; { make the default location the browser selection }
  732. kNavSelectAllReadableItem = $00000800; { make the dialog select "All Readable Documents" on open }
  733. kNavSupportPackages = $00001000; { recognize file system packages, v2.0 or greater }
  734. kNavAllowOpenPackages = $00002000; { allow opening of packages, v2.0 or greater }
  735. kNavDontAddRecents = $00004000; { don't add chosen objects to the recents list, v2.0 or greater }
  736. kNavDontUseCustomFrame = $00008000; { don't draw the custom area bevel frame, v2.0 or greater }
  737. kNavDontConfirmReplacement = $00010000; { don't show the "Replace File?" alert on save conflict, v3.0 or greater }
  738. kNavPreserveSaveFileExtension = $00020000; { extension in default file name is preserved between dialog invocations and initially hidden, v3.1 or greater }
  739. type
  740. NavTranslationOptions = UInt32;
  741. const
  742. kNavTranslateInPlace = 0; { translate in place, replacing translation source file (default for Save) }
  743. kNavTranslateCopy = 1; { translate to a copy of the source file (default for Open) }
  744. const
  745. kNavMenuItemSpecVersion = 0;
  746. type
  747. NavMenuItemSpec = record
  748. version: UInt16;
  749. menuCreator: OSType;
  750. menuType: OSType;
  751. menuItemName: Str255;
  752. reserved: packed array [0..244] of AnsiChar;
  753. end;
  754. type
  755. NavMenuItemSpecArray = array [0..0] of NavMenuItemSpec;
  756. NavMenuItemSpecArrayPtr = ^NavMenuItemSpecArray;
  757. NavMenuItemSpecArrayHandle = ^NavMenuItemSpecArrayPtr;
  758. NavMenuItemSpecPtr = ^NavMenuItemSpec;
  759. NavMenuItemSpecHandle = ^NavMenuItemSpecPtr;
  760. const
  761. kNavGenericSignature = FourCharCode('****');
  762. const
  763. kNavClientPopupExtensionTag = FourCharCode('extn');
  764. type
  765. NavTypeList = record
  766. componentSignature: OSType_fix;
  767. reserved: SInt16;
  768. osTypeCount: SInt16;
  769. osType: array [0..0] of OSType_fix;
  770. end;
  771. NavTypeListPtr = ^NavTypeList;
  772. type
  773. NavTypeListHandle = ^NavTypeListPtr;
  774. const
  775. kNavReplyRecordVersion = 2;
  776. {
  777. * NavReplyRecord
  778. *
  779. * Summary:
  780. * A structure describing the results of a Nav Services dialog
  781. *
  782. * Discussion:
  783. * A reply record is the result of a Nav Services file dialog. Using
  784. * the older API, which is always modal, the client passes the
  785. * address of a reply record when invoking the dialog. In the Carbon
  786. * API, dialogs may also be window modal or modeless, so the client
  787. * requests the reply record by calling NavDialogGetReply when a
  788. * kNavCBUserAction event is received. Either way, a reply record
  789. * should be disposed of using NavDisposeReply.
  790. }
  791. type
  792. NavReplyRecordPtr = ^NavReplyRecord;
  793. NavReplyRecord = record
  794. {
  795. * The version of the structure. The first public version of the
  796. * structure was version 0. Fields added after version 0, starting
  797. * with the saveFileName field, are noted below.
  798. }
  799. version: UInt16;
  800. {
  801. * True if the reply contains a non-null selection
  802. }
  803. validRecord: Boolean;
  804. {
  805. * True if this reply is from a PutFile dialog and the file to be
  806. * saved already exists and needs to be replaced. The user has
  807. * already been warned unless the kNavDontConfirmReplacement option
  808. * flag is used.
  809. }
  810. replacing: Boolean;
  811. {
  812. * True if this reply is from a PutFile dialog and the user wants to
  813. * save the file as stationery.
  814. }
  815. isStationery: Boolean;
  816. {
  817. * True if translation was performed on the file(s) to be opened or
  818. * if transtlation will be needed on the file to be saved.
  819. }
  820. translationNeeded: Boolean;
  821. {
  822. * For GetFile or Choose dialogs, a list of items chosen by the user.
  823. * For the older NavPutFile dialog, a list containing one item: an
  824. * FSSpec of the file to be saved. ** IMPORTANT NOTE *** For the new
  825. * Carbon-only PutFile dialog created with NavCreatePutFileDialog,
  826. * the selection is a list containing one item: the DIRECTORY where
  827. * the file is to be saved. The file name is obtained from the
  828. * saveFileName field. When using the original modal API, each
  829. * descriptor will contain an FSSpec (typeFSS). When using the new
  830. * Carbon-only dialogs created via the NavCreate*Dialog functions,
  831. * each descriptor could contain either an FSSpec (typeFSS, used on
  832. * Mac OS 8 or 9) or an FSRef (typeFSRef, used on Mac OS X). This
  833. * divergence is caused by the need to use FSRef (for Unicode/HFS+
  834. * support) on Mac OS X, while being unable to provide FSRefs on Mac
  835. * OS 8.6.
  836. }
  837. selection: AEDescList;
  838. {
  839. * For NavPutFile: the script system associated with the name of the
  840. * file to be saved.
  841. }
  842. keyScript: ScriptCode;
  843. {
  844. * A handle to an array of type FileTranslationSpec. Each array entry
  845. * corresponds to an item in the selection and describes the
  846. * translation that was performed (GetFile) or needs to be performed
  847. * (PutFile) on that item.
  848. }
  849. fileTranslation: FileTranslationSpecArrayHandle;
  850. {
  851. * Reserved for private use.
  852. }
  853. reserved1: UInt32;
  854. {
  855. * Carbon PutFile dialog only: the name of the file to be saved. This
  856. * field contains the true file name to saved, even if the extension
  857. * will be hidden from the user. This field was added in structure
  858. * version 1.
  859. }
  860. saveFileName: CFStringRef;
  861. {
  862. * The extension on the name of the saved file should be hidden. Once
  863. * the file has been saved, the client should call NavCompleteSave.
  864. * NavCompleteSave will take care of hiding the extension on the
  865. * file. However, the client needs to know that the extension is
  866. * hidden so that it can display the document name correctly in the
  867. * UI, such as in window titles and menus. This field is only used if
  868. * the client has r equested extension preservation using the
  869. * kNavPreserveSaveFileExtension dialog option flag. This field was
  870. * added in structure version 2.
  871. }
  872. saveFileExtensionHidden: Boolean;
  873. {
  874. * Reserved for future use.
  875. }
  876. reserved2: UInt8;
  877. {
  878. * Reserved for future use.
  879. }
  880. reserved: array [0..224] of SInt8;
  881. end;
  882. {$ifc not TARGET_CPU_64}
  883. {
  884. * NavCompleteSave()
  885. *
  886. * Availability:
  887. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  888. * CarbonLib: in CarbonLib 1.0 and later
  889. * Non-Carbon CFM: in NavigationLib 1.0 and later
  890. }
  891. function NavCompleteSave( const (*var*) reply: NavReplyRecord; howToTranslate: NavTranslationOptions ): OSErr; external name '_NavCompleteSave';
  892. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  893. {
  894. * NavCustomControl()
  895. *
  896. * Availability:
  897. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  898. * CarbonLib: in CarbonLib 1.0 and later
  899. * Non-Carbon CFM: in NavigationLib 1.0 and later
  900. }
  901. function NavCustomControl( dialog: NavDialogRef; selector: NavCustomControlMessage; parms: UnivPtr ): OSErr; external name '_NavCustomControl';
  902. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  903. {
  904. * NavCreatePreview() *** DEPRECATED ***
  905. *
  906. * Availability:
  907. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  908. * CarbonLib: in CarbonLib 1.0 and later
  909. * Non-Carbon CFM: in NavigationLib 2.0 and later
  910. }
  911. function NavCreatePreview( var theObject: AEDesc; previewDataType: OSType; previewData: {const} UnivPtr; previewDataSize: Size ): OSErr; external name '_NavCreatePreview';
  912. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  913. {
  914. * NavDisposeReply()
  915. *
  916. * Availability:
  917. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  918. * CarbonLib: in CarbonLib 1.0 and later
  919. * Non-Carbon CFM: in NavigationLib 1.0 and later
  920. }
  921. function NavDisposeReply( var reply: NavReplyRecord ): OSErr; external name '_NavDisposeReply';
  922. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  923. {$endc} {not TARGET_CPU_64}
  924. { Carbon API }
  925. { Includes support for Unicode and long file names (where available). }
  926. const
  927. kNavDialogCreationOptionsVersion = 0;
  928. {
  929. * NavDialogCreationOptions
  930. *
  931. * Summary:
  932. * Options used to control the appearance and operation of a Nav
  933. * Services dialog
  934. *
  935. * Discussion:
  936. * NavDialogCreationOptions is a preferred replacement for
  937. * NavDialogOptions. The new structure uses CFStrings in place of
  938. * Pascal strings, and adds fields for setting the dialog modality
  939. * and the parent window (for sheet dialogs). A
  940. * NavDialogCreationOptions structure can be initialized using
  941. * NavGetDefaultDialogCreationOptions. Each of the NavCreate*Dialog
  942. * functions accepts a pointer to the client's
  943. * NavDialogCreationOptions structure.
  944. }
  945. type
  946. NavDialogCreationOptionsPtr = ^NavDialogCreationOptions;
  947. NavDialogCreationOptions = record
  948. {
  949. * The version of the struture. Currently, the only valid version is
  950. * 0, containing all the fields described here.
  951. }
  952. version: UInt16;
  953. {
  954. * Options for the dialog. See NavDialogOptionFlags for a description
  955. * of each option.
  956. }
  957. optionFlags: NavDialogOptionFlags;
  958. {
  959. * The screen position at which to place the upper left corner of the
  960. * dialog, in global coordinates. Specify (-1, -1) to use the default
  961. * (persistent) location. Ignored for sheet dialogs.
  962. }
  963. location: Point;
  964. {
  965. * The user-readable name of the client, usually the name of the
  966. * current application. This value is used to construct the default
  967. * window title in the file dialogs, and the message text in the Ask
  968. * dialogs. On Mac OS 9 and earlier, this value is used as a key to
  969. * store persistent per-client dialog settings, so it's always a good
  970. * idea to set this field to a non-NULL value.
  971. }
  972. clientName: CFStringRef;
  973. {
  974. * The custom title for the dialog window. Specify NULL to use the
  975. * default title.
  976. }
  977. windowTitle: CFStringRef;
  978. {
  979. * The custom label for the default (Open/Save/Choose) button.
  980. * Specify NULL to use the default label.
  981. }
  982. actionButtonLabel: CFStringRef;
  983. {
  984. * The custom label for the Cancel button. Specify NULL to use the
  985. * default label.
  986. }
  987. cancelButtonLabel: CFStringRef;
  988. {
  989. * The initial value appearing in the edit text field for the file
  990. * name to be saved (PutFile, NavAskSaveChanges only).
  991. }
  992. saveFileName: CFStringRef;
  993. {
  994. * For the file dialogs, a banner message appearing across the top of
  995. * the dialog. Specify NULL to provide no banner message. For the Ask
  996. * alerts, a custom message to replace the default message.
  997. }
  998. message: CFStringRef;
  999. {
  1000. * A key to uniquely identify the dialog's usage context within the
  1001. * application. If an application uses the same class of dialog (e.g.
  1002. * GetFile or ChooseFile) for more than one purpose, set this field
  1003. * to a unique value for each usage in order to give each dialog its
  1004. * own persistent settings (e.g. screen rectangle, starting target
  1005. * folder).
  1006. }
  1007. preferenceKey: UInt32;
  1008. {
  1009. * A CFArray of CFStrings. The strings are added as menu items to the
  1010. * Show or Format popup menus in the GetFile or PutFile dialogs,
  1011. * respectively.
  1012. }
  1013. popupExtension: CFArrayRef;
  1014. {
  1015. * The modality in which to present the dialog. The default modality
  1016. * for all dialogs is kWindowModalityAppModal. If
  1017. * kWindowModalityWindowModal is specified, then a valid parentWindow
  1018. * is required.
  1019. }
  1020. modality: WindowModality;
  1021. {
  1022. * The window to which a window-modal (sheet) dialog is to be
  1023. * attached.
  1024. }
  1025. parentWindow: WindowRef;
  1026. {
  1027. * Reserved for future use.
  1028. }
  1029. reserved: array [0..15] of SInt8;
  1030. end;
  1031. {$ifc not TARGET_CPU_64}
  1032. {
  1033. * NavGetDefaultDialogCreationOptions()
  1034. *
  1035. * Summary:
  1036. * Initialize the input structure to default values
  1037. *
  1038. * Discussion:
  1039. * Provided as a convenience to obtain the preferred default options
  1040. * for use in creating any Nav Services dialog.
  1041. *
  1042. * Parameters:
  1043. *
  1044. * outOptions:
  1045. * A pointer to the client-allocated options structure to
  1046. * initialize
  1047. *
  1048. * Result:
  1049. * A status code
  1050. *
  1051. * Availability:
  1052. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1053. * CarbonLib: in CarbonLib 1.1 and later
  1054. * Non-Carbon CFM: not available
  1055. }
  1056. function NavGetDefaultDialogCreationOptions( var outOptions: NavDialogCreationOptions ): OSStatus; external name '_NavGetDefaultDialogCreationOptions';
  1057. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1058. {
  1059. * NavCreateGetFileDialog()
  1060. *
  1061. * Summary:
  1062. * Create a GetFile dialog
  1063. *
  1064. * Discussion:
  1065. * Use this function to create a dialog designed for opening
  1066. * document files. This function replaces NavGetFile, allowing new
  1067. * window modalities, and adding Unicode support. Upon successful
  1068. * creation, the dialog is not visible. Present and run the dialog
  1069. * with NavDialogRun. After the dialog is complete, dispose of it
  1070. * with NavDialogDispose.
  1071. *
  1072. * Parameters:
  1073. *
  1074. * inOptions:
  1075. * Options controlling the appearance and behavior of the dialog
  1076. *
  1077. * inTypeList:
  1078. * A creator signature and list of file types to show in the
  1079. * dialog file browser. If NULL, show all files.
  1080. *
  1081. * inEventProc:
  1082. * The UPP for the client's event callack, or NULL for no event
  1083. * callback
  1084. *
  1085. * inPreviewProc:
  1086. * The UPP for the client's custom file preview callback, or NULL
  1087. * for standard previews
  1088. *
  1089. * inFilterProc:
  1090. * The UPP for the client's custom filter callback, or NULL for no
  1091. * custom file filtering
  1092. *
  1093. * inClientData:
  1094. * A client-defined context value passed to all callback functions
  1095. *
  1096. * outDialog:
  1097. * Upon successful completion, a reference to the created dialog
  1098. *
  1099. * Result:
  1100. * A status code
  1101. *
  1102. * Availability:
  1103. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1104. * CarbonLib: in CarbonLib 1.1 and later
  1105. * Non-Carbon CFM: not available
  1106. }
  1107. function NavCreateGetFileDialog( {const} inOptions: NavDialogCreationOptionsPtr { can be NULL }; inTypeList: NavTypeListHandle { can be NULL }; inEventProc: NavEventUPP { can be NULL }; inPreviewProc: NavPreviewUPP { can be NULL }; inFilterProc: NavObjectFilterUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateGetFileDialog';
  1108. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1109. {
  1110. * NavCreatePutFileDialog()
  1111. *
  1112. * Summary:
  1113. * Create a PutFile dialog
  1114. *
  1115. * Discussion:
  1116. * Use this function to create a dialog designed for setting the
  1117. * name and location of a document file prior to saving. This
  1118. * function replaces NavPutFile, allowing new window modalities, and
  1119. * adding Unicode support. Upon successful creation, the dialog is
  1120. * not visible. Present and run the dialog with NavDialogRun. After
  1121. * the dialog is complete, dispose of it with NavDialogDispose.
  1122. *
  1123. * Parameters:
  1124. *
  1125. * inOptions:
  1126. * Options controlling the appearance and behavior of the dialog
  1127. *
  1128. * inFileType:
  1129. * The type of the file to be saved. This parameter is used in
  1130. * conjunction with the inFileCreator parameter to look up the
  1131. * kind string for the Format popup menu, and to drive the
  1132. * identification of translation options.
  1133. *
  1134. * inFileCreator:
  1135. * The creator signature of the file to be saved (see inFileType
  1136. * parameter)
  1137. *
  1138. * inEventProc:
  1139. * The UPP for the client's event callack, or NULL for no event
  1140. * callback
  1141. *
  1142. * inClientData:
  1143. * A client-defined context value passed to all callback functions
  1144. *
  1145. * outDialog:
  1146. * Upon successful completion, a reference to the created dialog
  1147. *
  1148. * Result:
  1149. * A status code
  1150. *
  1151. * Availability:
  1152. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1153. * CarbonLib: in CarbonLib 1.1 and later
  1154. * Non-Carbon CFM: not available
  1155. }
  1156. function NavCreatePutFileDialog( {const} inOptions: NavDialogCreationOptionsPtr { can be NULL }; inFileType: OSType; inFileCreator: OSType; inEventProc: NavEventUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreatePutFileDialog';
  1157. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1158. {
  1159. * NavCreateAskReviewDocumentsDialog()
  1160. *
  1161. * Summary:
  1162. * Create an AskReviewDocumentsDialog dialog
  1163. *
  1164. * Discussion:
  1165. * Use this function to create a dialog which tells the user how
  1166. * many unsaved documents there are, and asks the user to start
  1167. * reviewing the documents, don't save any documents, or cancel.
  1168. * This dialog is appropriate to use when an application is quitting
  1169. * and there is more than one unsaved document. It is supported only
  1170. * on Mac OS X because the HI guidelines for earlier versions of Mac
  1171. * OS do not include this dialog as part of the application quit
  1172. * sequence. Upon successful creation, the dialog is not visible.
  1173. * Present and run the dialog with NavDialogRun. After the dialog is
  1174. * complete, dispose of it with NavDialogDispose. Upon dismissal of
  1175. * the dialog, this dialog's user action will be set to one of the
  1176. * following: kNavUserActionReviewDocuments,
  1177. * kNavUserActionDiscardDocuments, or kNavUserActionCancel.
  1178. *
  1179. * Parameters:
  1180. *
  1181. * inOptions:
  1182. * Options controlling the appearance and behavior of the dialog
  1183. *
  1184. * inDocumentCount:
  1185. * Indicates the number of documents needing review. This number
  1186. * appears in the text presented to the user. If for any reason
  1187. * the total number of unsaved documents is unknown, specify 0,
  1188. * and an ambiguous message will appear. Do not specifiy 1, since
  1189. * the HI guidelines call for this alert only when there is more
  1190. * than one document to be reviewed.
  1191. *
  1192. * inEventProc:
  1193. * The UPP for the client's event callack, or NULL for no event
  1194. * callback
  1195. *
  1196. * inClientData:
  1197. * A client-defined context value passed to all callback functions
  1198. *
  1199. * outDialog:
  1200. * Upon successful completion, a reference to the created dialog
  1201. *
  1202. * Result:
  1203. * A status code
  1204. *
  1205. * Availability:
  1206. * Mac OS X: in version 10.1 and later in Carbon.framework [32-bit only]
  1207. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1208. * Non-Carbon CFM: not available
  1209. }
  1210. function NavCreateAskReviewDocumentsDialog( const (*var*) inOptions: NavDialogCreationOptions; inDocumentCount: ItemCount; inEventProc: NavEventUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateAskReviewDocumentsDialog';
  1211. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  1212. {
  1213. * NavCreateAskSaveChangesDialog()
  1214. *
  1215. * Summary:
  1216. * Create an AskSaveChanges dialog
  1217. *
  1218. * Discussion:
  1219. * Use this function to create a dialog which asks the user to save,
  1220. * don't save or cancel closing a document with unsaved changes.
  1221. * This function replaces NavAskSaveChanges and
  1222. * NavCustomAskSaveChanges, allowing new window modalities, and
  1223. * adding Unicode support. Upon successful creation, the dialog is
  1224. * not visible. Present and run the dialog with NavDialogRun. After
  1225. * the dialog is complete, dispose of it with NavDialogDispose. To
  1226. * provide a customized message for the alert, specify an non-NULL
  1227. * message value in the options structure.
  1228. *
  1229. * Parameters:
  1230. *
  1231. * inOptions:
  1232. * Options controlling the appearance and behavior of the dialog
  1233. *
  1234. * inAction:
  1235. * Indicates this usage context for this dialog: closing a
  1236. * document or quitting an application. This setting affects the
  1237. * message text displayed to the user.
  1238. *
  1239. * inEventProc:
  1240. * The UPP for the client's event callack, or NULL for no event
  1241. * callback
  1242. *
  1243. * inClientData:
  1244. * A client-defined context value passed to all callback functions
  1245. *
  1246. * outDialog:
  1247. * Upon successful completion, a reference to the created dialog
  1248. *
  1249. * Result:
  1250. * A status code
  1251. *
  1252. * Availability:
  1253. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1254. * CarbonLib: in CarbonLib 1.1 and later
  1255. * Non-Carbon CFM: not available
  1256. }
  1257. function NavCreateAskSaveChangesDialog( const (*var*) inOptions: NavDialogCreationOptions; inAction: NavAskSaveChangesAction; inEventProc: NavEventUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateAskSaveChangesDialog';
  1258. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1259. {
  1260. * NavCreateAskDiscardChangesDialog()
  1261. *
  1262. * Summary:
  1263. * Create an AskDiscardChanges dialog
  1264. *
  1265. * Discussion:
  1266. * Use this function to create a dialog which asks the user to
  1267. * discard changes to a document or cancel. This is most often use
  1268. * when the user wants to revert a a document to the last saved
  1269. * revision. This function replaces NavAskDiscardChanges, allowing
  1270. * new window modalities, and adding Unicode support. Upon
  1271. * successful creation, the dialog is not visible. Present and run
  1272. * the dialog with NavDialogRun. After the dialog is complete,
  1273. * dispose of it with NavDialogDispose.
  1274. *
  1275. * Parameters:
  1276. *
  1277. * inOptions:
  1278. * Options controlling the appearance and behavior of the dialog
  1279. *
  1280. * inEventProc:
  1281. * The UPP for the client's event callack, or NULL for no event
  1282. * callback
  1283. *
  1284. * inClientData:
  1285. * A client-defined context value passed to all callback functions
  1286. *
  1287. * outDialog:
  1288. * Upon successful completion, a reference to the created dialog
  1289. *
  1290. * Result:
  1291. * A status code
  1292. *
  1293. * Availability:
  1294. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1295. * CarbonLib: in CarbonLib 1.1 and later
  1296. * Non-Carbon CFM: not available
  1297. }
  1298. function NavCreateAskDiscardChangesDialog( const (*var*) inOptions: NavDialogCreationOptions; inEventProc: NavEventUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateAskDiscardChangesDialog';
  1299. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1300. {
  1301. * NavCreateChooseFileDialog()
  1302. *
  1303. * Summary:
  1304. * Create a ChooseFile dialog
  1305. *
  1306. * Discussion:
  1307. * Use this function to create a dialog designed for selecting one
  1308. * file as the target of an operation. A ChooseFile dialog is a
  1309. * simple version a GetFile dialog. This function replaces
  1310. * NavChooseFile, allowing new window modalities, and adding Unicode
  1311. * support. Upon successful creation, the dialog is not visible.
  1312. * Present and run the dialog with NavDialogRun. After the dialog is
  1313. * complete, dispose of it with NavDialogDispose.
  1314. *
  1315. * Parameters:
  1316. *
  1317. * inOptions:
  1318. * Options controlling the appearance and behavior of the dialog
  1319. *
  1320. * inTypeList:
  1321. * A creator signature and list of file types to show in the
  1322. * dialog file browser. If NULL, show all files.
  1323. *
  1324. * inEventProc:
  1325. * The UPP for the client's event callack, or NULL for no event
  1326. * callback
  1327. *
  1328. * inPreviewProc:
  1329. * The UPP for the client's custom file preview callback, or NULL
  1330. * for standard previews
  1331. *
  1332. * inFilterProc:
  1333. * The UPP for the client's custom filter callback, or NULL for no
  1334. * custom file filtering
  1335. *
  1336. * inClientData:
  1337. * A client-defined context value passed to all callback functions
  1338. *
  1339. * outDialog:
  1340. * Upon successful completion, a reference to the created dialog
  1341. *
  1342. * Result:
  1343. * A status code
  1344. *
  1345. * Availability:
  1346. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1347. * CarbonLib: in CarbonLib 1.1 and later
  1348. * Non-Carbon CFM: not available
  1349. }
  1350. function NavCreateChooseFileDialog( {const} inOptions: NavDialogCreationOptionsPtr { can be NULL }; inTypeList: NavTypeListHandle { can be NULL }; inEventProc: NavEventUPP { can be NULL }; inPreviewProc: NavPreviewUPP { can be NULL }; inFilterProc: NavObjectFilterUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateChooseFileDialog';
  1351. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1352. {
  1353. * NavCreateChooseFolderDialog()
  1354. *
  1355. * Summary:
  1356. * Create a ChooseFolder dialog
  1357. *
  1358. * Discussion:
  1359. * Use this function to create a dialog designed for selecting a
  1360. * folder as the target of an operation. This function replaces
  1361. * NavChooseFolder, allowing new window modalities, and adding
  1362. * Unicode support. Upon successful creation, the dialog is not
  1363. * visible. Present and run the dialog with NavDialogRun. After the
  1364. * dialog is complete, dispose of it with NavDialogDispose.
  1365. *
  1366. * Parameters:
  1367. *
  1368. * inOptions:
  1369. * Options controlling the appearance and behavior of the dialog
  1370. *
  1371. * inEventProc:
  1372. * The UPP for the client's event callack, or NULL for no event
  1373. * callback
  1374. *
  1375. * inFilterProc:
  1376. * The UPP for the client's custom filter callback, or NULL for no
  1377. * custom file filtering
  1378. *
  1379. * inClientData:
  1380. * A client-defined context value passed to all callback functions
  1381. *
  1382. * outDialog:
  1383. * Upon successful completion, a reference to the created dialog
  1384. *
  1385. * Result:
  1386. * A status code
  1387. *
  1388. * Availability:
  1389. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1390. * CarbonLib: in CarbonLib 1.1 and later
  1391. * Non-Carbon CFM: not available
  1392. }
  1393. function NavCreateChooseFolderDialog( {const} inOptions: NavDialogCreationOptionsPtr { can be NULL }; inEventProc: NavEventUPP { can be NULL }; inFilterProc: NavObjectFilterUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateChooseFolderDialog';
  1394. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1395. {
  1396. * NavCreateChooseVolumeDialog()
  1397. *
  1398. * Summary:
  1399. * Create a ChooseVolume dialog
  1400. *
  1401. * Discussion:
  1402. * Use this function to create a dialog designed for selecting a
  1403. * volume as the target of an operation. This function replaces
  1404. * NavChooseVolume, allowing new window modalities, and adding
  1405. * Unicode support. Upon successful creation, the dialog is not
  1406. * visible. Present and run the dialog with NavDialogRun. After the
  1407. * dialog is complete, dispose of it with NavDialogDispose.
  1408. *
  1409. * Parameters:
  1410. *
  1411. * inOptions:
  1412. * Options controlling the appearance and behavior of the dialog
  1413. *
  1414. * inEventProc:
  1415. * The UPP for the client's event callack, or NULL for no event
  1416. * callback
  1417. *
  1418. * inFilterProc:
  1419. * The UPP for the client's custom filter callback, or NULL for no
  1420. * custom file filtering
  1421. *
  1422. * inClientData:
  1423. * A client-defined context value passed to all callback functions
  1424. *
  1425. * outDialog:
  1426. * Upon successful completion, a reference to the created dialog
  1427. *
  1428. * Result:
  1429. * A status code
  1430. *
  1431. * Availability:
  1432. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1433. * CarbonLib: in CarbonLib 1.1 and later
  1434. * Non-Carbon CFM: not available
  1435. }
  1436. function NavCreateChooseVolumeDialog( {const} inOptions: NavDialogCreationOptionsPtr { can be NULL }; inEventProc: NavEventUPP { can be NULL }; inFilterProc: NavObjectFilterUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateChooseVolumeDialog';
  1437. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1438. {
  1439. * NavCreateChooseObjectDialog()
  1440. *
  1441. * Summary:
  1442. * Create a ChooseObject dialog
  1443. *
  1444. * Discussion:
  1445. * Use this function to create a dialog designed for selecting a
  1446. * file, folder, or volume as the target of an operation. This
  1447. * function replaces NavChooseObject, allowing new window
  1448. * modalities, and adding Unicode support. Upon successful creation,
  1449. * the dialog is not visible. Present and run the dialog with
  1450. * NavDialogRun. After the dialog is complete, dispose of it with
  1451. * NavDialogDispose.
  1452. *
  1453. * Parameters:
  1454. *
  1455. * inOptions:
  1456. * Options controlling the appearance and behavior of the dialog
  1457. *
  1458. * inEventProc:
  1459. * The UPP for the client's event callack, or NULL for no event
  1460. * callback
  1461. *
  1462. * inPreviewProc:
  1463. * The UPP for the client's custom file preview callback, or NULL
  1464. * for standard previews
  1465. *
  1466. * inFilterProc:
  1467. * The UPP for the client's custom filter callback, or NULL for no
  1468. * custom file filtering
  1469. *
  1470. * inClientData:
  1471. * A client-defined context value passed to all callback functions
  1472. *
  1473. * outDialog:
  1474. * Upon successful completion, a reference to the created dialog
  1475. *
  1476. * Result:
  1477. * A status code
  1478. *
  1479. * Availability:
  1480. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1481. * CarbonLib: in CarbonLib 1.1 and later
  1482. * Non-Carbon CFM: not available
  1483. }
  1484. function NavCreateChooseObjectDialog( {const} inOptions: NavDialogCreationOptionsPtr { can be NULL }; inEventProc: NavEventUPP { can be NULL }; inPreviewProc: NavPreviewUPP { can be NULL }; inFilterProc: NavObjectFilterUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateChooseObjectDialog';
  1485. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1486. {
  1487. * NavCreateNewFolderDialog()
  1488. *
  1489. * Summary:
  1490. * Create a NewFolder dialog
  1491. *
  1492. * Discussion:
  1493. * Use this function to create a dialog designed for creating a new
  1494. * folder. Nav Services creates the folder as specified by the user
  1495. * and returns a reference to the folder in the selection field of
  1496. * the reply record. This function replaces NavNewFolder, allowing
  1497. * new window modalities, and adding Unicode support. Upon
  1498. * successful creation, the dialog is not visible. Present and run
  1499. * the dialog with NavDialogRun. After the dialog is complete,
  1500. * dispose of it with NavDialogDispose.
  1501. *
  1502. * Parameters:
  1503. *
  1504. * inOptions:
  1505. * Options controlling the appearance and behavior of the dialog
  1506. *
  1507. * inEventProc:
  1508. * The UPP for the client's event callack, or NULL for no event
  1509. * callback
  1510. *
  1511. * inClientData:
  1512. * A client-defined context value passed to all callback functions
  1513. *
  1514. * outDialog:
  1515. * Upon successful completion, a reference to the created dialog
  1516. *
  1517. * Result:
  1518. * A status code
  1519. *
  1520. * Availability:
  1521. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1522. * CarbonLib: in CarbonLib 1.1 and later
  1523. * Non-Carbon CFM: not available
  1524. }
  1525. function NavCreateNewFolderDialog( {const} inOptions: NavDialogCreationOptionsPtr { can be NULL }; inEventProc: NavEventUPP { can be NULL }; inClientData: UnivPtr { can be NULL }; var outDialog: NavDialogRef ): OSStatus; external name '_NavCreateNewFolderDialog';
  1526. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1527. {
  1528. * NavDialogRun()
  1529. *
  1530. * Summary:
  1531. * Show and run a Nav Services dialog
  1532. *
  1533. * Discussion:
  1534. * After a dialog is created with a NavCreate*Dialog function, the
  1535. * client can modify the dialog target folder or save file name
  1536. * using NavCustomControl with the appropriate selectors. The dialog
  1537. * is presented to the user by calling NavDialogRun. If the dialog
  1538. * is system modal or application modal (kWindowModalitySystemModal,
  1539. * kWindowModalityAppModal), NavDialogRun does not return until the
  1540. * dialog has been dismissed. If the dialog is modeless or window
  1541. * modal (kWindowModalityNone, kWindowModalityWindowModal),
  1542. * NavDialogRun shows the dialog and returns immediately. In order
  1543. * to know when the dialog has been dismissed, the client must watch
  1544. * for the kNavCBUserAction event sent to the client event proc.
  1545. * Note that on Mac OS 9 and earlier, all dialogs are modal, even if
  1546. * a modeless or window modal dialog is requested. However, the
  1547. * kNavCBUserAction event is still sent to the event proc, so it's
  1548. * possible to use a single programming model on OS 9 and OS X
  1549. * provided the client assumes NavDialogRun returns immediately
  1550. * after showing the dialog.
  1551. *
  1552. * Parameters:
  1553. *
  1554. * inDialog:
  1555. * The dialog to run
  1556. *
  1557. * Result:
  1558. * A status code
  1559. *
  1560. * Availability:
  1561. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1562. * CarbonLib: in CarbonLib 1.1 and later
  1563. * Non-Carbon CFM: not available
  1564. }
  1565. function NavDialogRun( inDialog: NavDialogRef ): OSStatus; external name '_NavDialogRun';
  1566. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1567. {
  1568. * NavDialogDispose()
  1569. *
  1570. * Summary:
  1571. * Dispose of a Nav Services dialog
  1572. *
  1573. * Discussion:
  1574. * Call this function when completely finished with a Nav Services
  1575. * dialog. After calling NavDialogDispose, the dialog reference is
  1576. * no longer valid. NavDialogDispose is safe to call from within a
  1577. * callback to the client's Nav Services event proc. On Mac OS X
  1578. * 10.5 and later, -release and CFRelease may be used instead.
  1579. *
  1580. * Parameters:
  1581. *
  1582. * inDialog:
  1583. * The dialog to dispose
  1584. *
  1585. * Availability:
  1586. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1587. * CarbonLib: in CarbonLib 1.1 and later
  1588. * Non-Carbon CFM: not available
  1589. }
  1590. procedure NavDialogDispose( inDialog: NavDialogRef ); external name '_NavDialogDispose';
  1591. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1592. {
  1593. * NavDialogGetWindow()
  1594. *
  1595. * Summary:
  1596. * Return the window in which a Nav Services dialog appears
  1597. *
  1598. * Discussion:
  1599. * Note that a valid NavDialogRef may not have a window until
  1600. * NavDialogRun has been called. If no window exists for the dialog,
  1601. * NavDialogGetWindow returns NULL.
  1602. *
  1603. * Parameters:
  1604. *
  1605. * inDialog:
  1606. * Which dialog
  1607. *
  1608. * Result:
  1609. * The window reference
  1610. *
  1611. * Availability:
  1612. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1613. * CarbonLib: in CarbonLib 1.1 and later
  1614. * Non-Carbon CFM: not available
  1615. }
  1616. function NavDialogGetWindow( inDialog: NavDialogRef ): WindowRef; external name '_NavDialogGetWindow';
  1617. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1618. {
  1619. * NavDialogGetUserAction()
  1620. *
  1621. * Summary:
  1622. * Return the current user action taken by the user
  1623. *
  1624. * Discussion:
  1625. * A user action occurs when the user dismisses the dialog or
  1626. * otherwise does something generating a reply record that the
  1627. * client needs to act upon. If the user has not taken such an
  1628. * action, NavDialogGetUserAction returns kNavUserActionNone. If the
  1629. * dialog is terminated using the NavCustomControl selector
  1630. * kNavCtlTerminate, the final user action is kNavUserActionNone.
  1631. * For file dialogs, if the final user action is not
  1632. * kNavUserActionCancel, then there is a valid reply record which
  1633. * can be obtained with NavDialogGetReply. Although the user action
  1634. * is sent to the client event proc as a kNavCBUserAction event,
  1635. * this function is provided as a convenience for clients of modal
  1636. * dialogs who may find it easier to get the user action immediately
  1637. * after NavDialogRun returns.
  1638. *
  1639. * Parameters:
  1640. *
  1641. * inDialog:
  1642. * Which dialog
  1643. *
  1644. * Result:
  1645. * The user action
  1646. *
  1647. * Availability:
  1648. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1649. * CarbonLib: in CarbonLib 1.1 and later
  1650. * Non-Carbon CFM: not available
  1651. }
  1652. function NavDialogGetUserAction( inDialog: NavDialogRef ): NavUserAction; external name '_NavDialogGetUserAction';
  1653. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1654. {
  1655. * NavDialogGetReply()
  1656. *
  1657. * Summary:
  1658. * Fill in the provided reply record with the results of a user
  1659. * action such as kNavUserActionOpen, kNavUserActionSaveAs, or
  1660. * kNavUserActionChoose.
  1661. *
  1662. * Discussion:
  1663. * Call this function when a file dialog receives a user action
  1664. * other that implies an item or items to open, save, etc. Upon
  1665. * successful completion, the reply record describes the item(s)
  1666. * that the client needs to act upon. The reply record should later
  1667. * be disposed of with NavDisposeReply.
  1668. *
  1669. * Parameters:
  1670. *
  1671. * inDialog:
  1672. * Which dialog
  1673. *
  1674. * outReply:
  1675. * A pointer to the client-allocated reply record to be filled in
  1676. *
  1677. * Result:
  1678. * A status code
  1679. *
  1680. * Availability:
  1681. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1682. * CarbonLib: in CarbonLib 1.1 and later
  1683. * Non-Carbon CFM: not available
  1684. }
  1685. function NavDialogGetReply( inDialog: NavDialogRef; var outReply: NavReplyRecord ): OSStatus; external name '_NavDialogGetReply';
  1686. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1687. {
  1688. * NavDialogGetSaveFileName()
  1689. *
  1690. * Summary:
  1691. * Return the current value of the file name to be saved in a
  1692. * PutFile dialog
  1693. *
  1694. * Discussion:
  1695. * This function can be called at any time on a valid PutFile dialog
  1696. * to obtain the current value of the save file name. This function
  1697. * is a Unicode-based replacement for the kNavCtlGetEditFileName
  1698. * NavCustomControl selector. On Mac OS X, the full file name is
  1699. * returned, including any extenison that may be hidden from the
  1700. * user.
  1701. *
  1702. * Parameters:
  1703. *
  1704. * inPutFileDialog:
  1705. * Which dialog
  1706. *
  1707. * Result:
  1708. * The save file name as a CFStringRef. The string is immutable. The
  1709. * client should retain the string if the reference is to be held
  1710. * beyond the life of the dialog (standard CF retain/release
  1711. * semantics).
  1712. *
  1713. * Availability:
  1714. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1715. * CarbonLib: in CarbonLib 1.1 and later
  1716. * Non-Carbon CFM: not available
  1717. }
  1718. function NavDialogGetSaveFileName( inPutFileDialog: NavDialogRef ): CFStringRef; external name '_NavDialogGetSaveFileName';
  1719. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1720. {
  1721. * NavDialogSetSaveFileName()
  1722. *
  1723. * Summary:
  1724. * Set the current value of the file name to be saved in a PutFile
  1725. * dialog
  1726. *
  1727. * Discussion:
  1728. * This function can be called at any time to set the current save
  1729. * file name. Use it to set an initial name before calling
  1730. * NavDialogRun or to change the file name dynamically while a
  1731. * dialog is running. This function is a Unicode-based replacement
  1732. * for the kNavCtlSetEditFileName NavCustomControl selector.
  1733. *
  1734. * Parameters:
  1735. *
  1736. * inPutFileDialog:
  1737. * Which PutFile dialog
  1738. *
  1739. * inFileName:
  1740. * The file name to use. A copy of the provided string is made for
  1741. * use by Navigation Services.
  1742. *
  1743. * Result:
  1744. * A status code
  1745. *
  1746. * Availability:
  1747. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1748. * CarbonLib: in CarbonLib 1.1 and later
  1749. * Non-Carbon CFM: not available
  1750. }
  1751. function NavDialogSetSaveFileName( inPutFileDialog: NavDialogRef; inFileName: CFStringRef ): OSStatus; external name '_NavDialogSetSaveFileName';
  1752. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1753. {
  1754. * NavDialogGetSaveFileExtensionHidden()
  1755. *
  1756. * Summary:
  1757. * Get the current state of the extension hiding in a PutFile dialog
  1758. *
  1759. * Discussion:
  1760. * This function can be called at any time to determine if a PutFile
  1761. * dialog is hiding the file extesion (if any) of the file to be
  1762. * saved.
  1763. *
  1764. * Parameters:
  1765. *
  1766. * inPutFileDialog:
  1767. * Which PutFile dialog
  1768. *
  1769. * Result:
  1770. * True if the extension is hidden, false if the extension is
  1771. * visible or there is no extension.
  1772. *
  1773. * Availability:
  1774. * Mac OS X: in version 10.1 and later in Carbon.framework [32-bit only]
  1775. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1776. * Non-Carbon CFM: not available
  1777. }
  1778. function NavDialogGetSaveFileExtensionHidden( inPutFileDialog: NavDialogRef ): Boolean; external name '_NavDialogGetSaveFileExtensionHidden';
  1779. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  1780. {
  1781. * NavDialogSetSaveFileExtensionHidden()
  1782. *
  1783. * Summary:
  1784. * Set the current state of the extension hiding in a PutFile dialog
  1785. *
  1786. * Discussion:
  1787. * This function can be called at any time to hide or show the
  1788. * extension of the file to be saved in a PutFile dialog. If the
  1789. * current file name has no extension, then hiding the extension has
  1790. * no effect.
  1791. *
  1792. * Parameters:
  1793. *
  1794. * inPutFileDialog:
  1795. * Which PutFile dialog
  1796. *
  1797. * inHidden:
  1798. * The new value for the hidden extension state
  1799. *
  1800. * Result:
  1801. * A status code
  1802. *
  1803. * Availability:
  1804. * Mac OS X: in version 10.1 and later in Carbon.framework [32-bit only]
  1805. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1806. * Non-Carbon CFM: not available
  1807. }
  1808. function NavDialogSetSaveFileExtensionHidden( inPutFileDialog: NavDialogRef; inHidden: Boolean ): OSStatus; external name '_NavDialogSetSaveFileExtensionHidden';
  1809. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  1810. {
  1811. * NavDialogSetFilterTypeIdentifiers()
  1812. *
  1813. * Summary:
  1814. * Set a list Uniform Type Identifers against which all files will
  1815. * be automatically filtered.
  1816. *
  1817. * Discussion:
  1818. * This function can be called at any time to filter files shown in
  1819. * the dialog based on the list of type identifiers provided. This
  1820. * function is only applicable for GetFile and ChooseFile dialogs.
  1821. *
  1822. * Parameters:
  1823. *
  1824. * inGetFileDialog:
  1825. * Which GetFile or ChooseFile dialog.
  1826. *
  1827. * inTypeIdentifiers:
  1828. * The list of Uniform Type Identifiers describing the file types
  1829. * to be shown in the dialog file browser. If an empty array is
  1830. * passed, all files will be filtered out. If NULL, no files are
  1831. * filtered. The "Enable" popup view will be automatically shown
  1832. * and hidden as necessary.
  1833. *
  1834. * Result:
  1835. * A status code
  1836. *
  1837. * Availability:
  1838. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1839. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1840. * Non-Carbon CFM: not available
  1841. }
  1842. function NavDialogSetFilterTypeIdentifiers( inGetFileDialog: NavDialogRef; inTypeIdentifiers: CFArrayRef { can be NULL } ): OSStatus; external name '_NavDialogSetFilterTypeIdentifiers';
  1843. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1844. //#pragma mark -
  1845. {--------------------------------------------------------------------------------------}
  1846. { ¥ DEPRECATED }
  1847. { All functions below this point are either deprecated (they continue to function }
  1848. { but are not the most modern nor most efficient solution to a problem), or they are }
  1849. { completely unavailable on Mac OS X. }
  1850. {--------------------------------------------------------------------------------------}
  1851. {$endc} {not TARGET_CPU_64}
  1852. const
  1853. kNavDialogOptionsVersion = 0;
  1854. type
  1855. NavDialogOptionsPtr = ^NavDialogOptions;
  1856. NavDialogOptions = record
  1857. version: UInt16;
  1858. dialogOptionFlags: NavDialogOptionFlags; { option flags for affecting the dialog's behavior }
  1859. location: Point; { top-left location of the dialog, or (-1,-1) for default position }
  1860. clientName: Str255;
  1861. windowTitle: Str255;
  1862. actionButtonLabel: Str255; { label of the default button (or null string for default) }
  1863. cancelButtonLabel: Str255; { label of the cancel button (or null string for default) }
  1864. savedFileName: Str255; { default name for text box in NavPutFile (or null string for default) }
  1865. message: Str255; { custom message prompt (or null string for default) }
  1866. preferenceKey: UInt32; { a key for to managing preferences for using multiple utility dialogs }
  1867. popupExtension: NavMenuItemSpecArrayHandle; { extended popup menu items, an array of NavMenuItemSpecs }
  1868. reserved: array [0..493] of SInt8;
  1869. end;
  1870. {$ifc not TARGET_CPU_64}
  1871. {
  1872. * NavLoad() *** DEPRECATED ***
  1873. *
  1874. * Deprecated:
  1875. * Not available in Mac OS X.
  1876. *
  1877. * Availability:
  1878. * Mac OS X: not available [32-bit only] but deprecated in 10.5
  1879. * CarbonLib: in CarbonLib 1.0 and later
  1880. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1881. }
  1882. function NavLoad: OSErr; external name '_NavLoad';
  1883. {
  1884. * NavUnload() *** DEPRECATED ***
  1885. *
  1886. * Deprecated:
  1887. * Not available in Mac OS X.
  1888. *
  1889. * Availability:
  1890. * Mac OS X: not available [32-bit only] but deprecated in 10.5
  1891. * CarbonLib: in CarbonLib 1.0 and later
  1892. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1893. }
  1894. function NavUnload: OSErr; external name '_NavUnload';
  1895. {
  1896. * NavLibraryVersion() *** DEPRECATED ***
  1897. *
  1898. * Deprecated:
  1899. * Test against the system version instead.
  1900. *
  1901. * Availability:
  1902. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1903. * CarbonLib: in CarbonLib 1.0 and later
  1904. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1905. }
  1906. function NavLibraryVersion: UInt32; external name '_NavLibraryVersion';
  1907. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1908. {
  1909. * NavGetDefaultDialogOptions() *** DEPRECATED ***
  1910. *
  1911. * Deprecated:
  1912. * Use NavGetDefaultDialogCreationOptions instead.
  1913. *
  1914. * Availability:
  1915. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1916. * CarbonLib: in CarbonLib 1.0 and later
  1917. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1918. }
  1919. function NavGetDefaultDialogOptions( var dialogOptions: NavDialogOptions ): OSErr; external name '_NavGetDefaultDialogOptions';
  1920. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1921. {
  1922. * NavGetFile() *** DEPRECATED ***
  1923. *
  1924. * Deprecated:
  1925. * Use NavCreateGetFileDialog instead.
  1926. *
  1927. * Availability:
  1928. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1929. * CarbonLib: in CarbonLib 1.0 and later
  1930. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1931. }
  1932. function NavGetFile( defaultLocation: AEDescPtr { can be NULL }; var reply: NavReplyRecord; dialogOptions: NavDialogOptionsPtr { can be NULL }; eventProc: NavEventUPP { can be NULL }; previewProc: NavPreviewUPP { can be NULL }; filterProc: NavObjectFilterUPP { can be NULL }; typeList: NavTypeListHandle { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavGetFile';
  1933. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1934. {
  1935. * NavPutFile() *** DEPRECATED ***
  1936. *
  1937. * Deprecated:
  1938. * Use NavCreatePutFileDialog instead.
  1939. *
  1940. * Availability:
  1941. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1942. * CarbonLib: in CarbonLib 1.0 and later
  1943. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1944. }
  1945. function NavPutFile( defaultLocation: AEDescPtr { can be NULL }; var reply: NavReplyRecord; dialogOptions: NavDialogOptionsPtr { can be NULL }; eventProc: NavEventUPP { can be NULL }; fileType: OSType; fileCreator: OSType; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavPutFile';
  1946. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1947. {
  1948. * NavAskSaveChanges() *** DEPRECATED ***
  1949. *
  1950. * Deprecated:
  1951. * Use NavCreateAskSaveChangesDialog instead.
  1952. *
  1953. * Availability:
  1954. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1955. * CarbonLib: in CarbonLib 1.0 and later
  1956. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1957. }
  1958. function NavAskSaveChanges( var dialogOptions: NavDialogOptions; action: NavAskSaveChangesAction; var reply: NavAskSaveChangesResult; eventProc: NavEventUPP { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavAskSaveChanges';
  1959. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1960. {
  1961. * NavCustomAskSaveChanges() *** DEPRECATED ***
  1962. *
  1963. * Deprecated:
  1964. * Use NavCreateAskSaveChangesDialog instead.
  1965. *
  1966. * Availability:
  1967. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1968. * CarbonLib: in CarbonLib 1.0 and later
  1969. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1970. }
  1971. function NavCustomAskSaveChanges( var dialogOptions: NavDialogOptions; var reply: NavAskSaveChangesResult; eventProc: NavEventUPP { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavCustomAskSaveChanges';
  1972. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1973. {
  1974. * NavAskDiscardChanges() *** DEPRECATED ***
  1975. *
  1976. * Deprecated:
  1977. * Use NavCreateAskDiscardChangesDialog instead.
  1978. *
  1979. * Availability:
  1980. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1981. * CarbonLib: in CarbonLib 1.0 and later
  1982. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1983. }
  1984. function NavAskDiscardChanges( var dialogOptions: NavDialogOptions; var reply: NavAskDiscardChangesResult; eventProc: NavEventUPP { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavAskDiscardChanges';
  1985. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1986. {
  1987. * NavChooseFile() *** DEPRECATED ***
  1988. *
  1989. * Deprecated:
  1990. * Use NavCreateChooseFileDialog instead.
  1991. *
  1992. * Availability:
  1993. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1994. * CarbonLib: in CarbonLib 1.0 and later
  1995. * Non-Carbon CFM: in NavigationLib 1.0 and later
  1996. }
  1997. function NavChooseFile( defaultLocation: AEDescPtr { can be NULL }; var reply: NavReplyRecord; dialogOptions: NavDialogOptionsPtr { can be NULL }; eventProc: NavEventUPP { can be NULL }; previewProc: NavPreviewUPP { can be NULL }; filterProc: NavObjectFilterUPP { can be NULL }; typeList: NavTypeListHandle { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavChooseFile';
  1998. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1999. {
  2000. * NavChooseFolder() *** DEPRECATED ***
  2001. *
  2002. * Deprecated:
  2003. * Use NavCreateChooseFolderDialog instead.
  2004. *
  2005. * Availability:
  2006. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2007. * CarbonLib: in CarbonLib 1.0 and later
  2008. * Non-Carbon CFM: in NavigationLib 1.0 and later
  2009. }
  2010. function NavChooseFolder( defaultLocation: AEDescPtr { can be NULL }; var reply: NavReplyRecord; dialogOptions: NavDialogOptionsPtr { can be NULL }; eventProc: NavEventUPP { can be NULL }; filterProc: NavObjectFilterUPP { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavChooseFolder';
  2011. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2012. {
  2013. * NavChooseVolume() *** DEPRECATED ***
  2014. *
  2015. * Deprecated:
  2016. * Use NavCreateChooseVolumeDialog instead.
  2017. *
  2018. * Availability:
  2019. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2020. * CarbonLib: in CarbonLib 1.0 and later
  2021. * Non-Carbon CFM: in NavigationLib 1.0 and later
  2022. }
  2023. function NavChooseVolume( defaultSelection: AEDescPtr { can be NULL }; var reply: NavReplyRecord; dialogOptions: NavDialogOptionsPtr { can be NULL }; eventProc: NavEventUPP { can be NULL }; filterProc: NavObjectFilterUPP { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavChooseVolume';
  2024. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2025. {
  2026. * NavChooseObject() *** DEPRECATED ***
  2027. *
  2028. * Deprecated:
  2029. * Use NavCreateChooseObjectDialog instead.
  2030. *
  2031. * Availability:
  2032. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2033. * CarbonLib: in CarbonLib 1.0 and later
  2034. * Non-Carbon CFM: in NavigationLib 1.0 and later
  2035. }
  2036. function NavChooseObject( defaultLocation: AEDescPtr { can be NULL }; var reply: NavReplyRecord; dialogOptions: NavDialogOptionsPtr { can be NULL }; eventProc: NavEventUPP { can be NULL }; filterProc: NavObjectFilterUPP { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavChooseObject';
  2037. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2038. {
  2039. * NavNewFolder() *** DEPRECATED ***
  2040. *
  2041. * Deprecated:
  2042. * Use NavCreateNewFolderDialog instead.
  2043. *
  2044. * Availability:
  2045. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2046. * CarbonLib: in CarbonLib 1.0 and later
  2047. * Non-Carbon CFM: in NavigationLib 1.0 and later
  2048. }
  2049. function NavNewFolder( defaultLocation: AEDescPtr { can be NULL }; var reply: NavReplyRecord; dialogOptions: NavDialogOptionsPtr { can be NULL }; eventProc: NavEventUPP { can be NULL }; callBackUD: UnivPtr { can be NULL } ): OSErr; external name '_NavNewFolder';
  2050. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2051. {
  2052. * NavTranslateFile() *** DEPRECATED ***
  2053. *
  2054. * Deprecated:
  2055. * Navigation Services does not include Translation Manager support
  2056. * on Mac OS X.
  2057. *
  2058. * Availability:
  2059. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2060. * CarbonLib: in CarbonLib 1.0 and later
  2061. * Non-Carbon CFM: in NavigationLib 1.0 and later
  2062. }
  2063. function NavTranslateFile( const (*var*) reply: NavReplyRecord; howToTranslate: NavTranslationOptions ): OSErr; external name '_NavTranslateFile';
  2064. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2065. {
  2066. * NavServicesCanRun() *** DEPRECATED ***
  2067. *
  2068. * Deprecated:
  2069. * Navigation Services can always run on Mac OS X.
  2070. *
  2071. * Availability:
  2072. * Mac OS X: not available [32-bit only] but deprecated in 10.5
  2073. * CarbonLib: in CarbonLib 1.0 and later
  2074. * Non-Carbon CFM: in NavigationLib 1.0 and later
  2075. }
  2076. function NavServicesCanRun: Boolean; external name '_NavServicesCanRun';
  2077. {$endc} {not TARGET_CPU_64}
  2078. {$ifc TARGET_RT_MAC_CFM}
  2079. {
  2080. NavServicesAvailable() is a macro available only in C/C++.
  2081. To get the same functionality from pascal or assembly, you need
  2082. to test if NavigationLib functions are not NULL and call NavServicesCanRun()
  2083. which will test if NavServices is properly installed. For instance:
  2084. gNavServicesAvailable = FALSE;
  2085. IF @NavLibraryVersion <> kUnresolvedCFragSymbolAddress THEN
  2086. gNavServicesAvailable = NavServicesCanRun;
  2087. end
  2088. }
  2089. {$elsec}
  2090. {$ifc TARGET_RT_MAC_MACHO}
  2091. { Navigation is always available on OS X }
  2092. {$elsec}
  2093. { NavServicesAvailable() is implemented in Navigation.o for classic 68K clients }
  2094. {$ifc CALL_NOT_IN_CARBON}
  2095. { NavServicesAvailable() is implemented in Navigation.o for classic 68K clients}
  2096. {
  2097. * NavServicesAvailable()
  2098. *
  2099. * Availability:
  2100. * Mac OS X: not available
  2101. * CarbonLib: not available
  2102. * Non-Carbon CFM: not available
  2103. }
  2104. {$endc} {CALL_NOT_IN_CARBON}
  2105. {$endc} {TARGET_RT_MAC_MACHO}
  2106. {$endc} {TARGET_RT_MAC_CFM}
  2107. {$endc} {TARGET_OS_MAC}
  2108. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  2109. end.
  2110. {$endc} {not MACOSALLINCLUDE}