xref: /haiku/src/kits/tracker/SettingsViews.h (revision b0623e48efa646b8d1a4c6f51e09d696d9803276)
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 BMenuField;
48 class BStringView;
49 
50 
51 namespace BPrivate {
52 
53 class SettingsView : public BView {
54 	public:
55 		SettingsView(BRect frame, const char *name);
56 		virtual ~SettingsView();
57 
58 		virtual void SetDefaults();
59 		virtual void Revert();
60 		virtual void ShowCurrentSettings();
61 		virtual void RecordRevertSettings();
62 		virtual bool IsRevertable() const;
63 
64 	protected:
65 		typedef BView _inherited;
66 };
67 
68 class DesktopSettingsView : public SettingsView {
69 	public:
70 		DesktopSettingsView(BRect frame);
71 
72 		virtual void MessageReceived(BMessage *message);
73 		virtual void AttachedToWindow();
74 
75 		virtual void SetDefaults();
76 		virtual void Revert();
77 		virtual void ShowCurrentSettings();
78 		virtual void RecordRevertSettings();
79 		virtual bool IsRevertable() const;
80 
81 	private:
82 		void _SendNotices();
83 
84 		BRadioButton *fShowDisksIconRadioButton;
85 		BRadioButton *fMountVolumesOntoDesktopRadioButton;
86 		BCheckBox *fMountSharedVolumesOntoDesktopCheckBox;
87 		BCheckBox *fIntegrateNonBootBeOSDesktopsCheckBox;
88 		BCheckBox *fEjectWhenUnmountingCheckBox;
89 
90 		bool fShowDisksIcon;
91 		bool fMountVolumesOntoDesktop;
92 		bool fMountSharedVolumesOntoDesktop;
93 		bool fIntegrateNonBootBeOSDesktops;
94 		bool fEjectWhenUnmounting;
95 
96 		typedef SettingsView _inherited;
97 };
98 
99 class WindowsSettingsView : public SettingsView {
100 	public:
101 		WindowsSettingsView(BRect frame);
102 
103 		virtual void MessageReceived(BMessage *message);
104 		virtual void AttachedToWindow();
105 
106 		virtual void SetDefaults();
107 		virtual void Revert();
108 		virtual void ShowCurrentSettings();
109 		virtual void RecordRevertSettings();
110 		virtual bool IsRevertable() const;
111 
112 	private:
113 		BCheckBox *fShowFullPathInTitleBarCheckBox;
114 		BCheckBox *fSingleWindowBrowseCheckBox;
115 		BCheckBox *fShowNavigatorCheckBox;
116 		BCheckBox *fShowSelectionWhenInactiveCheckBox;
117 		BCheckBox *fOutlineSelectionCheckBox;
118 		BCheckBox *fSortFolderNamesFirstCheckBox;
119 
120 		bool fShowFullPathInTitleBar;
121 		bool fSingleWindowBrowse;
122 		bool fShowNavigator;
123 		bool fShowSelectionWhenInactive;
124 		bool fTransparentSelection;
125 		bool fSortFolderNamesFirst;
126 
127 		typedef SettingsView _inherited;
128 };
129 
130 class FilePanelSettingsView : public SettingsView {
131 	public:
132 		FilePanelSettingsView(BRect frame);
133 		virtual ~FilePanelSettingsView();
134 
135 		virtual void MessageReceived(BMessage *message);
136 		virtual void AttachedToWindow();
137 
138 		virtual void SetDefaults();
139 		virtual void Revert();
140 		virtual void ShowCurrentSettings();
141 		virtual void RecordRevertSettings();
142 		virtual bool IsRevertable() const;
143 
144 
145 	private:
146 		void _GetAndRefreshDisplayedFigures() const;
147 		void _SendNotices();
148 
149 		BCheckBox *fDesktopFilePanelRootCheckBox;
150 
151 		BTextControl *fRecentApplicationsTextControl; // Not used for the moment.
152 		BTextControl *fRecentDocumentsTextControl;
153 		BTextControl *fRecentFoldersTextControl;
154 
155 		bool fDesktopFilePanelRoot;
156 		int32 fRecentApplications; // Not used for the moment,
157 		int32 fRecentDocuments;
158 		int32 fRecentFolders;
159 
160 		mutable int32 fDisplayedAppCount; // Not used for the moment.
161 		mutable int32 fDisplayedDocCount;
162 		mutable int32 fDisplayedFolderCount;
163 
164 		typedef SettingsView _inherited;
165 };
166 
167 class TimeFormatSettingsView : public SettingsView {
168 	public:
169 		TimeFormatSettingsView(BRect frame);
170 
171 		virtual void MessageReceived(BMessage *message);
172 		virtual void AttachedToWindow();
173 
174 		virtual void SetDefaults();
175 		virtual void Revert();
176 		virtual void ShowCurrentSettings();
177 		virtual void RecordRevertSettings();
178 		virtual bool IsRevertable() const;
179 
180 	private:
181 		void _UpdateExamples();
182 		void _SendNotices();
183 
184 		BRadioButton *f24HrRadioButton;
185 		BRadioButton *f12HrRadioButton;
186 
187 		BRadioButton *fYMDRadioButton;
188 		BRadioButton *fDMYRadioButton;
189 		BRadioButton *fMDYRadioButton;
190 
191 		BMenuField *fSeparatorMenuField;
192 
193 		BStringView *fLongDateExampleView;
194 		BStringView *fShortDateExampleView;
195 
196 		bool f24HrClock;
197 
198 		FormatSeparator fSeparator;
199 		DateOrder fFormat;
200 
201 		typedef SettingsView _inherited;
202 };
203 
204 class SpaceBarSettingsView : public SettingsView {
205 	public:
206 		SpaceBarSettingsView(BRect frame);
207 		virtual ~SpaceBarSettingsView();
208 
209 		virtual void MessageReceived(BMessage *message);
210 		virtual void AttachedToWindow();
211 
212 		virtual void SetDefaults();
213 		virtual void Revert();
214 		virtual void ShowCurrentSettings();
215 		virtual void RecordRevertSettings();
216 		virtual bool IsRevertable() const;
217 
218 	private:
219 		BCheckBox		*fSpaceBarShowCheckBox;
220 		BColorControl	*fColorControl;
221 		BMenuField		*fColorPicker;
222 		int32			fCurrentColor;
223 
224 		bool			fSpaceBarShow;
225 		rgb_color		fUsedSpaceColor;
226 		rgb_color		fFreeSpaceColor;
227 		rgb_color		fWarningSpaceColor;
228 
229 		typedef SettingsView _inherited;
230 };
231 
232 class TrashSettingsView : public SettingsView {
233 	public:
234 		TrashSettingsView(BRect frame);
235 
236 		virtual void MessageReceived(BMessage *message);
237 		virtual void AttachedToWindow();
238 
239 		virtual void SetDefaults();
240 		virtual void Revert();
241 		virtual void ShowCurrentSettings();
242 		virtual void RecordRevertSettings();
243 		virtual bool IsRevertable() const;
244 
245 	private:
246 		void _SendNotices();
247 
248 		BCheckBox *fDontMoveFilesToTrashCheckBox;
249 		BCheckBox *fAskBeforeDeleteFileCheckBox;
250 
251 		bool fDontMoveFilesToTrash;
252 		bool fAskBeforeDeleteFile;
253 
254 		typedef SettingsView _inherited;
255 };
256 
257 } // namespace BPrivate
258 
259 using namespace BPrivate;
260 
261 #endif	// _SETTINGS_VIEWS
262