Assorted whitespace cleanup and typo fixes.
[haiku.git] / src / preferences / appearance / FontSelectionView.h
blob130a8fe19fa21adafdf41eb3ea3677f036ffbb5f
1 /*
2 * Copyright 2001-2009, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Mark Hogben
7 * DarkWyrm <bpmagic@columbus.rr.com>
8 * Axel Dörfler, axeld@pinc-software.de
9 * Philippe Saint-Pierre, stpere@gmail.com
11 #ifndef FONT_SELECTION_VIEW_H
12 #define FONT_SELECTION_VIEW_H
15 #include <View.h>
17 class BLayoutItem;
18 class BBox;
19 class BMenuField;
20 class BPopUpMenu;
21 class BStringView;
23 static const int32 kMsgSetFamily = 'fmly';
24 static const int32 kMsgSetStyle = 'styl';
25 static const int32 kMsgSetSize = 'size';
28 class FontSelectionView : public BView {
29 public:
30 FontSelectionView(const char* name,
31 const char* label,
32 const BFont* font = NULL);
33 virtual ~FontSelectionView();
35 virtual void MessageReceived(BMessage* message);
37 void SetTarget(BHandler* messageTarget);
39 void SetDefaults();
40 void Revert();
41 bool IsDefaultable();
42 bool IsRevertable();
44 void UpdateFontsMenu();
46 BLayoutItem* CreateSizesLabelLayoutItem();
47 BLayoutItem* CreateSizesMenuBarLayoutItem();
49 BLayoutItem* CreateFontsLabelLayoutItem();
50 BLayoutItem* CreateFontsMenuBarLayoutItem();
52 BView* GetPreviewBox();
54 private:
55 void _SelectCurrentFont(bool select);
56 void _SelectCurrentSize(bool select);
57 void _UpdateFontPreview();
58 void _UpdateSystemFont();
59 void _BuildSizesMenu();
61 protected:
62 BHandler* fMessageTarget;
64 BMenuField* fFontsMenuField;
65 BMenuField* fSizesMenuField;
66 BPopUpMenu* fFontsMenu;
67 BPopUpMenu* fSizesMenu;
69 BBox* fPreviewBox;
70 BStringView* fPreviewText;
72 BFont fSavedFont;
73 BFont fCurrentFont;
74 float fMaxFontNameWidth;
77 #endif // FONT_SELECTION_VIEW_H