![]()
Technote 1107Extensible Folder ManagerGreg Robbins and John Montbriand, 1997 |
CONTENTS
If the Extensible Folder Manager is Present... |
Mac OS 8 includes a new Extensible Folder Manager for use by system software and by applications. The Extensible Folder Manager supports FindFolder as well as additional functionality:
|
The call FindFolder remains unchanged, as documented in Inside
Macintosh: Macintosh Toolbox Essentials. FindFolder can now be used
to locate folders registered using the new routines described below.
The following routines can be used for registering folders with the Extensible Folder Manager as well as querying the Extensible Folder Manager for information about registered folders. These routines are found in FoldersLib, a fat library residing in the System file.
AddFolderDescriptorpascal OSErr AddFolderDescriptor(FolderType foldType, FolderDescFlags flags, FolderClass foldClass, FolderLocation foldLocation, OSType badgeSignature, OSType badgeType, Str63 name, Boolean replaceFlag);
AddFolderDescriptor copies the supplied information into a new
descriptor entry in the global descriptor list. If a descriptor is
already installed with the specified FolderType and replaceFlag is
false, an error is returned.
RemoveFolderDescriptorpascal OSErr RemoveFolderDescriptor(FolderType foldType);
RemoveFolderDescriptor removes the specified entry from the global
descriptor list.
GetFolderDescriptorpascal OSErr GetFolderDescriptor(FolderType foldType, Size descSize, FolderDesc *foldDesc);
GetFolderDescriptor returns the folder descriptor information for
the specified FolderType from the global descriptor list. descSize
should be sizeof(FolderDesc).
GetFolderTypespascal OSErr GetFolderTypes(UInt32 requestedTypeCount, UInt32 *totalTypeCount, FolderType *theTypes);
GetFolderTypes returns the folder types from the global descriptor
list. requestedTypeCount should be the number of FolderTypes that can
fit in the buffer pointed to by theTypes. totalTypeCount returns the
number of FolderTypes in the global list; if this is less than
requestedTypeCount, then not all FolderTypes were returned to the
caller. Pass nil for theTypes if only the total count of types is
desired.
IdentifyFolderpascal OSErr IdentifyFolder(short vReNum, long dirID, FolderType *foldType);
IdentifyFolder returns the folder type for the folder specified by
vRefNum and dirID, if such a folder exists.
Warning: IdentifyFolder may be slow, taking several seconds to complete.
In addition, there
may be multiple folder descriptors that map to an individual folder;
IdentifyFolder will just return the FolderType of one of those
descriptors.
The following routines can be used for providing routing information that will be used in future versions of the Finder for auto-routing items dropped into designated folders registered with the Extensible Folder Manager.
|
COMPATIBILITY NOTE: |
Folder Routing information software provides is as follows:
typedef UInt32 RoutingFlags;
The RoutingFlags describe special behavior applying to a routing.
The defined bits are
enum {
kPersistentRouting = 1L << 0 /* routing persists across boots */
};
Because persistent records create a system that can be "cleaned up" rebooting, software should use it only when there is no other way to initialize the descriptor after a reboot. Persistent routing is not currently supported in Mac OS 8.
typedef struct FolderRouting {
Size descSize;
OSType fileType;
FolderType routeFromFolder;
FolderType routeToFolder;
RoutingFlags flags;
};
A FolderRouting is returned by GetFolderRoutings to describe a set
of routing instructions.
AddFolderRoutingpascal OSErr AddFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType routeToFolder, RoutingFlags flags, Boolean replaceFlag);
AddFolderRouting adds an entry to the folder routing table.
RemoveFolderRoutingpascal OSErr RemoveFolderRouting(OSType fileType, FolderType routeFromFolder)
RemoveFolderRouting removes an entry from the routing table.
FindFolderRoutingpascal OSErr FindFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType *routeToFolder, RoutingFlags *flags)
FindFolderRouting is used by clients to resolve a routing request
specified by two criteria (fileType and routeFromFolder).
GetFolderRoutingspascal OSErr GetFolderRoutings(UInt32 requestedRoutingCount, UInt32 *totalRoutingCount, Size routingSize, FolderRouting *theRoutings);
GetFolderRoutings returns the folder descriptor information from
the global routing list. requestedRoutingCount should be the number
of FolderRoutings that can fit in the buffer pointed to by
theRoutings. routingSize should be sizeof(FolderRouting).
totalRoutingCount returns the number of FolderRoutings in the global
list; if this is less than requestedRoutingCount, then not all
FolderRoutings were returned to the caller. Pass nil for theRoutings
if only the total count of routines is desired.
|
Thanks to Kevin Aitken, Jean-Pierre Ciudad, Steve Falkenburg, Pete Gontier, Winston Hendrickson,
Erik Koebler
and Barb Kozlowski.
![]()
Tech Support
Technotes |
Previous Technote |
Next Technote |
Contents
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help