Important: The information in this document is obsolete and should not be used for new development.
DoIdentifyScrap
A scrap translation extension must respond to thekTranslateIdentifyScraprequest 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 theCallComponentFunctionWithStoragefunction and passing it a pointer to a function with the syntax defined by theDoIdentifyScrapfunction.
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
YourDoIdentifyScrapfunction returns, through thedataFormatparameter, the scrap type of the scrap specified by thedataPtranddataLengthparameters. If your translation extension does not recognize the type of the specified scrap,DoIdentifyScrapshould return the result codenoTypeErr.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.RESULT CODES
noErr 0 No error noTypeErr -102 Unrecognized scrap type