tcp: Fix 64 bit build with debugging features enabled.
[haiku.git] / src / kits / translation / FuncTranslator.h
blob996df98bedae0ee109b17c68cf42892c6bb95243
1 /*
2 * Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Michael Wilber
7 * Axel Dörfler, axeld@pinc-software.de
8 */
9 #ifndef _FUNC_TRANSLATOR_H
10 #define _FUNC_TRANSLATOR_H
13 #include <Translator.h>
16 // Structure used to hold the collection of function pointers and
17 // public variables exported by function based translator add-ons.
18 struct translator_data {
19 const char* name;
20 const char* info;
21 int32 version;
22 const translation_format* input_formats;
23 const translation_format* output_formats;
25 status_t (*identify_hook)(BPositionIO* source, const translation_format* format,
26 BMessage* ioExtension, translator_info* outInfo, uint32 outType);
28 status_t (*translate_hook)(BPositionIO* source, const translator_info* info,
29 BMessage* ioExtension, uint32 outType, BPositionIO* destination);
31 status_t (*make_config_hook)(BMessage* ioExtension, BView** _view, BRect* _extent);
32 status_t (*get_config_message_hook)(BMessage* ioExtension);
35 namespace BPrivate {
37 class BFuncTranslator : public BTranslator {
38 public:
39 BFuncTranslator(const translator_data& data);
41 virtual const char *TranslatorName() const;
42 virtual const char *TranslatorInfo() const;
43 virtual int32 TranslatorVersion() const;
45 virtual const translation_format *InputFormats(int32 *out_count) const;
46 virtual const translation_format *OutputFormats(int32 *out_count) const;
48 virtual status_t Identify(BPositionIO *inSource,
49 const translation_format *inFormat, BMessage *ioExtension,
50 translator_info *outInfo, uint32 outType);
51 virtual status_t Translate(BPositionIO *inSource,
52 const translator_info *inInfo, BMessage *ioExtension, uint32 outType,
53 BPositionIO * outDestination);
54 virtual status_t MakeConfigurationView(BMessage *ioExtension,
55 BView **outView, BRect *outExtent);
56 virtual status_t GetConfigurationMessage(BMessage *ioExtension);
58 protected:
59 virtual ~BFuncTranslator();
60 // This object is deleted by calling Release(),
61 // it can not be deleted directly. See BTranslator in the Be Book
63 private:
64 translator_data fData;
67 } // namespace BPrivate
69 #endif // _FUNC_TRANSLATOR_H