Mac OS 9
Finder.h
Go to the documentation of this file.
1 
19 #ifndef __FINDER__
20 #define __FINDER__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #if PRAGMA_ONCE
27 #pragma once
28 #endif
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #if PRAGMA_IMPORT
35 #pragma import on
36 #endif
37 
38 #if PRAGMA_STRUCT_ALIGN
39 #pragma options align = mac68k
40 #elif PRAGMA_STRUCT_PACKPUSH
41 #pragma pack(push, 2)
42 #elif PRAGMA_STRUCT_PACK
43 #pragma pack(2)
44 #endif
45 
46 /* Creator and type of clipping files */
47 enum {
48  kClippingCreator = FOUR_CHAR_CODE('drag'),
49  kClippingPictureType = FOUR_CHAR_CODE('clpp'),
50  kClippingTextType = FOUR_CHAR_CODE('clpt'),
51  kClippingSoundType = FOUR_CHAR_CODE('clps'),
52  kClippingUnknownType = FOUR_CHAR_CODE('clpu')
53 };
54 
55 /* Creator and type of Internet Location files */
56 enum {
57  kInternetLocationCreator = FOUR_CHAR_CODE('drag'),
58  kInternetLocationHTTP = FOUR_CHAR_CODE('ilht'),
59  kInternetLocationFTP = FOUR_CHAR_CODE('ilft'),
60  kInternetLocationFile = FOUR_CHAR_CODE('ilfi'),
61  kInternetLocationMail = FOUR_CHAR_CODE('ilma'),
62  kInternetLocationNNTP = FOUR_CHAR_CODE('ilnw'),
63  kInternetLocationAFP = FOUR_CHAR_CODE('ilaf'),
64  kInternetLocationAppleTalk = FOUR_CHAR_CODE('ilat'),
65  kInternetLocationNSL = FOUR_CHAR_CODE('ilns'),
66  kInternetLocationGeneric = FOUR_CHAR_CODE('ilge')
67 };
68 
69 enum {
70  kCustomIconResource = -16455 /* Custom icon family resource ID */
71 };
72 
73 /* In order to specify any of the information described in the */
74 /* CustomBadgeResource data structure you must clear the
75  * kExtendedFlagsAreInvalid */
76 /* and set kExtendedFlagHasCustomBadge of the FXInfo.fdXFlags or DXInfo.frXFlags
77  * field, */
78 /* and add a resource of type kCustomBadgeResourceType and ID
79  * kCustomBadgeResourceID to */
80 /* the file or to the "Icon/n" file for a folder */
81 enum {
82  kCustomBadgeResourceType = FOUR_CHAR_CODE('badg'),
83  kCustomBadgeResourceID = kCustomIconResource,
84  kCustomBadgeResourceVersion = 0
85 };
86 
88  SInt16 version; /* This is version kCustomBadgeResourceVersion*/
89  SInt16
90  customBadgeResourceID; /* If not 0, the ID of a resource to use on top*/
91  /* of the icon for this file or folder*/
92  OSType customBadgeType; /* If not 0, the type and creator of an icon*/
93  OSType customBadgeCreator; /* to use on top of the icon*/
94  OSType windowBadgeType; /* If not 0, the type and creator of an icon*/
95  OSType
96  windowBadgeCreator; /* to display in the header of the window for this */
97  /* file or folder*/
98  OSType overrideType; /* If not 0, the type and creator of an icon to*/
99  OSType overrideCreator; /* use INSTEAD of the icon for this file or folder*/
100 };
104 /* You can specify routing information for a file by including a 'rout' 0
105  resource in it and setting the kExtendedFlagHasRoutingInfo bit in the
106  extended Finder flags. The 'rout' resource is an array of
107  RoutingResourceEntry. Each entry is considered in turn. The first matching
108  entry is used. If the creator and fileType match the file being dropped and
109  targetFolder match the folder ID of the folder being dropped onto, then the
110  file is rerouted into the specified destination folder. The only target
111  folder currently supported is the system folder, kSystemFolderType = 'macs'.
112 */
113 enum { kRoutingResourceType = FOUR_CHAR_CODE('rout'), kRoutingResourceID = 0 };
114 
116  OSType creator; /* Use '****' or 0 to match any creator */
117  OSType fileType; /* Use '****' or 0 to match any file type */
118  OSType targetFolder; /* Folder ID of the folder this file was dropped onto */
119  OSType destinationFolder; /* Folder that the source will be routed to */
120  OSType reservedField; /* Set to 0 */
121 };
125 
126 /* Types for special container aliases */
127 enum {
128  kContainerFolderAliasType =
129  FOUR_CHAR_CODE('fdrp'), /* type for folder aliases */
130  kContainerTrashAliasType =
131  FOUR_CHAR_CODE('trsh'), /* type for trash folder aliases */
132  kContainerHardDiskAliasType =
133  FOUR_CHAR_CODE('hdsk'), /* type for hard disk aliases */
134  kContainerFloppyAliasType =
135  FOUR_CHAR_CODE('flpy'), /* type for floppy aliases */
136  kContainerServerAliasType =
137  FOUR_CHAR_CODE('srvr'), /* type for server aliases */
138  kApplicationAliasType =
139  FOUR_CHAR_CODE('adrp'), /* type for application aliases */
140  kContainerAliasType =
141  FOUR_CHAR_CODE('drop'), /* type for all other containers */
142  kDesktopPrinterAliasType =
143  FOUR_CHAR_CODE('dtpa'), /* type for Desktop Printer alias */
144  kContainerCDROMAliasType = FOUR_CHAR_CODE('cddr'), /* type for CD-ROM alias */
145  kApplicationCPAliasType =
146  FOUR_CHAR_CODE('acdp'), /* type for application control panel alias */
147  kApplicationDAAliasType =
148  FOUR_CHAR_CODE('addp'), /* type for application DA alias */
149  kPackageAliasType = FOUR_CHAR_CODE('fpka'), /* type for plain package alias */
150  kAppPackageAliasType =
151  FOUR_CHAR_CODE('fapa') /* type for application package alias */
152 };
153 
154 /* Types for Special folder aliases */
155 enum {
156  kSystemFolderAliasType = FOUR_CHAR_CODE('fasy'),
157  kAppleMenuFolderAliasType = FOUR_CHAR_CODE('faam'),
158  kStartupFolderAliasType = FOUR_CHAR_CODE('fast'),
159  kPrintMonitorDocsFolderAliasType = FOUR_CHAR_CODE('fapn'),
160  kPreferencesFolderAliasType = FOUR_CHAR_CODE('fapf'),
161  kControlPanelFolderAliasType = FOUR_CHAR_CODE('fact'),
162  kExtensionFolderAliasType = FOUR_CHAR_CODE('faex')
163 };
164 
165 /* Types for AppleShare folder aliases */
166 enum {
167  kExportedFolderAliasType = FOUR_CHAR_CODE('faet'),
168  kDropFolderAliasType = FOUR_CHAR_CODE('fadr'),
169  kSharedFolderAliasType = FOUR_CHAR_CODE('fash'),
170  kMountedFolderAliasType = FOUR_CHAR_CODE('famn')
171 };
172 
173 /* Finder flags (finderFlags, fdFlags and frFlags) */
174 /* Any flag reserved or not specified should be set to 0. */
175 /* If a flag applies to a file, but not to a folder, make sure to check */
176 /* that the item is not a folder by checking ((ParamBlockRec.ioFlAttrib &
177  * ioDirMask) == 0) */
178 enum {
179  kIsOnDesk = 0x0001, /* Files and folders (System 6) */
180  kColor = 0x000E, /* Files and folders */
181  /* bit 0x0020 was kRequireSwitchLaunch, but is now reserved for future use*/
182  kIsShared = 0x0040, /* Files only (Applications only) */
183  /* If clear, the application needs to write to */
184  /* its resource fork, and therefore cannot be */
185  /* shared on a server */
186  kHasNoINITs = 0x0080, /* Files only (Extensions/Control Panels only) */
187  /* This file contains no INIT resource */
188  kHasBeenInited = 0x0100, /* Files only */
189  /* Clear if the file contains desktop database */
190  /* resources ('BNDL', 'FREF', 'open', 'kind'...) */
191  /* that have not been added yet. Set only by the Finder */
192  /* Reserved for folders - make sure this bit is cleared for folders */
193  /* bit 0x0200 was the letter bit for AOCE, but is now reserved for future use
194  */
195  kHasCustomIcon = 0x0400, /* Files and folders */
196  kIsStationery = 0x0800, /* Files only */
197  kNameLocked = 0x1000, /* Files and folders */
198  kHasBundle = 0x2000, /* Files only */
199  kIsInvisible = 0x4000, /* Files and folders */
200  kIsAlias = 0x8000 /* Files only */
201 };
202 
203 /* Obsolete. Use names defined above. */
204 enum {
205  fOnDesk = kIsOnDesk,
206  fHasBundle = kHasBundle,
207  fInvisible = kIsInvisible
208 };
209 
210 /* Obsolete */
211 enum { fTrash = -3, fDesktop = -2, fDisk = 0 };
212 
213 #if OLDROUTINENAMES
214 enum { kIsStationary = kIsStationery };
215 
216 #endif /* OLDROUTINENAMES */
217 
218 /* Extended flags (extendedFinderFlags, fdXFlags and frXFlags) */
219 /* Any flag not specified should be set to 0. */
220 enum {
221  kExtendedFlagsAreInvalid =
222  0x8000, /* If set the other extended flags are ignored */
223  kExtendedFlagHasCustomBadge =
224  0x0100, /* Set if the file or folder has a badge resource */
225  kExtendedFlagHasRoutingInfo =
226  0x0004 /* Set if the file contains routing info resource */
227 };
228 
229 /* Use a filetype in this range to indicate that a file is temporarily busy */
230 /* (while it is being downloaded or installed, for example). This prevents */
231 /* Finder 8.5 and later from trying to change the item's attributes before it */
232 /* is fully created. -- If you provide a series of 'BNDL' icons for your creator
233  */
234 /* and some of these filetypes, you can achieve limited icon animation while */
235 /* the file creation progresses. */
236 enum {
237  kFirstMagicBusyFiletype = FOUR_CHAR_CODE('bzy '),
238  kLastMagicBusyFiletype = FOUR_CHAR_CODE('bzy?')
239 };
240 
241 /* Use this date as a file's or folder's creation date to indicate that it is */
242 /* temporarily busy (while it is being downloaded or installed, for example). */
243 /* This prevents Finder from trying to change the item's attributes before it */
244 /* is fully created (Finder 8.5 and 8.6 check file creation dates; later Finders
245  */
246 /* may check folder creation dates as well). */
247 enum { kMagicBusyCreationDate = 0x4F3AFDB0 };
248 
249 /*------------------------------------------------------------------------*/
255 /*------------------------------------------------------------------------*/
256 
257 struct FileInfo {
258  OSType fileType; /* The type of the file */
259  OSType fileCreator; /* The file's creator */
260  UInt16 finderFlags; /* ex: kHasBundle, kIsInvisible... */
261  Point location; /* File's location in the folder */
262  /* If set to {0, 0}, the Finder will place the item automatically */
263  UInt16 reservedField; /* (set to 0) */
264 };
265 typedef struct FileInfo FileInfo;
266 struct FolderInfo {
267  Rect windowBounds; /* The position and dimension of the folder's window */
268  UInt16 finderFlags; /* ex. kIsInvisible, kNameLocked, etc.*/
269  Point location; /* Folder's location in the parent folder */
270  /* If set to {0, 0}, the Finder will place the item automatically */
271  UInt16 reservedField; /* (set to 0) */
272 };
273 typedef struct FolderInfo FolderInfo;
275  SInt16 reserved1[4]; /* Reserved (set to 0) */
276  UInt16
277  extendedFinderFlags; /* Extended flags (custom badge, routing info...) */
278  SInt16 reserved2; /* Reserved (set to 0). Comment ID if high-bit is clear */
279  SInt32 putAwayFolderID; /* Put away folder ID */
280 };
281 typedef struct ExtendedFileInfo ExtendedFileInfo;
283  Point scrollPosition; /* Scroll position (for icon views) */
284  SInt32 reserved1; /* Reserved (set to 0) */
285  UInt16
286  extendedFinderFlags; /* Extended flags (custom badge, routing info...) */
287  SInt16 reserved2; /* Reserved (set to 0). Comment ID if high-bit is clear */
288  SInt32 putAwayFolderID; /* Put away folder ID */
289 };
291 /*------------------------------------------------------------------------*/
297 /*------------------------------------------------------------------------*/
298 /* File info */
303 struct FInfo {
304  OSType fdType; /* The type of the file */
305  OSType fdCreator; /* The file's creator */
306  UInt16 fdFlags; /* Flags ex. kHasBundle, kIsInvisible, etc. */
307  Point fdLocation; /* File's location in folder. */
308  /* If set to {0, 0}, the Finder will place the item automatically */
309  SInt16 fdFldr; /* Reserved (set to 0) */
310 };
311 typedef struct FInfo FInfo;
312 /* Extended file info */
319 struct FXInfo {
320  SInt16 fdIconID; /* Reserved (set to 0) */
321  SInt16 fdReserved[3]; /* Reserved (set to 0) */
322  SInt8 fdScript; /* Extended flags. Script code if high-bit is set */
323  SInt8 fdXFlags; /* Extended flags */
324  SInt16 fdComment; /* Reserved (set to 0). Comment ID if high-bit is clear */
325  SInt32 fdPutAway; /* Put away folder ID */
326 };
327 typedef struct FXInfo FXInfo;
328 /* Folder info */
334 struct DInfo {
335  Rect frRect; /* Folder's window bounds */
336  UInt16 frFlags; /* Flags ex. kIsInvisible, kNameLocked, etc.*/
337  Point frLocation; /* Folder's location in parent folder */
338  /* If set to {0, 0}, the Finder will place the item automatically */
339  SInt16 frView; /* Reserved (set to 0) */
340 };
341 typedef struct DInfo DInfo;
342 /* Extended folder info */
349 struct DXInfo {
350  Point frScroll; /* Scroll position */
351  SInt32 frOpenChain; /* Reserved (set to 0) */
352  SInt8 frScript; /* Extended flags. Script code if high-bit is set */
353  SInt8 frXFlags; /* Extended flags */
354  SInt16 frComment; /* Reserved (set to 0). Comment ID if high-bit is clear */
355  SInt32 frPutAway; /* Put away folder ID */
356 };
357 typedef struct DXInfo DXInfo;
358 /* ControlPanelDefProcPtr and cdev constants have all been moved to
359  * Processes.i*/
360 
361 #if PRAGMA_STRUCT_ALIGN
362 #pragma options align = reset
363 #elif PRAGMA_STRUCT_PACKPUSH
364 #pragma pack(pop)
365 #elif PRAGMA_STRUCT_PACK
366 #pragma pack()
367 #endif
368 
369 #ifdef PRAGMA_IMPORT_OFF
370 #pragma import off
371 #elif PRAGMA_IMPORT
372 #pragma import reset
373 #endif
374 
375 #ifdef __cplusplus
376 }
377 #endif
378 
379 #endif /* __FINDER__ */
Basic Macintosh data types.
Definition: Finder.h:87
Definition: Finder.h:334
Definition: Finder.h:349
Definition: Finder.h:274
Definition: Finder.h:282
Definition: Finder.h:303
Definition: Finder.h:319
Definition: Finder.h:257
Definition: Finder.h:266
Definition: MacTypes.h:520
Definition: MacTypes.h:527
Definition: Finder.h:115