1/*
2 * Copyright 2001-2010, 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 <GroupView.h>
12#include <Messenger.h>
13#include <ObjectList.h>
14#include <String.h>
15
16
17static const uint32 MSG_HALF_FONT_CHANGED				= 'mchf';
18static const uint32 MSG_HALF_SIZE_CHANGED				= 'mchs';
19static const uint32 MSG_FULL_FONT_CHANGED				= 'mcff';
20static const uint32 MSG_FULL_SIZE_CHANGED				= 'mcfs';
21static const uint32 MSG_COLOR_CHANGED					= 'mcbc';
22
23static const uint32 MSG_TAB_TITLE_SETTING_CHANGED		= 'mtts';
24static const uint32 MSG_WINDOW_TITLE_SETTING_CHANGED	= 'mwts';
25static const uint32 MSG_BLINK_CURSOR_CHANGED			= 'mbcc';
26static const uint32 MSG_ALLOW_BOLD_CHANGED				= 'mabc';
27static const uint32 MSG_USE_OPTION_AS_META_CHANGED		= 'momc';
28static const uint32 MSG_WARN_ON_EXIT_CHANGED			= 'mwec';
29static const uint32 MSG_COLS_CHANGED					= 'mccl';
30static const uint32 MSG_HISTORY_CHANGED					= 'mhst';
31// TODO MSG_ENCODING_CHANGED?
32
33static const uint32 MSG_PREF_MODIFIED					= 'mpmo';
34
35
36struct color_scheme;
37class BCheckBox;
38class BColorControl;
39class BMenu;
40class BMenuField;
41class BPopUpMenu;
42class BTextControl;
43
44
45class AppearancePrefView : public BGroupView {
46public:
47								AppearancePrefView(const char* name,
48									const BMessenger &messenger);
49
50	virtual	void				Revert();
51	virtual void				MessageReceived(BMessage* message);
52	virtual void				AttachedToWindow();
53
54private:
55			void				_SetEncoding(const char* encoding);
56			void				_SetWindowSize(int rows, int cols);
57
58	static	BMenu*				_MakeFontMenu(uint32 command,
59									const char* defaultFamily,
60									const char* defaultStyle);
61	static	BMenu*				_MakeFontSizeMenu(const char* label,
62									uint32 command,
63									const char* family,
64									const char* style,
65									const char* size);
66
67	static	BPopUpMenu*			_MakeMenu(uint32 msg, const char** items,
68										const char* defaultItem);
69
70			void				_MarkSelectedFont(const char* family,
71									const char* style, const char* size);
72
73			BCheckBox*			fBlinkCursor;
74			BCheckBox*			fAllowBold;
75			BCheckBox*			fUseOptionAsMetaKey;
76			BCheckBox*			fWarnOnExit;
77			BMenuField*			fFontField;
78
79			BMenuField*			fWindowSizeField;
80			BMenuField*			fEncodingField;
81
82			BTextControl*		fTabTitle;
83			BTextControl*		fWindowTitle;
84
85			BMessenger			fTerminalMessenger;
86};
87
88
89#endif	// APPEARANCE_PREF_VIEW_H
90