libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / apps / resedit / ResFields.h
blobf00ae40f24cef86d2526cab79347da62676f9025
1 /*
2 * Copyright (c) 2005-2010, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Author:
6 * DarkWyrm <darkwyrm@gmail.com>
7 */
8 #ifndef RESFIELDS_H
9 #define RESFIELDS_H
11 #include <ColumnTypes.h>
12 #include <Resources.h>
14 class ResourceData;
16 class TypeCodeField : public BStringField
18 public:
19 TypeCodeField(const type_code &code, ResourceData *data);
20 type_code GetTypeCode(void) const { return fTypeCode; }
21 ResourceData * GetResourceData(void) const { return fData; }
23 private:
24 type_code fTypeCode;
25 ResourceData *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
32 public:
33 PreviewField(void);
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
44 public:
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);
50 private:
51 BBitmap *fBitmap;
54 class IntegerPreviewField : public PreviewField
56 public:
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);
62 private:
63 int64 fValue;
67 class StringPreviewField : public PreviewField
69 public:
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);
75 private:
76 BString fString;
77 BString fClipped;
80 BString MakeTypeString(int32 type);
82 #endif