xref: /haiku/src/apps/haikudepot/ui/WorkStatusView.h (revision 3995592cdf304335132305e27c40cbb0b1ac46e3)
1 /*
2  * Copyright 2017 Julian Harnath <julian.harnath@rwth-aachen.de>
3  * All rights reserved. Distributed under the terms of the MIT license.
4  */
5 #ifndef WORK_STATUS_VIEW_H
6 #define WORK_STATUS_VIEW_H
7 
8 
9 #include <View.h>
10 
11 #include <set>
12 
13 #include "PackageInfo.h"
14 
15 
16 class BarberPole;
17 class BCardLayout;
18 class BMessageRunner;
19 class BStatusBar;
20 class BStringView;
21 
22 
23 class WorkStatusView : public BView {
24 public:
25 								WorkStatusView(const char* name);
26 								~WorkStatusView();
27 
28 			void				SetBusy(const BString& text);
29 			void				SetBusy();
30 			void				SetIdle();
31 			void				SetProgress(float value);
32 			void				SetText(const BString& text);
33 
34 			void				PackageStatusChanged(
35 									const PackageInfoRef& package);
36 
37 private:
38 			void				_SetTextPendingDownloads();
39 			void				_SetTextDownloading(const BString& title);
40 
41 private:
42 			BStatusBar*			fProgressBar;
43 			BarberPole*			fBarberPole;
44 			BCardLayout*		fProgressLayout;
45 			BView*				fProgressView;
46 			BStringView*		fStatusText;
47 
48 			BString				fDownloadingPackage;
49 			std::set<BString>	fPendingPackages;
50 };
51 
52 
53 #endif // WORK_STATUS_VIEW_H
54