Important: The information in this document is obsolete and should not be used for new development.
DoGetFileTranslationList
A file translation extension must respond to thekTranslateGetFileTranslationList
request 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 theCallComponentFunctionWithStorage
function and passing it a pointer to a function with the syntax defined by theDoGetFileTranslationList
function.
FUNCTION DoGetFileTranslationList (self: ComponentInstance; translationList: FileTranslationListHandle) : ComponentResult;
self
- A component instance that identifies the component containing the translation extension.
translationList
- A handle to a file translation list.
DESCRIPTION
YourDoGetFileTranslationList
function should return, through thetranslationList
parameter, a handle to a list of the file types from and into which your translation extension can translate. On entry toDoGetFileTranslationList
, thetranslationList
parameter contains a handle to a structure of typeFileTranslationList
. If your translation extension can translate any files at all, yourDoGetFileTranslationList
function 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 intranslationList
has thegroupCount
field set to 0, Macintosh Easy Open assumes that your extension cannot translate any file types.Macintosh Easy Open calls your translation extension's
DoGetFileTranslationList
function 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 toDoGetFileTranslationList
in thetranslationList
parameter. If you determine that the list hasn't changed, you should simply return the same handle to Macintosh Easy Open.RESULT CODES
TheDoGetFileTranslationList
function should returnnoErr
if successful, or an appropriate result code otherwise.SEE ALSO
See "File Translation Lists" on page 7-48 for a description of theFileTranslationList
data 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.