xref: /haiku/src/apps/terminal/AppearPrefView.h (revision 9760dcae2038d47442f4658c2575844c6cf92c40)
1 /*
2  * Copyright 2001-2007, Haiku, Inc.
3  * Copyright 2003-2004 Kian Duffy, myob@users.sourceforge.net
4  * Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai.
5  * All rights reserved. Distributed under the terms of the MIT license.
6  */
7 #ifndef APPEARANCE_PREF_VIEW_H
8 #define APPEARANCE_PREF_VIEW_H
9 
10 
11 #include <Messenger.h>
12 #include <String.h>
13 #include <View.h>
14 
15 
16 const ulong MSG_HALF_FONT_CHANGED	= 'mchf';
17 const ulong MSG_HALF_SIZE_CHANGED	= 'mchs';
18 const ulong MSG_FULL_FONT_CHANGED	= 'mcff';
19 const ulong MSG_FULL_SIZE_CHANGED	= 'mcfs';
20 const ulong MSG_COLOR_FIELD_CHANGED	= 'mccf';
21 const ulong MSG_COLOR_CHANGED		= 'mcbc';
22 
23 const ulong MSG_COLS_CHANGED            = 'mccl';
24 const ulong MSG_ROWS_CHANGED            = 'mcrw';
25 const ulong MSG_HISTORY_CHANGED         = 'mhst';
26 
27 const ulong MSG_PREF_MODIFIED		= 'mpmo';
28 
29 
30 class BColorControl;
31 class BMenu;
32 class BMenuField;
33 class BPopUpMenu;
34 
35 class AppearancePrefView : public BView {
36 public:
37 								AppearancePrefView(const char *name,
38 									const BMessenger &messenger);
39 
40 	virtual	void				Revert();
41 	virtual void				MessageReceived(BMessage *message);
42 	virtual void				AttachedToWindow();
43 
44 	virtual	void				GetPreferredSize(float *_width,
45 									float *_height);
46 
47 private:
48 	static	BMenu*				_MakeFontMenu(uint32 command,
49 									const char *defaultFamily,
50 									const char *defaultStyle);
51 	static	BMenu*				_MakeSizeMenu(uint32 command,
52 									uint8 defaultSize);
53 
54 	static	BPopUpMenu*			_MakeMenu(uint32 msg, const char **items,
55 									const char *defaultItemName);
56 
57 			BMenuField			*fFont;
58 			BMenuField			*fFontSize;
59 
60 			BMenuField			*fColorField;
61 			BColorControl		*fColorControl;
62 
63 			BMessenger			fTerminalMessenger;
64 };
65 
66 #endif	// APPEARANCE_PREF_VIEW_H
67