Important: The information in this document is obsolete and should not be used for new development.
DoIdentifyScrap
A scrap translation extension must respond to thekTranslateIdentifyScrap
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 theCallComponentFunctionWithStorage
function and passing it a pointer to a function with the syntax defined by theDoIdentifyScrap
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
YourDoIdentifyScrap
function returns, through thedataFormat
parameter, the scrap type of the scrap specified by thedataPtr
anddataLength
parameters. If your translation extension does not recognize the type of the specified scrap,DoIdentifyScrap
should return the result codenoTypeErr
.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
noErr 0 No error noTypeErr -102 Unrecognized scrap type