1/*
2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef ICO_TRANSLATOR_H
6#define ICO_TRANSLATOR_H
7
8
9#include "BaseTranslator.h"
10
11#include <Translator.h>
12#include <TranslatorFormats.h>
13#include <TranslationDefs.h>
14#include <GraphicsDefs.h>
15#include <InterfaceDefs.h>
16#include <DataIO.h>
17#include <File.h>
18#include <ByteOrder.h>
19
20
21#define ICO_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(0, 3, 0)
22#define ICO_IMAGE_FORMAT	'ICO '
23
24#define ICO_IN_QUALITY		0.5
25#define ICO_IN_CAPABILITY	0.5
26#define BITS_IN_QUALITY		1
27#define BITS_IN_CAPABILITY	1
28
29#define ICO_OUT_QUALITY		0.8
30#define ICO_OUT_CAPABILITY	0.8
31#define BITS_OUT_QUALITY	1
32#define BITS_OUT_CAPABILITY	0.9
33
34
35class ICOTranslator : public BaseTranslator {
36	public:
37		ICOTranslator();
38
39		virtual status_t DerivedIdentify(BPositionIO *inSource,
40			const translation_format *inFormat, BMessage *ioExtension,
41			translator_info *outInfo, uint32 outType);
42
43		virtual status_t DerivedTranslate(BPositionIO *inSource,
44			const translator_info *inInfo, BMessage *ioExtension,
45			uint32 outType, BPositionIO *outDestination, int32 baseType);
46
47		virtual status_t DerivedCanHandleImageSize(float width,
48			float height) const;
49
50		virtual BView *NewConfigView(TranslatorSettings *settings);
51
52	protected:
53		virtual ~ICOTranslator();
54			// this is protected because the object is deleted by the
55			// Release() function instead of being deleted directly by
56			// the user
57
58	private:
59};
60
61// Extensions that ShowImage supports
62extern const char *kDocumentCount;
63extern const char *kDocumentIndex;
64
65#endif	/* ICO_TRANSLATOR_H */
66