1 /* 2 * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef RTF_TRANSLATOR_H 6 #define RTF_TRANSLATOR_H 7 8 9 #include <Translator.h> 10 #include <TranslatorFormats.h> 11 #include <TranslationDefs.h> 12 #include <GraphicsDefs.h> 13 #include <InterfaceDefs.h> 14 #include <DataIO.h> 15 #include <File.h> 16 #include <ByteOrder.h> 17 #include <fs_attr.h> 18 19 20 #define RTF_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(0, 6, 0) 21 #define RTF_TEXT_FORMAT 'RTF ' 22 #define RTF_IN_QUALITY 0.7 23 #define RTF_IN_CAPABILITY 0.9 24 25 #define TEXT_OUT_QUALITY 0.3 26 #define TEXT_OUT_CAPABILITY 0.6 27 #define STXT_OUT_QUALITY 0.5 28 #define STXT_OUT_CAPABILITY 0.5 29 30 31 class RTFTranslator : public BTranslator { 32 public: 33 RTFTranslator(); 34 35 virtual const char *TranslatorName() const; 36 virtual const char *TranslatorInfo() const; 37 virtual int32 TranslatorVersion() const; 38 39 virtual const translation_format *InputFormats(int32 *_outCount) const; 40 virtual const translation_format *OutputFormats(int32 *_outCount) const; 41 42 virtual status_t Identify(BPositionIO *inSource, 43 const translation_format *inFormat, BMessage *ioExtension, 44 translator_info *outInfo, uint32 outType); 45 46 virtual status_t Translate(BPositionIO *inSource, 47 const translator_info *inInfo, BMessage *ioExtension, 48 uint32 outType, BPositionIO *outDestination); 49 50 virtual status_t MakeConfigurationView(BMessage *ioExtension, 51 BView **outView, BRect *outExtent); 52 53 protected: 54 virtual ~RTFTranslator(); 55 // this is protected because the object is deleted by the 56 // Release() function instead of being deleted directly by 57 // the user 58 59 private: 60 char *fInfo; 61 }; 62 63 #endif /* RTF_TRANSLATOR_H */ 64