1/*
2Open Tracker License
3
4Terms and Conditions
5
6Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
7
8Permission is hereby granted, free of charge, to any person obtaining a copy of
9this software and associated documentation files (the "Software"), to deal in
10the Software without restriction, including without limitation the rights to
11use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12of the Software, and to permit persons to whom the Software is furnished to do
13so, subject to the following conditions:
14
15The above copyright notice and this permission notice applies to all licensees
16and shall be included in all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
23WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25Except as contained in this notice, the name of Be Incorporated shall not be
26used in advertising or otherwise to promote the sale, use or other dealings in
27this Software without prior written authorization from Be Incorporated.
28
29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
30of Be Incorporated in the United States and other countries. Other brand product
31names are registered trademarks or trademarks of their respective holders.
32All rights reserved.
33*/
34#ifndef _SETTINGS_VIEWS_H
35#define _SETTINGS_VIEWS_H
36
37
38#include <GroupView.h>
39
40#include "TrackerSettings.h"
41
42
43const uint32 kSettingsContentsModified = 'Scmo';
44
45
46class BButton;
47class BCheckBox;
48class BColorControl;
49class BMenuField;
50class BRadioButton;
51class BStringView;
52
53
54namespace BPrivate {
55
56class SettingsView : public BGroupView {
57public:
58			SettingsView(const char* name);
59	virtual ~SettingsView();
60
61	virtual void SetDefaults();
62	virtual bool IsDefaultable() const;
63	virtual void Revert();
64	virtual void ShowCurrentSettings();
65	virtual void RecordRevertSettings();
66	virtual bool IsRevertable() const;
67
68protected:
69	typedef BGroupView _inherited;
70};
71
72
73class DesktopSettingsView : public SettingsView {
74public:
75	DesktopSettingsView();
76
77	virtual void MessageReceived(BMessage* message);
78	virtual void AttachedToWindow();
79
80	virtual void SetDefaults();
81	virtual bool IsDefaultable() const;
82	virtual void Revert();
83	virtual void ShowCurrentSettings();
84	virtual void RecordRevertSettings();
85	virtual bool IsRevertable() const;
86
87private:
88	void _SendNotices();
89
90	BRadioButton*	fShowDisksIconRadioButton;
91	BRadioButton*	fMountVolumesOntoDesktopRadioButton;
92	BCheckBox*		fMountSharedVolumesOntoDesktopCheckBox;
93
94	bool fShowDisksIcon;
95	bool fMountVolumesOntoDesktop;
96	bool fMountSharedVolumesOntoDesktop;
97	bool fIntegrateNonBootBeOSDesktops;
98	bool fEjectWhenUnmounting;
99
100	typedef SettingsView _inherited;
101};
102
103
104class WindowsSettingsView : public SettingsView {
105public:
106	WindowsSettingsView();
107
108	virtual void MessageReceived(BMessage* message);
109	virtual void AttachedToWindow();
110
111	virtual void SetDefaults();
112	virtual bool IsDefaultable() const;
113	virtual void Revert();
114	virtual void ShowCurrentSettings();
115	virtual void RecordRevertSettings();
116	virtual bool IsRevertable() const;
117
118private:
119	BCheckBox* fShowFullPathInTitleBarCheckBox;
120	BCheckBox* fSingleWindowBrowseCheckBox;
121	BCheckBox* fShowNavigatorCheckBox;
122	BCheckBox* fOutlineSelectionCheckBox;
123	BCheckBox* fSortFolderNamesFirstCheckBox;
124	BCheckBox* fHideDotFilesCheckBox;
125	BCheckBox* fTypeAheadFilteringCheckBox;
126	BCheckBox* fGenerateImageThumbnailsCheckBox;
127
128	bool fShowFullPathInTitleBar;
129	bool fSingleWindowBrowse;
130	bool fShowNavigator;
131	bool fTransparentSelection;
132	bool fSortFolderNamesFirst;
133	bool fHideDotFiles;
134	bool fTypeAheadFiltering;
135	bool fGenerateImageThumbnails;
136
137	typedef SettingsView _inherited;
138};
139
140
141class SpaceBarSettingsView : public SettingsView {
142public:
143	SpaceBarSettingsView();
144	virtual ~SpaceBarSettingsView();
145
146	virtual void MessageReceived(BMessage* message);
147	virtual void AttachedToWindow();
148
149	virtual void SetDefaults();
150	virtual bool IsDefaultable() const;
151	virtual void Revert();
152	virtual void ShowCurrentSettings();
153	virtual void RecordRevertSettings();
154	virtual bool IsRevertable() const;
155
156private:
157	BCheckBox*		fSpaceBarShowCheckBox;
158	BColorControl*	fColorControl;
159	BMenuField*		fColorPicker;
160	int32			fCurrentColor;
161
162	bool			fSpaceBarShow;
163	rgb_color		fUsedSpaceColor;
164	rgb_color		fFreeSpaceColor;
165	rgb_color		fWarningSpaceColor;
166
167	typedef SettingsView _inherited;
168};
169
170
171class AutomountSettingsPanel : public SettingsView {
172public:
173								AutomountSettingsPanel();
174	virtual						~AutomountSettingsPanel();
175
176	virtual	bool				IsDefaultable() const;
177	virtual	void				Revert();
178	virtual	void				ShowCurrentSettings();
179	virtual void				RecordRevertSettings();
180	virtual	bool				IsRevertable() const;
181
182protected:
183	virtual	void				MessageReceived(BMessage* message);
184	virtual	void				AttachedToWindow();
185
186private:
187			void				_SendSettings(bool rescan);
188			void				_GetSettings(BMessage* reply) const;
189			void				_ParseSettings(const BMessage& settings);
190
191			BRadioButton*		fInitialDontMountCheck;
192			BRadioButton*		fInitialMountAllBFSCheck;
193			BRadioButton*		fInitialMountAllCheck;
194			BRadioButton*		fInitialMountRestoreCheck;
195
196			BRadioButton*		fScanningDisabledCheck;
197			BRadioButton*		fAutoMountAllBFSCheck;
198			BRadioButton*		fAutoMountAllCheck;
199
200			BCheckBox*			fEjectWhenUnmountingCheckBox;
201
202			BButton*			fMountAllNow;
203
204			BMessenger			fTarget;
205			BMessage			fInitialSettings;
206
207			typedef SettingsView _inherited;
208};
209
210
211} // namespace BPrivate
212
213using namespace BPrivate;
214
215
216#endif	// _SETTINGS_VIEWS_H
217