xref: /haiku/src/kits/tracker/SettingsViews.h (revision 32753ae9b5e96d3b5abb4cc4b9927eb6d3cb5d84)
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 		BCheckBox *fTypeAheadFilteringCheckBox;
126 
127 		bool fShowFullPathInTitleBar;
128 		bool fSingleWindowBrowse;
129 		bool fShowNavigator;
130 		bool fTransparentSelection;
131 		bool fSortFolderNamesFirst;
132 		bool fTypeAheadFiltering;
133 
134 		typedef SettingsView _inherited;
135 };
136 
137 class TimeFormatSettingsView : public SettingsView {
138 	public:
139 		TimeFormatSettingsView(BRect frame);
140 
141 		virtual void MessageReceived(BMessage *message);
142 		virtual void AttachedToWindow();
143 		virtual void GetPreferredSize(float *_width, float *_height);
144 
145 		virtual void SetDefaults();
146 		virtual bool IsDefaultable() const;
147 		virtual void Revert();
148 		virtual void ShowCurrentSettings();
149 		virtual void RecordRevertSettings();
150 		virtual bool IsRevertable() const;
151 
152 	private:
153 		void _UpdateExamples();
154 		void _SendNotices();
155 
156 		BRadioButton *f24HrRadioButton;
157 		BRadioButton *f12HrRadioButton;
158 
159 		BRadioButton *fYMDRadioButton;
160 		BRadioButton *fDMYRadioButton;
161 		BRadioButton *fMDYRadioButton;
162 
163 		BMenuField *fSeparatorMenuField;
164 
165 		BStringView *fLongDateExampleView;
166 		BStringView *fShortDateExampleView;
167 
168 		bool f24HrClock;
169 
170 		FormatSeparator fSeparator;
171 		DateOrder fFormat;
172 
173 		typedef SettingsView _inherited;
174 };
175 
176 class SpaceBarSettingsView : public SettingsView {
177 	public:
178 		SpaceBarSettingsView(BRect frame);
179 		virtual ~SpaceBarSettingsView();
180 
181 		virtual void MessageReceived(BMessage *message);
182 		virtual void AttachedToWindow();
183 		virtual void GetPreferredSize(float *_width, float *_height);
184 
185 		virtual void SetDefaults();
186 		virtual bool IsDefaultable() const;
187 		virtual void Revert();
188 		virtual void ShowCurrentSettings();
189 		virtual void RecordRevertSettings();
190 		virtual bool IsRevertable() const;
191 
192 	private:
193 		BCheckBox		*fSpaceBarShowCheckBox;
194 		BColorControl	*fColorControl;
195 		BMenuField		*fColorPicker;
196 		int32			fCurrentColor;
197 
198 		bool			fSpaceBarShow;
199 		rgb_color		fUsedSpaceColor;
200 		rgb_color		fFreeSpaceColor;
201 		rgb_color		fWarningSpaceColor;
202 
203 		typedef SettingsView _inherited;
204 };
205 
206 class TrashSettingsView : public SettingsView {
207 	public:
208 		TrashSettingsView(BRect frame);
209 
210 		virtual void MessageReceived(BMessage *message);
211 		virtual void AttachedToWindow();
212 		virtual void GetPreferredSize(float *_width, float *_height);
213 
214 		virtual void SetDefaults();
215 		virtual bool IsDefaultable() const;
216 		virtual void Revert();
217 		virtual void ShowCurrentSettings();
218 		virtual void RecordRevertSettings();
219 		virtual bool IsRevertable() const;
220 
221 	private:
222 		void _SendNotices();
223 
224 		BCheckBox *fDontMoveFilesToTrashCheckBox;
225 		BCheckBox *fAskBeforeDeleteFileCheckBox;
226 
227 		bool fDontMoveFilesToTrash;
228 		bool fAskBeforeDeleteFile;
229 
230 		typedef SettingsView _inherited;
231 };
232 
233 } // namespace BPrivate
234 
235 using namespace BPrivate;
236 
237 #endif	// _SETTINGS_VIEWS
238