vfs: check userland buffers before reading them.
[haiku.git] / src / apps / deskbar / PreferencesWindow.h
blob6daf790c8ef61d554ae16c713f7078877d596d33
1 /*
2 * Copyright 2009 Haiku, Inc.
3 * All Rights Reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef _PREFERENCES_WINDOW_H
6 #define _PREFERENCES_WINDOW_H
9 #include <Window.h>
11 #include "BarSettings.h"
14 const uint32 kConfigShow = 'PrSh';
15 const uint32 kConfigQuit = 'PrQt';
16 const uint32 kUpdateRecentCounts = 'upct';
17 const uint32 kEditInTracker = 'etrk';
19 const uint32 kTrackerFirst = 'TkFt';
20 const uint32 kSortRunningApps = 'SAps';
21 const uint32 kSuperExpando = 'SprE';
22 const uint32 kExpandNewTeams = 'ExTm';
23 const uint32 kHideLabels = 'hLbs';
24 const uint32 kResizeTeamIcons = 'RTIs';
25 const uint32 kAutoRaise = 'AtRs';
26 const uint32 kAutoHide = 'AtHd';
28 const uint32 kDefaults = 'dflt';
29 const uint32 kRevert = 'rvrt';
32 class BCheckBox;
33 class BFile;
34 class BMessage;
35 class BRadioButton;
36 class BSlider;
37 class BSpinner;
39 class PreferencesWindow : public BWindow
41 public:
42 PreferencesWindow(BRect frame);
43 ~PreferencesWindow();
45 virtual void MessageReceived(BMessage* message);
46 virtual bool QuitRequested();
47 virtual void Show();
49 private:
50 void _EnableDisableDependentItems();
52 bool _IsDefaultable();
53 bool _IsRevertable();
55 status_t _InitSettingsFile(BFile* file, bool write);
56 status_t _LoadSettings(BMessage* settings);
57 status_t _SaveSettings(BMessage* settings);
59 void _SetInitialSettings();
61 void _UpdateButtons();
62 void _UpdatePreferences(desk_settings* settings);
63 void _UpdateRecentCounts();
65 private:
66 BCheckBox* fMenuRecentDocuments;
67 BCheckBox* fMenuRecentApplications;
68 BCheckBox* fMenuRecentFolders;
70 BSpinner* fMenuRecentDocumentCount;
71 BSpinner* fMenuRecentApplicationCount;
72 BSpinner* fMenuRecentFolderCount;
74 BCheckBox* fAppsSort;
75 BCheckBox* fAppsSortTrackerFirst;
76 BCheckBox* fAppsShowExpanders;
77 BCheckBox* fAppsExpandNew;
78 BCheckBox* fAppsHideLabels;
79 BSlider* fAppsIconSizeSlider;
81 BCheckBox* fWindowAlwaysOnTop;
82 BCheckBox* fWindowAutoRaise;
83 BCheckBox* fWindowAutoHide;
85 BButton* fDefaultsButton;
86 BButton* fRevertButton;
88 private:
89 desk_settings fSettings;
93 #endif // _PREFERENCES_WINDOW_H