2 * Copyright (c) 2005-2010, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
6 * DarkWyrm <darkwyrm@gmail.com>
11 #include <ColumnTypes.h>
12 #include <Resources.h>
16 class TypeCodeField
: public BStringField
19 TypeCodeField(const type_code
&code
, ResourceData
*data
);
20 type_code
GetTypeCode(void) const { return fTypeCode
; }
21 ResourceData
* GetResourceData(void) const { return fData
; }
28 // This is the base class for fields displaying the preview in the Data
29 // column of the main window. Each child class must implement all methods
30 class PreviewField
: public BField
34 virtual ~PreviewField(void);
35 virtual void DrawField(BRect rect
, BView
* parent
) = 0;
36 virtual void SetData(char *data
, const size_t &length
) = 0;
39 // Unlike the BBitmapField class, this one actually takes ownership of the
40 // bitmap passed to it. This is good because the bitmap given to it is
41 // allocated by the Translation Kit.
42 class BitmapPreviewField
: public PreviewField
45 BitmapPreviewField(BBitmap
*bitmap
);
46 virtual ~BitmapPreviewField(void);
47 virtual void DrawField(BRect rect
, BView
* parent
);
48 virtual void SetData(char *data
, const size_t &length
);
54 class IntegerPreviewField
: public PreviewField
57 IntegerPreviewField(const int64
&value
);
58 virtual ~IntegerPreviewField(void);
59 virtual void DrawField(BRect rect
, BView
* parent
);
60 virtual void SetData(char *data
, const size_t &length
);
67 class StringPreviewField
: public PreviewField
70 StringPreviewField(const char *string
);
71 virtual ~StringPreviewField(void);
72 virtual void DrawField(BRect rect
, BView
* parent
);
73 virtual void SetData(char *data
, const size_t &length
);
80 BString
MakeTypeString(int32 type
);