xref: /haiku/src/apps/webpositive/SettingsWindow.h (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2  * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
3  *
4  * All rights reserved. Distributed under the terms of the MIT License.
5  */
6 #ifndef SETTINGS_WINDOW_H
7 #define SETTINGS_WINDOW_H
8 
9 #include <Window.h>
10 
11 
12 class BButton;
13 class BCheckBox;
14 class BMenu;
15 class BMenuField;
16 class BMenuItem;
17 class BSpinner;
18 class BTextControl;
19 class FontSelectionView;
20 class SettingsMessage;
21 class BFilePanel;
22 
23 
24 class SettingsWindow : public BWindow {
25 public:
26 								SettingsWindow(BRect frame,
27 									SettingsMessage* settings);
28 	virtual						~SettingsWindow();
29 
30 	virtual	void				MessageReceived(BMessage* message);
31 	virtual	bool				QuitRequested();
32 
33 	virtual	void				Show();
34 
35 private:
36 			BView*				_CreateGeneralPage(float spacing);
37 			BView*				_CreateFontsPage(float spacing);
38 			BView*				_CreateProxyPage(float spacing);
39 			void				_SetupFontSelectionView(
40 									FontSelectionView* view,
41 									BMessage* message);
42 
43 			bool				_CanApplySettings() const;
44 			void				_ApplySettings();
45 			void				_RevertSettings();
46 			void 				_ChooseDownloadFolder(const BMessage* message);
47 
48 			void				_HandleDownloadPanelResult(BFilePanel* panel,
49 									const BMessage* message);
50 			void				_ValidateControlsEnabledStatus();
51 
52 			uint32				_StartUpPolicy() const;
53 			uint32				_NewWindowPolicy() const;
54 			uint32				_NewTabPolicy() const;
55 
56 			BFont				_FindDefaultSerifFont() const;
57 
58 			uint32				_ProxyPort() const;
59 
60 private:
61 			SettingsMessage*	fSettings;
62 
63 			BTextControl*		fStartPageControl;
64 			BTextControl*		fSearchPageControl;
65 			BTextControl*		fDownloadFolderControl;
66 
67 			BMenuField*			fNewWindowBehaviorMenu;
68 			BMenuItem*			fNewWindowBehaviorOpenHomeItem;
69 			BMenuItem*			fNewWindowBehaviorOpenSearchItem;
70 			BMenuItem*			fNewWindowBehaviorOpenBlankItem;
71 
72 			BMenuField*			fNewTabBehaviorMenu;
73 			BMenuItem*			fNewTabBehaviorCloneCurrentItem;
74 			BMenuItem*			fNewTabBehaviorOpenHomeItem;
75 			BMenuItem*			fNewTabBehaviorOpenSearchItem;
76 			BMenuItem*			fNewTabBehaviorOpenBlankItem;
77 
78 			BMenuField*			fStartUpBehaviorMenu;
79 			BMenuItem*			fStartUpBehaviorResumePriorSession;
80 			BMenuItem*			fStartUpBehaviorStartNewSession;
81 
82 			BSpinner*			fDaysInHistory;
83 			BCheckBox*			fShowTabsIfOnlyOnePage;
84 			BCheckBox*			fAutoHideInterfaceInFullscreenMode;
85 			BCheckBox*			fAutoHidePointer;
86 			BCheckBox*			fShowHomeButton;
87 
88 			FontSelectionView*	fStandardFontView;
89 			FontSelectionView*	fSerifFontView;
90 			FontSelectionView*	fSansSerifFontView;
91 			FontSelectionView*	fFixedFontView;
92 
93 			BCheckBox*			fUseProxyCheckBox;
94 			BTextControl*		fProxyAddressControl;
95 			BTextControl*		fProxyPortControl;
96 			BCheckBox*			fUseProxyAuthCheckBox;
97 			BTextControl*		fProxyUsernameControl;
98 			BTextControl*		fProxyPasswordControl;
99 
100 			BButton*			fApplyButton;
101 			BButton*			fCancelButton;
102 			BButton*			fRevertButton;
103 			BButton*			fChooseButton;
104 
105 			BSpinner*			fStandardSizesSpinner;
106 			BSpinner*			fFixedSizesSpinner;
107 
108 			BFilePanel*			fOpenFilePanel;
109 };
110 
111 
112 #endif // SETTINGS_WINDOW_H
113 
114