vfs: check userland buffers before reading them.
[haiku.git] / src / preferences / repositories / RepositoriesView.h
blob84a977b1e5cfb28464249a8647843cd71f239623
1 /*
2 * Copyright 2017 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Brian Hill
7 */
8 #ifndef REPOSITORIES_VIEW_H
9 #define REPOSITORIES_VIEW_H
12 #include <ColumnListView.h>
13 #include <GroupView.h>
14 #include <String.h>
15 #include <StringView.h>
16 #include <View.h>
18 #include "RepositoriesSettings.h"
19 #include "RepoRow.h"
20 #include "TaskLooper.h"
23 class RepositoriesListView : public BColumnListView {
24 public:
25 RepositoriesListView(const char* name);
26 virtual void KeyDown(const char* bytes, int32 numBytes);
30 class RepositoriesView : public BGroupView {
31 public:
32 RepositoriesView();
33 ~RepositoriesView();
34 virtual void AllAttached();
35 virtual void AttachedToWindow();
36 virtual void MessageReceived(BMessage*);
37 void AddManualRepository(BString url);
38 bool IsTaskRunning() { return fRunningTaskCount > 0; }
40 private:
41 // Message helpers
42 void _AddSelectedRowsToQueue();
43 void _TaskStarted(RepoRow* rowItem, int16 count);
44 void _TaskCompleted(RepoRow* rowItem, int16 count,
45 BString& newName);
46 void _TaskCanceled(RepoRow* rowItem, int16 count);
47 void _ShowCompletedStatusIfDone();
48 void _UpdateFromRepoConfig(RepoRow* rowItem);
50 // GUI functions
51 status_t _EmptyList();
52 void _InitList();
53 void _RefreshList();
54 void _UpdateListFromRoster();
55 void _SaveList();
56 RepoRow* _AddRepo(BString name, BString url, bool enabled);
57 void _FindSiblings();
58 void _UpdateButtons();
59 void _UpdateStatusView();
61 RepositoriesSettings fSettings;
62 RepositoriesListView* fListView;
63 BView* fStatusContainerView;
64 BStringView* fListStatusView;
65 TaskLooper* fTaskLooper;
66 bool fShowCompletedStatus;
67 int fRunningTaskCount, fLastCompletedTimerId;
68 BButton* fAddButton;
69 BButton* fRemoveButton;
70 BButton* fEnableButton;
71 BButton* fDisableButton;
75 #endif