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 BCheckBox *fEjectWhenUnmountingCheckBox; 93 BButton *fMountButton; 94 95 bool fShowDisksIcon; 96 bool fMountVolumesOntoDesktop; 97 bool fMountSharedVolumesOntoDesktop; 98 bool fIntegrateNonBootBeOSDesktops; 99 bool fEjectWhenUnmounting; 100 101 typedef SettingsView _inherited; 102 }; 103 104 class WindowsSettingsView : public SettingsView { 105 public: 106 WindowsSettingsView(BRect frame); 107 108 virtual void MessageReceived(BMessage *message); 109 virtual void AttachedToWindow(); 110 virtual void GetPreferredSize(float *_width, float *_height); 111 112 virtual void SetDefaults(); 113 virtual bool IsDefaultable() const; 114 virtual void Revert(); 115 virtual void ShowCurrentSettings(); 116 virtual void RecordRevertSettings(); 117 virtual bool IsRevertable() const; 118 119 private: 120 BCheckBox *fShowFullPathInTitleBarCheckBox; 121 BCheckBox *fSingleWindowBrowseCheckBox; 122 BCheckBox *fShowNavigatorCheckBox; 123 BCheckBox *fShowSelectionWhenInactiveCheckBox; 124 BCheckBox *fOutlineSelectionCheckBox; 125 BCheckBox *fSortFolderNamesFirstCheckBox; 126 127 bool fShowFullPathInTitleBar; 128 bool fSingleWindowBrowse; 129 bool fShowNavigator; 130 bool fTransparentSelection; 131 bool fSortFolderNamesFirst; 132 133 typedef SettingsView _inherited; 134 }; 135 136 class TimeFormatSettingsView : public SettingsView { 137 public: 138 TimeFormatSettingsView(BRect frame); 139 140 virtual void MessageReceived(BMessage *message); 141 virtual void AttachedToWindow(); 142 virtual void GetPreferredSize(float *_width, float *_height); 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 void _UpdateExamples(); 153 void _SendNotices(); 154 155 BRadioButton *f24HrRadioButton; 156 BRadioButton *f12HrRadioButton; 157 158 BRadioButton *fYMDRadioButton; 159 BRadioButton *fDMYRadioButton; 160 BRadioButton *fMDYRadioButton; 161 162 BMenuField *fSeparatorMenuField; 163 164 BStringView *fLongDateExampleView; 165 BStringView *fShortDateExampleView; 166 167 bool f24HrClock; 168 169 FormatSeparator fSeparator; 170 DateOrder fFormat; 171 172 typedef SettingsView _inherited; 173 }; 174 175 class SpaceBarSettingsView : public SettingsView { 176 public: 177 SpaceBarSettingsView(BRect frame); 178 virtual ~SpaceBarSettingsView(); 179 180 virtual void MessageReceived(BMessage *message); 181 virtual void AttachedToWindow(); 182 virtual void GetPreferredSize(float *_width, float *_height); 183 184 virtual void SetDefaults(); 185 virtual bool IsDefaultable() const; 186 virtual void Revert(); 187 virtual void ShowCurrentSettings(); 188 virtual void RecordRevertSettings(); 189 virtual bool IsRevertable() const; 190 191 private: 192 BCheckBox *fSpaceBarShowCheckBox; 193 BColorControl *fColorControl; 194 BMenuField *fColorPicker; 195 int32 fCurrentColor; 196 197 bool fSpaceBarShow; 198 rgb_color fUsedSpaceColor; 199 rgb_color fFreeSpaceColor; 200 rgb_color fWarningSpaceColor; 201 202 typedef SettingsView _inherited; 203 }; 204 205 class TrashSettingsView : public SettingsView { 206 public: 207 TrashSettingsView(BRect frame); 208 209 virtual void MessageReceived(BMessage *message); 210 virtual void AttachedToWindow(); 211 virtual void GetPreferredSize(float *_width, float *_height); 212 213 virtual void SetDefaults(); 214 virtual bool IsDefaultable() const; 215 virtual void Revert(); 216 virtual void ShowCurrentSettings(); 217 virtual void RecordRevertSettings(); 218 virtual bool IsRevertable() const; 219 220 private: 221 void _SendNotices(); 222 223 BCheckBox *fDontMoveFilesToTrashCheckBox; 224 BCheckBox *fAskBeforeDeleteFileCheckBox; 225 226 bool fDontMoveFilesToTrash; 227 bool fAskBeforeDeleteFile; 228 229 typedef SettingsView _inherited; 230 }; 231 232 } // namespace BPrivate 233 234 using namespace BPrivate; 235 236 #endif // _SETTINGS_VIEWS 237