Important: The information in this document is obsolete and should not be used for new development.
DoIdentifyScrapA scrap translation extension must respond to the
kTranslateIdentifyScraprequest 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
CallComponentFunctionWithStoragefunction and passing it a pointer to a function with the syntax defined by the
FUNCTION DoIdentifyScrap (self: ComponentInstance; dataPtr: Ptr; dataLength: Size; VAR dataFormat: ScrapType) : ComponentResult;
- A component instance that identifies the component containing the translation extension.
- A pointer to the scrap.
- The size of the scrap to be translated.
- On entry, the type of the scrap format. On exit, the type of the scrap format as recognized by your translation extension.
DoIdentifyScrapfunction returns, through the
dataFormatparameter, the scrap type of the scrap specified by the
dataLengthparameters. If your translation extension does not recognize the type of the specified scrap,
DoIdentifyScrapshould return the result code
In general, the scrap that your
DoIdentifyScrapfunction 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.
noErr 0 No error noTypeErr -102 Unrecognized scrap type