xref: /haiku/src/kits/tracker/SettingsViews.h (revision e0ef64750f3169cd634bb2f7a001e22488b05231)
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 <GroupView.h>
40 #include <RadioButton.h>
41 #include <TextControl.h>
42 #include <ColorControl.h>
43 
44 #include "TrackerSettings.h"
45 
46 const uint32 kSettingsContentsModified = 'Scmo';
47 
48 class BButton;
49 class BMenuField;
50 class BStringView;
51 
52 
53 namespace BPrivate {
54 
55 class SettingsView : public BGroupView {
56 	public:
57 				SettingsView(const char* name);
58 		virtual ~SettingsView();
59 
60 		virtual void SetDefaults();
61 		virtual bool IsDefaultable() const;
62 		virtual void Revert();
63 		virtual void ShowCurrentSettings();
64 		virtual void RecordRevertSettings();
65 		virtual bool IsRevertable() const;
66 
67 	protected:
68 		typedef BGroupView _inherited;
69 };
70 
71 class DesktopSettingsView : public SettingsView {
72 	public:
73 		DesktopSettingsView();
74 
75 		virtual void MessageReceived(BMessage *message);
76 		virtual void AttachedToWindow();
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();
106 
107 		virtual void MessageReceived(BMessage *message);
108 		virtual void AttachedToWindow();
109 
110 		virtual void SetDefaults();
111 		virtual bool IsDefaultable() const;
112 		virtual void Revert();
113 		virtual void ShowCurrentSettings();
114 		virtual void RecordRevertSettings();
115 		virtual bool IsRevertable() const;
116 
117 	private:
118 		BCheckBox *fShowFullPathInTitleBarCheckBox;
119 		BCheckBox *fSingleWindowBrowseCheckBox;
120 		BCheckBox *fShowNavigatorCheckBox;
121 		BCheckBox *fShowSelectionWhenInactiveCheckBox;
122 		BCheckBox *fOutlineSelectionCheckBox;
123 		BCheckBox *fSortFolderNamesFirstCheckBox;
124 		BCheckBox *fTypeAheadFilteringCheckBox;
125 
126 		bool fShowFullPathInTitleBar;
127 		bool fSingleWindowBrowse;
128 		bool fShowNavigator;
129 		bool fTransparentSelection;
130 		bool fSortFolderNamesFirst;
131 		bool fTypeAheadFiltering;
132 
133 		typedef SettingsView _inherited;
134 };
135 
136 class SpaceBarSettingsView : public SettingsView {
137 	public:
138 		SpaceBarSettingsView();
139 		virtual ~SpaceBarSettingsView();
140 
141 		virtual void MessageReceived(BMessage *message);
142 		virtual void AttachedToWindow();
143 
144 		virtual void SetDefaults();
145 		virtual bool IsDefaultable() const;
146 		virtual void Revert();
147 		virtual void ShowCurrentSettings();
148 		virtual void RecordRevertSettings();
149 		virtual bool IsRevertable() const;
150 
151 	private:
152 		BCheckBox		*fSpaceBarShowCheckBox;
153 		BColorControl	*fColorControl;
154 		BMenuField		*fColorPicker;
155 		int32			fCurrentColor;
156 
157 		bool			fSpaceBarShow;
158 		rgb_color		fUsedSpaceColor;
159 		rgb_color		fFreeSpaceColor;
160 		rgb_color		fWarningSpaceColor;
161 
162 		typedef SettingsView _inherited;
163 };
164 
165 class TrashSettingsView : public SettingsView {
166 	public:
167 		TrashSettingsView();
168 
169 		virtual void MessageReceived(BMessage *message);
170 		virtual void AttachedToWindow();
171 
172 		virtual void SetDefaults();
173 		virtual bool IsDefaultable() const;
174 		virtual void Revert();
175 		virtual void ShowCurrentSettings();
176 		virtual void RecordRevertSettings();
177 		virtual bool IsRevertable() const;
178 
179 	private:
180 		void _SendNotices();
181 
182 		BCheckBox *fDontMoveFilesToTrashCheckBox;
183 		BCheckBox *fAskBeforeDeleteFileCheckBox;
184 
185 		bool fDontMoveFilesToTrash;
186 		bool fAskBeforeDeleteFile;
187 
188 		typedef SettingsView _inherited;
189 };
190 
191 } // namespace BPrivate
192 
193 using namespace BPrivate;
194 
195 #endif	// _SETTINGS_VIEWS
196