To extend data translators, you must provide one translator class to serve as a gateway between third party data and Taligent objects. To write this translator, you need to create a library that contains a derived class of TForeignDataTranslator. TGIFTranslator and TXBMTranslator both override
CreateScrapItem provides the interface for converting an abstract TForeignData object to a CommonPoint TScrapItem. Both sample translators achieve this by creating a stream from the TForeignData object and then parsing the incoming data. TGIFTranslator accomplishes this by using the built-in CommonPoint TGIFConverter. TXBMTranslator shows a full conversion from an incoming data stream to an X-Bitmap image.
In both cases, the incoming data is bundled into a scrap item and returned. The recipient of the scrap item can use CommonPoint's dynamic cast interface to extract the data it requires.
NOTE
The ExportData member function translates from a local scrap item to an external data type. It is unsupported in this release.
Once you have written your translators, you can install them in the global translators with a text file that specifies the supported translators using
the CreateScrapItem and ExportData member functions to implement the translator protocol.
the command
For the GIF translator, this file is called GIFTranslator.txt. You install it using $TaligentBinaries/InstallTranslator
the command
When you have installed the translators, they automatically become available to any program that uses a TImportForeignDataQuery with the appropriate type $TaligentBinaries/InstallTranslator GIFTranslator.txt
of input.