xref: /haiku/src/apps/terminal/PrefWindow.h (revision b028e77473189065f2baefc6f5e10d451cf591e2)
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 ulong MSG_SAVE_PRESSED = 'okok';
18 const ulong MSG_SAVEAS_PRESSED = 'canl';
19 const ulong MSG_REVERT_PRESSED = 'revt';
20 const ulong 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(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		*fPrefTemp;
50 		BFilePanel		*fSavePanel;
51 
52 		BButton			*fSaveAsFileButton,
53 						*fRevertButton,
54 						*fSaveButton;
55 
56 		bool			fDirty;
57 		BMessenger		fPrefDlgMessenger;
58 };
59 
60 #endif	// PREFDLG_H_INCLUDED
61