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


DoIdentifyScrap

A scrap translation extension must respond to the kTranslateIdentifyScrap request code. The Translation Manager uses this request code to allow the translation extension to identify a scrap as one 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 DoIdentifyScrap function.

FUNCTION DoIdentifyScrap (self: ComponentInstance; 
                          dataPtr: Ptr;
                          dataLength: Size;
                          VAR dataFormat: ScrapType) 
                          : ComponentResult;
self
A component instance that identifies the component containing the translation extension.
dataPtr
A pointer to the scrap.
dataLength
The size of the scrap to be translated.
dataFormat
On entry, the type of the scrap format. On exit, the type of the scrap format as recognized by your translation extension.
DESCRIPTION
Your DoIdentifyScrap function returns, through the dataFormat parameter, the scrap type of the scrap specified by the dataPtr and dataLength parameters. If your translation extension does not recognize the type of the specified scrap, DoIdentifyScrap should return the result code noTypeErr.

In general, the scrap that your DoIdentifyScrap function is asked to identify is always in one of the formats listed among the source formats in the translation groups contained in your extension's scrap translation list. Your scrap translation extension therefore needs only to verify that the indicated scrap is of the specified format.

RESULT CODES
noErr0No error
noTypeErr-102Unrecognized scrap type

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996