xref: /haiku/src/apps/terminal/PrefWindow.h (revision c237c4ce593ee823d9867fd997e51e4c447f5623)
1 /*
2  * Copyright 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 PREFDLG_H_INCLUDED
8 #define PREFDLG_H_INCLUDED
9 
10 
11 #include "PrefHandler.h"
12 
13 #include <Box.h>
14 #include <Window.h>
15 
16 // local messages
17 const uint32 MSG_DEFAULTS_PRESSED = 'defl';
18 const uint32 MSG_SAVEAS_PRESSED = 'canl';
19 const uint32 MSG_REVERT_PRESSED = 'revt';
20 const uint32 MSG_PREF_CLOSED = 'mspc';
21 
22 class BButton;
23 class BFilePanel;
24 class BMessage;
25 class BRect;
26 class BTextControl;
27 
28 class PrefHandler;
29 
30 
31 class PrefWindow : public BWindow
32 {
33 	public:
34 		PrefWindow(const BMessenger &messenger);
35 		virtual ~PrefWindow();
36 
37 		virtual void Quit();
38 		virtual bool QuitRequested();
39 		virtual void MessageReceived(BMessage *msg);
40 
41 	private:
42 		void _Save();
43 		void _SaveAs();
44 		void _Revert();
45 		void _SaveRequested(BMessage *msg);
46 		BRect _CenteredRect(BRect rect);
47 
48 	private:
49 		PrefHandler		*fPreviousPref;
50 		BFilePanel		*fSavePanel;
51 
52 		BButton			*fSaveAsFileButton,
53 						*fRevertButton,
54 						*fDefaultsButton;
55 
56 		AppearancePrefView	*fAppearanceView;
57 
58 		bool			fDirty;
59 		BMessenger		fTerminalMessenger;
60 };
61 
62 #endif	// PREFDLG_H_INCLUDED
63