Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 7 - Translation Manager / Translation Extension Reference
Translation Extension Data Structures


File Type Specifications

You use file type specifications to describe document formats in a file translation list. (See the next section for a description of file translation lists.) The interpretation of some of the fields of a file type specification depends on whether the specification occurs in the list of source document types or in the list of destination document types. A file type specification is defined by the FileTypeSpec data structure.

TYPE FileTypeSpec = 
   RECORD
      format:           FileType;
      hint:             LongInt;
      flags:            TranslationAttributes;
      catInfoType:      OSType;
      catInfoCreator:   OSType;
   END;
Field Description
format
The translation file type of the document. Macintosh Easy Open uses this field as the canonical way to describe the format of a file for translation purposes.
hint
A 4-byte value reserved for use by your translation extension.
flags
A 4-byte value consisting of bit flags that specify how to control the translation. This field is used only for destination file types; you should set it to 0 for all source file type specifications. Currently 2 bits are defined; all other bits should be cleared to 0:
               CONST
                  taDstDocNeedsResourceFork     = 1;
                  taDstIsAppTranslation         = 2;
Before Macintosh Easy Open sends your translation extension the kTranslateTranslateFile request code, it has already created the destination file's data fork. The bit specified by the constant taDstDocNeedsResourceFork should be set if the translated document also needs a resource fork.
The bit specified by the constant taDstIsAppTranslation should be set if your extension doesn't actually perform the translation because an associated application can already translate the specified file type into the desired format. See "Writing Application Translation Extensions" on page 7-35 for more details.
catInfoType
The type of the file as contained in the volume's catalog file.
catInfoCreator
The creator of the file as contained in the volume's catalog file.
In file type specifications occurring in the list of source document types in a file translation list, Macintosh Easy Open uses the format and catInfoCreator fields to determine the kind string displayed in the "From" format specification of the translation progress dialog box (see Figure 7-4 on page 7-7).

In file type specifications occurring in the list of destination document types in a file translation list, Macintosh Easy Open uses the format and catInfoCreator fields to determine the kind string displayed in the "To" format specification in the translation progress dialog box (see Figure 7-4 on page 7-7). The format and catInfoCreator fields are also used to get the information displayed in the Document Converter dialog box (Figure 7-7 on page 7-9). However, Macintosh Easy Open uses the catInfoType and catInfoCreator fields to set the catalog type and creator of the destination file.

Note
See page 7-19 for a discussion of why the translation file type described in the format field may differ from the catalog type described in the catInfoType field.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996