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