xref: /haiku/src/servers/package/ResultWindow.h (revision 9f81ca838ce7b92b5689e57d3f86765db4705a7b)
1 /*
2  * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef RESULT_WINDOW_H
6 #define RESULT_WINDOW_H
7 
8 
9 #include <map>
10 #include <set>
11 
12 #include <ObjectList.h>
13 #include <Window.h>
14 
15 
16 namespace BPackageKit {
17 	class BSolverPackage;
18 }
19 
20 using BPackageKit::BSolverPackage;
21 
22 class BButton;
23 class BGroupLayout;
24 class BGroupView;
25 
26 
27 class ResultWindow : public BWindow {
28 public:
29 			typedef std::set<BSolverPackage*> PackageSet;
30 			typedef BObjectList<BSolverPackage> PackageList;
31 
32 public:
33 								ResultWindow();
34 	virtual						~ResultWindow();
35 
36 			bool				AddLocationChanges(const char* location,
37 									const PackageList& packagesToInstall,
38 									const PackageSet& packagesAlreadyAdded,
39 									const PackageList& packagesToUninstall,
40 									const PackageSet& packagesAlreadyRemoved);
41 			bool				Go();
42 
43 	virtual	bool				QuitRequested();
44 	virtual	void				MessageReceived(BMessage* message);
45 
46 private:
47 			bool				_AddPackages(BGroupLayout* packagesGroup,
48 									const PackageList& packages,
49 									const PackageSet& ignorePackages,
50 									bool install);
51 
52 private:
53 			sem_id				fDoneSemaphore;
54 			bool				fClientWaiting;
55 			bool				fAccepted;
56 			BGroupView*			fContainerView;
57 			BButton*			fCancelButton;
58 			BButton*			fApplyButton;
59 };
60 
61 
62 #endif	// RESULT_WINDOW_H
63