]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/morefile/MoreDesktopMgr.h
110c673403690c91eccc6a443c1f4ce515b5909f
4 Contains: A collection of useful high-level Desktop Manager routines. If the Desktop Manager is not available, use the Desktop file for 'read' operations.
6 Version: Technology: MoreFiles
9 Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved.
11 Bugs?: For bug reports, consult the following page on
14 http://developer.apple.com/bugreporter/
19 You may incorporate this sample code into your applications without
20 restriction, though the sample code has been provided "AS IS" and the
21 responsibility for its operation is 100% yours. However, what you are
22 not permitted to do is to redistribute the source as "DSC Sample Code"
23 after having made changes. If you're going to re-distribute the source,
24 we require that you make it clear in the source that the code was
25 descended from Apple Sample Code, but that you've made changes.
28 #ifndef __MOREDESKTOPMGR__
29 #define __MOREDESKTOPMGR__
39 #include "Optimization.h"
54 #if PRAGMA_STRUCT_ALIGN
55 #pragma options align=mac68k
56 #elif PRAGMA_STRUCT_PACKPUSH
58 #elif PRAGMA_STRUCT_PACK
62 /*****************************************************************************/
66 ConstStr255Param volName
,
69 Boolean
* newDTDatabase
);
73 The DTOpen function opens a volume's desktop database. It returns
74 the reference number of the desktop database and indicates if the
75 desktop database was created as a result of this call (if it was created,
78 volName input: A pointer to the name of a mounted volume
80 vRefNum input: Volume specification.
81 dtRefNum output: The reference number of Desktop Manager's
82 desktop database on the specified volume.
83 newDTDatabase output: true if the desktop database was created as a
84 result of this call and thus empty.
85 false if the desktop database was already created,
86 or if it could not be determined if it was already
91 nsvErr -35 Volume not found
93 paramErr -50 Volume doesn't support this function
94 extFSErr -58 External file system error - no file
95 system claimed this call.
96 desktopDamagedErr -1305 The desktop database has become corrupted -
97 the Finder will fix this, but if your
98 application is not running with the
99 Finder, use PBDTReset or PBDTDelete
102 /*****************************************************************************/
106 ConstStr255Param volName
,
109 Boolean searchCatalog
,
116 The DTXGetAPPL function finds an application (file type 'APPL') with
117 the specified creator on the specified volume. It first tries to get
118 the application mapping from the desktop database. If that fails,
119 then it tries to find an application in the Desktop file. If that
120 fails and searchCatalog is true, then it tries to find an application
121 with the specified creator using the File Manager's CatSearch routine.
123 volName input: A pointer to the name of a mounted volume
125 vRefNum input: Volume specification.
126 creator input: The file's creator type.
127 searchCatalog input: If true, search the catalog for the application
128 if it isn't found in the desktop database.
129 applVRefNum output: The volume reference number of the volume the
131 applParID output: The parent directory ID of the application.
132 applName output: The name of the application.
136 nsvErr -35 Volume not found
138 paramErr -50 No default volume
139 rfNumErr -51 Reference number invalid
140 extFSErr -58 External file system error - no file
141 system claimed this call
142 desktopDamagedErr -1305 The desktop database has become corrupted -
143 the Finder will fix this, but if your
144 application is not running with the
145 Finder, use PBDTReset or PBDTDelete
146 afpItemNotFound -5012 Information not found
150 Also see: FSpDTGetAPPL
153 /*****************************************************************************/
157 ConstStr255Param volName
,
160 Boolean searchCatalog
,
165 The FSpDTXGetAPPL function finds an application (file type 'APPL') with
166 the specified creator on the specified volume. It first tries to get
167 the application mapping from the desktop database. If that fails,
168 then it tries to find an application in the Desktop file. If that
169 fails and searchCatalog is true, then it tries to find an application
170 with the specified creator using the File Manager's CatSearch routine.
172 volName input: A pointer to the name of a mounted volume
174 vRefNum input: Volume specification.
175 creator input: The file's creator type.
176 searchCatalog input: If true, search the catalog for the application
177 if it isn't found in the desktop database.
178 spec output: FSSpec record containing the application name and
183 nsvErr -35 Volume not found
185 paramErr -50 No default volume
186 rfNumErr -51 Reference number invalid
187 extFSErr -58 External file system error - no file
188 system claimed this call
189 desktopDamagedErr -1305 The desktop database has become corrupted -
190 the Finder will fix this, but if your
191 application is not running with the
192 Finder, use PBDTReset or PBDTDelete
193 afpItemNotFound -5012 Information not found
197 Also see: FSpDTGetAPPL
200 /*****************************************************************************/
204 ConstStr255Param volName
,
213 The DTGetAPPL function finds an application (file type 'APPL') with
214 the specified creator on the specified volume. It first tries to get
215 the application mapping from the desktop database. If that fails,
216 then it tries to find an application in the Desktop file. If that
217 fails, then it tries to find an application with the specified creator
218 using the File Manager's CatSearch routine.
220 volName input: A pointer to the name of a mounted volume
222 vRefNum input: Volume specification.
223 creator input: The file's creator type.
224 applVRefNum output: The volume reference number of the volume the
226 applParID output: The parent directory ID of the application.
227 applName output: The name of the application.
231 nsvErr -35 Volume not found
233 paramErr -50 No default volume
234 rfNumErr -51 Reference number invalid
235 extFSErr -58 External file system error - no file
236 system claimed this call
237 desktopDamagedErr -1305 The desktop database has become corrupted -
238 the Finder will fix this, but if your
239 application is not running with the
240 Finder, use PBDTReset or PBDTDelete
241 afpItemNotFound -5012 Information not found
245 Also see: FSpDTGetAPPL
248 /*****************************************************************************/
252 ConstStr255Param volName
,
259 The FSpDTGetAPPL function finds an application (file type 'APPL') with
260 the specified creator on the specified volume. It first tries to get
261 the application mapping from the desktop database. If that fails,
262 then it tries to find an application in the Desktop file. If that
263 fails, then it tries to find an application with the specified creator
264 using the File Manager's CatSearch routine.
266 volName input: A pointer to the name of a mounted volume
268 vRefNum input: Volume specification.
269 creator input: The file's creator type.
270 spec output: FSSpec record containing the application name and
275 nsvErr -35 Volume not found
277 paramErr -50 No default volume
278 rfNumErr -51 Reference number invalid
279 extFSErr -58 External file system error - no file
280 system claimed this call
281 desktopDamagedErr -1305 The desktop database has become corrupted -
282 the Finder will fix this, but if your
283 application is not running with the
284 Finder, use PBDTReset or PBDTDelete
285 afpItemNotFound -5012 Information not found
292 /*****************************************************************************/
296 ConstStr255Param volName
,
301 Handle
* iconHandle
);
305 The DTGetIcon function retrieves the specified icon and returns it in
306 a newly created handle. The icon is retrieves from the Desktop Manager
307 or if the Desktop Manager is not available, from the Finder's Desktop
308 file. Your program is responsible for disposing of the handle when it is
311 volName input: A pointer to the name of a mounted volume
313 vRefNum input: Volume specification.
314 iconType input: The icon type as defined in Files.h. Valid values are:
321 fileCreator input: The icon's creator type.
322 fileType input: The icon's file type.
323 iconHandle output: A Handle containing the newly created icon.
327 nsvErr -35 Volume not found
329 paramErr -50 Volume doesn't support this function
330 rfNumErr -51 Reference number invalid
331 extFSErr -58 External file system error - no file
332 system claimed this call
333 memFullErr -108 iconHandle could not be allocated
334 desktopDamagedErr -1305 The desktop database has become corrupted -
335 the Finder will fix this, but if your
336 application is not running with the
337 Finder, use PBDTReset or PBDTDelete
338 afpItemNotFound -5012 Information not found
341 /*****************************************************************************/
347 ConstStr255Param name
,
348 ConstStr255Param comment
);
352 The DTSetComment function sets a file or directory's Finder comment
353 field. The volume must support the Desktop Manager because you only
354 have read access to the Desktop file.
356 vRefNum input: Volume specification.
357 dirID input: Directory ID.
358 name input: Pointer to object name, or nil when dirID
359 specifies a directory that's the object.
360 comment input: The comment to add. Comments are limited to 200 characters;
361 longer comments are truncated.
365 nsvErr -35 Volume not found
367 fnfErr Ð43 File or directory doesnÕt exist
368 paramErr -50 Volume doesn't support this function
369 wPrErr Ð44 Volume is locked through hardware
370 vLckdErr Ð46 Volume is locked through software
371 rfNumErr Ð51 Reference number invalid
372 extFSErr -58 External file system error - no file
373 system claimed this call.
374 desktopDamagedErr -1305 The desktop database has become corrupted -
375 the Finder will fix this, but if your
376 application is not running with the
377 Finder, use PBDTReset or PBDTDelete
381 Also see: DTCopyComment, FSpDTCopyComment, FSpDTSetComment, DTGetComment,
385 /*****************************************************************************/
390 ConstStr255Param comment
);
394 The FSpDTSetComment function sets a file or directory's Finder comment
395 field. The volume must support the Desktop Manager because you only
396 have read access to the Desktop file.
398 spec input: An FSSpec record specifying the file or directory.
399 comment input: The comment to add. Comments are limited to 200 characters;
400 longer comments are truncated.
404 nsvErr -35 Volume not found
406 fnfErr Ð43 File or directory doesnÕt exist
407 wPrErr Ð44 Volume is locked through hardware
408 vLckdErr Ð46 Volume is locked through software
409 rfNumErr Ð51 Reference number invalid
410 paramErr -50 Volume doesn't support this function
411 extFSErr -58 External file system error - no file
412 system claimed this call.
413 desktopDamagedErr -1305 The desktop database has become corrupted -
414 the Finder will fix this, but if your
415 application is not running with the
416 Finder, use PBDTReset or PBDTDelete
420 Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, DTGetComment,
424 /*****************************************************************************/
430 ConstStr255Param name
,
435 The DTGetComment function gets a file or directory's Finder comment
436 field (if any) from the Desktop Manager or if the Desktop Manager is
437 not available, from the Finder's Desktop file.
439 IMPORTANT NOTE: Inside Macintosh says that comments are up to
440 200 characters. While that may be correct for the HFS file system's
441 Desktop Manager, other file systems (such as Apple Photo Access) return
442 up to 255 characters. Make sure the comment buffer is a Str255 or you'll
445 vRefNum input: Volume specification.
446 dirID input: Directory ID.
447 name input: Pointer to object name, or nil when dirID
448 specifies a directory that's the object.
449 comment output: A Str255 where the comment is to be returned.
453 nsvErr -35 Volume not found
455 fnfErr -43 File not found
456 paramErr -50 Volume doesn't support this function
457 rfNumErr Ð51 Reference number invalid
458 extFSErr -58 External file system error - no file
459 system claimed this call.
460 desktopDamagedErr -1305 The desktop database has become corrupted -
461 the Finder will fix this, but if your
462 application is not running with the
463 Finder, use PBDTReset or PBDTDelete
464 afpItemNotFound -5012 Information not found
468 Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, FSpDTSetComment,
472 /*****************************************************************************/
481 The FSpDTGetComment function gets a file or directory's Finder comment
482 field (if any) from the Desktop Manager or if the Desktop Manager is
483 not available, from the Finder's Desktop file.
485 IMPORTANT NOTE: Inside Macintosh says that comments are up to
486 200 characters. While that may be correct for the HFS file system's
487 Desktop Manager, other file systems (such as Apple Photo Access) return
488 up to 255 characters. Make sure the comment buffer is a Str255 or you'll
491 spec input: An FSSpec record specifying the file or directory.
492 comment output: A Str255 where the comment is to be returned.
496 nsvErr -35 Volume not found
498 fnfErr -43 File not found
499 paramErr -50 Volume doesn't support this function
500 rfNumErr Ð51 Reference number invalid
501 extFSErr -58 External file system error - no file
502 system claimed this call.
503 desktopDamagedErr -1305 The desktop database has become corrupted -
504 the Finder will fix this, but if your
505 application is not running with the
506 Finder, use PBDTReset or PBDTDelete
507 afpItemNotFound -5012 Information not found
511 Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, FSpDTSetComment,
515 /*****************************************************************************/
521 ConstStr255Param srcName
,
524 ConstStr255Param dstName
);
528 The DTCopyComment function copies the file or folder comment from the
529 source to the destination object. The destination volume must support
530 the Desktop Manager because you only have read access to the Desktop file.
532 srcVRefNum input: Source volume specification.
533 srcDirID input: Source directory ID.
534 srcName input: Pointer to source object name, or nil when srcDirID
535 specifies a directory that's the object.
536 dstVRefNum input: Destination volume specification.
537 dstDirID input: Destination directory ID.
538 dstName input: Pointer to destination object name, or nil when
539 dstDirID specifies a directory that's the object.
543 nsvErr -35 Volume not found
545 fnfErr Ð43 File or directory doesnÕt exist
546 wPrErr Ð44 Volume is locked through hardware
547 vLckdErr Ð46 Volume is locked through software
548 paramErr -50 Volume doesn't support this function
549 rfNumErr Ð51 Reference number invalid
550 paramErr -50 Volume doesn't support this function
551 extFSErr -58 External file system error - no file
552 system claimed this call.
553 desktopDamagedErr -1305 The desktop database has become corrupted -
554 the Finder will fix this, but if your
555 application is not running with the
556 Finder, use PBDTReset or PBDTDelete
557 afpItemNotFound -5012 Information not found
561 Also see: FSpDTCopyComment, DTSetComment, FSpDTSetComment, DTGetComment,
565 /*****************************************************************************/
569 const FSSpec
* srcSpec
,
570 const FSSpec
* dstSpec
);
574 The FSpDTCopyComment function copies the desktop database comment from
575 the source to the destination object. Both the source and the
576 destination volumes must support the Desktop Manager.
578 srcSpec input: An FSSpec record specifying the source object.
579 dstSpec input: An FSSpec record specifying the destination object.
583 nsvErr -35 Volume not found
585 fnfErr Ð43 File or directory doesnÕt exist
586 wPrErr Ð44 Volume is locked through hardware
587 vLckdErr Ð46 Volume is locked through software
588 paramErr -50 Volume doesn't support this function
589 rfNumErr Ð51 Reference number invalid
590 paramErr -50 Volume doesn't support this function
591 extFSErr -58 External file system error - no file
592 system claimed this call.
593 desktopDamagedErr -1305 The desktop database has become corrupted -
594 the Finder will fix this, but if your
595 application is not running with the
596 Finder, use PBDTReset or PBDTDelete
597 afpItemNotFound -5012 Information not found
601 Also see: DTCopyComment, DTSetComment, FSpDTSetComment, DTGetComment,
605 /*****************************************************************************/
607 #include "OptimizationEnd.h"
609 #if PRAGMA_STRUCT_ALIGN
610 #pragma options align=reset
611 #elif PRAGMA_STRUCT_PACKPUSH
613 #elif PRAGMA_STRUCT_PACK
617 #ifdef PRAGMA_IMPORT_OFF
627 #endif /* __MOREDESKTOPMGR__ */