xref: /haiku/src/apps/webpositive/SettingsWindow.h (revision 899e0ef82b5624ace2ccfa5f5a58c8ebee54aaef)
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 BSeparatorItem;
18 class BSpinner;
19 class BTextControl;
20 class FontSelectionView;
21 class SettingsMessage;
22 class BFilePanel;
23 
24 
25 class SettingsWindow : public BWindow {
26 public:
27 								SettingsWindow(BRect frame,
28 									SettingsMessage* settings);
29 	virtual						~SettingsWindow();
30 
31 	virtual	void				MessageReceived(BMessage* message);
32 	virtual	bool				QuitRequested();
33 
34 	virtual	void				Show();
35 
36 private:
37 			BView*				_CreateGeneralPage(float spacing);
38 			BView*				_CreateFontsPage(float spacing);
39 			BView*				_CreateProxyPage(float spacing);
40 			void				_SetupFontSelectionView(
41 									FontSelectionView* view,
42 									BMessage* message);
43 
44 			bool				_CanApplySettings() const;
45 			void				_ApplySettings();
46 			void				_RevertSettings();
47 			void 				_ChooseDownloadFolder(const BMessage* message);
48 
49 			void				_HandleDownloadPanelResult(BFilePanel* panel,
50 									const BMessage* message);
51 			void				_ValidateControlsEnabledStatus();
52 
53 			uint32				_StartUpPolicy() const;
54 			uint32				_NewWindowPolicy() const;
55 			uint32				_NewTabPolicy() const;
56 
57 			BFont				_FindDefaultSerifFont() const;
58 
59 			uint32				_ProxyPort() const;
60 
61 private:
62 			SettingsMessage*	fSettings;
63 
64 			BTextControl*		fStartPageControl;
65 			BTextControl*		fSearchPageControl;
66 			BTextControl*		fDownloadFolderControl;
67 
68 			BMenuField*			fSearchPageMenu;
69 
70 			BMenuField*			fNewWindowBehaviorMenu;
71 			BMenuItem*			fNewWindowBehaviorOpenHomeItem;
72 			BMenuItem*			fNewWindowBehaviorOpenSearchItem;
73 			BMenuItem*			fNewWindowBehaviorOpenBlankItem;
74 
75 			BMenuField*			fNewTabBehaviorMenu;
76 			BMenuItem*			fNewTabBehaviorCloneCurrentItem;
77 			BMenuItem*			fNewTabBehaviorOpenHomeItem;
78 			BMenuItem*			fNewTabBehaviorOpenSearchItem;
79 			BMenuItem*			fNewTabBehaviorOpenBlankItem;
80 
81 			BMenuField*			fStartUpBehaviorMenu;
82 			BMenuItem*			fStartUpBehaviorResumePriorSession;
83 			BMenuItem*			fStartUpBehaviorStartNewSession;
84 
85 			BSpinner*			fDaysInHistory;
86 			BCheckBox*			fShowTabsIfOnlyOnePage;
87 			BCheckBox*			fAutoHideInterfaceInFullscreenMode;
88 			BCheckBox*			fAutoHidePointer;
89 			BCheckBox*			fShowHomeButton;
90 
91 			FontSelectionView*	fStandardFontView;
92 			FontSelectionView*	fSerifFontView;
93 			FontSelectionView*	fSansSerifFontView;
94 			FontSelectionView*	fFixedFontView;
95 
96 			BCheckBox*			fUseProxyCheckBox;
97 			BTextControl*		fProxyAddressControl;
98 			BTextControl*		fProxyPortControl;
99 			BCheckBox*			fUseProxyAuthCheckBox;
100 			BTextControl*		fProxyUsernameControl;
101 			BTextControl*		fProxyPasswordControl;
102 
103 			BButton*			fApplyButton;
104 			BButton*			fCancelButton;
105 			BButton*			fRevertButton;
106 			BButton*			fChooseButton;
107 
108 			BSpinner*			fStandardSizesSpinner;
109 			BSpinner*			fFixedSizesSpinner;
110 
111 			BFilePanel*			fOpenFilePanel;
112 };
113 
114 
115 #endif // SETTINGS_WINDOW_H
116