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-Defined Routines / Scrap Translation Extension Routines


DoGetScrapTranslationList

A scrap translation extension must respond to the kTranslateGetScrapTranslationList request code. At system startup time, the Translation Manager calls your extension with this request code to obtain a list of the scrap types that the extension can translate. You can handle this request by calling the CallComponentFunctionWithStorage function and passing it a pointer to a function with the syntax defined by the DoGetScrapTranslationList function.

FUNCTION DoGetScrapTranslationList 
                        (self: ComponentInstance; 
                         list: ScrapTranslationListHandle) 
                         : ComponentResult;
self
A component instance that identifies the component containing the translation extension.
list
A handle to a scrap translation list.
DESCRIPTION
The DoGetScrapTranslationList function returns, through the list parameter, a handle to a list of the scrap types from and into which your translation extension can translate. On entry to DoGetScrapTranslationList, the list parameter contains a handle to a structure of type ScrapTranslationList. If your translation extension can translate any scrap types at all, your DoGetScrapTranslationList function should resize that handle and fill the block with a list of the scrap types it can translate. If the translation list whose handle you return in list has the groupCount field set to 0, Macintosh Easy Open assumes that your extension cannot translate any scrap types.

When it first becomes aware of your extension, Macintosh Easy Open calls your translation extension's DoGetScrapTranslationList function. For improved performance, Macintosh Easy Open remembers each translation extension's most recently returned scrap translation list and passes that list to DoGetScrapTranslationList in the list parameter. If you determine that the list hasn't changed, you should simply return the same handle to Macintosh Easy Open.

RESULT CODES
The DoGetScrapTranslationList function should return noErr if successful, or an appropriate result code otherwise.

SEE ALSO
See "Scrap Translation Lists" on page 7-49 for a description of the ScrapTranslationList data structure. See "Writing a Translation Extension" beginning on page 7-18 for more information about implementing a translation extension.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996