Carbon


DoGetFileTranslationListProcPtr

Header: TranslationExtensions.h Carbon status: Unsupported

Defines a pointer to a get file translation list callback function. Your get file translation list callback function returns a list of the file types which your extension can translate.

typedef ComponentResult(* DoGetFileTranslationListProcPtr) (
    ComponentInstance self, 
    FileTranslationListHandle translationList
);

You would declare your function like this if you were to name it MyDoGetFileTranslationListCallback:

ComponentResult MyDoGetFileTranslationListCallback (
    ComponentInstance self, 
    FileTranslationListHandle translationList
);
Parameter descriptions
self

A component instance that identifies the component containing the translation extension.

translationList

On entry to your function, this parameter contains a handle to a structure of type FileTranslationList. If your translation extension can translate any files at all, your 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 in this parameter has the groupCount field set to 0, Macintosh Easy Open assumes that your extension cannot translate any file types.

For improved performance, Macintosh Easy Open remembers each translation extension’s most recently returned file translation list and passes that list to your get file translation list callback function in this parameter. If you determine that the list hasn’t changed, you should simply return the same handle to Macintosh Easy Open.

function result

If successful, your function should return noErr. Otherwise, your function should return an appropriate result code. The Component Manager requires this function to return a value of type ComponentResult to simplify dispatching.

DISCUSSION

A file translation extension must respond to the kTranslateGetFileTranslationList 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 the Component Manager functionCallComponentFunctionWithStorage and passing it a pointer to a your get file translation list callback function.

CARBON NOTES

The functions contained in TranslationExtensions.h were originally written to be used only by someone implementing a Mac Easy Open translation component. Carbon, however, is for applications and not extensions. Therefore, this function is not supported.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)