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