Important: The information in this document is obsolete and should not be used for new development.
DoGetFileTranslationListA file translation extension must respond to the
kTranslateGetFileTranslationListrequest code. Whenever it first notices the extension, Macintosh Easy Open calls your extension with this request code to obtain a list of the file types that the extension can translate. You can handle this request by calling the
CallComponentFunctionWithStoragefunction and passing it a pointer to a function with the syntax defined by the
FUNCTION DoGetFileTranslationList (self: ComponentInstance; translationList: FileTranslationListHandle) : ComponentResult;
- A component instance that identifies the component containing the translation extension.
- A handle to a file translation list.
DoGetFileTranslationListfunction should return, through the
translationListparameter, a handle to a list of the file types from and into which your translation extension can translate. On entry to
translationListparameter contains a handle to a structure of type
FileTranslationList. If your translation extension can translate any files at all, your
DoGetFileTranslationListfunction should resize that handle and fill the block with a list of the file types it can translate. If the translation list whose handle you return in
groupCountfield set to 0, Macintosh Easy Open assumes that your extension cannot translate any file types.
Macintosh Easy Open calls your translation extension's
DoGetFileTranslationListfunction when it first becomes aware of your extension. For improved performance, Macintosh Easy Open remembers each translation extension's most recently returned file translation list and passes that list to
translationListparameter. If you determine that the list hasn't changed, you should simply return the same handle to Macintosh Easy Open.
DoGetFileTranslationListfunction should return
noErrif successful, or an appropriate result code otherwise.
SEE ALSOSee "File Translation Lists" on page 7-48 for a description of the
FileTranslationListdata structure. See "Writing a Translation Extension" beginning on page 7-18 for more information about implementing a translation extension. See Listing 7-6 on page 7-30 for a routine that constructs a sample file translation list.