vfs: check userland buffers before reading them.
[haiku.git] / src / preferences / notifications / NotificationsView.h
blob1eec7b12c52fb64587db8ba82c8f51e0bcc48571
1 /*
2 * Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
3 * Copyright 2009, Pier Luigi Fiorini.
4 * Distributed under the terms of the MIT License.
5 */
6 #ifndef _APPS_VIEW_H
7 #define _APPS_VIEW_H
9 #include <FilePanel.h>
10 #include <ColumnListView.h>
11 #include <View.h>
13 #include <notification/AppUsage.h>
15 #include "AppRefFilter.h"
16 #include "SettingsPane.h"
18 typedef std::map<BString, AppUsage *> appusage_t;
20 class BButton;
21 class BCheckBox;
22 class BTextControl;
23 class BStringColumn;
24 class BDateColumn;
27 class AppRow : public BRow {
28 public:
29 AppRow(const char* name,
30 const char* signature, bool allowed);
32 const char* Name() const { return fName.String(); }
33 const char* Signature() { return fSignature.String(); };
34 void SetAllowed(bool allowed);
35 bool Allowed() { return fAllowed; };
36 void RefreshEnabledField();
38 private:
39 BString fName;
40 BString fSignature;
41 bool fAllowed;
45 class NotificationsView : public SettingsPane {
46 public:
47 NotificationsView(SettingsHost* host);
48 ~NotificationsView();
50 virtual void AttachedToWindow();
51 virtual void MessageReceived(BMessage* msg);
52 status_t Revert();
53 bool RevertPossible();
54 status_t Defaults();
55 bool DefaultsPossible();
56 bool UseDefaultRevertButtons();
58 private:
59 status_t Load(BMessage&);
60 status_t Save(BMessage&);
61 void _ClearItemSettings();
62 void _UpdateSelectedItem();
63 void _RecallItemSettings();
64 void _PopulateApplications();
66 appusage_t fAppFilters;
67 AppRefFilter* fPanelFilter;
68 BFilePanel* fAddAppPanel;
69 BButton* fAddButton;
70 BButton* fRemoveButton;
71 BCheckBox* fMuteAll;
72 BColumnListView* fApplications;
73 AppRow* fSelectedRow;
74 BStringColumn* fAppCol;
75 BStringColumn* fAppEnabledCol;
78 #endif // _APPS_VIEW_H