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 17const uint32 MSG_DEFAULTS_PRESSED = 'defl'; 18const uint32 MSG_SAVEAS_PRESSED = 'canl'; 19const uint32 MSG_REVERT_PRESSED = 'revt'; 20const uint32 MSG_PREF_CLOSED = 'mspc'; 21 22class BButton; 23class BFilePanel; 24class BMessage; 25class BRect; 26class BTextControl; 27 28class PrefHandler; 29 30 31class 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