xref: /haiku/src/kits/tracker/SettingsViews.h (revision 4b7e219688450694efc9d1890f83f816758c16d3)
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 #ifndef _SETTINGS_VIEWS
35 #define _SETTINGS_VIEWS
36 
37 
38 #include <GroupView.h>
39 
40 #include "TrackerSettings.h"
41 
42 
43 const uint32 kSettingsContentsModified = 'Scmo';
44 
45 
46 class BButton;
47 class BCheckBox;
48 class BColorControl;
49 class BMenuField;
50 class BRadioButton;
51 class BStringView;
52 
53 
54 namespace BPrivate {
55 
56 class SettingsView : public BGroupView {
57 	public:
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 
68 	protected:
69 		typedef BGroupView _inherited;
70 };
71 
72 
73 class DesktopSettingsView : public SettingsView {
74 	public:
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 
87 	private:
88 		void _SendNotices();
89 
90 		BRadioButton*	fShowDisksIconRadioButton;
91 		BRadioButton*	fMountVolumesOntoDesktopRadioButton;
92 		BCheckBox*		fMountSharedVolumesOntoDesktopCheckBox;
93 		BCheckBox*		fIntegrateNonBootBeOSDesktopsCheckBox;
94 		BButton*		fMountButton;
95 
96 		bool fShowDisksIcon;
97 		bool fMountVolumesOntoDesktop;
98 		bool fMountSharedVolumesOntoDesktop;
99 		bool fIntegrateNonBootBeOSDesktops;
100 		bool fEjectWhenUnmounting;
101 
102 		typedef SettingsView _inherited;
103 };
104 
105 
106 class WindowsSettingsView : public SettingsView {
107 	public:
108 		WindowsSettingsView();
109 
110 		virtual void MessageReceived(BMessage* message);
111 		virtual void AttachedToWindow();
112 
113 		virtual void SetDefaults();
114 		virtual bool IsDefaultable() const;
115 		virtual void Revert();
116 		virtual void ShowCurrentSettings();
117 		virtual void RecordRevertSettings();
118 		virtual bool IsRevertable() const;
119 
120 	private:
121 		BCheckBox* fShowFullPathInTitleBarCheckBox;
122 		BCheckBox* fSingleWindowBrowseCheckBox;
123 		BCheckBox* fShowNavigatorCheckBox;
124 		BCheckBox* fShowSelectionWhenInactiveCheckBox;
125 		BCheckBox* fOutlineSelectionCheckBox;
126 		BCheckBox* fSortFolderNamesFirstCheckBox;
127 		BCheckBox* fTypeAheadFilteringCheckBox;
128 
129 		bool fShowFullPathInTitleBar;
130 		bool fSingleWindowBrowse;
131 		bool fShowNavigator;
132 		bool fTransparentSelection;
133 		bool fSortFolderNamesFirst;
134 		bool fTypeAheadFiltering;
135 
136 		typedef SettingsView _inherited;
137 };
138 
139 
140 class SpaceBarSettingsView : public SettingsView {
141 	public:
142 		SpaceBarSettingsView();
143 		virtual ~SpaceBarSettingsView();
144 
145 		virtual void MessageReceived(BMessage* message);
146 		virtual void AttachedToWindow();
147 
148 		virtual void SetDefaults();
149 		virtual bool IsDefaultable() const;
150 		virtual void Revert();
151 		virtual void ShowCurrentSettings();
152 		virtual void RecordRevertSettings();
153 		virtual bool IsRevertable() const;
154 
155 	private:
156 		BCheckBox*		fSpaceBarShowCheckBox;
157 		BColorControl*	fColorControl;
158 		BMenuField*		fColorPicker;
159 		int32			fCurrentColor;
160 
161 		bool			fSpaceBarShow;
162 		rgb_color		fUsedSpaceColor;
163 		rgb_color		fFreeSpaceColor;
164 		rgb_color		fWarningSpaceColor;
165 
166 		typedef SettingsView _inherited;
167 };
168 
169 } // namespace BPrivate
170 
171 using namespace BPrivate;
172 
173 #endif	// _SETTINGS_VIEWS
174