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